@webex/plugin-meetings 3.12.0-next.20 → 3.12.0-next.22
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/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/hashTree/hashTreeParser.js +480 -320
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +170 -36
- package/dist/locus-info/index.js.map +1 -1
- package/dist/meetings/index.js +130 -45
- package/dist/meetings/index.js.map +1 -1
- package/dist/types/hashTree/hashTreeParser.d.ts +40 -12
- package/dist/types/locus-info/index.d.ts +29 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +14 -14
- package/src/hashTree/hashTreeParser.ts +182 -97
- package/src/locus-info/index.ts +176 -48
- package/src/meetings/index.ts +42 -17
- package/test/unit/spec/hashTree/hashTreeParser.ts +372 -7
- package/test/unit/spec/locus-info/index.js +179 -4
- package/test/unit/spec/meetings/index.js +127 -5
|
@@ -372,7 +372,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
372
372
|
throw error;
|
|
373
373
|
});
|
|
374
374
|
},
|
|
375
|
-
version: "3.12.0-next.
|
|
375
|
+
version: "3.12.0-next.22"
|
|
376
376
|
});
|
|
377
377
|
var _default = exports.default = SimultaneousInterpretation;
|
|
378
378
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
|
|
|
18
18
|
languageCode: 'number',
|
|
19
19
|
languageName: 'string'
|
|
20
20
|
},
|
|
21
|
-
version: "3.12.0-next.
|
|
21
|
+
version: "3.12.0-next.22"
|
|
22
22
|
});
|
|
23
23
|
var _default = exports.default = SILanguage;
|
|
24
24
|
//# sourceMappingURL=siLanguage.js.map
|
package/dist/locus-info/index.js
CHANGED
|
@@ -53,7 +53,7 @@ var _hashTreeParser2 = _interopRequireWildcard(require("../hashTree/hashTreePars
|
|
|
53
53
|
var _types = require("../hashTree/types");
|
|
54
54
|
var _utils = require("../hashTree/utils");
|
|
55
55
|
var _util = _interopRequireDefault(require("../meetings/util"));
|
|
56
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
56
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
57
57
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
58
58
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
59
59
|
function ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -676,7 +676,19 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
676
676
|
var isWrapped = 'locus' in responseBody;
|
|
677
677
|
var locusUrl = isWrapped ? (_responseBody$locus = responseBody.locus) === null || _responseBody$locus === void 0 ? void 0 : _responseBody$locus.url : responseBody.url;
|
|
678
678
|
var hashTreeParserEntry = locusUrl && this.hashTreeParsers.get(locusUrl);
|
|
679
|
-
|
|
679
|
+
var locus = isWrapped ? responseBody.locus : responseBody;
|
|
680
|
+
if (this.hashTreeParsers.size > 0) {
|
|
681
|
+
// We are in hash tree mode. Check if we need to create/reactivate a parser for this locusUrl.
|
|
682
|
+
if (!hashTreeParserEntry || hashTreeParserEntry.parser.state === 'stopped') {
|
|
683
|
+
if (!locusUrl) {
|
|
684
|
+
_loggerProxy.default.logger.warn('Locus-info:index#handleLocusAPIResponse --> API response has no locusUrl, cannot handle hash tree parser switch');
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
this.handleHashTreeParserSwitchForAPIResponse(locusUrl, locus);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// Active parser found - pass the API response to it
|
|
680
692
|
if (isWrapped) {
|
|
681
693
|
if (!responseBody.dataSets) {
|
|
682
694
|
this.sendClassicVsHashTreeMismatchMetric(meeting, "expected hash tree dataSets in API response but they are missing");
|
|
@@ -686,19 +698,21 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
686
698
|
// update the data in our hash trees
|
|
687
699
|
hashTreeParserEntry.parser.handleLocusUpdate(responseBody);
|
|
688
700
|
} else {
|
|
689
|
-
// LocusDTO without wrapper - pass it through as if it had no dataSets
|
|
701
|
+
// LocusDTO without wrapper - pass it through as if it had no dataSets nor metadata
|
|
690
702
|
hashTreeParserEntry.parser.handleLocusUpdate({
|
|
691
703
|
locus: responseBody
|
|
692
704
|
});
|
|
693
705
|
}
|
|
694
|
-
|
|
695
|
-
if (isWrapped && responseBody.dataSets) {
|
|
696
|
-
this.sendClassicVsHashTreeMismatchMetric(meeting, "unexpected hash tree dataSets in API response");
|
|
697
|
-
}
|
|
698
|
-
// classic Locus delta
|
|
699
|
-
var locus = isWrapped ? responseBody.locus : responseBody;
|
|
700
|
-
this.handleLocusDelta(locus, meeting);
|
|
706
|
+
return;
|
|
701
707
|
}
|
|
708
|
+
|
|
709
|
+
// No hash tree parsers - classic Locus mode
|
|
710
|
+
if (isWrapped && responseBody.dataSets) {
|
|
711
|
+
this.sendClassicVsHashTreeMismatchMetric(meeting, "unexpected hash tree dataSets in API response");
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// classic Locus delta
|
|
715
|
+
this.handleLocusDelta(locus, meeting);
|
|
702
716
|
}
|
|
703
717
|
|
|
704
718
|
/**
|
|
@@ -881,6 +895,81 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
881
895
|
}
|
|
882
896
|
}
|
|
883
897
|
|
|
898
|
+
/**
|
|
899
|
+
* Helper that handles the common logic for reactivating a stopped HashTreeParser when
|
|
900
|
+
* a newer "replaces" is detected. Used by both the message and API response parser switch methods.
|
|
901
|
+
*
|
|
902
|
+
* @param {string} callerName - name of the calling method, used in log messages
|
|
903
|
+
* @param {string} locusUrl - the locus URL of the stopped parser
|
|
904
|
+
* @param {HashTreeParserEntry} stoppedEntry - the stopped parser entry
|
|
905
|
+
* @param {ReplacesInfo} replaces - replacement info extracted from self
|
|
906
|
+
* @param {Function} resumeCallback - callback to invoke after reactivation to resume the parser
|
|
907
|
+
* @returns {void}
|
|
908
|
+
*/
|
|
909
|
+
}, {
|
|
910
|
+
key: "resumeStoppedParser",
|
|
911
|
+
value: function resumeStoppedParser(callerName, locusUrl, stoppedEntry, replaces, resumeCallback) {
|
|
912
|
+
// this check is just for typescript, it should never happen, replaces should always be defined
|
|
913
|
+
if (!replaces) {
|
|
914
|
+
_loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> received data for stopped HashTreeParser with locusUrl ").concat(locusUrl, ", but no replaces info provided, so not re-activating the parser"));
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
if (replaces.replacedAt <= (stoppedEntry.replacedAt || '')) {
|
|
918
|
+
_loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> received data for stopped HashTreeParser with locusUrl ").concat(locusUrl, ", but replaces info provided is not newer, so not re-activating the parser"));
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
_loggerProxy.default.logger.info("Locus-info:index#".concat(callerName, " --> reactivating HashTreeParser for locusUrl=").concat(locusUrl, ", which replaces ").concat(replaces.locusUrl));
|
|
922
|
+
var replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
|
|
923
|
+
if (replacedEntry) {
|
|
924
|
+
replacedEntry.replacedAt = replaces.replacedAt;
|
|
925
|
+
replacedEntry.parser.stop();
|
|
926
|
+
} else {
|
|
927
|
+
_loggerProxy.default.logger.warn("Locus-info:index#".concat(callerName, " --> the parser that is supposed to be replaced with the currently reactivated parser is not found, locusUrl=").concat(replaces.locusUrl));
|
|
928
|
+
}
|
|
929
|
+
stoppedEntry.initializedFromHashTree = false;
|
|
930
|
+
this.hashTreeObjectId2ParticipantId.clear();
|
|
931
|
+
resumeCallback();
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Handles an API response whose locusUrl doesn't match any active HashTreeParser
|
|
936
|
+
* (either no entry exists, or the existing entry is stopped).
|
|
937
|
+
* Creates a new parser or reactivates a stopped one using initializeFromGetLociResponse.
|
|
938
|
+
*
|
|
939
|
+
* @param {string} locusUrl - the locus URL from the API response
|
|
940
|
+
* @param {LocusDTO} locus - the locus DTO from the API response
|
|
941
|
+
* @returns {void}
|
|
942
|
+
*/
|
|
943
|
+
}, {
|
|
944
|
+
key: "handleHashTreeParserSwitchForAPIResponse",
|
|
945
|
+
value: function handleHashTreeParserSwitchForAPIResponse(locusUrl, locus) {
|
|
946
|
+
var entry = this.hashTreeParsers.get(locusUrl);
|
|
947
|
+
var replaces = getReplaceInfoFromSelf(locus.self,
|
|
948
|
+
// @ts-ignore
|
|
949
|
+
this.webex.internal.device.url);
|
|
950
|
+
if (!entry) {
|
|
951
|
+
_loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> no parser for locusUrl ".concat(locusUrl, ", creating a new one"));
|
|
952
|
+
var parser = this.createHashTreeParser({
|
|
953
|
+
locusUrl: locusUrl,
|
|
954
|
+
initialLocus: {
|
|
955
|
+
locus: null,
|
|
956
|
+
dataSets: []
|
|
957
|
+
},
|
|
958
|
+
metadata: null,
|
|
959
|
+
replacedAt: replaces === null || replaces === void 0 ? void 0 : replaces.replacedAt
|
|
960
|
+
});
|
|
961
|
+
parser.initializeFromGetLociResponse(locus);
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
if (entry.parser.state !== 'stopped') {
|
|
965
|
+
_loggerProxy.default.logger.warn("Locus-info:index#handleHashTreeParserSwitchForAPIResponse --> unexpected parser state \"".concat(entry.parser.state, "\" for locusUrl ").concat(locusUrl));
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
this.resumeStoppedParser('handleHashTreeParserSwitchForAPIResponse', locusUrl, entry, replaces, function () {
|
|
969
|
+
return entry.parser.resumeFromApiResponse(locus);
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
|
|
884
973
|
/**
|
|
885
974
|
* Checks if the hash tree message should trigger a switch to a different HashTreeParser
|
|
886
975
|
*
|
|
@@ -928,25 +1017,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
928
1017
|
if (entry.parser.state === 'stopped') {
|
|
929
1018
|
// 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
|
|
930
1019
|
// this happens when you move from breakout A -> breakout B -> back to breakout A
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
var replacedEntry = this.hashTreeParsers.get(replaces.locusUrl);
|
|
935
|
-
if (replacedEntry) {
|
|
936
|
-
replacedEntry.replacedAt = replaces.replacedAt;
|
|
937
|
-
entry.initializedFromHashTree = false;
|
|
938
|
-
this.hashTreeObjectId2ParticipantId.clear();
|
|
939
|
-
replacedEntry.parser.stop();
|
|
940
|
-
entry.parser.resume(message);
|
|
941
|
-
} else {
|
|
942
|
-
_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));
|
|
943
|
-
}
|
|
944
|
-
} else {
|
|
945
|
-
_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"));
|
|
946
|
-
}
|
|
947
|
-
return true;
|
|
948
|
-
}
|
|
949
|
-
_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"));
|
|
1020
|
+
this.resumeStoppedParser('handleHashTreeParserSwitch', message.locusUrl, entry, replaces, function () {
|
|
1021
|
+
return entry.parser.resumeFromMessage(message);
|
|
1022
|
+
});
|
|
950
1023
|
return true;
|
|
951
1024
|
}
|
|
952
1025
|
return false;
|
|
@@ -979,6 +1052,60 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
979
1052
|
}
|
|
980
1053
|
}
|
|
981
1054
|
|
|
1055
|
+
/**
|
|
1056
|
+
* Triggers a sync of all hash tree datasets for all hash tree parsers associated with this meeting.
|
|
1057
|
+
* The syncs are executed sequentially within each parser.
|
|
1058
|
+
*
|
|
1059
|
+
* @returns {Promise<void>}
|
|
1060
|
+
*/
|
|
1061
|
+
}, {
|
|
1062
|
+
key: "syncAllHashTreeDatasets",
|
|
1063
|
+
value: (function () {
|
|
1064
|
+
var _syncAllHashTreeDatasets = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
1065
|
+
var _iterator3, _step3, _step3$value, entry, _t2;
|
|
1066
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
1067
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1068
|
+
case 0:
|
|
1069
|
+
_iterator3 = _createForOfIteratorHelper(this.hashTreeParsers);
|
|
1070
|
+
_context2.prev = 1;
|
|
1071
|
+
_iterator3.s();
|
|
1072
|
+
case 2:
|
|
1073
|
+
if ((_step3 = _iterator3.n()).done) {
|
|
1074
|
+
_context2.next = 4;
|
|
1075
|
+
break;
|
|
1076
|
+
}
|
|
1077
|
+
_step3$value = (0, _slicedToArray2.default)(_step3.value, 2), entry = _step3$value[1];
|
|
1078
|
+
if (!entry.parser) {
|
|
1079
|
+
_context2.next = 3;
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
_context2.next = 3;
|
|
1083
|
+
return entry.parser.syncAllDatasets();
|
|
1084
|
+
case 3:
|
|
1085
|
+
_context2.next = 2;
|
|
1086
|
+
break;
|
|
1087
|
+
case 4:
|
|
1088
|
+
_context2.next = 6;
|
|
1089
|
+
break;
|
|
1090
|
+
case 5:
|
|
1091
|
+
_context2.prev = 5;
|
|
1092
|
+
_t2 = _context2["catch"](1);
|
|
1093
|
+
_iterator3.e(_t2);
|
|
1094
|
+
case 6:
|
|
1095
|
+
_context2.prev = 6;
|
|
1096
|
+
_iterator3.f();
|
|
1097
|
+
return _context2.finish(6);
|
|
1098
|
+
case 7:
|
|
1099
|
+
case "end":
|
|
1100
|
+
return _context2.stop();
|
|
1101
|
+
}
|
|
1102
|
+
}, _callee2, this, [[1, 5, 6, 7]]);
|
|
1103
|
+
}));
|
|
1104
|
+
function syncAllHashTreeDatasets() {
|
|
1105
|
+
return _syncAllHashTreeDatasets.apply(this, arguments);
|
|
1106
|
+
}
|
|
1107
|
+
return syncAllHashTreeDatasets;
|
|
1108
|
+
}()
|
|
982
1109
|
/**
|
|
983
1110
|
* Callback registered with HashTreeParser to receive locus info updates.
|
|
984
1111
|
* Updates our locus info based on the data parsed by the hash tree parser.
|
|
@@ -987,6 +1114,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
987
1114
|
* @param {LocusInfoUpdate} update - Details about the update.
|
|
988
1115
|
* @returns {void}
|
|
989
1116
|
*/
|
|
1117
|
+
)
|
|
990
1118
|
}, {
|
|
991
1119
|
key: "updateFromHashTree",
|
|
992
1120
|
value: function updateFromHashTree(locusUrl, update) {
|
|
@@ -1097,7 +1225,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1097
1225
|
key: "parse",
|
|
1098
1226
|
value: function parse(meeting, data) {
|
|
1099
1227
|
if (this.hashTreeParsers.size > 0) {
|
|
1100
|
-
|
|
1228
|
+
if (data.eventType === _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS) {
|
|
1229
|
+
// sync meetings response follows the format of "not wrapped" locus API responses,
|
|
1230
|
+
// so has no dataSets nor Metadata
|
|
1231
|
+
this.handleLocusAPIResponse(meeting, _objectSpread({}, data.locus));
|
|
1232
|
+
} else {
|
|
1233
|
+
this.handleHashTreeMessage(meeting, data.eventType, data.stateElementsMessage);
|
|
1234
|
+
}
|
|
1101
1235
|
} else {
|
|
1102
1236
|
var eventType = data.eventType;
|
|
1103
1237
|
if (eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
|
|
@@ -1590,11 +1724,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1590
1724
|
isReplace: isReplace
|
|
1591
1725
|
});
|
|
1592
1726
|
if (participants && (0, _isArray.default)(participants) && participants.length > 0) {
|
|
1593
|
-
var
|
|
1594
|
-
|
|
1727
|
+
var _iterator4 = _createForOfIteratorHelper(participants),
|
|
1728
|
+
_step4;
|
|
1595
1729
|
try {
|
|
1596
|
-
for (
|
|
1597
|
-
var participant =
|
|
1730
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1731
|
+
var participant = _step4.value;
|
|
1598
1732
|
if (participant && (participant === null || participant === void 0 ? void 0 : participant.reason) === 'FAILURE') {
|
|
1599
1733
|
var _participant$person;
|
|
1600
1734
|
this.emitScoped({
|
|
@@ -1606,9 +1740,9 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1606
1740
|
}
|
|
1607
1741
|
}
|
|
1608
1742
|
} catch (err) {
|
|
1609
|
-
|
|
1743
|
+
_iterator4.e(err);
|
|
1610
1744
|
} finally {
|
|
1611
|
-
|
|
1745
|
+
_iterator4.f();
|
|
1612
1746
|
}
|
|
1613
1747
|
}
|
|
1614
1748
|
}
|