@webex/plugin-meetings 3.9.0-webinar5k.1 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/constants.js +16 -0
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +40 -328
- package/dist/locus-info/index.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +6 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +196 -160
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +5 -2
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/type.js +7 -0
- package/dist/meeting/type.js.map +1 -0
- package/dist/meeting/util.js +79 -10
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +37 -39
- package/dist/meetings/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/members/collection.js +0 -13
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +21 -40
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +1 -1
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +34 -5
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +42 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/types/constants.d.ts +16 -0
- package/dist/types/locus-info/index.d.ts +3 -102
- package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
- package/dist/types/meeting/index.d.ts +23 -28
- package/dist/types/meeting/type.d.ts +9 -0
- package/dist/types/meeting/util.d.ts +6 -3
- package/dist/types/member/types.d.ts +0 -1
- package/dist/types/members/collection.d.ts +0 -6
- package/dist/types/members/index.d.ts +7 -16
- package/dist/types/members/util.d.ts +2 -1
- package/dist/types/multistream/remoteMedia.d.ts +20 -1
- package/dist/types/multistream/remoteMediaGroup.d.ts +11 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +22 -24
- package/src/constants.ts +16 -2
- package/src/locus-info/index.ts +39 -409
- package/src/meeting/in-meeting-actions.ts +13 -0
- package/src/meeting/index.ts +92 -63
- package/src/meeting/muteState.ts +6 -2
- package/src/meeting/type.ts +9 -0
- package/src/meeting/util.ts +93 -19
- package/src/meetings/index.ts +6 -19
- package/src/member/types.ts +0 -1
- package/src/members/collection.ts +0 -11
- package/src/members/index.ts +10 -33
- package/src/members/util.ts +2 -1
- package/src/multistream/mediaRequestManager.ts +7 -7
- package/src/multistream/remoteMedia.ts +34 -4
- package/src/multistream/remoteMediaGroup.ts +37 -2
- package/test/unit/spec/locus-info/index.js +8 -365
- package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
- package/test/unit/spec/meeting/index.js +254 -38
- package/test/unit/spec/meeting/utils.js +122 -1
- package/test/unit/spec/meetings/index.js +2 -0
- package/test/unit/spec/members/index.js +37 -1
- package/test/unit/spec/multistream/mediaRequestManager.ts +19 -6
- package/test/unit/spec/multistream/remoteMedia.ts +66 -2
- package/dist/hashTree/constants.js +0 -23
- package/dist/hashTree/constants.js.map +0 -1
- package/dist/hashTree/hashTree.js +0 -516
- package/dist/hashTree/hashTree.js.map +0 -1
- package/dist/hashTree/hashTreeParser.js +0 -521
- package/dist/hashTree/hashTreeParser.js.map +0 -1
- package/dist/types/hashTree/constants.d.ts +0 -8
- package/dist/types/hashTree/hashTree.d.ts +0 -128
- package/dist/types/hashTree/hashTreeParser.d.ts +0 -152
- package/src/hashTree/constants.ts +0 -12
- package/src/hashTree/hashTree.ts +0 -460
- package/src/hashTree/hashTreeParser.ts +0 -556
- package/test/unit/spec/hashTree/hashTree.ts +0 -394
- package/test/unit/spec/hashTree/hashTreeParser.ts +0 -156
package/dist/locus-info/index.js
CHANGED
@@ -1,25 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
|
4
3
|
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
5
|
-
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
6
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
7
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
8
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
9
|
-
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
10
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
11
4
|
var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
|
12
5
|
var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
|
13
6
|
var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
|
14
7
|
var _Array$isArray2 = require("@babel/runtime-corejs2/core-js/array/is-array");
|
15
|
-
var
|
8
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
16
9
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
17
10
|
_Object$defineProperty(exports, "__esModule", {
|
18
11
|
value: true
|
19
12
|
});
|
20
13
|
exports.default = void 0;
|
21
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
|
22
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
23
14
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
|
24
15
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
25
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
@@ -42,18 +33,11 @@ var _mediaSharesUtils = _interopRequireDefault(require("./mediaSharesUtils"));
|
|
42
33
|
var _parser = _interopRequireDefault(require("./parser"));
|
43
34
|
var _metrics = _interopRequireDefault(require("../metrics"));
|
44
35
|
var _constants2 = _interopRequireDefault(require("../metrics/constants"));
|
45
|
-
var _hashTreeParser = _interopRequireWildcard(require("../hashTree/hashTreeParser"));
|
46
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
47
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
48
36
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray2(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
49
37
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
50
38
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
51
|
-
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; }
|
52
|
-
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; }
|
53
39
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
54
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
55
|
-
var LocusDtoTopLevelKeys = ['controls', 'fullState', 'host', 'info', 'links', 'mediaShares', 'meetings', 'participants', 'replaces', 'self', 'sequence', 'syncUrl', 'url'];
|
56
|
-
|
40
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
57
41
|
/**
|
58
42
|
* @description LocusInfo extends ChildEmitter to convert locusInfo info a private emitter to parent object
|
59
43
|
* @export
|
@@ -63,8 +47,6 @@ var LocusDtoTopLevelKeys = ['controls', 'fullState', 'host', 'info', 'links', 'm
|
|
63
47
|
var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
64
48
|
(0, _inherits2.default)(LocusInfo, _EventsScope);
|
65
49
|
var _super = _createSuper(LocusInfo);
|
66
|
-
// mapping of hash tree object ids to participant ids
|
67
|
-
|
68
50
|
/**
|
69
51
|
* Constructor
|
70
52
|
* @param {function} updateMeeting callback to update the meeting object from an object
|
@@ -86,7 +68,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
86
68
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "aclUrl", void 0);
|
87
69
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "baseSequence", void 0);
|
88
70
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "created", void 0);
|
89
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deltaParticipants", void 0);
|
90
71
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "identities", void 0);
|
91
72
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "membership", void 0);
|
92
73
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "participants", void 0);
|
@@ -108,8 +89,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
108
89
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resources", void 0);
|
109
90
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mainSessionLocusCache", void 0);
|
110
91
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "self", void 0);
|
111
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hashTreeParser", void 0);
|
112
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hashTreeObjectId2ParticipantId", void 0);
|
113
92
|
_this.parsedLocus = {
|
114
93
|
states: []
|
115
94
|
};
|
@@ -119,7 +98,6 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
119
98
|
_this.meetingId = meetingId;
|
120
99
|
_this.updateMeeting = updateMeeting;
|
121
100
|
_this.locusParser = new _parser.default();
|
122
|
-
_this.hashTreeObjectId2ParticipantId = new _map.default();
|
123
101
|
return _this;
|
124
102
|
}
|
125
103
|
|
@@ -190,8 +168,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
190
168
|
}
|
191
169
|
if (isDelta) {
|
192
170
|
if (res.body.baseSequence) {
|
193
|
-
meeting.locusInfo.handleLocusDelta(res.body, meeting);
|
194
|
-
|
171
|
+
meeting.locusInfo.handleLocusDelta(res.body, meeting);
|
195
172
|
return;
|
196
173
|
}
|
197
174
|
// in some cases Locus might return us full DTO even when we asked for a delta
|
@@ -303,20 +280,10 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
303
280
|
* @property {Object} person - Contains person data.
|
304
281
|
*/
|
305
282
|
|
306
|
-
/**
|
307
|
-
* Stored participant changes between the last event and the current event.
|
308
|
-
* All previously stored events are overwritten between events.
|
309
|
-
*
|
310
|
-
* @instance
|
311
|
-
* @type {Array<DeltaParticipant>}
|
312
|
-
* @private
|
313
|
-
* @member LocusInfo
|
314
|
-
*/
|
315
|
-
this.deltaParticipants = [];
|
316
283
|
this.updateLocusCache(locus);
|
317
284
|
// above section only updates the locusInfo object
|
318
285
|
// The below section makes sure it updates the locusInfo as well as updates the meeting object
|
319
|
-
this.updateParticipants(locus.participants
|
286
|
+
this.updateParticipants(locus.participants);
|
320
287
|
// For 1:1 space meeting the conversation Url does not exist in locus.conversation
|
321
288
|
this.updateConversationUrl(locus.conversationUrl, locus.info);
|
322
289
|
this.updateControls(locus.controls, locus.self);
|
@@ -334,178 +301,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
334
301
|
|
335
302
|
/**
|
336
303
|
* @param {Object} locus
|
337
|
-
* @param {DataSet[]} [dataSets=[]] - Array of data sets
|
338
304
|
* @returns {undefined}
|
339
305
|
* @memberof LocusInfo
|
340
306
|
*/
|
341
307
|
}, {
|
342
308
|
key: "initialSetup",
|
343
309
|
value: function initialSetup(locus) {
|
344
|
-
var dataSets = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
345
310
|
this.updateLocusCache(locus);
|
346
|
-
this.onFullLocus(locus
|
311
|
+
this.onFullLocus(locus);
|
347
312
|
|
348
313
|
// Change it to true after it receives it first locus object
|
349
314
|
this.emitChange = true;
|
350
315
|
}
|
351
316
|
|
352
|
-
/**
|
353
|
-
*
|
354
|
-
* @param {HashTreeObject} object data set object
|
355
|
-
* @param {any} locus
|
356
|
-
* @returns {void}
|
357
|
-
*/
|
358
|
-
}, {
|
359
|
-
key: "updateHashTreeObjectInLocus",
|
360
|
-
value: function updateHashTreeObjectInLocus(object, locus) {
|
361
|
-
var type = object.htMeta.elementId.type.toLowerCase();
|
362
|
-
switch (type) {
|
363
|
-
case _hashTreeParser.ObjectType.locus:
|
364
|
-
{
|
365
|
-
if (!object.data) {
|
366
|
-
_loggerProxy.default.logger.warn("Locus-info:index#updateHashTreeObjectInLocus --> received LOCUS object without data, this is not supported!");
|
367
|
-
return locus;
|
368
|
-
}
|
369
|
-
// replace the main locus
|
370
|
-
|
371
|
-
// The Locus object from MAIN dataset has empty participants, so removing them to avoid it overriding the ones in our current locus object
|
372
|
-
// Also, it 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
|
373
|
-
var locusObjectFromData = object.data;
|
374
|
-
delete locusObjectFromData.participants;
|
375
|
-
locus = _objectSpread(_objectSpread({}, locus), locusObjectFromData);
|
376
|
-
locus.htMeta = object.htMeta;
|
377
|
-
break;
|
378
|
-
}
|
379
|
-
case _hashTreeParser.ObjectType.participant:
|
380
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateHashTreeObjectInLocus --> participant id=".concat(object.htMeta.elementId.id, " ").concat(object.data ? 'updated' : 'removed'));
|
381
|
-
console.log('marcin: hashTreeObjectId2ParticipantId=', (0, _lodash.cloneDeep)(this.hashTreeObjectId2ParticipantId));
|
382
|
-
if (object.data) {
|
383
|
-
if (!locus.participants) {
|
384
|
-
locus.participants = [];
|
385
|
-
}
|
386
|
-
var participantObject = object.data;
|
387
|
-
participantObject.htMeta = object.htMeta;
|
388
|
-
locus.participants.push(participantObject);
|
389
|
-
this.hashTreeObjectId2ParticipantId.set(object.htMeta.elementId.id, participantObject.id);
|
390
|
-
} else {
|
391
|
-
var participantId = this.hashTreeObjectId2ParticipantId.get(object.htMeta.elementId.id);
|
392
|
-
if (!locus.jsSdkMeta) {
|
393
|
-
locus.jsSdkMeta = {
|
394
|
-
removedParticipantIds: []
|
395
|
-
};
|
396
|
-
}
|
397
|
-
locus.jsSdkMeta.removedParticipantIds.push(participantId);
|
398
|
-
this.hashTreeObjectId2ParticipantId.delete(object.htMeta.elementId.id);
|
399
|
-
}
|
400
|
-
break;
|
401
|
-
case _hashTreeParser.ObjectType.self:
|
402
|
-
if (!object.data) {
|
403
|
-
_loggerProxy.default.logger.warn("Locus-info:index#updateHashTreeObjectInLocus --> received SELF object without data, this is not supported!");
|
404
|
-
return locus;
|
405
|
-
}
|
406
|
-
locus.self = object.data;
|
407
|
-
break;
|
408
|
-
}
|
409
|
-
return locus;
|
410
|
-
}
|
411
|
-
|
412
|
-
/**
|
413
|
-
* Handles HTTP response from Locus API call when hash tree update.
|
414
|
-
* @param {Meeting} meeting meeting object
|
415
|
-
* @param {LocusApiResponseBody} responseBody body of the http reponse from Locus API call
|
416
|
-
* @returns {void}
|
417
|
-
*/
|
418
|
-
}, {
|
419
|
-
key: "handleLocusAPIResponse",
|
420
|
-
value: function handleLocusAPIResponse(meeting, responseBody) {
|
421
|
-
console.log('marcin: locus response from API call:', responseBody);
|
422
|
-
if (responseBody.dataSets) {
|
423
|
-
if (!this.hashTreeParser) {
|
424
|
-
_loggerProxy.default.logger.warn("Locus-info:index#handleLocusAPIResponse --> received response with hash tree info from Locus API, but we don't have the hashTreeParser created");
|
425
|
-
return;
|
426
|
-
}
|
427
|
-
// Locus is using the new hash tree mechanism
|
428
|
-
// so update our data in the hash tree parser
|
429
|
-
this.hashTreeParser.handleLocusUpdate(responseBody);
|
430
|
-
|
431
|
-
// but the Locus object we receive in this case looks same like classic delta, so we can use existing delta method to process it
|
432
|
-
this.onDeltaLocus(responseBody.locus);
|
433
|
-
} else {
|
434
|
-
// classic Locus delta
|
435
|
-
this.handleLocusDelta(responseBody.locus, meeting);
|
436
|
-
}
|
437
|
-
}
|
438
|
-
|
439
|
-
/**
|
440
|
-
* Handles a hash tree message received from Locus.
|
441
|
-
*
|
442
|
-
* @param {Meeting} meeting - The meeting object
|
443
|
-
* @param {HashTreeMessage} message incoming hash tree message
|
444
|
-
* @returns {void}
|
445
|
-
*/
|
446
|
-
}, {
|
447
|
-
key: "handleHashTreeMessage",
|
448
|
-
value: function handleHashTreeMessage(meeting, message) {
|
449
|
-
if (!this.hashTreeParser) {
|
450
|
-
_loggerProxy.default.logger.warn("Locus-info:index#handleHashTreeMessage --> received hash tree message, but we don't have the hashTreeParser");
|
451
|
-
return;
|
452
|
-
}
|
453
|
-
if (message.locusStateElements === undefined) {
|
454
|
-
// todo: need to see in practice how exactly the heartbeat messages look like
|
455
|
-
this.hashTreeParser.handleRootHashHeartBeatMessage(message);
|
456
|
-
} else {
|
457
|
-
this.hashTreeParser.handleMessage(message);
|
458
|
-
}
|
459
|
-
}
|
460
|
-
|
461
|
-
/**
|
462
|
-
* Updates our locus info based on the data parsed by the hash tree parser.
|
463
|
-
*
|
464
|
-
* @param {LocusInfoUpdateType} updateType - The type of update received.
|
465
|
-
* @param {Object} [data] - Additional data for the update, if applicable.
|
466
|
-
* @returns {void}
|
467
|
-
*/
|
468
|
-
}, {
|
469
|
-
key: "updateFromHashTree",
|
470
|
-
value: function updateFromHashTree(updateType, data) {
|
471
|
-
var _this4 = this;
|
472
|
-
switch (updateType) {
|
473
|
-
case _hashTreeParser.LocusInfoUpdateType.OBJECTS_UPDATED:
|
474
|
-
{
|
475
|
-
// initialize the main locus with what we currently have
|
476
|
-
// but with empty participants array
|
477
|
-
var locus = {
|
478
|
-
participants: [],
|
479
|
-
jsSdkMeta: {
|
480
|
-
removedParticipantIds: []
|
481
|
-
}
|
482
|
-
};
|
483
|
-
LocusDtoTopLevelKeys.forEach(function (key) {
|
484
|
-
if (key === 'participants') {
|
485
|
-
locus[key] = [];
|
486
|
-
} else {
|
487
|
-
locus[key] = (0, _lodash.cloneDeep)(_this4[key]);
|
488
|
-
}
|
489
|
-
});
|
490
|
-
|
491
|
-
// apply the updates from the hash tree onto the locus
|
492
|
-
data.updatedObjects.forEach(function (object) {
|
493
|
-
locus = _this4.updateHashTreeObjectInLocus(object, locus);
|
494
|
-
});
|
495
|
-
|
496
|
-
// update our locus info with the new locus
|
497
|
-
this.onDeltaLocus(locus);
|
498
|
-
break;
|
499
|
-
}
|
500
|
-
case _hashTreeParser.LocusInfoUpdateType.MEETING_ENDED:
|
501
|
-
{
|
502
|
-
_loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> received signal that meeting ended, destroying meeting ".concat(this.meetingId));
|
503
|
-
var meeting = this.webex.meetings.meetingCollection.get(this.meetingId);
|
504
|
-
this.webex.meetings.destroy(meeting, _constants.MEETING_REMOVED_REASON.LOCUS_DTO_SYNC_FAILED);
|
505
|
-
}
|
506
|
-
}
|
507
|
-
}
|
508
|
-
|
509
317
|
/**
|
510
318
|
* @param {Meeting} meeting
|
511
319
|
* @param {Object} data
|
@@ -515,42 +323,34 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
515
323
|
}, {
|
516
324
|
key: "parse",
|
517
325
|
value: function parse(meeting, data) {
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
case _constants.LOCUSEVENT.DIFFERENCE:
|
547
|
-
this.handleLocusDelta(locus, meeting);
|
548
|
-
break;
|
549
|
-
default:
|
550
|
-
// Why will there be a event with no eventType ????
|
551
|
-
// we may not need this, we can get full locus
|
552
|
-
this.handleLocusDelta(locus, meeting);
|
553
|
-
}
|
326
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
327
|
+
var eventType = data.eventType;
|
328
|
+
var locus = this.getTheLocusToUpdate(data.locus);
|
329
|
+
_loggerProxy.default.logger.info("Locus-info:index#parse --> received locus data: ".concat(eventType));
|
330
|
+
switch (eventType) {
|
331
|
+
case _constants.LOCUSEVENT.PARTICIPANT_JOIN:
|
332
|
+
case _constants.LOCUSEVENT.PARTICIPANT_LEFT:
|
333
|
+
case _constants.LOCUSEVENT.CONTROLS_UPDATED:
|
334
|
+
case _constants.LOCUSEVENT.PARTICIPANT_AUDIO_MUTED:
|
335
|
+
case _constants.LOCUSEVENT.PARTICIPANT_AUDIO_UNMUTED:
|
336
|
+
case _constants.LOCUSEVENT.PARTICIPANT_VIDEO_MUTED:
|
337
|
+
case _constants.LOCUSEVENT.PARTICIPANT_VIDEO_UNMUTED:
|
338
|
+
case _constants.LOCUSEVENT.SELF_CHANGED:
|
339
|
+
case _constants.LOCUSEVENT.PARTICIPANT_UPDATED:
|
340
|
+
case _constants.LOCUSEVENT.PARTICIPANT_CONTROLS_UPDATED:
|
341
|
+
case _constants.LOCUSEVENT.PARTICIPANT_ROLES_UPDATED:
|
342
|
+
case _constants.LOCUSEVENT.PARTICIPANT_DECLINED:
|
343
|
+
case _constants.LOCUSEVENT.FLOOR_GRANTED:
|
344
|
+
case _constants.LOCUSEVENT.FLOOR_RELEASED:
|
345
|
+
this.onFullLocus(locus, eventType);
|
346
|
+
break;
|
347
|
+
case _constants.LOCUSEVENT.DIFFERENCE:
|
348
|
+
this.handleLocusDelta(locus, meeting);
|
349
|
+
break;
|
350
|
+
default:
|
351
|
+
// Why will there be a event with no eventType ????
|
352
|
+
// we may not need this, we can get full locus
|
353
|
+
this.handleLocusDelta(locus, meeting);
|
554
354
|
}
|
555
355
|
}
|
556
356
|
|
@@ -571,57 +371,24 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
571
371
|
* updates the locus with full locus object
|
572
372
|
* @param {object} locus locus object
|
573
373
|
* @param {string} eventType particulat locus event
|
574
|
-
* @param {DataSet[]} dataSets
|
575
374
|
* @returns {object} null
|
576
375
|
* @memberof LocusInfo
|
577
376
|
*/
|
578
377
|
}, {
|
579
378
|
key: "onFullLocus",
|
580
|
-
value: function onFullLocus(locus, eventType
|
581
|
-
var _this$participants,
|
582
|
-
_this5 = this,
|
583
|
-
_locus$jsSdkMeta;
|
379
|
+
value: function onFullLocus(locus, eventType) {
|
584
380
|
if (!locus) {
|
585
381
|
_loggerProxy.default.logger.error('Locus-info:index#onFullLocus --> object passed as argument was invalid, continuing.');
|
586
382
|
}
|
587
|
-
if (
|
588
|
-
// this is the new hashmap Locus DTO format (only applicable to webinars for now)
|
589
|
-
if (!this.hashTreeParser) {
|
590
|
-
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus --> creating hash tree parser");
|
591
|
-
_loggerProxy.default.logger.info('Locus-info:index#onFullLocus --> dataSets:', dataSets, ' and locus:', locus);
|
592
|
-
this.hashTreeParser = new _hashTreeParser.default({
|
593
|
-
initialLocus: {
|
594
|
-
locus: locus,
|
595
|
-
dataSets: dataSets
|
596
|
-
},
|
597
|
-
webexRequest: this.webex.request.bind(this.webex),
|
598
|
-
locusInfoUpdateCallback: this.updateFromHashTree.bind(this),
|
599
|
-
debugId: "HT-".concat(this.meetingId.substring(0, 4))
|
600
|
-
});
|
601
|
-
} else {
|
602
|
-
// in this case the Locus we're getting is not necessarily the full one
|
603
|
-
// so treat it like if we just got it in a message
|
604
|
-
console.log('marcin: !!!!!!!! full DTO - this is not fully implemented/tested yet');
|
605
|
-
_loggerProxy.default.logger.warn('Locus-info:index#onFullLocus --> full DTO - this is not fully implemented/tested yet!!!!!!!!');
|
606
|
-
this.handleLocusAPIResponse(undefined, {
|
607
|
-
dataSets: dataSets,
|
608
|
-
locus: locus
|
609
|
-
});
|
610
|
-
return;
|
611
|
-
}
|
612
|
-
} else if (!this.locusParser.isNewFullLocus(locus)) {
|
383
|
+
if (!this.locusParser.isNewFullLocus(locus)) {
|
613
384
|
_loggerProxy.default.logger.info("Locus-info:index#onFullLocus --> ignoring old full locus DTO, eventType=".concat(eventType));
|
614
385
|
return;
|
615
386
|
}
|
616
|
-
this.updateParticipantDeltas(locus.participants);
|
617
387
|
this.scheduledMeeting = locus.meeting || null;
|
618
388
|
this.participants = locus.participants;
|
619
|
-
(_this$participants = this.participants) === null || _this$participants === void 0 ? void 0 : _this$participants.forEach(function (participant) {
|
620
|
-
_this5.hashTreeObjectId2ParticipantId.set(participant.htMeta.elementId.id, participant.id);
|
621
|
-
});
|
622
389
|
var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
|
623
390
|
this.updateLocusInfo(locus);
|
624
|
-
this.updateParticipants(locus.participants,
|
391
|
+
this.updateParticipants(locus.participants, isReplaceMembers);
|
625
392
|
this.isMeetingActive();
|
626
393
|
this.handleOneOnOneEvent(eventType);
|
627
394
|
this.updateEmbeddedApps(locus.embeddedApps);
|
@@ -673,11 +440,10 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
673
440
|
}, {
|
674
441
|
key: "onDeltaLocus",
|
675
442
|
value: function onDeltaLocus(locus) {
|
676
|
-
var _locus$jsSdkMeta2;
|
677
443
|
var isReplaceMembers = _controlsUtils.default.isNeedReplaceMembers(this.controls, locus.controls);
|
678
444
|
this.mergeParticipants(this.participants, locus.participants);
|
679
445
|
this.updateLocusInfo(locus);
|
680
|
-
this.updateParticipants(locus.participants,
|
446
|
+
this.updateParticipants(locus.participants, isReplaceMembers);
|
681
447
|
this.isMeetingActive();
|
682
448
|
}
|
683
449
|
|
@@ -908,76 +674,22 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
908
674
|
}
|
909
675
|
}
|
910
676
|
|
911
|
-
/**
|
912
|
-
* Update the deltaParticipants property of this object based on a list of
|
913
|
-
* provided participants.
|
914
|
-
*
|
915
|
-
* @param {Array} [participants] - The participants to update against.
|
916
|
-
* @returns {void}
|
917
|
-
*/
|
918
|
-
}, {
|
919
|
-
key: "updateParticipantDeltas",
|
920
|
-
value: function updateParticipantDeltas() {
|
921
|
-
var _this6 = this;
|
922
|
-
var participants = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
923
|
-
// Used to find a participant within a participants collection.
|
924
|
-
var findParticipant = function findParticipant(participant, collection) {
|
925
|
-
return collection.find(function (item) {
|
926
|
-
return item.person.id === participant.person.id;
|
927
|
-
});
|
928
|
-
};
|
929
|
-
|
930
|
-
// Generates an object that indicates which state properties have changed.
|
931
|
-
var generateDelta = function generateDelta() {
|
932
|
-
var prevState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
933
|
-
var newState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
934
|
-
// Setup deltas.
|
935
|
-
var deltas = {
|
936
|
-
audioStatus: prevState.audioStatus !== newState.audioStatus,
|
937
|
-
videoSlidesStatus: prevState.videoSlidesStatus !== newState.videoSlidesStatus,
|
938
|
-
videoStatus: prevState.videoStatus !== newState.videoStatus
|
939
|
-
};
|
940
|
-
|
941
|
-
// Clean the object
|
942
|
-
(0, _keys.default)(deltas).forEach(function (key) {
|
943
|
-
if (deltas[key] !== true) {
|
944
|
-
delete deltas[key];
|
945
|
-
}
|
946
|
-
});
|
947
|
-
return deltas;
|
948
|
-
};
|
949
|
-
this.deltaParticipants = participants.reduce(function (collection, participant) {
|
950
|
-
var existingParticipant = findParticipant(participant, _this6.participants || []) || {};
|
951
|
-
var delta = generateDelta(existingParticipant.status, participant.status);
|
952
|
-
var changed = (0, _keys.default)(delta).length > 0;
|
953
|
-
if (changed) {
|
954
|
-
collection.push({
|
955
|
-
person: participant.person,
|
956
|
-
delta: delta
|
957
|
-
});
|
958
|
-
}
|
959
|
-
return collection;
|
960
|
-
}, []);
|
961
|
-
}
|
962
|
-
|
963
677
|
/**
|
964
678
|
* update meeting's members
|
965
679
|
* @param {Object} participants new participants object
|
966
|
-
* @param {Array} removedParticipantIds list of removed participants
|
967
680
|
* @param {Boolean} isReplace is replace the whole members
|
968
681
|
* @returns {Array} updatedParticipants
|
969
682
|
* @memberof LocusInfo
|
970
683
|
*/
|
971
684
|
}, {
|
972
685
|
key: "updateParticipants",
|
973
|
-
value: function updateParticipants(participants,
|
686
|
+
value: function updateParticipants(participants, isReplace) {
|
974
687
|
var _this$parsedLocus$con;
|
975
688
|
this.emitScoped({
|
976
689
|
file: 'locus-info',
|
977
690
|
function: 'updateParticipants'
|
978
691
|
}, _constants.EVENTS.LOCUS_INFO_UPDATE_PARTICIPANTS, {
|
979
692
|
participants: participants,
|
980
|
-
removedParticipantIds: removedParticipantIds,
|
981
693
|
recordingId: this.parsedLocus.controls && ((_this$parsedLocus$con = this.parsedLocus.controls.record) === null || _this$parsedLocus$con === void 0 ? void 0 : _this$parsedLocus$con.modifiedBy),
|
982
694
|
selfIdentity: this.parsedLocus.self && this.parsedLocus.self.selfIdentity,
|
983
695
|
selfId: this.parsedLocus.self && this.parsedLocus.self.selfId,
|
@@ -1879,7 +1591,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
1879
1591
|
}, {
|
1880
1592
|
key: "updateMainSessionLocusCache",
|
1881
1593
|
value: function updateMainSessionLocusCache(mainLocus) {
|
1882
|
-
var
|
1594
|
+
var _this4 = this;
|
1883
1595
|
if (!mainLocus) {
|
1884
1596
|
return;
|
1885
1597
|
}
|
@@ -1888,7 +1600,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
1888
1600
|
// shallow merge and do special merge for participants
|
1889
1601
|
(0, _lodash.assignWith)(this.mainSessionLocusCache, locusClone, function (objValue, srcValue, key) {
|
1890
1602
|
if (key === 'participants') {
|
1891
|
-
return
|
1603
|
+
return _this4.mergeParticipants(objValue, srcValue);
|
1892
1604
|
}
|
1893
1605
|
return srcValue || objValue;
|
1894
1606
|
});
|