@webex/plugin-meetings 3.12.0-next.8 → 3.12.0-task-refactor.1
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/annotation/index.js +5 -14
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +2 -8
- package/dist/config.js.map +1 -1
- package/dist/constants.js +6 -29
- package/dist/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +29 -1563
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/types.js +3 -13
- package/dist/hashTree/types.js.map +1 -1
- package/dist/index.js +2 -11
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.js +0 -7
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRouteToken.js +5 -27
- package/dist/interceptors/locusRouteToken.js.map +1 -1
- package/dist/interpretation/index.js +2 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +3 -7
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +247 -642
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +0 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +1 -57
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/properties.js +2 -4
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +1 -7
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1036 -1481
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/request.js +0 -50
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +3 -133
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +59 -142
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/util.js +7 -11
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +0 -10
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +0 -10
- package/dist/member/util.js.map +1 -1
- package/dist/metrics/constants.js +1 -7
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +60 -9
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +0 -11
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +2 -116
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +18 -171
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +11 -21
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachabilityPeerConnection.js +1 -1
- package/dist/reachability/reachabilityPeerConnection.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +1 -0
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/types/common/browser-detection.d.ts +0 -1
- package/dist/types/common/events/events-scope.d.ts +0 -1
- package/dist/types/common/events/events.d.ts +0 -1
- package/dist/types/config.d.ts +0 -5
- package/dist/types/constants.d.ts +1 -24
- package/dist/types/hashTree/hashTreeParser.d.ts +11 -260
- package/dist/types/hashTree/types.d.ts +0 -20
- package/dist/types/index.d.ts +0 -1
- package/dist/types/interceptors/index.d.ts +1 -2
- package/dist/types/interceptors/locusRouteToken.d.ts +0 -2
- package/dist/types/locus-info/index.d.ts +47 -68
- package/dist/types/locus-info/types.d.ts +12 -28
- package/dist/types/media/MediaConnectionAwaiter.d.ts +1 -10
- package/dist/types/media/properties.d.ts +1 -2
- package/dist/types/meeting/in-meeting-actions.d.ts +0 -6
- package/dist/types/meeting/index.d.ts +7 -86
- package/dist/types/meeting/request.d.ts +1 -16
- package/dist/types/meeting/request.type.d.ts +0 -5
- package/dist/types/meeting/util.d.ts +0 -31
- package/dist/types/meeting-info/util.d.ts +0 -1
- package/dist/types/meeting-info/utilv2.d.ts +0 -1
- package/dist/types/meetings/index.d.ts +2 -4
- package/dist/types/member/index.d.ts +0 -1
- package/dist/types/member/types.d.ts +4 -4
- package/dist/types/member/util.d.ts +0 -5
- package/dist/types/metrics/constants.d.ts +0 -6
- package/dist/types/multistream/mediaRequestManager.d.ts +23 -0
- package/dist/types/multistream/sendSlotManager.d.ts +1 -23
- package/dist/types/reachability/clusterReachability.d.ts +3 -30
- package/dist/types/reactions/reactions.type.d.ts +0 -1
- package/dist/types/recording-controller/util.d.ts +5 -5
- package/dist/types/roap/index.d.ts +1 -1
- package/dist/webinar/index.js +163 -438
- package/dist/webinar/index.js.map +1 -1
- package/package.json +24 -26
- package/src/annotation/index.ts +7 -27
- package/src/config.ts +0 -5
- package/src/constants.ts +1 -30
- package/src/hashTree/hashTreeParser.ts +25 -1523
- package/src/hashTree/types.ts +1 -24
- package/src/index.ts +1 -8
- package/src/interceptors/index.ts +1 -2
- package/src/interceptors/locusRouteToken.ts +5 -22
- package/src/interpretation/index.ts +2 -2
- package/src/locus-info/controlsUtils.ts +0 -17
- package/src/locus-info/index.ts +213 -707
- package/src/locus-info/selfUtils.ts +0 -1
- package/src/locus-info/types.ts +12 -27
- package/src/media/MediaConnectionAwaiter.ts +1 -41
- package/src/media/properties.ts +1 -3
- package/src/meeting/in-meeting-actions.ts +0 -12
- package/src/meeting/index.ts +84 -461
- package/src/meeting/request.ts +0 -42
- package/src/meeting/request.type.ts +0 -6
- package/src/meeting/util.ts +2 -160
- package/src/meetings/index.ts +60 -180
- package/src/meetings/util.ts +9 -10
- package/src/member/index.ts +0 -10
- package/src/member/util.ts +0 -12
- package/src/metrics/constants.ts +0 -7
- package/src/multistream/mediaRequestManager.ts +54 -4
- package/src/multistream/remoteMediaManager.ts +0 -13
- package/src/multistream/sendSlotManager.ts +3 -97
- package/src/reachability/clusterReachability.ts +27 -153
- package/src/reachability/index.ts +1 -15
- package/src/reachability/reachabilityPeerConnection.ts +1 -3
- package/src/reactions/reactions.type.ts +0 -1
- package/src/reconnection-manager/index.ts +1 -0
- package/src/webinar/index.ts +6 -265
- package/test/unit/spec/annotation/index.ts +7 -69
- package/test/unit/spec/interceptors/locusRouteToken.ts +0 -44
- package/test/unit/spec/locus-info/controlsUtils.js +1 -56
- package/test/unit/spec/locus-info/index.js +90 -1457
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +1 -41
- package/test/unit/spec/media/properties.ts +3 -12
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -8
- package/test/unit/spec/meeting/index.js +128 -981
- package/test/unit/spec/meeting/request.js +0 -70
- package/test/unit/spec/meeting/utils.js +26 -438
- package/test/unit/spec/meetings/index.js +33 -845
- package/test/unit/spec/meetings/utils.js +1 -51
- package/test/unit/spec/member/index.js +4 -28
- package/test/unit/spec/member/util.js +27 -65
- package/test/unit/spec/multistream/mediaRequestManager.ts +85 -2
- package/test/unit/spec/multistream/remoteMediaManager.ts +0 -30
- package/test/unit/spec/multistream/sendSlotManager.ts +36 -135
- package/test/unit/spec/reachability/clusterReachability.ts +1 -125
- package/test/unit/spec/reachability/index.ts +3 -26
- package/test/unit/spec/reconnection-manager/index.js +8 -4
- package/test/unit/spec/webinar/index.ts +37 -534
- package/dist/aiEnableRequest/index.js +0 -184
- package/dist/aiEnableRequest/index.js.map +0 -1
- package/dist/aiEnableRequest/utils.js +0 -36
- package/dist/aiEnableRequest/utils.js.map +0 -1
- package/dist/hashTree/constants.js +0 -22
- package/dist/hashTree/constants.js.map +0 -1
- package/dist/hashTree/hashTree.js +0 -533
- package/dist/hashTree/hashTree.js.map +0 -1
- package/dist/hashTree/utils.js +0 -69
- package/dist/hashTree/utils.js.map +0 -1
- package/dist/interceptors/constant.js +0 -12
- package/dist/interceptors/constant.js.map +0 -1
- package/dist/interceptors/dataChannelAuthToken.js +0 -290
- package/dist/interceptors/dataChannelAuthToken.js.map +0 -1
- package/dist/interceptors/utils.js +0 -27
- package/dist/interceptors/utils.js.map +0 -1
- package/dist/types/aiEnableRequest/index.d.ts +0 -5
- package/dist/types/aiEnableRequest/utils.d.ts +0 -2
- package/dist/types/hashTree/constants.d.ts +0 -9
- package/dist/types/hashTree/hashTree.d.ts +0 -136
- package/dist/types/hashTree/utils.d.ts +0 -22
- package/dist/types/interceptors/constant.d.ts +0 -5
- package/dist/types/interceptors/dataChannelAuthToken.d.ts +0 -43
- package/dist/types/interceptors/utils.d.ts +0 -1
- package/dist/types/webinar/utils.d.ts +0 -6
- package/dist/webinar/utils.js +0 -25
- package/dist/webinar/utils.js.map +0 -1
- package/src/aiEnableRequest/README.md +0 -84
- package/src/aiEnableRequest/index.ts +0 -170
- package/src/aiEnableRequest/utils.ts +0 -25
- package/src/hashTree/constants.ts +0 -10
- package/src/hashTree/hashTree.ts +0 -480
- package/src/hashTree/utils.ts +0 -62
- package/src/interceptors/constant.ts +0 -6
- package/src/interceptors/dataChannelAuthToken.ts +0 -170
- package/src/interceptors/utils.ts +0 -16
- package/src/webinar/utils.ts +0 -16
- package/test/unit/spec/aiEnableRequest/index.ts +0 -981
- package/test/unit/spec/aiEnableRequest/utils.ts +0 -130
- package/test/unit/spec/hashTree/hashTree.ts +0 -721
- package/test/unit/spec/hashTree/hashTreeParser.ts +0 -3670
- package/test/unit/spec/hashTree/utils.ts +0 -140
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +0 -210
- package/test/unit/spec/interceptors/utils.ts +0 -75
- package/test/unit/spec/webinar/utils.ts +0 -39
package/dist/locus-info/index.js
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
|
|
7
|
-
var _Array$isArray2 = require("@babel/runtime-corejs2/core-js/array/is-array");
|
|
8
|
-
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
4
|
+
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
5
|
+
var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
9
6
|
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
10
7
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
11
8
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
12
9
|
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
13
10
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
14
|
-
var
|
|
11
|
+
var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
|
|
12
|
+
var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
|
|
13
|
+
var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
|
|
14
|
+
var _Array$isArray2 = require("@babel/runtime-corejs2/core-js/array/is-array");
|
|
15
15
|
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
16
16
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
17
17
|
_Object$defineProperty(exports, "__esModule", {
|
|
18
18
|
value: true
|
|
19
19
|
});
|
|
20
|
-
exports.createLocusFromHashTreeMessage = createLocusFromHashTreeMessage;
|
|
21
20
|
exports.default = void 0;
|
|
22
|
-
exports.findMeetingForHashTreeMessage = findMeetingForHashTreeMessage;
|
|
23
21
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
22
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
|
|
23
|
+
var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
|
|
24
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
25
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
|
|
24
26
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
25
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
26
27
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
27
28
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
28
29
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
|
|
29
30
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
|
|
30
31
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
|
|
31
32
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
32
|
-
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
33
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
|
|
34
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
|
|
35
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
36
|
-
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
33
|
var _lodash = require("lodash");
|
|
39
34
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
40
35
|
var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
|
|
@@ -49,190 +44,23 @@ var _mediaSharesUtils = _interopRequireDefault(require("./mediaSharesUtils"));
|
|
|
49
44
|
var _parser = _interopRequireDefault(require("./parser"));
|
|
50
45
|
var _metrics = _interopRequireDefault(require("../metrics"));
|
|
51
46
|
var _constants2 = _interopRequireDefault(require("../metrics/constants"));
|
|
52
|
-
var
|
|
47
|
+
var _hashTreeParser = _interopRequireWildcard(require("../hashTree/hashTreeParser"));
|
|
53
48
|
var _types = require("../hashTree/types");
|
|
54
|
-
var _utils = require("../hashTree/utils");
|
|
55
|
-
var _util = _interopRequireDefault(require("../meetings/util"));
|
|
56
49
|
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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
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
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
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; }
|
|
60
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
61
50
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && r[_Symbol$iterator] || r["@@iterator"]; if (!t) { if (_Array$isArray2(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; } } }; }
|
|
62
51
|
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; } }
|
|
63
52
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
function ownKeys(e, r) { var t = _Object$keys(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; }
|
|
54
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
55
|
+
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)); }
|
|
56
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
57
|
+
var LocusDtoTopLevelKeys = ['controls', 'fullState', 'host', 'info', 'links', 'mediaShares', 'meetings', 'participants', 'replaces', 'self', 'sequence', 'syncUrl', 'url', 'htMeta' // only exists when hash trees are used
|
|
67
58
|
];
|
|
68
|
-
// when we invoke APIs on the whole Locus like "mute all" backend returns the whole Locus in the response like this
|
|
69
|
-
|
|
70
59
|
var LocusObjectStateAfterUpdates = {
|
|
71
60
|
unchanged: 'unchanged',
|
|
72
61
|
removed: 'removed',
|
|
73
62
|
updated: 'updated'
|
|
74
63
|
};
|
|
75
|
-
/**
|
|
76
|
-
* Gets the replacement information
|
|
77
|
-
*
|
|
78
|
-
* @param {any} self - "self" object from Locus DTO
|
|
79
|
-
* @param {string} deviceUrl - The URL of the user's device
|
|
80
|
-
* @returns {any} The replace information if available, otherwise undefined
|
|
81
|
-
*/
|
|
82
|
-
function getReplaceInfoFromSelf(self, deviceUrl) {
|
|
83
|
-
if (self) {
|
|
84
|
-
var _device$replaces;
|
|
85
|
-
var device = _util.default.getThisDevice({
|
|
86
|
-
self: self
|
|
87
|
-
}, deviceUrl);
|
|
88
|
-
if ((device === null || device === void 0 ? void 0 : (_device$replaces = device.replaces) === null || _device$replaces === void 0 ? void 0 : _device$replaces.length) > 0) {
|
|
89
|
-
return device.replaces[0];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Finds a meeting by its locus URL in meeting collection. It checks all HashTreeParsers of all meetings in the collection.
|
|
97
|
-
*
|
|
98
|
-
* @param {MeetingCollection} meetingCollection - The collection of meetings to search
|
|
99
|
-
* @param {string} locusUrl - The locus URL to search for
|
|
100
|
-
* @returns {any} The meeting if found, otherwise undefined
|
|
101
|
-
*/
|
|
102
|
-
function findLocusUrlInAnyHashTreeParser(meetingCollection, locusUrl) {
|
|
103
|
-
for (var _i = 0, _arr = (0, _values.default)(meetingCollection.getAll()); _i < _arr.length; _i++) {
|
|
104
|
-
var _meeting$locusInfo, _meeting$locusInfo$ha;
|
|
105
|
-
var meeting = _arr[_i];
|
|
106
|
-
if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && (_meeting$locusInfo$ha = _meeting$locusInfo.hashTreeParsers) !== null && _meeting$locusInfo$ha !== void 0 && _meeting$locusInfo$ha.has(locusUrl)) {
|
|
107
|
-
return meeting;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return undefined;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Finds a meeting for a given hash tree message.
|
|
115
|
-
*
|
|
116
|
-
* @param {HashTreeMessage} message - The hash tree message to find the meeting for
|
|
117
|
-
* @param {MeetingCollection} meetingCollection - The collection of meetings to search
|
|
118
|
-
* @param {string} deviceUrl - The URL of the user's device
|
|
119
|
-
* @returns {any} The meeting if found, otherwise undefined
|
|
120
|
-
*/
|
|
121
|
-
function findMeetingForHashTreeMessage(message, meetingCollection, deviceUrl) {
|
|
122
|
-
var _message$locusStateEl, _message$locusStateEl2;
|
|
123
|
-
var foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, message.locusUrl);
|
|
124
|
-
if (foundMeeting) {
|
|
125
|
-
return foundMeeting;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// if we haven't found anything, it may mean that message has a new locusUrl
|
|
129
|
-
// check if it indicates that it replaces some existing current locusUrl (this is indicated in "self")
|
|
130
|
-
var self = (_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : (_message$locusStateEl2 = _message$locusStateEl.find(function (el) {
|
|
131
|
-
return (0, _utils.isSelf)(el);
|
|
132
|
-
})) === null || _message$locusStateEl2 === void 0 ? void 0 : _message$locusStateEl2.data;
|
|
133
|
-
var replaces = getReplaceInfoFromSelf(self, deviceUrl);
|
|
134
|
-
if (replaces !== null && replaces !== void 0 && replaces.locusUrl) {
|
|
135
|
-
foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, replaces.locusUrl);
|
|
136
|
-
return foundMeeting;
|
|
137
|
-
}
|
|
138
|
-
return undefined;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Creates a locus object from the objects received in a hash tree message. It usually will be
|
|
143
|
-
* incomplete, because hash tree messages only contain the parts of locus that have changed,
|
|
144
|
-
* and some updates come separately over Mercury or LLM in separate messages.
|
|
145
|
-
*
|
|
146
|
-
* @param {HashTreeMessage} message hash tree message to created the locus from
|
|
147
|
-
* @returns {Object} the created locus object and metadata if present
|
|
148
|
-
*/
|
|
149
|
-
function createLocusFromHashTreeMessage(message) {
|
|
150
|
-
var locus = {
|
|
151
|
-
participants: [],
|
|
152
|
-
url: message.locusUrl
|
|
153
|
-
};
|
|
154
|
-
var metadata;
|
|
155
|
-
if (!message.locusStateElements) {
|
|
156
|
-
return {
|
|
157
|
-
locus: locus,
|
|
158
|
-
metadata: metadata
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
var _iterator = _createForOfIteratorHelper(message.locusStateElements),
|
|
162
|
-
_step;
|
|
163
|
-
try {
|
|
164
|
-
var _loop = function _loop() {
|
|
165
|
-
var element = _step.value;
|
|
166
|
-
if (!element.data) {
|
|
167
|
-
// eslint-disable-next-line no-continue
|
|
168
|
-
return 1; // continue
|
|
169
|
-
}
|
|
170
|
-
var type = element.htMeta.elementId.type.toLowerCase();
|
|
171
|
-
switch (type) {
|
|
172
|
-
case _types.ObjectType.locus:
|
|
173
|
-
{
|
|
174
|
-
// spread locus object data onto the top level, but remove keys managed by other ObjectTypes
|
|
175
|
-
var locusObjectData = _objectSpread({}, element.data);
|
|
176
|
-
(0, _values.default)(_types.ObjectTypeToLocusKeyMap).forEach(function (locusDtoKey) {
|
|
177
|
-
delete locusObjectData[locusDtoKey];
|
|
178
|
-
});
|
|
179
|
-
(0, _assign.default)(locus, locusObjectData);
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
case _types.ObjectType.participant:
|
|
183
|
-
locus.participants.push(element.data);
|
|
184
|
-
break;
|
|
185
|
-
case _types.ObjectType.mediaShare:
|
|
186
|
-
if (!locus.mediaShares) {
|
|
187
|
-
locus.mediaShares = [];
|
|
188
|
-
}
|
|
189
|
-
locus.mediaShares.push(element.data);
|
|
190
|
-
break;
|
|
191
|
-
case _types.ObjectType.embeddedApp:
|
|
192
|
-
if (!locus.embeddedApps) {
|
|
193
|
-
locus.embeddedApps = [];
|
|
194
|
-
}
|
|
195
|
-
locus.embeddedApps.push(element.data);
|
|
196
|
-
break;
|
|
197
|
-
case _types.ObjectType.control:
|
|
198
|
-
if (!locus.controls) {
|
|
199
|
-
locus.controls = {};
|
|
200
|
-
}
|
|
201
|
-
(0, _assign.default)(locus.controls, element.data);
|
|
202
|
-
break;
|
|
203
|
-
case _types.ObjectType.links:
|
|
204
|
-
case _types.ObjectType.info:
|
|
205
|
-
case _types.ObjectType.fullState:
|
|
206
|
-
case _types.ObjectType.self:
|
|
207
|
-
{
|
|
208
|
-
var locusDtoKey = _types.ObjectTypeToLocusKeyMap[type];
|
|
209
|
-
locus[locusDtoKey] = element.data;
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
case _types.ObjectType.metadata:
|
|
213
|
-
// metadata is not part of Locus DTO
|
|
214
|
-
metadata = _objectSpread(_objectSpread({}, element.data), {}, {
|
|
215
|
-
htMeta: element.htMeta
|
|
216
|
-
});
|
|
217
|
-
break;
|
|
218
|
-
default:
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
223
|
-
if (_loop()) continue;
|
|
224
|
-
}
|
|
225
|
-
} catch (err) {
|
|
226
|
-
_iterator.e(err);
|
|
227
|
-
} finally {
|
|
228
|
-
_iterator.f();
|
|
229
|
-
}
|
|
230
|
-
return {
|
|
231
|
-
locus: locus,
|
|
232
|
-
metadata: metadata
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
64
|
/**
|
|
237
65
|
* @description LocusInfo extends ChildEmitter to convert locusInfo info a private emitter to parent object
|
|
238
66
|
* @export
|
|
@@ -261,7 +89,10 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
261
89
|
(0, _defineProperty2.default)(_this, "aclUrl", void 0);
|
|
262
90
|
(0, _defineProperty2.default)(_this, "baseSequence", void 0);
|
|
263
91
|
(0, _defineProperty2.default)(_this, "created", void 0);
|
|
92
|
+
(0, _defineProperty2.default)(_this, "identities", void 0);
|
|
93
|
+
(0, _defineProperty2.default)(_this, "membership", void 0);
|
|
264
94
|
(0, _defineProperty2.default)(_this, "participants", void 0);
|
|
95
|
+
(0, _defineProperty2.default)(_this, "participantsUrl", void 0);
|
|
265
96
|
(0, _defineProperty2.default)(_this, "replaces", void 0);
|
|
266
97
|
(0, _defineProperty2.default)(_this, "scheduledMeeting", void 0);
|
|
267
98
|
(0, _defineProperty2.default)(_this, "sequence", void 0);
|
|
@@ -273,11 +104,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
273
104
|
(0, _defineProperty2.default)(_this, "info", void 0);
|
|
274
105
|
(0, _defineProperty2.default)(_this, "roles", void 0);
|
|
275
106
|
(0, _defineProperty2.default)(_this, "mediaShares", void 0);
|
|
107
|
+
(0, _defineProperty2.default)(_this, "replace", void 0);
|
|
276
108
|
(0, _defineProperty2.default)(_this, "url", void 0);
|
|
277
|
-
(0, _defineProperty2.default)(_this, "
|
|
109
|
+
(0, _defineProperty2.default)(_this, "services", void 0);
|
|
110
|
+
(0, _defineProperty2.default)(_this, "resources", void 0);
|
|
278
111
|
(0, _defineProperty2.default)(_this, "mainSessionLocusCache", void 0);
|
|
279
112
|
(0, _defineProperty2.default)(_this, "self", void 0);
|
|
280
|
-
(0, _defineProperty2.default)(_this, "
|
|
113
|
+
(0, _defineProperty2.default)(_this, "hashTreeParser", void 0);
|
|
281
114
|
(0, _defineProperty2.default)(_this, "hashTreeObjectId2ParticipantId", void 0);
|
|
282
115
|
// mapping of hash tree object ids to participant ids
|
|
283
116
|
(0, _defineProperty2.default)(_this, "classicVsHashTreeMismatchMetricCounter", 0);
|
|
@@ -290,7 +123,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
290
123
|
_this.meetingId = meetingId;
|
|
291
124
|
_this.updateMeeting = updateMeeting;
|
|
292
125
|
_this.locusParser = new _parser.default();
|
|
293
|
-
_this.hashTreeParsers = new _map.default();
|
|
294
126
|
_this.hashTreeObjectId2ParticipantId = new _map.default();
|
|
295
127
|
return _this;
|
|
296
128
|
}
|
|
@@ -378,7 +210,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
378
210
|
// in some cases Locus might return us full DTO even when we asked for a delta
|
|
379
211
|
_loggerProxy.default.logger.info('Locus-info:index#doLocusSync --> got full DTO when we asked for delta');
|
|
380
212
|
}
|
|
381
|
-
meeting.locusInfo.onFullLocus(
|
|
213
|
+
meeting.locusInfo.onFullLocus(res.body);
|
|
382
214
|
}).catch(function (e) {
|
|
383
215
|
_loggerProxy.default.logger.info("Locus-info:index#doLocusSync --> getLocusDTO succeeded but failed to handle result, locus parser will resume but not all data may be synced (".concat(e.toString(), ")"));
|
|
384
216
|
_metrics.default.sendBehavioralMetric(_constants2.default.LOCUS_SYNC_HANDLING_FAILED, {
|
|
@@ -464,13 +296,17 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
464
296
|
}, {
|
|
465
297
|
key: "init",
|
|
466
298
|
value: function init() {
|
|
299
|
+
var _locus$links, _locus$links2;
|
|
467
300
|
var locus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
468
301
|
this.created = locus.created || null;
|
|
469
302
|
this.scheduledMeeting = locus.meeting || null;
|
|
303
|
+
this.participantsUrl = locus.participantsUrl || null;
|
|
470
304
|
this.replaces = locus.replaces || null;
|
|
471
305
|
this.aclUrl = locus.aclUrl || null;
|
|
472
306
|
this.baseSequence = locus.baseSequence || null;
|
|
473
307
|
this.sequence = locus.sequence || null;
|
|
308
|
+
this.membership = locus.membership || null;
|
|
309
|
+
this.identities = locus.identities || null;
|
|
474
310
|
this.participants = locus.participants || null;
|
|
475
311
|
|
|
476
312
|
/**
|
|
@@ -496,64 +332,25 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
496
332
|
this.updateSelf(locus.self);
|
|
497
333
|
this.updateHostInfo(locus.host);
|
|
498
334
|
this.updateMediaShares(locus.mediaShares);
|
|
499
|
-
this.
|
|
335
|
+
this.updateServices((_locus$links = locus.links) === null || _locus$links === void 0 ? void 0 : _locus$links.services);
|
|
336
|
+
this.updateResources((_locus$links2 = locus.links) === null || _locus$links2 === void 0 ? void 0 : _locus$links2.resources);
|
|
500
337
|
}
|
|
501
338
|
|
|
502
339
|
/**
|
|
503
|
-
* Creates
|
|
504
|
-
* @param {Object}
|
|
505
|
-
* @
|
|
506
|
-
* @param {Object} params.initialLocus - initial locus data
|
|
507
|
-
* @param {Object} params.metadata - hash tree metadata
|
|
508
|
-
* @param {string} params.replacedAt - timestamp from Locus indicating when the replacement happened
|
|
509
|
-
* @returns {HashTreeParser} the newly created parser
|
|
340
|
+
* Creates the HashTreeParser instance.
|
|
341
|
+
* @param {Object} initial locus data
|
|
342
|
+
* @returns {void}
|
|
510
343
|
*/
|
|
511
344
|
}, {
|
|
512
345
|
key: "createHashTreeParser",
|
|
513
346
|
value: function createHashTreeParser(_ref) {
|
|
514
|
-
var
|
|
515
|
-
|
|
516
|
-
initialLocus = _ref.initialLocus,
|
|
517
|
-
metadata = _ref.metadata,
|
|
518
|
-
replacedAt = _ref.replacedAt;
|
|
519
|
-
var parser = new _hashTreeParser2.default({
|
|
347
|
+
var initialLocus = _ref.initialLocus;
|
|
348
|
+
return new _hashTreeParser.default({
|
|
520
349
|
initialLocus: initialLocus,
|
|
521
|
-
metadata: metadata,
|
|
522
350
|
webexRequest: this.webex.request.bind(this.webex),
|
|
523
|
-
locusInfoUpdateCallback: this.updateFromHashTree.bind(this
|
|
524
|
-
debugId: "HT-".concat(
|
|
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
|
-
});
|
|
527
|
-
|
|
528
|
-
// When a new HashTreeParser is created, previous one should be stopped.
|
|
529
|
-
// Locus will only be sending us updates for the current one.
|
|
530
|
-
var _iterator2 = _createForOfIteratorHelper(this.hashTreeParsers),
|
|
531
|
-
_step2;
|
|
532
|
-
try {
|
|
533
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
534
|
-
var _step2$value = (0, _slicedToArray2.default)(_step2.value, 2),
|
|
535
|
-
existingLocusUrl = _step2$value[0],
|
|
536
|
-
existingEntry = _step2$value[1];
|
|
537
|
-
if (existingEntry.parser.state !== 'stopped') {
|
|
538
|
-
existingEntry.parser.stop();
|
|
539
|
-
if (replacedAt) {
|
|
540
|
-
existingEntry.replacedAt = replacedAt;
|
|
541
|
-
} else {
|
|
542
|
-
_loggerProxy.default.logger.warn("Locus-info:index#createHashTreeParser --> no replacedAt timestamp provided for new HashTreeParser with locusUrl ".concat(locusUrl, ", replacing ").concat(existingLocusUrl));
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
} catch (err) {
|
|
547
|
-
_iterator2.e(err);
|
|
548
|
-
} finally {
|
|
549
|
-
_iterator2.f();
|
|
550
|
-
}
|
|
551
|
-
this.hashTreeParsers.set(locusUrl, {
|
|
552
|
-
parser: parser,
|
|
553
|
-
initializedFromHashTree: false
|
|
351
|
+
locusInfoUpdateCallback: this.updateFromHashTree.bind(this),
|
|
352
|
+
debugId: "HT-".concat(this.meetingId.substring(0, 4))
|
|
554
353
|
});
|
|
555
|
-
this.hashTreeObjectId2ParticipantId.clear();
|
|
556
|
-
return parser;
|
|
557
354
|
}
|
|
558
355
|
|
|
559
356
|
/**
|
|
@@ -566,7 +363,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
566
363
|
value: (function () {
|
|
567
364
|
var _initialSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(data) {
|
|
568
365
|
var _data$locus, _data$locus$links, _data$locus$links$res, _data$locus$links$res2;
|
|
569
|
-
var _data$hashTreeMessage,
|
|
366
|
+
var _data$hashTreeMessage, _selfObject$data, selfObject, _data$locus2, _data$locus2$self, _t;
|
|
570
367
|
return _regenerator.default.wrap(function (_context) {
|
|
571
368
|
while (1) switch (_context.prev = _context.next) {
|
|
572
369
|
case 0:
|
|
@@ -578,49 +375,47 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
578
375
|
_context.next = 4;
|
|
579
376
|
break;
|
|
580
377
|
}
|
|
581
|
-
// we need the
|
|
378
|
+
// we need the SELF object to be in the received message, because it contains visibleDataSets
|
|
582
379
|
// and these are needed to initialize all the hash trees
|
|
583
|
-
|
|
584
|
-
return (0,
|
|
380
|
+
selfObject = (_data$hashTreeMessage = data.hashTreeMessage.locusStateElements) === null || _data$hashTreeMessage === void 0 ? void 0 : _data$hashTreeMessage.find(function (el) {
|
|
381
|
+
return (0, _hashTreeParser.isSelf)(el);
|
|
585
382
|
});
|
|
586
|
-
if (
|
|
383
|
+
if (selfObject !== null && selfObject !== void 0 && (_selfObject$data = selfObject.data) !== null && _selfObject$data !== void 0 && _selfObject$data.visibleDataSets) {
|
|
587
384
|
_context.next = 2;
|
|
588
385
|
break;
|
|
589
386
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
_loggerProxy.default.logger.info("Locus-info:index#initialSetup --> cannot initialize HashTreeParser, Metadata object with visibleDataSets is missing in the message");
|
|
593
|
-
|
|
594
|
-
// throw so that handleLocusEvent() catches it and destroys the partially created meeting object
|
|
595
|
-
throw new Error('Metadata object with visibleDataSets is missing in the message');
|
|
387
|
+
_loggerProxy.default.logger.warn("Locus-info:index#initialSetup --> cannot initialize HashTreeParser, SELF object with visibleDataSets is missing in the message");
|
|
388
|
+
throw new Error('SELF object with visibleDataSets is missing in the message');
|
|
596
389
|
case 2:
|
|
597
390
|
_loggerProxy.default.logger.info('Locus-info:index#initialSetup --> creating HashTreeParser from message');
|
|
598
391
|
// first create the HashTreeParser, but don't initialize it with any data yet
|
|
599
|
-
|
|
600
|
-
|
|
392
|
+
// pass just a fake locus that contains only the visibleDataSets
|
|
393
|
+
this.hashTreeParser = this.createHashTreeParser({
|
|
601
394
|
initialLocus: {
|
|
602
|
-
locus:
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
395
|
+
locus: {
|
|
396
|
+
self: {
|
|
397
|
+
visibleDataSets: selfObject.data.visibleDataSets
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
dataSets: [] // empty, because they will be populated in initializeFromMessage() call // dataSets: data.hashTreeMessage.dataSets,
|
|
608
401
|
}
|
|
609
|
-
});
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
// now handle the message - that should populate all the visible datasets
|
|
610
405
|
_context.next = 3;
|
|
611
|
-
return hashTreeParser.initializeFromMessage(data.hashTreeMessage);
|
|
406
|
+
return this.hashTreeParser.initializeFromMessage(data.hashTreeMessage);
|
|
612
407
|
case 3:
|
|
613
408
|
_context.next = 5;
|
|
614
409
|
break;
|
|
615
410
|
case 4:
|
|
616
411
|
// "classic" Locus case, no hash trees involved
|
|
617
412
|
this.updateLocusCache(data.locus);
|
|
618
|
-
this.onFullLocus(
|
|
413
|
+
this.onFullLocus(data.locus, undefined);
|
|
619
414
|
case 5:
|
|
620
415
|
return _context.abrupt("continue", 10);
|
|
621
416
|
case 6:
|
|
622
417
|
this.updateLocusCache(data.locus);
|
|
623
|
-
this.onFullLocus(
|
|
418
|
+
this.onFullLocus(data.locus, undefined, data.dataSets);
|
|
624
419
|
return _context.abrupt("continue", 10);
|
|
625
420
|
case 7:
|
|
626
421
|
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)) {
|
|
@@ -629,23 +424,28 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
629
424
|
}
|
|
630
425
|
_loggerProxy.default.logger.info('Locus-info:index#initialSetup --> creating HashTreeParser from get-loci-response');
|
|
631
426
|
// first create the HashTreeParser, but don't initialize it with any data yet
|
|
632
|
-
|
|
633
|
-
|
|
427
|
+
// pass just a fake locus that contains only the visibleDataSets
|
|
428
|
+
this.hashTreeParser = this.createHashTreeParser({
|
|
634
429
|
initialLocus: {
|
|
635
|
-
locus:
|
|
430
|
+
locus: {
|
|
431
|
+
self: {
|
|
432
|
+
visibleDataSets: (_data$locus2 = data.locus) === null || _data$locus2 === void 0 ? void 0 : (_data$locus2$self = _data$locus2.self) === null || _data$locus2$self === void 0 ? void 0 : _data$locus2$self.visibleDataSets
|
|
433
|
+
}
|
|
434
|
+
},
|
|
636
435
|
dataSets: [] // empty, because we don't have them yet
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
// now initialize all the data
|
|
640
440
|
_context.next = 8;
|
|
641
|
-
return
|
|
441
|
+
return this.hashTreeParser.initializeFromGetLociResponse(data.locus);
|
|
642
442
|
case 8:
|
|
643
443
|
_context.next = 10;
|
|
644
444
|
break;
|
|
645
445
|
case 9:
|
|
646
446
|
// "classic" Locus case, no hash trees involved
|
|
647
447
|
this.updateLocusCache(data.locus);
|
|
648
|
-
this.onFullLocus(
|
|
448
|
+
this.onFullLocus(data.locus, undefined);
|
|
649
449
|
case 10:
|
|
650
450
|
// Change it to true after it receives it first locus object
|
|
651
451
|
this.emitChange = true;
|
|
@@ -670,36 +470,22 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
670
470
|
}, {
|
|
671
471
|
key: "handleLocusAPIResponse",
|
|
672
472
|
value: function handleLocusAPIResponse(meeting, responseBody) {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
if (isWrapped) {
|
|
679
|
-
if (!responseBody.dataSets) {
|
|
680
|
-
this.sendClassicVsHashTreeMismatchMetric(meeting, "expected hash tree dataSets in API response but they are missing");
|
|
681
|
-
// continuing as we can still manage without responseBody.dataSets, but this is very suspicious
|
|
682
|
-
}
|
|
683
|
-
_loggerProxy.default.logger.info('Locus-info:index#handleLocusAPIResponse --> passing Locus API response to HashTreeParser: ', responseBody);
|
|
684
|
-
// update the data in our hash trees
|
|
685
|
-
hashTreeParserEntry.parser.handleLocusUpdate(responseBody);
|
|
686
|
-
} else {
|
|
687
|
-
// LocusDTO without wrapper - pass it through as if it had no dataSets
|
|
688
|
-
hashTreeParserEntry.parser.handleLocusUpdate({
|
|
689
|
-
locus: responseBody
|
|
690
|
-
});
|
|
691
|
-
}
|
|
473
|
+
if (this.hashTreeParser) {
|
|
474
|
+
// API responses with hash tree are a bit problematic and not fully confirmed how they will look like
|
|
475
|
+
// we don't really need them, because all updates are guaranteed to come via Mercury or LLM messages anyway
|
|
476
|
+
// so it's OK to skip them for now
|
|
477
|
+
_loggerProxy.default.logger.info('Locus-info:index#handleLocusAPIResponse: skipping handling of API http response with hashTreeParser');
|
|
692
478
|
} else {
|
|
693
|
-
if (
|
|
479
|
+
if (responseBody.dataSets) {
|
|
694
480
|
this.sendClassicVsHashTreeMismatchMetric(meeting, "unexpected hash tree dataSets in API response");
|
|
695
481
|
}
|
|
696
482
|
// classic Locus delta
|
|
697
|
-
|
|
698
|
-
this.handleLocusDelta(locus, meeting);
|
|
483
|
+
this.handleLocusDelta(responseBody.locus, meeting);
|
|
699
484
|
}
|
|
700
485
|
}
|
|
701
486
|
|
|
702
487
|
/**
|
|
488
|
+
*
|
|
703
489
|
* @param {HashTreeObject} object data set object
|
|
704
490
|
* @param {any} locus
|
|
705
491
|
* @returns {void}
|
|
@@ -707,42 +493,32 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
707
493
|
}, {
|
|
708
494
|
key: "updateLocusFromHashTreeObject",
|
|
709
495
|
value: function updateLocusFromHashTreeObject(object, locus) {
|
|
710
|
-
var _this4 = this,
|
|
711
|
-
_locus$self;
|
|
712
496
|
var type = object.htMeta.elementId.type.toLowerCase();
|
|
713
|
-
var addParticipantObject = function addParticipantObject(obj) {
|
|
714
|
-
if (!locus.participants) {
|
|
715
|
-
locus.participants = [];
|
|
716
|
-
}
|
|
717
|
-
locus.participants.push(obj.data);
|
|
718
|
-
_this4.hashTreeObjectId2ParticipantId.set(obj.htMeta.elementId.id, obj.data.id);
|
|
719
|
-
};
|
|
720
497
|
switch (type) {
|
|
721
498
|
case _types.ObjectType.locus:
|
|
722
499
|
{
|
|
723
500
|
if (!object.data) {
|
|
724
501
|
// not doing anything here, as we need Locus to always be there (at least some fields)
|
|
725
502
|
// and that's already taken care of in updateFromHashTree()
|
|
726
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> LOCUS object removed
|
|
503
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> LOCUS object removed");
|
|
727
504
|
return locus;
|
|
728
505
|
}
|
|
729
506
|
// replace the main locus
|
|
730
507
|
|
|
731
|
-
// The Locus object we receive from backend has empty participants
|
|
732
|
-
//
|
|
733
|
-
//
|
|
508
|
+
// The Locus object we receive from backend has empty participants, so removing them to avoid it overriding the ones in our current locus object
|
|
509
|
+
// Also, other fields like mediaShares are managed by other ObjectType updates, so removing them too
|
|
510
|
+
// BTW, it also doesn't have "self". That's OK as it won't override existing locus.self and also existing SDK code can handle that missing self in Locus updates
|
|
734
511
|
var locusObjectFromData = object.data;
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
});
|
|
512
|
+
delete locusObjectFromData.participants;
|
|
513
|
+
delete locusObjectFromData.mediaShares;
|
|
738
514
|
locus = _objectSpread(_objectSpread({}, locus), locusObjectFromData);
|
|
739
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> LOCUS object updated
|
|
515
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> LOCUS object updated");
|
|
740
516
|
break;
|
|
741
517
|
}
|
|
742
518
|
case _types.ObjectType.mediaShare:
|
|
743
519
|
if (object.data) {
|
|
744
520
|
var _object$data$floor, _object$data$floor2, _object$data$floor2$b, _locus$mediaShares;
|
|
745
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> mediaShare id=".concat(object.htMeta.elementId.id, " name='").concat(object.data.name, "' updated ").concat(object.data.name === 'content' ? "floor=".concat((_object$data$floor = object.data.floor) === null || _object$data$floor === void 0 ? void 0 : _object$data$floor.disposition, ", ").concat((_object$data$floor2 = object.data.floor) === null || _object$data$floor2 === void 0 ? void 0 : (_object$data$floor2$b = _object$data$floor2.beneficiary) === null || _object$data$floor2$b === void 0 ? void 0 : _object$data$floor2$b.id) : ''
|
|
521
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> mediaShare id=".concat(object.htMeta.elementId.id, " name='").concat(object.data.name, "' updated ").concat(object.data.name === 'content' ? "floor=".concat((_object$data$floor = object.data.floor) === null || _object$data$floor === void 0 ? void 0 : _object$data$floor.disposition, ", ").concat((_object$data$floor2 = object.data.floor) === null || _object$data$floor2 === void 0 ? void 0 : (_object$data$floor2$b = _object$data$floor2.beneficiary) === null || _object$data$floor2$b === void 0 ? void 0 : _object$data$floor2$b.id) : ''));
|
|
746
522
|
var existingMediaShare = (_locus$mediaShares = locus.mediaShares) === null || _locus$mediaShares === void 0 ? void 0 : _locus$mediaShares.find(function (ms) {
|
|
747
523
|
return ms.htMeta.elementId.id === object.htMeta.elementId.id;
|
|
748
524
|
});
|
|
@@ -754,37 +530,22 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
754
530
|
}
|
|
755
531
|
} else {
|
|
756
532
|
var _locus$mediaShares2;
|
|
757
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> mediaShare id=".concat(object.htMeta.elementId.id, " removed
|
|
533
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> mediaShare id=".concat(object.htMeta.elementId.id, " removed"));
|
|
758
534
|
locus.mediaShares = (_locus$mediaShares2 = locus.mediaShares) === null || _locus$mediaShares2 === void 0 ? void 0 : _locus$mediaShares2.filter(function (ms) {
|
|
759
535
|
return ms.htMeta.elementId.id !== object.htMeta.elementId.id;
|
|
760
536
|
});
|
|
761
537
|
}
|
|
762
538
|
break;
|
|
763
|
-
case _types.ObjectType.embeddedApp:
|
|
764
|
-
if (object.data) {
|
|
765
|
-
var _locus$embeddedApps;
|
|
766
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> embeddedApp id=".concat(object.htMeta.elementId.id, " url='").concat(object.data.url, "' updated version=").concat(object.htMeta.elementId.version, ":"), object.data);
|
|
767
|
-
var existingEmbeddedApp = (_locus$embeddedApps = locus.embeddedApps) === null || _locus$embeddedApps === void 0 ? void 0 : _locus$embeddedApps.find(function (ms) {
|
|
768
|
-
return ms.htMeta.elementId.id === object.htMeta.elementId.id;
|
|
769
|
-
});
|
|
770
|
-
if (existingEmbeddedApp) {
|
|
771
|
-
(0, _assign.default)(existingEmbeddedApp, object.data);
|
|
772
|
-
} else {
|
|
773
|
-
locus.embeddedApps = locus.embeddedApps || [];
|
|
774
|
-
locus.embeddedApps.push(object.data);
|
|
775
|
-
}
|
|
776
|
-
} else {
|
|
777
|
-
var _locus$embeddedApps2;
|
|
778
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> embeddedApp id=".concat(object.htMeta.elementId.id, " removed, version=").concat(object.htMeta.elementId.version));
|
|
779
|
-
locus.embeddedApps = (_locus$embeddedApps2 = locus.embeddedApps) === null || _locus$embeddedApps2 === void 0 ? void 0 : _locus$embeddedApps2.filter(function (ms) {
|
|
780
|
-
return ms.htMeta.elementId.id !== object.htMeta.elementId.id;
|
|
781
|
-
});
|
|
782
|
-
}
|
|
783
|
-
break;
|
|
784
539
|
case _types.ObjectType.participant:
|
|
785
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> participant id=".concat(object.htMeta.elementId.id, " ").concat(object.data ? 'updated' : 'removed'
|
|
540
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> participant id=".concat(object.htMeta.elementId.id, " ").concat(object.data ? 'updated' : 'removed'));
|
|
786
541
|
if (object.data) {
|
|
787
|
-
|
|
542
|
+
if (!locus.participants) {
|
|
543
|
+
locus.participants = [];
|
|
544
|
+
}
|
|
545
|
+
var participantObject = object.data;
|
|
546
|
+
participantObject.htMeta = object.htMeta;
|
|
547
|
+
locus.participants.push(participantObject);
|
|
548
|
+
this.hashTreeObjectId2ParticipantId.set(object.htMeta.elementId.id, participantObject.id);
|
|
788
549
|
} else {
|
|
789
550
|
var participantId = this.hashTreeObjectId2ParticipantId.get(object.htMeta.elementId.id);
|
|
790
551
|
if (!locus.jsSdkMeta) {
|
|
@@ -795,60 +556,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
795
556
|
locus.jsSdkMeta.removedParticipantIds.push(participantId);
|
|
796
557
|
this.hashTreeObjectId2ParticipantId.delete(object.htMeta.elementId.id);
|
|
797
558
|
}
|
|
798
|
-
// Create self from the participant if it matches self identity and is being moved.
|
|
799
|
-
// We need this, because participant update comes in LLM message often before the self update from Mercury.
|
|
800
|
-
// Other parts of the code detect move only by looking at self, while some other parts of the SDK/webapp code
|
|
801
|
-
// look at participant for roles etc, so if participant is updated but not self, then it looks like we our lost roles temporarily
|
|
802
|
-
// (until self is updated)
|
|
803
|
-
// This will be fixed properly in SPARK-790239
|
|
804
|
-
if (object.data && object.data.identity === ((_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.identity) && object.data.state === 'LEFT' && object.data.reason === 'MOVED') {
|
|
805
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> FOUND a match for MOVED self in participant object ".concat(object.htMeta.elementId.id));
|
|
806
|
-
(0, _assign.default)(locus[_types.ObjectTypeToLocusKeyMap[_types.ObjectType.self]], object.data);
|
|
807
|
-
}
|
|
808
559
|
break;
|
|
809
|
-
case _types.ObjectType.control:
|
|
810
|
-
if (object.data) {
|
|
811
|
-
(0, _keys.default)(object.data).forEach(function (controlKey) {
|
|
812
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> control ".concat(controlKey, " updated:"), object.data[controlKey]);
|
|
813
|
-
if (!locus.controls) {
|
|
814
|
-
locus.controls = {};
|
|
815
|
-
}
|
|
816
|
-
locus.controls[controlKey] = object.data[controlKey];
|
|
817
|
-
});
|
|
818
|
-
} else {
|
|
819
|
-
_loggerProxy.default.logger.warn("Locus-info:index#updateLocusFromHashTreeObject --> control object update without data - this is not expected!");
|
|
820
|
-
}
|
|
821
|
-
break;
|
|
822
|
-
case _types.ObjectType.links:
|
|
823
|
-
case _types.ObjectType.info:
|
|
824
|
-
case _types.ObjectType.fullState:
|
|
825
560
|
case _types.ObjectType.self:
|
|
826
561
|
if (!object.data) {
|
|
827
562
|
// self without data is handled inside HashTreeParser and results in LocusInfoUpdateType.MEETING_ENDED, so we should never get here
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
} else {
|
|
831
|
-
var _locus$info, _object$data$controls, _object$data$controls2, _object$data$controls3;
|
|
832
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> ".concat(type, " object updated to version ").concat(object.htMeta.elementId.version));
|
|
833
|
-
var locusDtoKey = _types.ObjectTypeToLocusKeyMap[type];
|
|
834
|
-
locus[locusDtoKey] = object.data;
|
|
835
|
-
|
|
836
|
-
/* Hash tree based webinar attendees don't receive a Participant object for themselves from Locus,
|
|
837
|
-
but a lot of existing code in SDK and web app expects a member object for self to exist,
|
|
838
|
-
so whenever SELF changes for a webinar attendee, we copy it into a participant object.
|
|
839
|
-
We can do it, because SELF has always all the same properties as a participant object.
|
|
840
|
-
*/
|
|
841
|
-
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) {
|
|
842
|
-
return r.type === _constants.SELF_ROLES.ATTENDEE && r.hasRole;
|
|
843
|
-
})) {
|
|
844
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> webinar attendee: creating participant object from self");
|
|
845
|
-
addParticipantObject(object);
|
|
846
|
-
}
|
|
563
|
+
_loggerProxy.default.logger.warn("Locus-info:index#updateLocusFromHashTreeObject --> received SELF object without data, this is not expected!");
|
|
564
|
+
return locus;
|
|
847
565
|
}
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> metadata object updated to version ".concat(object.htMeta.elementId.version));
|
|
851
|
-
// we don't use hash tree metadata right now for anything, it's mainly used internally by HashTreeParser
|
|
566
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateLocusFromHashTreeObject --> SELF object updated");
|
|
567
|
+
locus.self = object.data;
|
|
852
568
|
break;
|
|
853
569
|
default:
|
|
854
570
|
_loggerProxy.default.logger.warn("Locus-info:index#updateLocusFromHashTreeObject --> received unsupported object type ".concat(type));
|
|
@@ -879,77 +595,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
879
595
|
}
|
|
880
596
|
}
|
|
881
597
|
|
|
882
|
-
/**
|
|
883
|
-
* Checks if the hash tree message should trigger a switch to a different HashTreeParser
|
|
884
|
-
*
|
|
885
|
-
* @param {HashTreeMessage} message incoming hash tree message
|
|
886
|
-
* @returns {boolean} true if the message was handled as a parser switch, false otherwise
|
|
887
|
-
*/
|
|
888
|
-
}, {
|
|
889
|
-
key: "handleHashTreeParserSwitch",
|
|
890
|
-
value: function handleHashTreeParserSwitch(message) {
|
|
891
|
-
var _message$locusStateEl3, _message$locusStateEl4;
|
|
892
|
-
var entry = this.hashTreeParsers.get(message.locusUrl);
|
|
893
|
-
var self = (_message$locusStateEl3 = message.locusStateElements) === null || _message$locusStateEl3 === void 0 ? void 0 : (_message$locusStateEl4 = _message$locusStateEl3.find(function (el) {
|
|
894
|
-
return (0, _utils.isSelf)(el);
|
|
895
|
-
})) === null || _message$locusStateEl4 === void 0 ? void 0 : _message$locusStateEl4.data;
|
|
896
|
-
var replaces = getReplaceInfoFromSelf(self,
|
|
897
|
-
// @ts-ignore
|
|
898
|
-
this.webex.internal.device.url);
|
|
899
|
-
if (!entry) {
|
|
900
|
-
var _message$locusStateEl5, _metadata$data, _metadata$data$visibl;
|
|
901
|
-
// Metadata object that contains information about visible datasets is needed to initialize the HashTreeParser,
|
|
902
|
-
// but it's buried inside the message, we need to find it and pass it to HashTreeParser constructor
|
|
903
|
-
var metadata = (_message$locusStateEl5 = message.locusStateElements) === null || _message$locusStateEl5 === void 0 ? void 0 : _message$locusStateEl5.find(function (el) {
|
|
904
|
-
return (0, _utils.isMetadata)(el);
|
|
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) {
|
|
907
|
-
_loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> no hash tree parser found for locusUrl ".concat(message.locusUrl, ", creating a new one"));
|
|
908
|
-
var parser = this.createHashTreeParser({
|
|
909
|
-
locusUrl: message.locusUrl,
|
|
910
|
-
initialLocus: {
|
|
911
|
-
locus: null,
|
|
912
|
-
dataSets: message.dataSets
|
|
913
|
-
},
|
|
914
|
-
metadata: {
|
|
915
|
-
htMeta: metadata.htMeta,
|
|
916
|
-
visibleDataSets: metadata.data.visibleDataSets
|
|
917
|
-
},
|
|
918
|
-
replacedAt: replaces === null || replaces === void 0 ? void 0 : replaces.replacedAt
|
|
919
|
-
});
|
|
920
|
-
|
|
921
|
-
// handle the message with the new parser
|
|
922
|
-
parser.handleMessage(message);
|
|
923
|
-
}
|
|
924
|
-
return true;
|
|
925
|
-
}
|
|
926
|
-
if (entry.parser.state === 'stopped') {
|
|
927
|
-
// 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
|
-
// this happens when you move from breakout A -> breakout B -> back to breakout A
|
|
929
|
-
if (replaces) {
|
|
930
|
-
if (replaces.replacedAt > (entry.replacedAt || '')) {
|
|
931
|
-
_loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> resuming a HashTreeParser for locusUrl=".concat(message.locusUrl, ", which replaces ").concat(replaces.locusUrl));
|
|
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"));
|
|
948
|
-
return true;
|
|
949
|
-
}
|
|
950
|
-
return false;
|
|
951
|
-
}
|
|
952
|
-
|
|
953
598
|
/**
|
|
954
599
|
* Handles a hash tree message received from Locus.
|
|
955
600
|
*
|
|
@@ -965,36 +610,29 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
965
610
|
this.sendClassicVsHashTreeMismatchMetric(meeting, "got ".concat(eventType, ", expected ").concat(_constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED));
|
|
966
611
|
return;
|
|
967
612
|
}
|
|
968
|
-
|
|
969
|
-
if (parserSwitched) {
|
|
970
|
-
return;
|
|
971
|
-
}
|
|
972
|
-
var entry = this.hashTreeParsers.get(message.locusUrl);
|
|
973
|
-
entry.parser.handleMessage(message);
|
|
613
|
+
this.hashTreeParser.handleMessage(message);
|
|
974
614
|
}
|
|
975
615
|
|
|
976
616
|
/**
|
|
977
617
|
* Callback registered with HashTreeParser to receive locus info updates.
|
|
978
618
|
* Updates our locus info based on the data parsed by the hash tree parser.
|
|
979
619
|
*
|
|
980
|
-
* @param {string} locusUrl - the locus URL for which the update is received
|
|
981
620
|
* @param {LocusInfoUpdateType} updateType - The type of update received.
|
|
982
621
|
* @param {Object} [data] - Additional data for the update, if applicable.
|
|
983
622
|
* @returns {void}
|
|
984
623
|
*/
|
|
985
624
|
}, {
|
|
986
625
|
key: "updateFromHashTree",
|
|
987
|
-
value: function updateFromHashTree(
|
|
988
|
-
var
|
|
626
|
+
value: function updateFromHashTree(updateType, data) {
|
|
627
|
+
var _this4 = this;
|
|
989
628
|
switch (updateType) {
|
|
990
|
-
case
|
|
629
|
+
case _hashTreeParser.LocusInfoUpdateType.OBJECTS_UPDATED:
|
|
991
630
|
{
|
|
992
631
|
// initialize our new locus
|
|
993
632
|
var locus = {
|
|
994
633
|
participants: [],
|
|
995
634
|
jsSdkMeta: {
|
|
996
|
-
removedParticipantIds: []
|
|
997
|
-
forceReplaceMembers: false
|
|
635
|
+
removedParticipantIds: []
|
|
998
636
|
}
|
|
999
637
|
};
|
|
1000
638
|
|
|
@@ -1009,7 +647,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1009
647
|
// but these should never happen
|
|
1010
648
|
_loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> received multiple LOCUS objects in one update, this is unexpected!");
|
|
1011
649
|
_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) ||
|
|
650
|
+
locusUrl: ((_object$data = object.data) === null || _object$data === void 0 ? void 0 : _object$data.url) || _this4.url,
|
|
1013
651
|
message: object.data ? 'multiple LOCUS object updates' : 'LOCUS object update followed by removal'
|
|
1014
652
|
});
|
|
1015
653
|
}
|
|
@@ -1020,33 +658,17 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1020
658
|
}
|
|
1021
659
|
}
|
|
1022
660
|
});
|
|
1023
|
-
|
|
1024
|
-
if (!hashTreeParserEntry.initializedFromHashTree) {
|
|
1025
|
-
// this is the first time we're getting an update for this locusUrl,
|
|
1026
|
-
// so it's probably a move to/from breakout. We need to start from a clean state,
|
|
1027
|
-
// so empty locus and we rely on Locus giving us sufficient data in the updates to populate it.
|
|
1028
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> first INITIAL update for locusUrl ".concat(locusUrl, ", starting from empty state"));
|
|
1029
|
-
hashTreeParserEntry.initializedFromHashTree = true;
|
|
1030
|
-
locus.jsSdkMeta.forceReplaceMembers = true;
|
|
1031
|
-
} else if (
|
|
661
|
+
|
|
1032
662
|
// if Locus object is unchanged or removed, we need to keep using the existing locus
|
|
1033
663
|
// because the rest of the locusInfo code expects locus to always be present (with at least some of the fields)
|
|
1034
|
-
// if it gets updated, we
|
|
1035
|
-
// so that when
|
|
664
|
+
// if it gets updated, we don't need to do anything and we start with an empty one
|
|
665
|
+
// so that when it gets updated, if the new one is missing some field, that field will
|
|
1036
666
|
// be removed from our locusInfo
|
|
1037
|
-
locusObjectStateAfterUpdates === LocusObjectStateAfterUpdates.unchanged || locusObjectStateAfterUpdates === LocusObjectStateAfterUpdates.removed) {
|
|
1038
|
-
// copy over
|
|
667
|
+
if (locusObjectStateAfterUpdates === LocusObjectStateAfterUpdates.unchanged || locusObjectStateAfterUpdates === LocusObjectStateAfterUpdates.removed) {
|
|
668
|
+
// copy over existing locus
|
|
1039
669
|
LocusDtoTopLevelKeys.forEach(function (key) {
|
|
1040
670
|
if (key !== 'participants') {
|
|
1041
|
-
locus[key] = (0, _lodash.cloneDeep)(
|
|
1042
|
-
}
|
|
1043
|
-
});
|
|
1044
|
-
} else {
|
|
1045
|
-
// initialize only the fields that are not part of main "Locus" object
|
|
1046
|
-
// (except participants, which need to stay empty - that means "no participant changes")
|
|
1047
|
-
(0, _values.default)(_types.ObjectTypeToLocusKeyMap).forEach(function (locusDtoKey) {
|
|
1048
|
-
if (locusDtoKey !== 'participants') {
|
|
1049
|
-
locus[locusDtoKey] = (0, _lodash.cloneDeep)(_this5[locusDtoKey]);
|
|
671
|
+
locus[key] = (0, _lodash.cloneDeep)(_this4[key]);
|
|
1050
672
|
}
|
|
1051
673
|
});
|
|
1052
674
|
}
|
|
@@ -1054,25 +676,23 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1054
676
|
return {
|
|
1055
677
|
type: o.htMeta.elementId.type,
|
|
1056
678
|
id: o.htMeta.elementId.id,
|
|
1057
|
-
hasData:
|
|
679
|
+
hasData: o.data !== undefined
|
|
1058
680
|
};
|
|
1059
681
|
}))));
|
|
1060
682
|
// now apply all the updates from the hash tree onto the locus
|
|
1061
683
|
data.updatedObjects.forEach(function (object) {
|
|
1062
|
-
locus =
|
|
684
|
+
locus = _this4.updateLocusFromHashTreeObject(object, locus);
|
|
1063
685
|
});
|
|
1064
686
|
|
|
1065
687
|
// update our locus info with the new locus
|
|
1066
688
|
this.onDeltaLocus(locus);
|
|
1067
689
|
break;
|
|
1068
690
|
}
|
|
1069
|
-
case
|
|
691
|
+
case _hashTreeParser.LocusInfoUpdateType.MEETING_ENDED:
|
|
1070
692
|
{
|
|
693
|
+
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> received signal that meeting ended, destroying meeting ".concat(this.meetingId));
|
|
1071
694
|
var meeting = this.webex.meetings.meetingCollection.get(this.meetingId);
|
|
1072
|
-
|
|
1073
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> received signal that meeting ended, destroying meeting ".concat(this.meetingId));
|
|
1074
|
-
this.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.SELF_REMOVED);
|
|
1075
|
-
}
|
|
695
|
+
this.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.SELF_REMOVED);
|
|
1076
696
|
}
|
|
1077
697
|
}
|
|
1078
698
|
}
|
|
@@ -1086,16 +706,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1086
706
|
}, {
|
|
1087
707
|
key: "parse",
|
|
1088
708
|
value: function parse(meeting, data) {
|
|
1089
|
-
if (this.
|
|
709
|
+
if (this.hashTreeParser) {
|
|
1090
710
|
this.handleHashTreeMessage(meeting, data.eventType, data.stateElementsMessage);
|
|
1091
711
|
} else {
|
|
712
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
1092
713
|
var eventType = data.eventType;
|
|
1093
|
-
if (eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
|
|
1094
|
-
// this can happen when we get an event before join http response
|
|
1095
|
-
// it's OK to just ignore it
|
|
1096
|
-
_loggerProxy.default.logger.info("Locus-info:index#parse --> received locus hash tree event before hashTreeParser is created");
|
|
1097
|
-
return;
|
|
1098
|
-
}
|
|
1099
714
|
var locus = this.getTheLocusToUpdate(data.locus);
|
|
1100
715
|
_loggerProxy.default.logger.info("Locus-info:index#parse --> received locus data: ".concat(eventType));
|
|
1101
716
|
locus.jsSdkMeta = {
|
|
@@ -1116,11 +731,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1116
731
|
case _constants.LOCUSEVENT.PARTICIPANT_DECLINED:
|
|
1117
732
|
case _constants.LOCUSEVENT.FLOOR_GRANTED:
|
|
1118
733
|
case _constants.LOCUSEVENT.FLOOR_RELEASED:
|
|
1119
|
-
this.onFullLocus(
|
|
734
|
+
this.onFullLocus(locus, eventType);
|
|
1120
735
|
break;
|
|
1121
736
|
case _constants.LOCUSEVENT.DIFFERENCE:
|
|
1122
737
|
this.handleLocusDelta(locus, meeting);
|
|
1123
738
|
break;
|
|
739
|
+
case _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED:
|
|
740
|
+
this.sendClassicVsHashTreeMismatchMetric(meeting, "got ".concat(eventType, ", expected classic events"));
|
|
741
|
+
break;
|
|
1124
742
|
default:
|
|
1125
743
|
// Why will there be a event with no eventType ????
|
|
1126
744
|
// we may not need this, we can get full locus
|
|
@@ -1145,39 +763,32 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1145
763
|
/**
|
|
1146
764
|
* Function for handling full locus when it's using hash trees (so not the "classic" one).
|
|
1147
765
|
*
|
|
1148
|
-
* @param {string} debugText string explaining the trigger for this call, added to logs for debugging purposes
|
|
1149
766
|
* @param {object} locus locus object
|
|
1150
|
-
* @param {object} metadata locus hash trees metadata
|
|
1151
767
|
* @param {string} eventType locus event
|
|
1152
768
|
* @param {DataSet[]} dataSets
|
|
1153
769
|
* @returns {void}
|
|
1154
770
|
*/
|
|
1155
771
|
}, {
|
|
1156
772
|
key: "onFullLocusWithHashTrees",
|
|
1157
|
-
value: function onFullLocusWithHashTrees(
|
|
1158
|
-
if (!this.
|
|
1159
|
-
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus
|
|
1160
|
-
_loggerProxy.default.logger.info(
|
|
1161
|
-
this.createHashTreeParser({
|
|
1162
|
-
locusUrl: locus.url,
|
|
773
|
+
value: function onFullLocusWithHashTrees(locus, eventType, dataSets) {
|
|
774
|
+
if (!this.hashTreeParser) {
|
|
775
|
+
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus --> creating hash tree parser");
|
|
776
|
+
_loggerProxy.default.logger.info('Locus-info:index#onFullLocus --> dataSets:', dataSets, ' and locus:', locus);
|
|
777
|
+
this.hashTreeParser = this.createHashTreeParser({
|
|
1163
778
|
initialLocus: {
|
|
1164
779
|
locus: locus,
|
|
1165
780
|
dataSets: dataSets
|
|
1166
|
-
}
|
|
1167
|
-
metadata: metadata
|
|
781
|
+
}
|
|
1168
782
|
});
|
|
1169
|
-
// we have a full locus to start with, so we consider Locus info to be "initialized"
|
|
1170
|
-
this.hashTreeParsers.get(locus.url).initializedFromHashTree = true;
|
|
1171
783
|
this.onFullLocusCommon(locus, eventType);
|
|
1172
784
|
} else {
|
|
1173
785
|
// in this case the Locus we're getting is not necessarily the full one
|
|
1174
786
|
// so treat it like if we just got it in any api response
|
|
1175
787
|
|
|
1176
|
-
_loggerProxy.default.logger.info(
|
|
788
|
+
_loggerProxy.default.logger.info('Locus-info:index#onFullLocus --> hash tree parser already exists, handling it like a normal API response');
|
|
1177
789
|
this.handleLocusAPIResponse(undefined, {
|
|
1178
790
|
dataSets: dataSets,
|
|
1179
|
-
locus: locus
|
|
1180
|
-
metadata: metadata
|
|
791
|
+
locus: locus
|
|
1181
792
|
});
|
|
1182
793
|
}
|
|
1183
794
|
}
|
|
@@ -1185,16 +796,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1185
796
|
/**
|
|
1186
797
|
* Function for handling full locus when it's the "classic" one (not hash trees)
|
|
1187
798
|
*
|
|
1188
|
-
* @param {string} debugText string explaining the trigger for this call, added to logs for debugging purposes
|
|
1189
799
|
* @param {object} locus locus object
|
|
1190
800
|
* @param {string} eventType locus event
|
|
1191
801
|
* @returns {void}
|
|
1192
802
|
*/
|
|
1193
803
|
}, {
|
|
1194
804
|
key: "onFullLocusClassic",
|
|
1195
|
-
value: function onFullLocusClassic(
|
|
805
|
+
value: function onFullLocusClassic(locus, eventType) {
|
|
1196
806
|
if (!this.locusParser.isNewFullLocus(locus)) {
|
|
1197
|
-
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus
|
|
807
|
+
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus --> ignoring old full locus DTO, eventType=".concat(eventType));
|
|
1198
808
|
return;
|
|
1199
809
|
}
|
|
1200
810
|
this.onFullLocusCommon(locus, eventType);
|
|
@@ -1202,28 +812,23 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1202
812
|
|
|
1203
813
|
/**
|
|
1204
814
|
* updates the locus with full locus object
|
|
1205
|
-
* @param {string} debugText string explaining the trigger for this call, added to logs for debugging purposes
|
|
1206
815
|
* @param {object} locus locus object
|
|
1207
816
|
* @param {string} eventType locus event
|
|
1208
817
|
* @param {DataSet[]} dataSets
|
|
1209
|
-
* @param {object} metadata locus hash trees metadata
|
|
1210
818
|
* @returns {object} null
|
|
1211
819
|
* @memberof LocusInfo
|
|
1212
820
|
*/
|
|
1213
821
|
}, {
|
|
1214
822
|
key: "onFullLocus",
|
|
1215
|
-
value: function onFullLocus(
|
|
823
|
+
value: function onFullLocus(locus, eventType, dataSets) {
|
|
1216
824
|
if (!locus) {
|
|
1217
|
-
_loggerProxy.default.logger.error(
|
|
825
|
+
_loggerProxy.default.logger.error('Locus-info:index#onFullLocus --> object passed as argument was invalid, continuing.');
|
|
1218
826
|
}
|
|
1219
827
|
if (dataSets) {
|
|
1220
|
-
if (!metadata) {
|
|
1221
|
-
throw new Error("Locus-info:index#onFullLocus (".concat(debugText, ") --> hash tree metadata is missing with full Locus"));
|
|
1222
|
-
}
|
|
1223
828
|
// this is the new hashmap Locus DTO format (only applicable to webinars for now)
|
|
1224
|
-
this.onFullLocusWithHashTrees(
|
|
829
|
+
this.onFullLocusWithHashTrees(locus, eventType, dataSets);
|
|
1225
830
|
} else {
|
|
1226
|
-
this.onFullLocusClassic(
|
|
831
|
+
this.onFullLocusClassic(locus, eventType);
|
|
1227
832
|
}
|
|
1228
833
|
}
|
|
1229
834
|
|
|
@@ -1237,15 +842,15 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1237
842
|
key: "onFullLocusCommon",
|
|
1238
843
|
value: function onFullLocusCommon(locus, eventType) {
|
|
1239
844
|
var _this$participants,
|
|
1240
|
-
|
|
845
|
+
_this5 = this,
|
|
1241
846
|
_locus$jsSdkMeta;
|
|
1242
847
|
this.scheduledMeeting = locus.meeting || null;
|
|
1243
848
|
this.participants = locus.participants;
|
|
1244
849
|
(_this$participants = this.participants) === null || _this$participants === void 0 ? void 0 : _this$participants.forEach(function (participant) {
|
|
1245
850
|
var _participant$htMeta;
|
|
1246
851
|
// participant.htMeta is set only for hash tree based locus
|
|
1247
|
-
if (
|
|
1248
|
-
|
|
852
|
+
if ((_participant$htMeta = participant.htMeta) !== null && _participant$htMeta !== void 0 && _participant$htMeta.elementId.id) {
|
|
853
|
+
_this5.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
|
|
1249
854
|
}
|
|
1250
855
|
});
|
|
1251
856
|
var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
|
|
@@ -1268,8 +873,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1268
873
|
}, {
|
|
1269
874
|
key: "handleOneOnOneEvent",
|
|
1270
875
|
value: function handleOneOnOneEvent(eventType) {
|
|
1271
|
-
|
|
1272
|
-
if (((_this$parsedLocus$ful = this.parsedLocus.fullState) === null || _this$parsedLocus$ful === void 0 ? void 0 : _this$parsedLocus$ful.type) === _constants._CALL_ || ((_this$parsedLocus$ful2 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful2 === void 0 ? void 0 : _this$parsedLocus$ful2.type) === _constants._SIP_BRIDGE_) {
|
|
876
|
+
if (this.parsedLocus.fullState.type === _constants._CALL_ || this.parsedLocus.fullState.type === _constants._SIP_BRIDGE_) {
|
|
1273
877
|
// for 1:1 bob calls alice and alice declines, notify the meeting state
|
|
1274
878
|
if (eventType === _constants.LOCUSEVENT.PARTICIPANT_DECLINED) {
|
|
1275
879
|
// trigger the event for stop ringing
|
|
@@ -1295,30 +899,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1295
899
|
}
|
|
1296
900
|
}
|
|
1297
901
|
|
|
1298
|
-
/**
|
|
1299
|
-
* Makes sure that passed in locus object has a participant object for self.
|
|
1300
|
-
*
|
|
1301
|
-
* @param {LocusDTO} locus The locus object to check and modify if needed
|
|
1302
|
-
* @returns {void}
|
|
1303
|
-
*/
|
|
1304
|
-
}, {
|
|
1305
|
-
key: "ensureSelfParticipantExists",
|
|
1306
|
-
value: function ensureSelfParticipantExists(locus) {
|
|
1307
|
-
var self = locus.self;
|
|
1308
|
-
|
|
1309
|
-
// sanity check, this should never fail
|
|
1310
|
-
if (!(self !== null && self !== void 0 && self.identity) || !(0, _isArray.default)(locus.participants)) {
|
|
1311
|
-
_loggerProxy.default.logger.warn("Locus-info:index#ensureSelfParticipantExists --> locus object is missing required fields, cannot ensure self participant exists. self?.identity=\"".concat(self === null || self === void 0 ? void 0 : self.identity, "\""));
|
|
1312
|
-
return;
|
|
1313
|
-
}
|
|
1314
|
-
var selfExists = locus.participants.some(function (participant) {
|
|
1315
|
-
return participant.identity === self.identity;
|
|
1316
|
-
});
|
|
1317
|
-
if (!selfExists) {
|
|
1318
|
-
locus.participants.push(_objectSpread({}, self));
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
902
|
/**
|
|
1323
903
|
* @param {Object} locus
|
|
1324
904
|
* @returns {undefined}
|
|
@@ -1328,20 +908,10 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1328
908
|
key: "onDeltaLocus",
|
|
1329
909
|
value: function onDeltaLocus(locus) {
|
|
1330
910
|
var _locus$jsSdkMeta2;
|
|
1331
|
-
var isReplaceMembers =
|
|
1332
|
-
if (isReplaceMembers) {
|
|
1333
|
-
// when we're moving between breakouts, Locus sometimes doesn't send us
|
|
1334
|
-
// any participants at all for a few seconds
|
|
1335
|
-
// Web app relies on having at least the self participant always there
|
|
1336
|
-
// so we copy self into participants if it's not there.
|
|
1337
|
-
this.ensureSelfParticipantExists(locus);
|
|
1338
|
-
}
|
|
911
|
+
var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
|
|
1339
912
|
this.mergeParticipants(this.participants, locus.participants);
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
var _locus$jsSdkMeta3;
|
|
1343
|
-
this.updateParticipants(locus.participants, (_locus$jsSdkMeta3 = locus.jsSdkMeta) === null || _locus$jsSdkMeta3 === void 0 ? void 0 : _locus$jsSdkMeta3.removedParticipantIds, isReplaceMembers);
|
|
1344
|
-
}
|
|
913
|
+
this.updateLocusInfo(locus);
|
|
914
|
+
this.updateParticipants(locus.participants, (_locus$jsSdkMeta2 = locus.jsSdkMeta) === null || _locus$jsSdkMeta2 === void 0 ? void 0 : _locus$jsSdkMeta2.removedParticipantIds, isReplaceMembers);
|
|
1345
915
|
this.isMeetingActive();
|
|
1346
916
|
}
|
|
1347
917
|
|
|
@@ -1353,12 +923,12 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1353
923
|
}, {
|
|
1354
924
|
key: "updateLocusInfo",
|
|
1355
925
|
value: function updateLocusInfo(locus) {
|
|
1356
|
-
var _locus$self2, _locus$
|
|
1357
|
-
if (((_locus$
|
|
926
|
+
var _locus$self, _locus$self2, _locus$links3, _locus$links4;
|
|
927
|
+
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') {
|
|
1358
928
|
// When moved to a breakout session locus sends a message for the previous locus
|
|
1359
929
|
// indicating that we have been moved. It isn't helpful to continue parsing this
|
|
1360
930
|
// as it gets interpreted as if we have left the call
|
|
1361
|
-
return
|
|
931
|
+
return;
|
|
1362
932
|
}
|
|
1363
933
|
this.updateControls(locus.controls, locus.self);
|
|
1364
934
|
this.updateConversationUrl(locus.conversationUrl, locus.info);
|
|
@@ -1368,17 +938,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1368
938
|
this.updateLocusUrl(locus.url, _controlsUtils.default.isMainSessionDTO(locus));
|
|
1369
939
|
this.updateMeetingInfo(locus.info, locus.self);
|
|
1370
940
|
this.updateMediaShares(locus.mediaShares);
|
|
1371
|
-
this.
|
|
941
|
+
this.updateParticipantsUrl(locus.participantsUrl);
|
|
942
|
+
this.updateReplace(locus.replace);
|
|
1372
943
|
this.updateSelf(locus.self);
|
|
1373
944
|
this.updateAclUrl(locus.aclUrl);
|
|
1374
945
|
this.updateBasequence(locus.baseSequence);
|
|
1375
946
|
this.updateSequence(locus.sequence);
|
|
947
|
+
this.updateMemberShip(locus.membership);
|
|
948
|
+
this.updateIdentifiers(locus.identities);
|
|
1376
949
|
this.updateEmbeddedApps(locus.embeddedApps);
|
|
1377
|
-
this.
|
|
950
|
+
this.updateServices((_locus$links3 = locus.links) === null || _locus$links3 === void 0 ? void 0 : _locus$links3.services);
|
|
951
|
+
this.updateResources((_locus$links4 = locus.links) === null || _locus$links4 === void 0 ? void 0 : _locus$links4.resources);
|
|
1378
952
|
this.compareAndUpdate();
|
|
1379
953
|
// update which required to compare different objects from locus
|
|
1380
|
-
|
|
1381
|
-
return true;
|
|
1382
954
|
}
|
|
1383
955
|
|
|
1384
956
|
/**
|
|
@@ -1408,8 +980,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1408
980
|
}, {
|
|
1409
981
|
key: "isMeetingActive",
|
|
1410
982
|
value: function isMeetingActive() {
|
|
1411
|
-
|
|
1412
|
-
if (((_this$parsedLocus$ful3 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful3 === void 0 ? void 0 : _this$parsedLocus$ful3.type) === _constants._CALL_ || ((_this$parsedLocus$ful4 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful4 === void 0 ? void 0 : _this$parsedLocus$ful4.type) === _constants._SIP_BRIDGE_ || ((_this$parsedLocus$ful5 = this.parsedLocus.fullState) === null || _this$parsedLocus$ful5 === void 0 ? void 0 : _this$parsedLocus$ful5.type) === _constants._SPACE_SHARE_) {
|
|
983
|
+
if (this.parsedLocus.fullState.type === _constants._CALL_ || this.parsedLocus.fullState.type === _constants._SIP_BRIDGE_ || this.parsedLocus.fullState.type === _constants._SPACE_SHARE_) {
|
|
1413
984
|
// @ts-ignore
|
|
1414
985
|
var partner = this.getLocusPartner(this.participants, this.self);
|
|
1415
986
|
this.updateMeeting({
|
|
@@ -1473,7 +1044,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1473
1044
|
shouldLeave: false
|
|
1474
1045
|
});
|
|
1475
1046
|
}
|
|
1476
|
-
} else if (
|
|
1047
|
+
} else if (this.parsedLocus.fullState.type === _constants._MEETING_) {
|
|
1477
1048
|
if (this.fullState && (this.fullState.state === _constants.LOCUS.STATE.INACTIVE ||
|
|
1478
1049
|
// @ts-ignore
|
|
1479
1050
|
this.fullState.state === _constants.LOCUS.STATE.TERMINATING)) {
|
|
@@ -1493,6 +1064,23 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1493
1064
|
reason: _constants.MEETING_REMOVED_REASON.MEETING_INACTIVE_TERMINATING,
|
|
1494
1065
|
shouldLeave: false
|
|
1495
1066
|
});
|
|
1067
|
+
} else if (this.fullState && this.fullState.removed) {
|
|
1068
|
+
// user has been dropped from a meeting
|
|
1069
|
+
|
|
1070
|
+
// @ts-ignore
|
|
1071
|
+
this.webex.internal.newMetrics.submitClientEvent({
|
|
1072
|
+
name: 'client.call.remote-ended',
|
|
1073
|
+
options: {
|
|
1074
|
+
meetingId: this.meetingId
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
this.emitScoped({
|
|
1078
|
+
file: 'locus-info',
|
|
1079
|
+
function: 'isMeetingActive'
|
|
1080
|
+
}, _constants.EVENTS.DESTROY_MEETING, {
|
|
1081
|
+
reason: _constants.MEETING_REMOVED_REASON.FULLSTATE_REMOVED,
|
|
1082
|
+
shouldLeave: false
|
|
1083
|
+
});
|
|
1496
1084
|
}
|
|
1497
1085
|
// If you are guest and you are removed from the meeting
|
|
1498
1086
|
// You wont get any further events
|
|
@@ -1537,7 +1125,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1537
1125
|
value: function compareSelfAndHost() {
|
|
1538
1126
|
var _this$parsedLocus$hos;
|
|
1539
1127
|
// In some cases the host info is not present but the moderator values changes from null to false so it triggers an update
|
|
1540
|
-
if (this.parsedLocus.self
|
|
1128
|
+
if (this.parsedLocus.self.selfIdentity === ((_this$parsedLocus$hos = this.parsedLocus.host) === null || _this$parsedLocus$hos === void 0 ? void 0 : _this$parsedLocus$hos.hostId) && this.parsedLocus.self.moderator) {
|
|
1541
1129
|
this.emitScoped({
|
|
1542
1130
|
file: 'locus-info',
|
|
1543
1131
|
function: 'compareSelfAndHost'
|
|
@@ -1579,11 +1167,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1579
1167
|
isReplace: isReplace
|
|
1580
1168
|
});
|
|
1581
1169
|
if (participants && (0, _isArray.default)(participants) && participants.length > 0) {
|
|
1582
|
-
var
|
|
1583
|
-
|
|
1170
|
+
var _iterator = _createForOfIteratorHelper(participants),
|
|
1171
|
+
_step;
|
|
1584
1172
|
try {
|
|
1585
|
-
for (
|
|
1586
|
-
var participant =
|
|
1173
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1174
|
+
var participant = _step.value;
|
|
1587
1175
|
if (participant && (participant === null || participant === void 0 ? void 0 : participant.reason) === 'FAILURE') {
|
|
1588
1176
|
var _participant$person;
|
|
1589
1177
|
this.emitScoped({
|
|
@@ -1595,9 +1183,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1595
1183
|
}
|
|
1596
1184
|
}
|
|
1597
1185
|
} catch (err) {
|
|
1598
|
-
|
|
1186
|
+
_iterator.e(err);
|
|
1599
1187
|
} finally {
|
|
1600
|
-
|
|
1188
|
+
_iterator.f();
|
|
1601
1189
|
}
|
|
1602
1190
|
}
|
|
1603
1191
|
}
|
|
@@ -1619,8 +1207,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1619
1207
|
hasRecordingPausedChanged = _ControlsUtils$getCon2.hasRecordingPausedChanged,
|
|
1620
1208
|
hasMeetingContainerChanged = _ControlsUtils$getCon2.hasMeetingContainerChanged,
|
|
1621
1209
|
hasTranscribeChanged = _ControlsUtils$getCon2.hasTranscribeChanged,
|
|
1622
|
-
hasHesiodLLMIdChanged = _ControlsUtils$getCon2.hasHesiodLLMIdChanged,
|
|
1623
|
-
hasAiSummaryNotificationChanged = _ControlsUtils$getCon2.hasAiSummaryNotificationChanged,
|
|
1624
1210
|
hasTranscribeSpokenLanguageChanged = _ControlsUtils$getCon2.hasTranscribeSpokenLanguageChanged,
|
|
1625
1211
|
hasManualCaptionChanged = _ControlsUtils$getCon2.hasManualCaptionChanged,
|
|
1626
1212
|
hasEntryExitToneChanged = _ControlsUtils$getCon2.hasEntryExitToneChanged,
|
|
@@ -1742,23 +1328,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1742
1328
|
caption: caption
|
|
1743
1329
|
});
|
|
1744
1330
|
}
|
|
1745
|
-
if (hasHesiodLLMIdChanged) {
|
|
1746
|
-
var hesiodLlmId = current.transcribe.hesiodLlmId;
|
|
1747
|
-
this.emitScoped({
|
|
1748
|
-
file: 'locus-info',
|
|
1749
|
-
function: 'updateControls'
|
|
1750
|
-
}, _constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_HESIOD_LLM_ID_UPDATED, {
|
|
1751
|
-
hesiodLlmId: hesiodLlmId
|
|
1752
|
-
});
|
|
1753
|
-
}
|
|
1754
|
-
if (hasAiSummaryNotificationChanged) {
|
|
1755
|
-
this.emitScoped({
|
|
1756
|
-
file: 'locus-info',
|
|
1757
|
-
function: 'updateControls'
|
|
1758
|
-
}, _constants.LOCUSINFO.EVENTS.CONTROLS_AI_SUMMARY_NOTIFICATION_UPDATED, {
|
|
1759
|
-
aiSummaryNotification: current.transcribe.aiSummaryNotification
|
|
1760
|
-
});
|
|
1761
|
-
}
|
|
1762
1331
|
if (hasTranscribeSpokenLanguageChanged) {
|
|
1763
1332
|
var spokenLanguage = current.transcribe.spokenLanguage;
|
|
1764
1333
|
this.emitScoped({
|
|
@@ -1928,35 +1497,41 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1928
1497
|
}
|
|
1929
1498
|
|
|
1930
1499
|
/**
|
|
1931
|
-
*
|
|
1932
|
-
* @param {Object} links
|
|
1500
|
+
* @param {Object} services
|
|
1933
1501
|
* @returns {undefined}
|
|
1934
1502
|
* @memberof LocusInfo
|
|
1935
1503
|
*/
|
|
1936
1504
|
}, {
|
|
1937
|
-
key: "
|
|
1938
|
-
value: function
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
services = _ref2.services,
|
|
1942
|
-
resources = _ref2.resources;
|
|
1943
|
-
if (services && !(0, _lodash.isEqual)((_this$links = this.links) === null || _this$links === void 0 ? void 0 : _this$links.services, services)) {
|
|
1505
|
+
key: "updateServices",
|
|
1506
|
+
value: function updateServices(services) {
|
|
1507
|
+
if (services && !(0, _lodash.isEqual)(this.services, services)) {
|
|
1508
|
+
this.services = services;
|
|
1944
1509
|
this.emitScoped({
|
|
1945
1510
|
file: 'locus-info',
|
|
1946
|
-
function: '
|
|
1511
|
+
function: 'updateServices'
|
|
1947
1512
|
}, _constants.LOCUSINFO.EVENTS.LINKS_SERVICES, {
|
|
1948
1513
|
services: services
|
|
1949
1514
|
});
|
|
1950
1515
|
}
|
|
1951
|
-
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* @param {Object} resources
|
|
1520
|
+
* @returns {undefined}
|
|
1521
|
+
* @memberof LocusInfo
|
|
1522
|
+
*/
|
|
1523
|
+
}, {
|
|
1524
|
+
key: "updateResources",
|
|
1525
|
+
value: function updateResources(resources) {
|
|
1526
|
+
if (resources && !(0, _lodash.isEqual)(this.resources, resources)) {
|
|
1527
|
+
this.resources = resources;
|
|
1952
1528
|
this.emitScoped({
|
|
1953
1529
|
file: 'locus-info',
|
|
1954
|
-
function: '
|
|
1530
|
+
function: 'updateResources'
|
|
1955
1531
|
}, _constants.LOCUSINFO.EVENTS.LINKS_RESOURCES, {
|
|
1956
1532
|
resources: resources
|
|
1957
1533
|
});
|
|
1958
1534
|
}
|
|
1959
|
-
this.links = links;
|
|
1960
1535
|
}
|
|
1961
1536
|
|
|
1962
1537
|
/**
|
|
@@ -2114,15 +1689,28 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2114
1689
|
}
|
|
2115
1690
|
|
|
2116
1691
|
/**
|
|
2117
|
-
* @param {
|
|
1692
|
+
* @param {String} participantsUrl
|
|
1693
|
+
* @returns {undefined}
|
|
1694
|
+
* @memberof LocusInfo
|
|
1695
|
+
*/
|
|
1696
|
+
}, {
|
|
1697
|
+
key: "updateParticipantsUrl",
|
|
1698
|
+
value: function updateParticipantsUrl(participantsUrl) {
|
|
1699
|
+
if (participantsUrl && !(0, _lodash.isEqual)(this.participantsUrl, participantsUrl)) {
|
|
1700
|
+
this.participantsUrl = participantsUrl;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* @param {Object} replace
|
|
2118
1706
|
* @returns {undefined}
|
|
2119
1707
|
* @memberof LocusInfo
|
|
2120
1708
|
*/
|
|
2121
1709
|
}, {
|
|
2122
|
-
key: "
|
|
2123
|
-
value: function
|
|
2124
|
-
if (
|
|
2125
|
-
this.
|
|
1710
|
+
key: "updateReplace",
|
|
1711
|
+
value: function updateReplace(replace) {
|
|
1712
|
+
if (replace && !(0, _lodash.isEqual)(this.replace, replace)) {
|
|
1713
|
+
this.replace = replace;
|
|
2126
1714
|
}
|
|
2127
1715
|
}
|
|
2128
1716
|
|
|
@@ -2137,7 +1725,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2137
1725
|
key: "updateSelf",
|
|
2138
1726
|
value: function updateSelf(self) {
|
|
2139
1727
|
if (self) {
|
|
2140
|
-
var _this$parsedLocus$ful7, _this$parsedLocus$inf;
|
|
2141
1728
|
// @ts-ignore
|
|
2142
1729
|
var parsedSelves = _selfUtils.default.getSelves(this.parsedLocus.self, self, this.webex.internal.device.url, this.participants // using this.participants instead of locus.participants here, because with delta DTOs locus.participants will only contain a small subset of participants
|
|
2143
1730
|
);
|
|
@@ -2149,9 +1736,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2149
1736
|
}
|
|
2150
1737
|
|
|
2151
1738
|
// TODO: check if we need to save the sipUri here as well
|
|
2152
|
-
// this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState
|
|
2153
|
-
var result = _selfUtils.default.getSipUrl(this.getLocusPartner(this.participants, self),
|
|
2154
|
-
if (result
|
|
1739
|
+
// this.emit(LOCUSINFO.EVENTS.MEETING_UPDATE, SelfUtils.getSipUrl(this.getLocusPartner(participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri));
|
|
1740
|
+
var result = _selfUtils.default.getSipUrl(this.getLocusPartner(this.participants, self), this.parsedLocus.fullState.type, this.parsedLocus.info.sipUri);
|
|
1741
|
+
if (result.sipUri) {
|
|
2155
1742
|
this.updateMeeting(result);
|
|
2156
1743
|
}
|
|
2157
1744
|
if (parsedSelves.updates.moderatorChanged) {
|
|
@@ -2183,14 +1770,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2183
1770
|
brb: parsedSelves.current.brb
|
|
2184
1771
|
});
|
|
2185
1772
|
}
|
|
2186
|
-
if (parsedSelves.updates.selfIdChanged) {
|
|
2187
|
-
this.emitScoped({
|
|
2188
|
-
file: 'locus-info',
|
|
2189
|
-
function: 'updateSelf'
|
|
2190
|
-
}, _constants.LOCUSINFO.EVENTS.SELF_ID_CHANGED, {
|
|
2191
|
-
selfId: parsedSelves.current.selfId
|
|
2192
|
-
});
|
|
2193
|
-
}
|
|
2194
1773
|
if (parsedSelves.updates.interpretationChanged) {
|
|
2195
1774
|
this.emitScoped({
|
|
2196
1775
|
file: 'locus-info',
|
|
@@ -2390,6 +1969,32 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2390
1969
|
}
|
|
2391
1970
|
}
|
|
2392
1971
|
|
|
1972
|
+
/**
|
|
1973
|
+
* @param {Object} membership
|
|
1974
|
+
* @returns {undefined}
|
|
1975
|
+
* @memberof LocusInfo
|
|
1976
|
+
*/
|
|
1977
|
+
}, {
|
|
1978
|
+
key: "updateMemberShip",
|
|
1979
|
+
value: function updateMemberShip(membership) {
|
|
1980
|
+
if (membership && !(0, _lodash.isEqual)(this.membership, membership)) {
|
|
1981
|
+
this.membership = membership;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
/**
|
|
1986
|
+
* @param {Array} identities
|
|
1987
|
+
* @returns {undefined}
|
|
1988
|
+
* @memberof LocusInfo
|
|
1989
|
+
*/
|
|
1990
|
+
}, {
|
|
1991
|
+
key: "updateIdentifiers",
|
|
1992
|
+
value: function updateIdentifiers(identities) {
|
|
1993
|
+
if (identities && !(0, _lodash.isEqual)(this.identities, identities)) {
|
|
1994
|
+
this.identities = identities;
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
|
|
2393
1998
|
/**
|
|
2394
1999
|
* check the locus is main session's one or not, if is main session's, update main session cache
|
|
2395
2000
|
* @param {Object} locus
|
|
@@ -2467,7 +2072,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2467
2072
|
}, {
|
|
2468
2073
|
key: "updateMainSessionLocusCache",
|
|
2469
2074
|
value: function updateMainSessionLocusCache(mainLocus) {
|
|
2470
|
-
var
|
|
2075
|
+
var _this6 = this;
|
|
2471
2076
|
if (!mainLocus) {
|
|
2472
2077
|
return;
|
|
2473
2078
|
}
|
|
@@ -2476,7 +2081,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
2476
2081
|
// shallow merge and do special merge for participants
|
|
2477
2082
|
(0, _lodash.assignWith)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
|
|
2478
2083
|
if (key === 'participants') {
|
|
2479
|
-
return
|
|
2084
|
+
return _this6.mergeParticipants(objValue, srcValue);
|
|
2480
2085
|
}
|
|
2481
2086
|
return srcValue || objValue;
|
|
2482
2087
|
});
|