@webex/plugin-meetings 3.12.0-next.1 → 3.12.0-next.100
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/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +15 -2
- package/dist/aiEnableRequest/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/index.js +26 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +35 -9
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +13 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +898 -391
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +42 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +75 -15
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +10 -1
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +401 -115
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +15 -2
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +1 -0
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1444 -772
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +35 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +231 -118
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +30 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +10 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +62 -15
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +116 -2
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +2 -2
- package/dist/types/constants.d.ts +12 -1
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +2 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +146 -17
- package/dist/types/hashTree/utils.d.ts +18 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +59 -6
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +21 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
- package/dist/types/media/properties.d.ts +1 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting/index.d.ts +143 -9
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +9 -0
- package/dist/types/meetings/index.d.ts +30 -18
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +9 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +9 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/multistream/sendSlotManager.d.ts +23 -1
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +3 -0
- package/dist/webinar/index.js +485 -234
- package/dist/webinar/index.js.map +1 -1
- package/package.json +22 -22
- package/src/aiEnableRequest/index.ts +16 -0
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/index.ts +31 -0
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +2 -2
- package/src/constants.ts +20 -3
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +16 -0
- package/src/hashTree/hashTreeParser.ts +596 -204
- package/src/hashTree/utils.ts +36 -0
- package/src/index.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +88 -12
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interpretation/index.ts +27 -9
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +415 -136
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +25 -1
- package/src/media/MediaConnectionAwaiter.ts +21 -4
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +1 -0
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +790 -136
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +47 -5
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +133 -78
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +29 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +10 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/sendSlotManager.ts +97 -3
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +3 -0
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +330 -50
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/index.ts +49 -0
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +1911 -143
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +645 -80
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +2261 -109
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +12 -0
- package/test/unit/spec/meeting/utils.js +157 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +366 -39
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +89 -0
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
- package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +516 -30
package/dist/locus-info/index.js
CHANGED
|
@@ -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"));
|
|
@@ -53,7 +53,7 @@ var _hashTreeParser2 = _interopRequireWildcard(require("../hashTree/hashTreePars
|
|
|
53
53
|
var _types = require("../hashTree/types");
|
|
54
54
|
var _utils = require("../hashTree/utils");
|
|
55
55
|
var _util = _interopRequireDefault(require("../meetings/util"));
|
|
56
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
56
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
57
57
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
58
58
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
59
59
|
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -76,7 +76,7 @@ var LocusObjectStateAfterUpdates = {
|
|
|
76
76
|
* Gets the replacement information
|
|
77
77
|
*
|
|
78
78
|
* @param {any} self - "self" object from Locus DTO
|
|
79
|
-
* @param {string} deviceUrl - The URL of the
|
|
79
|
+
* @param {string} deviceUrl - The URL of the specified device
|
|
80
80
|
* @returns {any} The replace information if available, otherwise undefined
|
|
81
81
|
*/
|
|
82
82
|
function getReplaceInfoFromSelf(self, deviceUrl) {
|
|
@@ -115,11 +115,13 @@ function findLocusUrlInAnyHashTreeParser(meetingCollection, locusUrl) {
|
|
|
115
115
|
*
|
|
116
116
|
* @param {HashTreeMessage} message - The hash tree message to find the meeting for
|
|
117
117
|
* @param {MeetingCollection} meetingCollection - The collection of meetings to search
|
|
118
|
-
* @param {string} deviceUrl - The URL of the user's device
|
|
119
118
|
* @returns {any} The meeting if found, otherwise undefined
|
|
120
119
|
*/
|
|
121
|
-
function findMeetingForHashTreeMessage(message, meetingCollection
|
|
120
|
+
function findMeetingForHashTreeMessage(message, meetingCollection) {
|
|
122
121
|
var _message$locusStateEl, _message$locusStateEl2;
|
|
122
|
+
if (!message) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
123
125
|
var foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, message.locusUrl);
|
|
124
126
|
if (foundMeeting) {
|
|
125
127
|
return foundMeeting;
|
|
@@ -130,7 +132,7 @@ function findMeetingForHashTreeMessage(message, meetingCollection, deviceUrl) {
|
|
|
130
132
|
var self = (_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : (_message$locusStateEl2 = _message$locusStateEl.find(function (el) {
|
|
131
133
|
return (0, _utils.isSelf)(el);
|
|
132
134
|
})) === null || _message$locusStateEl2 === void 0 ? void 0 : _message$locusStateEl2.data;
|
|
133
|
-
var replaces = getReplaceInfoFromSelf(self, deviceUrl);
|
|
135
|
+
var replaces = getReplaceInfoFromSelf(self, self === null || self === void 0 ? void 0 : self.deviceUrl);
|
|
134
136
|
if (replaces !== null && replaces !== void 0 && replaces.locusUrl) {
|
|
135
137
|
foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, replaces.locusUrl);
|
|
136
138
|
return foundMeeting;
|
|
@@ -281,6 +283,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
281
283
|
(0, _defineProperty2.default)(_this, "hashTreeObjectId2ParticipantId", void 0);
|
|
282
284
|
// mapping of hash tree object ids to participant ids
|
|
283
285
|
(0, _defineProperty2.default)(_this, "classicVsHashTreeMismatchMetricCounter", 0);
|
|
286
|
+
(0, _defineProperty2.default)(_this, "destroyMeetingSuspended", false);
|
|
284
287
|
_this.parsedLocus = {
|
|
285
288
|
states: []
|
|
286
289
|
};
|
|
@@ -490,7 +493,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
490
493
|
this.updateControls(locus.controls, locus.self);
|
|
491
494
|
this.updateLocusUrl(locus.url, _controlsUtils.default.isMainSessionDTO(locus));
|
|
492
495
|
this.updateFullState(locus.fullState);
|
|
493
|
-
this.updateMeetingInfo(locus.info);
|
|
496
|
+
this.updateMeetingInfo(locus.info, locus.self);
|
|
494
497
|
this.updateEmbeddedApps(locus.embeddedApps);
|
|
495
498
|
// self and participants generate sipUrl for 1:1 meeting
|
|
496
499
|
this.updateSelf(locus.self);
|
|
@@ -511,7 +514,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
511
514
|
}, {
|
|
512
515
|
key: "createHashTreeParser",
|
|
513
516
|
value: function createHashTreeParser(_ref) {
|
|
514
|
-
var _this$webex$config$me;
|
|
517
|
+
var _locusUrl$split, _locusUrl$split$pop, _this$webex$config$me;
|
|
515
518
|
var locusUrl = _ref.locusUrl,
|
|
516
519
|
initialLocus = _ref.initialLocus,
|
|
517
520
|
metadata = _ref.metadata,
|
|
@@ -521,7 +524,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
521
524
|
metadata: metadata,
|
|
522
525
|
webexRequest: this.webex.request.bind(this.webex),
|
|
523
526
|
locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
|
|
524
|
-
debugId: "HT-".concat(locusUrl.split('/').pop().substring(0, 4)),
|
|
527
|
+
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
528
|
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
529
|
});
|
|
527
530
|
|
|
@@ -558,18 +561,20 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
558
561
|
|
|
559
562
|
/**
|
|
560
563
|
* @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
|
|
564
|
+
* @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)
|
|
561
565
|
* @returns {undefined}
|
|
562
566
|
* @memberof LocusInfo
|
|
563
567
|
*/
|
|
564
568
|
}, {
|
|
565
569
|
key: "initialSetup",
|
|
566
570
|
value: (function () {
|
|
567
|
-
var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data) {
|
|
571
|
+
var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data, onLocusSynced) {
|
|
568
572
|
var _data$locus, _data$locus$links, _data$locus$links$res, _data$locus$links$res2;
|
|
569
|
-
var _data$hashTreeMessage, _metadataObject$data, metadataObject, hashTreeParser, _hashTreeParser, _t;
|
|
573
|
+
var initialFullLocus, _data$hashTreeMessage, _metadataObject$data, metadataObject, hashTreeParser, _hashTreeParser, _t;
|
|
570
574
|
return _regenerator.default.wrap(function (_context) {
|
|
571
575
|
while (1) switch (_context.prev = _context.next) {
|
|
572
576
|
case 0:
|
|
577
|
+
initialFullLocus = null;
|
|
573
578
|
_t = data.trigger;
|
|
574
579
|
_context.next = _t === 'locus-message' ? 1 : _t === 'join-response' ? 6 : _t === 'get-loci-response' ? 7 : 10;
|
|
575
580
|
break;
|
|
@@ -621,6 +626,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
621
626
|
case 6:
|
|
622
627
|
this.updateLocusCache(data.locus);
|
|
623
628
|
this.onFullLocus('join response', data.locus, undefined, data.dataSets, data.metadata);
|
|
629
|
+
initialFullLocus = data.locus;
|
|
624
630
|
return _context.abrupt("continue", 10);
|
|
625
631
|
case 7:
|
|
626
632
|
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)) {
|
|
@@ -646,7 +652,16 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
646
652
|
// "classic" Locus case, no hash trees involved
|
|
647
653
|
this.updateLocusCache(data.locus);
|
|
648
654
|
this.onFullLocus('classic get-loci-response', data.locus, undefined);
|
|
655
|
+
initialFullLocus = data.locus || null;
|
|
649
656
|
case 10:
|
|
657
|
+
if (onLocusSynced) {
|
|
658
|
+
try {
|
|
659
|
+
onLocusSynced(initialFullLocus || this.getCurrentLocusSnapshot());
|
|
660
|
+
} catch (error) {
|
|
661
|
+
_loggerProxy.default.logger.warn("Locus-info:index#initialSetup --> onLocusSynced callback failed: ".concat(error));
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
650
665
|
// Change it to true after it receives it first locus object
|
|
651
666
|
this.emitChange = true;
|
|
652
667
|
case 11:
|
|
@@ -655,18 +670,40 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
655
670
|
}
|
|
656
671
|
}, _callee, this);
|
|
657
672
|
}));
|
|
658
|
-
function initialSetup(_x) {
|
|
673
|
+
function initialSetup(_x, _x2) {
|
|
659
674
|
return _initialSetup.apply(this, arguments);
|
|
660
675
|
}
|
|
661
676
|
return initialSetup;
|
|
662
677
|
}()
|
|
678
|
+
/**
|
|
679
|
+
* Builds a full locus DTO snapshot from current internal locus state.
|
|
680
|
+
*
|
|
681
|
+
* @returns {LocusDTO}
|
|
682
|
+
*/
|
|
683
|
+
)
|
|
684
|
+
}, {
|
|
685
|
+
key: "getCurrentLocusSnapshot",
|
|
686
|
+
value: function getCurrentLocusSnapshot() {
|
|
687
|
+
var _this4 = this;
|
|
688
|
+
var locus = {};
|
|
689
|
+
LocusDtoTopLevelKeys.forEach(function (key) {
|
|
690
|
+
var value = _this4[key];
|
|
691
|
+
if (value !== undefined && value !== null) {
|
|
692
|
+
locus[key] = (0, _lodash.cloneDeep)(value);
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
if (!(0, _isArray.default)(locus.participants)) {
|
|
696
|
+
locus.participants = [];
|
|
697
|
+
}
|
|
698
|
+
return locus;
|
|
699
|
+
}
|
|
700
|
+
|
|
663
701
|
/**
|
|
664
702
|
* Handles HTTP response from Locus API call.
|
|
665
703
|
* @param {Meeting} meeting meeting object
|
|
666
704
|
* @param {LocusApiResponseBody} responseBody body of the http response from Locus API call
|
|
667
705
|
* @returns {void}
|
|
668
706
|
*/
|
|
669
|
-
)
|
|
670
707
|
}, {
|
|
671
708
|
key: "handleLocusAPIResponse",
|
|
672
709
|
value: function handleLocusAPIResponse(meeting, responseBody) {
|
|
@@ -674,29 +711,38 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
674
711
|
var isWrapped = 'locus' in responseBody;
|
|
675
712
|
var locusUrl = isWrapped ? (_responseBody$locus = responseBody.locus) === null || _responseBody$locus === void 0 ? void 0 : _responseBody$locus.url : responseBody.url;
|
|
676
713
|
var hashTreeParserEntry = locusUrl && this.hashTreeParsers.get(locusUrl);
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
714
|
+
var locus = isWrapped ? responseBody.locus : responseBody;
|
|
715
|
+
if (this.hashTreeParsers.size > 0) {
|
|
716
|
+
// We are in hash tree mode. Check if we need to create/reactivate a parser for this locusUrl.
|
|
717
|
+
if (!hashTreeParserEntry || hashTreeParserEntry.parser.state === 'stopped') {
|
|
718
|
+
if (!locusUrl) {
|
|
719
|
+
_loggerProxy.default.logger.warn('Locus-info:index#handleLocusAPIResponse --> API response has no locusUrl, cannot handle hash tree parser switch');
|
|
720
|
+
return;
|
|
682
721
|
}
|
|
683
|
-
|
|
722
|
+
this.handleHashTreeParserSwitchForAPIResponse(locusUrl, locus);
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// Active parser found - pass the API response to it
|
|
727
|
+
if (isWrapped) {
|
|
684
728
|
// update the data in our hash trees
|
|
685
729
|
hashTreeParserEntry.parser.handleLocusUpdate(responseBody);
|
|
686
730
|
} else {
|
|
687
|
-
// LocusDTO without wrapper - pass it through as if it had no dataSets
|
|
731
|
+
// LocusDTO without wrapper - pass it through as if it had no dataSets nor metadata
|
|
688
732
|
hashTreeParserEntry.parser.handleLocusUpdate({
|
|
689
733
|
locus: responseBody
|
|
690
734
|
});
|
|
691
735
|
}
|
|
692
|
-
|
|
693
|
-
if (isWrapped && responseBody.dataSets) {
|
|
694
|
-
this.sendClassicVsHashTreeMismatchMetric(meeting, "unexpected hash tree dataSets in API response");
|
|
695
|
-
}
|
|
696
|
-
// classic Locus delta
|
|
697
|
-
var locus = isWrapped ? responseBody.locus : responseBody;
|
|
698
|
-
this.handleLocusDelta(locus, meeting);
|
|
736
|
+
return;
|
|
699
737
|
}
|
|
738
|
+
|
|
739
|
+
// No hash tree parsers - classic Locus mode
|
|
740
|
+
if (isWrapped && responseBody.dataSets) {
|
|
741
|
+
this.sendClassicVsHashTreeMismatchMetric(meeting, "unexpected hash tree dataSets in API response");
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// classic Locus delta
|
|
745
|
+
this.handleLocusDelta(locus, meeting);
|
|
700
746
|
}
|
|
701
747
|
|
|
702
748
|
/**
|
|
@@ -707,7 +753,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
707
753
|
}, {
|
|
708
754
|
key: "updateLocusFromHashTreeObject",
|
|
709
755
|
value: function updateLocusFromHashTreeObject(object, locus) {
|
|
710
|
-
var
|
|
756
|
+
var _this5 = this,
|
|
711
757
|
_locus$self;
|
|
712
758
|
var type = object.htMeta.elementId.type.toLowerCase();
|
|
713
759
|
var addParticipantObject = function addParticipantObject(obj) {
|
|
@@ -715,7 +761,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
715
761
|
locus.participants = [];
|
|
716
762
|
}
|
|
717
763
|
locus.participants.push(obj.data);
|
|
718
|
-
|
|
764
|
+
_this5.hashTreeObjectId2ParticipantId.set(obj.htMeta.elementId.id, obj.data.id);
|
|
719
765
|
};
|
|
720
766
|
switch (type) {
|
|
721
767
|
case _types.ObjectType.locus:
|
|
@@ -826,10 +872,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
826
872
|
if (!object.data) {
|
|
827
873
|
// self without data is handled inside HashTreeParser and results in LocusInfoUpdateType.MEETING_ENDED, so we should never get here
|
|
828
874
|
// all other types info, fullstate, etc - Locus should never send them without data
|
|
829
|
-
|
|
875
|
+
// but we end up with this method being called without the data for them when the main dataset is removed from visible datasets list
|
|
876
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> received ".concat(type, " object without data, version=").concat(object.htMeta.elementId.version));
|
|
830
877
|
} else {
|
|
831
878
|
var _locus$info, _object$data$controls, _object$data$controls2, _object$data$controls3;
|
|
832
879
|
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> ".concat(type, " object updated to version ").concat(object.htMeta.elementId.version));
|
|
880
|
+
if (type === _types.ObjectType.self) {
|
|
881
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> self data: removed=".concat(object.data.removed, " state=").concat(object.data.state, " reason=").concat(object.data.reason));
|
|
882
|
+
}
|
|
833
883
|
var locusDtoKey = _types.ObjectTypeToLocusKeyMap[type];
|
|
834
884
|
locus[locusDtoKey] = object.data;
|
|
835
885
|
|
|
@@ -879,6 +929,81 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
879
929
|
}
|
|
880
930
|
}
|
|
881
931
|
|
|
932
|
+
/**
|
|
933
|
+
* Helper that handles the common logic for reactivating a stopped HashTreeParser when
|
|
934
|
+
* a newer "replaces" is detected. Used by both the message and API response parser switch methods.
|
|
935
|
+
*
|
|
936
|
+
* @param {string} callerName - name of the calling method, used in log messages
|
|
937
|
+
* @param {string} locusUrl - the locus URL of the stopped parser
|
|
938
|
+
* @param {HashTreeParserEntry} stoppedEntry - the stopped parser entry
|
|
939
|
+
* @param {ReplacesInfo} replaces - replacement info extracted from self
|
|
940
|
+
* @param {Function} resumeCallback - callback to invoke after reactivation to resume the parser
|
|
941
|
+
* @returns {void}
|
|
942
|
+
*/
|
|
943
|
+
}, {
|
|
944
|
+
key: "resumeStoppedParser",
|
|
945
|
+
value: function resumeStoppedParser(callerName, locusUrl, stoppedEntry, replaces, resumeCallback) {
|
|
946
|
+
// this check is just for typescript, it should never happen, replaces should always be defined
|
|
947
|
+
if (!replaces) {
|
|
948
|
+
_loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> received data for stopped HashTreeParser with locusUrl ").concat(locusUrl, ", but no replaces info provided, so not re-activating the parser"));
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
if (replaces.replacedAt <= (stoppedEntry.replacedAt || '')) {
|
|
952
|
+
_loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> received data for stopped HashTreeParser with locusUrl ").concat(locusUrl, ", but replaces info provided is not newer, so not re-activating the parser"));
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
_loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> reactivating HashTreeParser for locusUrl=").concat(locusUrl, ", which replaces ").concat(replaces.locusUrl));
|
|
956
|
+
var replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
|
|
957
|
+
if (replacedEntry) {
|
|
958
|
+
replacedEntry.replacedAt = replaces.replacedAt;
|
|
959
|
+
replacedEntry.parser.stop();
|
|
960
|
+
} else {
|
|
961
|
+
_loggerProxy.default.logger.warn("Locus-info:index#".concat(callerName, " --> the parser that is supposed to be replaced with the currently reactivated parser is not found, locusUrl=").concat(replaces.locusUrl));
|
|
962
|
+
}
|
|
963
|
+
stoppedEntry.initializedFromHashTree = false;
|
|
964
|
+
this.hashTreeObjectId2ParticipantId.clear();
|
|
965
|
+
resumeCallback();
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* Handles an API response whose locusUrl doesn't match any active HashTreeParser
|
|
970
|
+
* (either no entry exists, or the existing entry is stopped).
|
|
971
|
+
* Creates a new parser or reactivates a stopped one using initializeFromGetLociResponse.
|
|
972
|
+
*
|
|
973
|
+
* @param {string} locusUrl - the locus URL from the API response
|
|
974
|
+
* @param {LocusDTO} locus - the locus DTO from the API response
|
|
975
|
+
* @returns {void}
|
|
976
|
+
*/
|
|
977
|
+
}, {
|
|
978
|
+
key: "handleHashTreeParserSwitchForAPIResponse",
|
|
979
|
+
value: function handleHashTreeParserSwitchForAPIResponse(locusUrl, locus) {
|
|
980
|
+
var entry = this.hashTreeParsers.get(locusUrl);
|
|
981
|
+
var replaces = getReplaceInfoFromSelf(locus.self,
|
|
982
|
+
// @ts-ignore
|
|
983
|
+
this.webex.internal.device.url);
|
|
984
|
+
if (!entry) {
|
|
985
|
+
_loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> no parser for locusUrl ".concat(locusUrl, ", creating a new one"));
|
|
986
|
+
var parser = this.createHashTreeParser({
|
|
987
|
+
locusUrl: locusUrl,
|
|
988
|
+
initialLocus: {
|
|
989
|
+
locus: null,
|
|
990
|
+
dataSets: []
|
|
991
|
+
},
|
|
992
|
+
metadata: null,
|
|
993
|
+
replacedAt: replaces === null || replaces === void 0 ? void 0 : replaces.replacedAt
|
|
994
|
+
});
|
|
995
|
+
parser.initializeFromGetLociResponse(locus);
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
if (entry.parser.state !== 'stopped') {
|
|
999
|
+
_loggerProxy.default.logger.warn("Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> unexpected parser state \"".concat(entry.parser.state, "\" for locusUrl ").concat(locusUrl));
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
this.resumeStoppedParser('handleHashTreeParserSwitchForAPIResponse', locusUrl, entry, replaces, function () {
|
|
1003
|
+
return entry.parser.resumeFromApiResponse(locus);
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
|
|
882
1007
|
/**
|
|
883
1008
|
* Checks if the hash tree message should trigger a switch to a different HashTreeParser
|
|
884
1009
|
*
|
|
@@ -903,7 +1028,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
903
1028
|
var metadata = (_message$locusStateEl5 = message.locusStateElements) === null || _message$locusStateEl5 === void 0 ? void 0 : _message$locusStateEl5.find(function (el) {
|
|
904
1029
|
return (0, _utils.isMetadata)(el);
|
|
905
1030
|
});
|
|
906
|
-
if (
|
|
1031
|
+
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
1032
|
_loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> no hash tree parser found for locusUrl ".concat(message.locusUrl, ", creating a new one"));
|
|
908
1033
|
var parser = this.createHashTreeParser({
|
|
909
1034
|
locusUrl: message.locusUrl,
|
|
@@ -926,25 +1051,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
926
1051
|
if (entry.parser.state === 'stopped') {
|
|
927
1052
|
// the message matches a stopped parser, we need to check if maybe this is a new "replacement" and we need to re-activate the parser
|
|
928
1053
|
// this happens when you move from breakout A -> breakout B -> back to breakout A
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
var replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
|
|
933
|
-
if (replacedEntry) {
|
|
934
|
-
replacedEntry.replacedAt = replaces.replacedAt;
|
|
935
|
-
entry.initializedFromHashTree = false;
|
|
936
|
-
this.hashTreeObjectId2ParticipantId.clear();
|
|
937
|
-
replacedEntry.parser.stop();
|
|
938
|
-
entry.parser.resume(message);
|
|
939
|
-
} else {
|
|
940
|
-
_loggerProxy.default.logger.warn("Locus-info:index#handleHashTreeParserSwitch --> the parser that is supposed to be replaced with the currently resumed parser is not found, locusUrl=".concat(replaces.locusUrl));
|
|
941
|
-
}
|
|
942
|
-
} else {
|
|
943
|
-
_loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> received message for stopped HashTreeParser with locusUrl ".concat(message.locusUrl, ", but replaces info provided is not newer, so not re-activating the parser"));
|
|
944
|
-
}
|
|
945
|
-
return true;
|
|
946
|
-
}
|
|
947
|
-
_loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> received message for stopped HashTreeParser with locusUrl ".concat(message.locusUrl, ", but no replaces info provided, so not re-activating the parser"));
|
|
1054
|
+
this.resumeStoppedParser('handleHashTreeParserSwitch', message.locusUrl, entry, replaces, function () {
|
|
1055
|
+
return entry.parser.resumeFromMessage(message);
|
|
1056
|
+
});
|
|
948
1057
|
return true;
|
|
949
1058
|
}
|
|
950
1059
|
return false;
|
|
@@ -970,23 +1079,90 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
970
1079
|
return;
|
|
971
1080
|
}
|
|
972
1081
|
var entry = this.hashTreeParsers.get(message.locusUrl);
|
|
973
|
-
|
|
1082
|
+
|
|
1083
|
+
// the check is just for typescript, the case of no entry in hashTreeParsers is handled in handleHashTreeParserSwitch() above
|
|
1084
|
+
if (entry) {
|
|
1085
|
+
entry.parser.handleMessage(message);
|
|
1086
|
+
}
|
|
974
1087
|
}
|
|
975
1088
|
|
|
1089
|
+
/**
|
|
1090
|
+
* Triggers a sync of all hash tree datasets for all hash tree parsers associated with this meeting.
|
|
1091
|
+
* The syncs are executed sequentially within each parser.
|
|
1092
|
+
*
|
|
1093
|
+
* @param {Object} [options={}] - Options for syncing
|
|
1094
|
+
* @param {boolean} [options.onlyLLM=false] - Whether to sync only LLM based data sets
|
|
1095
|
+
* @returns {Promise<void>}
|
|
1096
|
+
*/
|
|
1097
|
+
}, {
|
|
1098
|
+
key: "syncAllHashTreeDatasets",
|
|
1099
|
+
value: (function () {
|
|
1100
|
+
var _syncAllHashTreeDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
1101
|
+
var options,
|
|
1102
|
+
_iterator3,
|
|
1103
|
+
_step3,
|
|
1104
|
+
_step3$value,
|
|
1105
|
+
entry,
|
|
1106
|
+
_args2 = arguments,
|
|
1107
|
+
_t2;
|
|
1108
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
1109
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1110
|
+
case 0:
|
|
1111
|
+
options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
1112
|
+
_iterator3 = _createForOfIteratorHelper(this.hashTreeParsers);
|
|
1113
|
+
_context2.prev = 1;
|
|
1114
|
+
_iterator3.s();
|
|
1115
|
+
case 2:
|
|
1116
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
1117
|
+
_context2.next = 4;
|
|
1118
|
+
break;
|
|
1119
|
+
}
|
|
1120
|
+
_step3$value = (0, _slicedToArray2.default)(_step3.value, 2), entry = _step3$value[1];
|
|
1121
|
+
if (!entry.parser) {
|
|
1122
|
+
_context2.next = 3;
|
|
1123
|
+
break;
|
|
1124
|
+
}
|
|
1125
|
+
_context2.next = 3;
|
|
1126
|
+
return entry.parser.syncAllDatasets(options);
|
|
1127
|
+
case 3:
|
|
1128
|
+
_context2.next = 2;
|
|
1129
|
+
break;
|
|
1130
|
+
case 4:
|
|
1131
|
+
_context2.next = 6;
|
|
1132
|
+
break;
|
|
1133
|
+
case 5:
|
|
1134
|
+
_context2.prev = 5;
|
|
1135
|
+
_t2 = _context2["catch"](1);
|
|
1136
|
+
_iterator3.e(_t2);
|
|
1137
|
+
case 6:
|
|
1138
|
+
_context2.prev = 6;
|
|
1139
|
+
_iterator3.f();
|
|
1140
|
+
return _context2.finish(6);
|
|
1141
|
+
case 7:
|
|
1142
|
+
case "end":
|
|
1143
|
+
return _context2.stop();
|
|
1144
|
+
}
|
|
1145
|
+
}, _callee2, this, [[1, 5, 6, 7]]);
|
|
1146
|
+
}));
|
|
1147
|
+
function syncAllHashTreeDatasets() {
|
|
1148
|
+
return _syncAllHashTreeDatasets.apply(this, arguments);
|
|
1149
|
+
}
|
|
1150
|
+
return syncAllHashTreeDatasets;
|
|
1151
|
+
}()
|
|
976
1152
|
/**
|
|
977
1153
|
* Callback registered with HashTreeParser to receive locus info updates.
|
|
978
1154
|
* Updates our locus info based on the data parsed by the hash tree parser.
|
|
979
1155
|
*
|
|
980
1156
|
* @param {string} locusUrl - the locus URL for which the update is received
|
|
981
|
-
* @param {
|
|
982
|
-
* @param {Object} [data] - Additional data for the update, if applicable.
|
|
1157
|
+
* @param {LocusInfoUpdate} update - Details about the update.
|
|
983
1158
|
* @returns {void}
|
|
984
1159
|
*/
|
|
1160
|
+
)
|
|
985
1161
|
}, {
|
|
986
1162
|
key: "updateFromHashTree",
|
|
987
|
-
value: function updateFromHashTree(locusUrl,
|
|
988
|
-
var
|
|
989
|
-
switch (updateType) {
|
|
1163
|
+
value: function updateFromHashTree(locusUrl, update) {
|
|
1164
|
+
var _this6 = this;
|
|
1165
|
+
switch (update.updateType) {
|
|
990
1166
|
case _hashTreeParser2.LocusInfoUpdateType.OBJECTS_UPDATED:
|
|
991
1167
|
{
|
|
992
1168
|
// initialize our new locus
|
|
@@ -1000,7 +1176,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1000
1176
|
|
|
1001
1177
|
// first go over all the updates and check what happens with the main locus object
|
|
1002
1178
|
var locusObjectStateAfterUpdates = LocusObjectStateAfterUpdates.unchanged;
|
|
1003
|
-
|
|
1179
|
+
update.updatedObjects.forEach(function (object) {
|
|
1004
1180
|
if (object.htMeta.elementId.type.toLowerCase() === _types.ObjectType.locus) {
|
|
1005
1181
|
if (locusObjectStateAfterUpdates === LocusObjectStateAfterUpdates.updated) {
|
|
1006
1182
|
var _object$data;
|
|
@@ -1009,7 +1185,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1009
1185
|
// but these should never happen
|
|
1010
1186
|
_loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> received multiple LOCUS objects in one update, this is unexpected!");
|
|
1011
1187
|
_metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_HASH_TREE_UNSUPPORTED_OPERATION, {
|
|
1012
|
-
locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) ||
|
|
1188
|
+
locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) || _this6.url,
|
|
1013
1189
|
message: object.data ? 'multiple LOCUS object updates' : 'LOCUS object update followed by removal'
|
|
1014
1190
|
});
|
|
1015
1191
|
}
|
|
@@ -1021,12 +1197,17 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1021
1197
|
}
|
|
1022
1198
|
});
|
|
1023
1199
|
var hashTreeParserEntry = this.hashTreeParsers.get(locusUrl);
|
|
1200
|
+
if (!hashTreeParserEntry) {
|
|
1201
|
+
_loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> no HashTreeParser found for locusUrl ".concat(locusUrl, " when trying to apply updates from hash tree"));
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1024
1204
|
if (!hashTreeParserEntry.initializedFromHashTree) {
|
|
1025
1205
|
// this is the first time we're getting an update for this locusUrl,
|
|
1026
1206
|
// so it's probably a move to/from breakout. We need to start from a clean state,
|
|
1027
1207
|
// so empty locus and we rely on Locus giving us sufficient data in the updates to populate it.
|
|
1028
1208
|
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> first INITIAL update for locusUrl ".concat(locusUrl, ", starting from empty state"));
|
|
1029
1209
|
hashTreeParserEntry.initializedFromHashTree = true;
|
|
1210
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1030
1211
|
locus.jsSdkMeta.forceReplaceMembers = true;
|
|
1031
1212
|
} else if (
|
|
1032
1213
|
// if Locus object is unchanged or removed, we need to keep using the existing locus
|
|
@@ -1038,7 +1219,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1038
1219
|
// copy over all of existing locus except participants
|
|
1039
1220
|
LocusDtoTopLevelKeys.forEach(function (key) {
|
|
1040
1221
|
if (key !== 'participants') {
|
|
1041
|
-
locus[key] = (0, _lodash.cloneDeep)(
|
|
1222
|
+
locus[key] = (0, _lodash.cloneDeep)(_this6[key]);
|
|
1042
1223
|
}
|
|
1043
1224
|
});
|
|
1044
1225
|
} else {
|
|
@@ -1046,11 +1227,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1046
1227
|
// (except participants, which need to stay empty - that means "no participant changes")
|
|
1047
1228
|
(0, _values.default)(_types.ObjectTypeToLocusKeyMap).forEach(function (locusDtoKey) {
|
|
1048
1229
|
if (locusDtoKey !== 'participants') {
|
|
1049
|
-
locus[locusDtoKey] = (0, _lodash.cloneDeep)(
|
|
1230
|
+
locus[locusDtoKey] = (0, _lodash.cloneDeep)(_this6[locusDtoKey]);
|
|
1050
1231
|
}
|
|
1051
1232
|
});
|
|
1052
1233
|
}
|
|
1053
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> LOCUS object is ".concat(locusObjectStateAfterUpdates, ", all updates: ").concat((0, _stringify.default)(
|
|
1234
|
+
_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
1235
|
return {
|
|
1055
1236
|
type: o.htMeta.elementId.type,
|
|
1056
1237
|
id: o.htMeta.elementId.id,
|
|
@@ -1058,8 +1239,8 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1058
1239
|
};
|
|
1059
1240
|
}))));
|
|
1060
1241
|
// now apply all the updates from the hash tree onto the locus
|
|
1061
|
-
|
|
1062
|
-
locus =
|
|
1242
|
+
update.updatedObjects.forEach(function (object) {
|
|
1243
|
+
locus = _this6.updateLocusFromHashTreeObject(object, locus);
|
|
1063
1244
|
});
|
|
1064
1245
|
|
|
1065
1246
|
// update our locus info with the new locus
|
|
@@ -1073,6 +1254,18 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1073
1254
|
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> received signal that meeting ended, destroying meeting ".concat(this.meetingId));
|
|
1074
1255
|
this.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.SELF_REMOVED);
|
|
1075
1256
|
}
|
|
1257
|
+
break;
|
|
1258
|
+
}
|
|
1259
|
+
case _hashTreeParser2.LocusInfoUpdateType.LOCUS_NOT_FOUND:
|
|
1260
|
+
{
|
|
1261
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> received LOCUS_NOT_FOUND for ".concat(locusUrl, ", triggering syncMeetings"));
|
|
1262
|
+
this.webex.meetings.syncMeetings({
|
|
1263
|
+
keepOnlyLocusMeetings: false,
|
|
1264
|
+
skipHashTreeSync: true
|
|
1265
|
+
}).catch(function (syncError) {
|
|
1266
|
+
_loggerProxy.default.logger.error("Locus-info:index#updateFromHashTree --> syncMeetings failed after LOCUS_NOT_FOUND: ".concat(syncError));
|
|
1267
|
+
});
|
|
1268
|
+
break;
|
|
1076
1269
|
}
|
|
1077
1270
|
}
|
|
1078
1271
|
}
|
|
@@ -1087,7 +1280,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1087
1280
|
key: "parse",
|
|
1088
1281
|
value: function parse(meeting, data) {
|
|
1089
1282
|
if (this.hashTreeParsers.size > 0) {
|
|
1090
|
-
|
|
1283
|
+
if (data.eventType === _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS) {
|
|
1284
|
+
// sync meetings response follows the format of "not wrapped" locus API responses,
|
|
1285
|
+
// so has no dataSets nor Metadata
|
|
1286
|
+
this.handleLocusAPIResponse(meeting, _objectSpread({}, data.locus));
|
|
1287
|
+
} else {
|
|
1288
|
+
this.handleHashTreeMessage(meeting, data.eventType, data.stateElementsMessage);
|
|
1289
|
+
}
|
|
1091
1290
|
} else {
|
|
1092
1291
|
var eventType = data.eventType;
|
|
1093
1292
|
if (eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
|
|
@@ -1148,13 +1347,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1148
1347
|
* @param {string} debugText string explaining the trigger for this call, added to logs for debugging purposes
|
|
1149
1348
|
* @param {object} locus locus object
|
|
1150
1349
|
* @param {object} metadata locus hash trees metadata
|
|
1151
|
-
* @param {string} eventType locus event
|
|
1152
1350
|
* @param {DataSet[]} dataSets
|
|
1351
|
+
* @param {string} eventType locus event
|
|
1153
1352
|
* @returns {void}
|
|
1154
1353
|
*/
|
|
1155
1354
|
}, {
|
|
1156
1355
|
key: "onFullLocusWithHashTrees",
|
|
1157
|
-
value: function onFullLocusWithHashTrees(debugText, locus, metadata,
|
|
1356
|
+
value: function onFullLocusWithHashTrees(debugText, locus, metadata, dataSets, eventType) {
|
|
1158
1357
|
if (!this.hashTreeParsers.has(locus.url)) {
|
|
1159
1358
|
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus (".concat(debugText, ") --> creating hash tree parser for locusUrl=").concat(locus.url));
|
|
1160
1359
|
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus (".concat(debugText, ") --> dataSets:"), dataSets, ' and locus:', locus, ' and metadata:', metadata);
|
|
@@ -1167,6 +1366,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1167
1366
|
metadata: metadata
|
|
1168
1367
|
});
|
|
1169
1368
|
// we have a full locus to start with, so we consider Locus info to be "initialized"
|
|
1369
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1170
1370
|
this.hashTreeParsers.get(locus.url).initializedFromHashTree = true;
|
|
1171
1371
|
this.onFullLocusCommon(locus, eventType);
|
|
1172
1372
|
} else {
|
|
@@ -1221,7 +1421,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1221
1421
|
throw new Error("Locus-info:index#onFullLocus (".concat(debugText, ") --> hash tree metadata is missing with full Locus"));
|
|
1222
1422
|
}
|
|
1223
1423
|
// this is the new hashmap Locus DTO format (only applicable to webinars for now)
|
|
1224
|
-
this.onFullLocusWithHashTrees(debugText, locus, metadata,
|
|
1424
|
+
this.onFullLocusWithHashTrees(debugText, locus, metadata, dataSets, eventType);
|
|
1225
1425
|
} else {
|
|
1226
1426
|
this.onFullLocusClassic(debugText, locus, eventType);
|
|
1227
1427
|
}
|
|
@@ -1237,7 +1437,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1237
1437
|
key: "onFullLocusCommon",
|
|
1238
1438
|
value: function onFullLocusCommon(locus, eventType) {
|
|
1239
1439
|
var _this$participants,
|
|
1240
|
-
|
|
1440
|
+
_this7 = this,
|
|
1241
1441
|
_locus$jsSdkMeta;
|
|
1242
1442
|
this.scheduledMeeting = locus.meeting || null;
|
|
1243
1443
|
this.participants = locus.participants;
|
|
@@ -1245,7 +1445,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1245
1445
|
var _participant$htMeta;
|
|
1246
1446
|
// participant.htMeta is set only for hash tree based locus
|
|
1247
1447
|
if (typeof ((_participant$htMeta = participant.htMeta) === null || _participant$htMeta === void 0 ? void 0 : _participant$htMeta.elementId.id) === 'number') {
|
|
1248
|
-
|
|
1448
|
+
_this7.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
|
|
1249
1449
|
}
|
|
1250
1450
|
});
|
|
1251
1451
|
var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
|
|
@@ -1353,8 +1553,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1353
1553
|
}, {
|
|
1354
1554
|
key: "updateLocusInfo",
|
|
1355
1555
|
value: function updateLocusInfo(locus) {
|
|
1356
|
-
|
|
1357
|
-
if (((_locus$self2 = locus.self) === null || _locus$self2 === void 0 ? void 0 : _locus$self2.reason) === 'MOVED' && ((_locus$self3 = locus.self) === null || _locus$self3 === void 0 ? void 0 : _locus$self3.state) === 'LEFT') {
|
|
1556
|
+
if (_util.default.isSelfMovedOrBreakoutEnded(locus)) {
|
|
1358
1557
|
// When moved to a breakout session locus sends a message for the previous locus
|
|
1359
1558
|
// indicating that we have been moved. It isn't helpful to continue parsing this
|
|
1360
1559
|
// as it gets interpreted as if we have left the call
|
|
@@ -1432,8 +1631,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1432
1631
|
name: 'client.call.remote-ended',
|
|
1433
1632
|
options: {
|
|
1434
1633
|
meetingId: this.meetingId
|
|
1634
|
+
},
|
|
1635
|
+
payload: {
|
|
1636
|
+
eventData: {
|
|
1637
|
+
joinInProgress: this.destroyMeetingSuspended
|
|
1638
|
+
}
|
|
1435
1639
|
}
|
|
1436
1640
|
});
|
|
1641
|
+
if (this.destroyMeetingSuspended) {
|
|
1642
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
|
|
1643
|
+
meetingId: this.meetingId,
|
|
1644
|
+
reason: 'CALL_INACTIVE'
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1437
1647
|
this.emitScoped({
|
|
1438
1648
|
file: 'locus-info',
|
|
1439
1649
|
function: 'isMeetingActive'
|
|
@@ -1447,8 +1657,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1447
1657
|
name: 'client.call.remote-ended',
|
|
1448
1658
|
options: {
|
|
1449
1659
|
meetingId: this.meetingId
|
|
1660
|
+
},
|
|
1661
|
+
payload: {
|
|
1662
|
+
eventData: {
|
|
1663
|
+
joinInProgress: this.destroyMeetingSuspended
|
|
1664
|
+
}
|
|
1450
1665
|
}
|
|
1451
1666
|
});
|
|
1667
|
+
if (this.destroyMeetingSuspended) {
|
|
1668
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
|
|
1669
|
+
meetingId: this.meetingId,
|
|
1670
|
+
reason: 'PARTNER_LEFT'
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1452
1673
|
this.emitScoped({
|
|
1453
1674
|
file: 'locus-info',
|
|
1454
1675
|
function: 'isMeetingActive'
|
|
@@ -1463,8 +1684,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1463
1684
|
name: 'client.call.remote-ended',
|
|
1464
1685
|
options: {
|
|
1465
1686
|
meetingId: this.meetingId
|
|
1687
|
+
},
|
|
1688
|
+
payload: {
|
|
1689
|
+
eventData: {
|
|
1690
|
+
joinInProgress: this.destroyMeetingSuspended
|
|
1691
|
+
}
|
|
1466
1692
|
}
|
|
1467
1693
|
});
|
|
1694
|
+
if (this.destroyMeetingSuspended) {
|
|
1695
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
|
|
1696
|
+
meetingId: this.meetingId,
|
|
1697
|
+
reason: 'SELF_LEFT'
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1468
1700
|
this.emitScoped({
|
|
1469
1701
|
file: 'locus-info',
|
|
1470
1702
|
function: 'isMeetingActive'
|
|
@@ -1474,43 +1706,69 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1474
1706
|
});
|
|
1475
1707
|
}
|
|
1476
1708
|
} else if (((_this$parsedLocus$ful6 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful6 === void 0 ? void 0 : _this$parsedLocus$ful6.type) === _constants._MEETING_) {
|
|
1477
|
-
if (this.fullState && (this.fullState
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1709
|
+
if (this.fullState && _util.default.isWholeMeetingEnded(this.fullState)) {
|
|
1710
|
+
if (this.destroyMeetingSuspended) {
|
|
1711
|
+
_loggerProxy.default.logger.info('Locus-info:index#isMeetingActive --> suppressing DESTROY_MEETING (MEETING_INACTIVE_TERMINATING) because destroyMeeting is suspended');
|
|
1712
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
|
|
1713
|
+
meetingId: this.meetingId,
|
|
1714
|
+
reason: 'MEETING_INACTIVE_TERMINATING'
|
|
1715
|
+
});
|
|
1716
|
+
} else {
|
|
1717
|
+
_loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting is ending due to inactive');
|
|
1481
1718
|
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1719
|
+
// @ts-ignore
|
|
1720
|
+
this.webex.internal.newMetrics.submitClientEvent({
|
|
1721
|
+
name: 'client.call.remote-ended',
|
|
1722
|
+
options: {
|
|
1723
|
+
meetingId: this.meetingId
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
this.emitScoped({
|
|
1727
|
+
file: 'locus-info',
|
|
1728
|
+
function: 'isMeetingActive'
|
|
1729
|
+
}, _constants.EVENTS.DESTROY_MEETING, {
|
|
1730
|
+
reason: _constants.MEETING_REMOVED_REASON.MEETING_INACTIVE_TERMINATING,
|
|
1731
|
+
shouldLeave: false
|
|
1732
|
+
});
|
|
1733
|
+
}
|
|
1496
1734
|
}
|
|
1497
1735
|
// If you are guest and you are removed from the meeting
|
|
1498
1736
|
// You wont get any further events
|
|
1499
1737
|
else if (this.parsedLocus.self && this.parsedLocus.self.removed) {
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1738
|
+
if (this.destroyMeetingSuspended) {
|
|
1739
|
+
_loggerProxy.default.logger.info('Locus-info:index#isMeetingActive --> suppressing DESTROY_MEETING (SELF_REMOVED) because destroyMeeting is suspended');
|
|
1740
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.DESTROY_MEETING_WHILE_SUSPENDED, {
|
|
1741
|
+
meetingId: this.meetingId,
|
|
1742
|
+
reason: 'SELF_REMOVED'
|
|
1743
|
+
});
|
|
1744
|
+
} else {
|
|
1745
|
+
this.emitScoped({
|
|
1746
|
+
file: 'locus-info',
|
|
1747
|
+
function: 'isMeetingActive'
|
|
1748
|
+
}, _constants.EVENTS.DESTROY_MEETING, {
|
|
1749
|
+
reason: _constants.MEETING_REMOVED_REASON.SELF_REMOVED,
|
|
1750
|
+
shouldLeave: false
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1508
1753
|
}
|
|
1509
1754
|
} else {
|
|
1510
1755
|
_loggerProxy.default.logger.warn('Locus-info:index#isMeetingActive --> Meeting Type is unknown.');
|
|
1511
1756
|
}
|
|
1512
1757
|
}
|
|
1513
1758
|
|
|
1759
|
+
/**
|
|
1760
|
+
* Suspends or resumes the emission of DESTROY_MEETING events in certain situations.
|
|
1761
|
+
* Used by joinWithMedia to prevent meeting destruction during retry flows.
|
|
1762
|
+
* @param {boolean} suspend - true to suppress, false to resume
|
|
1763
|
+
* @returns {undefined}
|
|
1764
|
+
* @memberof LocusInfo
|
|
1765
|
+
*/
|
|
1766
|
+
}, {
|
|
1767
|
+
key: "suspendDestroyMeeting",
|
|
1768
|
+
value: function suspendDestroyMeeting(suspend) {
|
|
1769
|
+
this.destroyMeetingSuspended = suspend;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1514
1772
|
/**
|
|
1515
1773
|
* checks if the host permissions have changed while in the meeting
|
|
1516
1774
|
* This would be the case if your role as host or moderator has been updated
|
|
@@ -1579,11 +1837,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1579
1837
|
isReplace: isReplace
|
|
1580
1838
|
});
|
|
1581
1839
|
if (participants && (0, _isArray.default)(participants) && participants.length > 0) {
|
|
1582
|
-
var
|
|
1583
|
-
|
|
1840
|
+
var _iterator4 = _createForOfIteratorHelper(participants),
|
|
1841
|
+
_step4;
|
|
1584
1842
|
try {
|
|
1585
|
-
for (
|
|
1586
|
-
var participant =
|
|
1843
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1844
|
+
var participant = _step4.value;
|
|
1587
1845
|
if (participant && (participant === null || participant === void 0 ? void 0 : participant.reason) === 'FAILURE') {
|
|
1588
1846
|
var _participant$person;
|
|
1589
1847
|
this.emitScoped({
|
|
@@ -1595,9 +1853,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1595
1853
|
}
|
|
1596
1854
|
}
|
|
1597
1855
|
} catch (err) {
|
|
1598
|
-
|
|
1856
|
+
_iterator4.e(err);
|
|
1599
1857
|
} finally {
|
|
1600
|
-
|
|
1858
|
+
_iterator4.f();
|
|
1601
1859
|
}
|
|
1602
1860
|
}
|
|
1603
1861
|
}
|
|
@@ -1718,7 +1976,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1718
1976
|
}, _constants.LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED, {
|
|
1719
1977
|
state: state,
|
|
1720
1978
|
modifiedBy: current.record.modifiedBy,
|
|
1721
|
-
lastModified: current.record.lastModified
|
|
1979
|
+
lastModified: current.record.lastModified,
|
|
1980
|
+
modifiedByServiceAppName: current.record.modifiedByServiceAppName,
|
|
1981
|
+
modifiedByServiceAppId: current.record.modifiedByServiceAppId
|
|
1722
1982
|
});
|
|
1723
1983
|
}
|
|
1724
1984
|
if (hasMeetingContainerChanged) {
|
|
@@ -2033,9 +2293,18 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2033
2293
|
value: function updateMeetingInfo(info, self) {
|
|
2034
2294
|
var _this$parsedLocus$sel;
|
|
2035
2295
|
var roles = self ? _selfUtils.default.getRoles(self) : ((_this$parsedLocus$sel = this.parsedLocus.self) === null || _this$parsedLocus$sel === void 0 ? void 0 : _this$parsedLocus$sel.roles) || [];
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2296
|
+
var isJoined = _selfUtils.default.isJoined(self || this.parsedLocus.self);
|
|
2297
|
+
|
|
2298
|
+
// The parsed userDisplayHints depend on info, roles and isJoined, so we must recompute
|
|
2299
|
+
// whenever any of them changes. A common case is self transitioning to JOINED via a delta
|
|
2300
|
+
// that doesn't carry an info section - in that case we fall back to the previously stored
|
|
2301
|
+
// info so the hints get reparsed with the new joined state (e.g. VIEW_THE_PARTICIPANT_LIST).
|
|
2302
|
+
var infoToParse = info || this.info;
|
|
2303
|
+
var infoChanged = info && !(0, _lodash.isEqual)(this.info, info);
|
|
2304
|
+
var rolesChanged = !(0, _lodash.isEqual)(this.roles, roles);
|
|
2305
|
+
var isJoinedChanged = _selfUtils.default.isJoined(this.parsedLocus.self) !== isJoined;
|
|
2306
|
+
if (infoToParse && (infoChanged || rolesChanged || isJoinedChanged)) {
|
|
2307
|
+
var parsedInfo = _infoUtils.default.getInfos(this.parsedLocus.info, infoToParse, roles, isJoined);
|
|
2039
2308
|
if (parsedInfo.updates.isLocked) {
|
|
2040
2309
|
this.emitScoped({
|
|
2041
2310
|
file: 'locus-info',
|
|
@@ -2048,7 +2317,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2048
2317
|
function: 'updateMeetingInfo'
|
|
2049
2318
|
}, _constants.LOCUSINFO.EVENTS.MEETING_UNLOCKED, info);
|
|
2050
2319
|
}
|
|
2051
|
-
this.info =
|
|
2320
|
+
this.info = infoToParse;
|
|
2052
2321
|
this.parsedLocus.info = parsedInfo.current;
|
|
2053
2322
|
// Parses the info and adds necessary values
|
|
2054
2323
|
this.updateMeeting(parsedInfo.current);
|
|
@@ -2243,12 +2512,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2243
2512
|
});
|
|
2244
2513
|
}
|
|
2245
2514
|
if (parsedSelves.updates.isMutedByOthersChanged) {
|
|
2515
|
+
var _parsedSelves$current2;
|
|
2246
2516
|
this.emitScoped({
|
|
2247
2517
|
file: 'locus-info',
|
|
2248
2518
|
function: 'updateSelf'
|
|
2249
2519
|
}, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED, {
|
|
2250
2520
|
muted: parsedSelves.current.remoteMuted,
|
|
2251
|
-
unmuteAllowed: parsedSelves.current.unmuteAllowed
|
|
2521
|
+
unmuteAllowed: parsedSelves.current.unmuteAllowed,
|
|
2522
|
+
modifiedBy: (_parsedSelves$current2 = parsedSelves.current.modifiedBy) !== null && _parsedSelves$current2 !== void 0 ? _parsedSelves$current2 : null
|
|
2252
2523
|
});
|
|
2253
2524
|
}
|
|
2254
2525
|
if (parsedSelves.updates.localAudioUnmuteRequestedByServer) {
|
|
@@ -2278,14 +2549,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2278
2549
|
_constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
|
|
2279
2550
|
}
|
|
2280
2551
|
if (parsedSelves.updates.audioStateChange || parsedSelves.updates.videoStateChange || parsedSelves.updates.shareStateChange) {
|
|
2281
|
-
var _parsedSelves$
|
|
2552
|
+
var _parsedSelves$current3, _parsedSelves$current4, _parsedSelves$current5;
|
|
2282
2553
|
this.emitScoped({
|
|
2283
2554
|
file: 'locus-info',
|
|
2284
2555
|
function: 'updateSelf'
|
|
2285
2556
|
}, _constants.LOCUSINFO.EVENTS.MEDIA_STATUS_CHANGE, {
|
|
2286
|
-
audioStatus: (_parsedSelves$
|
|
2287
|
-
videoStatus: (_parsedSelves$
|
|
2288
|
-
shareStatus: (_parsedSelves$
|
|
2557
|
+
audioStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.audio,
|
|
2558
|
+
videoStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.video,
|
|
2559
|
+
shareStatus: (_parsedSelves$current5 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current5 === void 0 ? void 0 : _parsedSelves$current5.share
|
|
2289
2560
|
});
|
|
2290
2561
|
}
|
|
2291
2562
|
if (parsedSelves.updates.isUserObserving) {
|
|
@@ -2467,7 +2738,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2467
2738
|
}, {
|
|
2468
2739
|
key: "updateMainSessionLocusCache",
|
|
2469
2740
|
value: function updateMainSessionLocusCache(mainLocus) {
|
|
2470
|
-
var
|
|
2741
|
+
var _this8 = this;
|
|
2471
2742
|
if (!mainLocus) {
|
|
2472
2743
|
return;
|
|
2473
2744
|
}
|
|
@@ -2476,7 +2747,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2476
2747
|
// shallow merge and do special merge for participants
|
|
2477
2748
|
(0, _lodash.assignWith)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
|
|
2478
2749
|
if (key === 'participants') {
|
|
2479
|
-
return
|
|
2750
|
+
return _this8.mergeParticipants(objValue, srcValue);
|
|
2480
2751
|
}
|
|
2481
2752
|
return srcValue || objValue;
|
|
2482
2753
|
});
|
|
@@ -2495,6 +2766,21 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2495
2766
|
value: function clearMainSessionLocusCache() {
|
|
2496
2767
|
this.mainSessionLocusCache = null;
|
|
2497
2768
|
}
|
|
2769
|
+
|
|
2770
|
+
/**
|
|
2771
|
+
* Cleans up all hash tree parsers and clears internal maps.
|
|
2772
|
+
* @returns {void}
|
|
2773
|
+
* @memberof LocusInfo
|
|
2774
|
+
*/
|
|
2775
|
+
}, {
|
|
2776
|
+
key: "cleanUp",
|
|
2777
|
+
value: function cleanUp() {
|
|
2778
|
+
this.hashTreeParsers.forEach(function (entry) {
|
|
2779
|
+
entry.parser.cleanUp();
|
|
2780
|
+
});
|
|
2781
|
+
this.hashTreeParsers.clear();
|
|
2782
|
+
this.hashTreeObjectId2ParticipantId.clear();
|
|
2783
|
+
}
|
|
2498
2784
|
}]);
|
|
2499
2785
|
}(_eventsScope.default);
|
|
2500
2786
|
//# sourceMappingURL=index.js.map
|