fcr-core 3.7.8 → 3.7.9-alpha
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/lib/chat-connection/index.js +26 -41
- package/lib/engine/index.js +74 -67
- package/lib/imports.js +0 -1
- package/lib/media-control/desktop.js +13 -18
- package/lib/media-control/mobile.js +13 -18
- package/lib/monitor-control/index.js +5 -10
- package/lib/peer-session/index.js +39 -48
- package/lib/plugins/chatroom.js +202 -218
- package/lib/room-control/ability-control/index.js +9 -14
- package/lib/room-control/group-control/index.js +16 -21
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +36 -53
- package/lib/room-control/interpreter-control/index.js +34 -47
- package/lib/room-control/interpreter-control/room.js +4 -6
- package/lib/room-control/join-before-host-waitingroom-control/index.js +4 -6
- package/lib/room-control/mainroom-control/index.js +17 -25
- package/lib/room-control/privilege-control/helper.js +5 -8
- package/lib/room-control/privilege-control/index.js +19 -26
- package/lib/room-control/room-connector-control/index.js +19 -28
- package/lib/room-control/room-control-factory.js +1 -2
- package/lib/room-control/room-session/index.js +39 -48
- package/lib/room-control/shared-cache.js +29 -36
- package/lib/room-control/sharing-control/index.js +32 -40
- package/lib/room-control/stream-control/index.js +173 -181
- package/lib/room-control/user-control/index.js +136 -143
- package/lib/room-control/waitingroom-control/index.js +9 -14
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +24 -32
- package/lib/room-control/whiteboard-control-v2/annotation-control/index.js +16 -27
- package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.js +53 -63
- package/lib/room-control/whiteboard-control-v2/index.js +28 -40
- package/lib/room-control/whiteboard-control-v2/main-window.js +23 -28
- package/lib/room-control/whiteboard-control-v2/utils.js +6 -7
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +27 -38
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +3 -5
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.js +42 -54
- package/lib/room-router/index.js +42 -52
- package/lib/service/api.js +207 -231
- package/lib/utilities/collection.js +2 -3
- package/lib/utilities/error-helpers.js +27 -34
- package/lib/utilities/error.js +8 -9
- package/lib/utilities/join-helper.js +25 -32
- package/lib/utilities/logger.js +3 -6
- package/lib/utilities/parameters.js +4 -8
- package/lib/utilities/retry-helpers.js +0 -1
- package/lib/utilities/shared-storage.js +0 -1
- package/lib/utilities/storage.js +0 -1
- package/lib/utilities/stream.js +11 -16
- package/lib/utilities/user.js +3 -4
- package/lib/utilities/validate-params.js +1 -2
- package/package.json +4 -4
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/esnext.function.metadata.js");
|
|
6
4
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
7
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -27,29 +25,30 @@ require("core-js/modules/esnext.map.merge.js");
|
|
|
27
25
|
require("core-js/modules/esnext.map.reduce.js");
|
|
28
26
|
require("core-js/modules/esnext.map.some.js");
|
|
29
27
|
require("core-js/modules/esnext.map.update.js");
|
|
30
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
31
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
32
28
|
var _imports = require("../../imports");
|
|
33
29
|
var _user = require("../../utilities/user");
|
|
34
30
|
var _logger = require("../../utilities/logger");
|
|
35
31
|
var _error = require("../../utilities/error");
|
|
36
32
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
37
33
|
var _schema = require("../../schema");
|
|
38
|
-
|
|
39
|
-
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs, _ref;
|
|
34
|
+
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs;
|
|
40
35
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
41
36
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
42
37
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
43
38
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
44
39
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
45
|
-
_ref = (_getGroupUserListDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _addGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _addUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _removeUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _moveUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema, _schema.stringSchema)], "logger");
|
|
46
40
|
class FcrGroupControl {
|
|
41
|
+
static {
|
|
42
|
+
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "getGroupList"], [_getGroupUserListDecs, 2, "getGroupUserList"], [_addGroupsDecs, 2, "addGroups"], [_updateGroupsDecs, 2, "updateGroups"], [_deleteGroupsDecs, 2, "deleteGroups"], [_imports.trace, 2, "deleteAllGroups"], [_addUsersDecs, 2, "addUsers"], [_removeUsersDecs, 2, "removeUsers"], [_moveUsersDecs, 2, "moveUsers"]], []).e;
|
|
43
|
+
}
|
|
44
|
+
//@internal
|
|
45
|
+
[(_getGroupUserListDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _addGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _addUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _removeUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _moveUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema, _schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
46
|
+
prefix: 'FcrGroupControl'
|
|
47
|
+
}));
|
|
48
|
+
//@internal
|
|
49
|
+
|
|
50
|
+
_observable = new _imports.AgoraObservable();
|
|
47
51
|
constructor(_engine, _scene, _api, _sharedCache) {
|
|
48
|
-
//@internal
|
|
49
|
-
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
50
|
-
prefix: 'FcrGroupControl'
|
|
51
|
-
})));
|
|
52
|
-
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
53
52
|
this._engine = _engine;
|
|
54
53
|
this._scene = _scene;
|
|
55
54
|
this._api = _api;
|
|
@@ -61,8 +60,7 @@ class FcrGroupControl {
|
|
|
61
60
|
_addSceneObserver() {
|
|
62
61
|
const observer = {
|
|
63
62
|
onScenePropertiesUpdated: (sceneId, event) => {
|
|
64
|
-
|
|
65
|
-
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 11) {
|
|
63
|
+
if (event.cause?.cmd === 11) {
|
|
66
64
|
const data = event.cause.data;
|
|
67
65
|
const changedProperties = event.changedProperties;
|
|
68
66
|
const groupDetails = changedProperties.groups.details;
|
|
@@ -90,8 +88,7 @@ class FcrGroupControl {
|
|
|
90
88
|
this._observable.notifyObservers('onGroupsUpdated', groupEvents);
|
|
91
89
|
}
|
|
92
90
|
if (data.actionType === 4) {
|
|
93
|
-
|
|
94
|
-
(_data$changeGroups = data.changeGroups) === null || _data$changeGroups === void 0 || _data$changeGroups.forEach(group => {
|
|
91
|
+
data.changeGroups?.forEach(group => {
|
|
95
92
|
const {
|
|
96
93
|
removeUsers,
|
|
97
94
|
groupUuid
|
|
@@ -112,7 +109,7 @@ class FcrGroupControl {
|
|
|
112
109
|
}
|
|
113
110
|
});
|
|
114
111
|
const toGroupMap = new Map();
|
|
115
|
-
|
|
112
|
+
data.changeGroups?.forEach(group => {
|
|
116
113
|
const {
|
|
117
114
|
removeUsers
|
|
118
115
|
} = group;
|
|
@@ -155,7 +152,7 @@ class FcrGroupControl {
|
|
|
155
152
|
};
|
|
156
153
|
}));
|
|
157
154
|
});
|
|
158
|
-
|
|
155
|
+
data.changeGroups?.forEach(group => {
|
|
159
156
|
const {
|
|
160
157
|
addUsers,
|
|
161
158
|
groupUuid
|
|
@@ -262,6 +259,4 @@ class FcrGroupControl {
|
|
|
262
259
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onGroupsAdded', 'onGroupsUpdated', 'onGroupsRemoved', 'onUserListAddedToGroup', 'onUserListRemovedFromGroup', 'onUserListMoveToGroup']));
|
|
263
260
|
}
|
|
264
261
|
}
|
|
265
|
-
exports.FcrGroupControl = FcrGroupControl;
|
|
266
|
-
_FcrGroupControl = FcrGroupControl;
|
|
267
|
-
[_initProto] = _applyDecs(_FcrGroupControl, [[_imports.trace, 2, "getGroupList"], [_getGroupUserListDecs, 2, "getGroupUserList"], [_addGroupsDecs, 2, "addGroups"], [_updateGroupsDecs, 2, "updateGroups"], [_deleteGroupsDecs, 2, "deleteGroups"], [_imports.trace, 2, "deleteAllGroups"], [_addUsersDecs, 2, "addUsers"], [_removeUsersDecs, 2, "removeUsers"], [_moveUsersDecs, 2, "moveUsers"]], []).e;
|
|
262
|
+
exports.FcrGroupControl = FcrGroupControl;
|
|
@@ -33,7 +33,7 @@ function validateControllerInitialized(controller, controllerType) {
|
|
|
33
33
|
*/
|
|
34
34
|
function validateRoomJoined(joinRoomSuccess, operation) {
|
|
35
35
|
if (!joinRoomSuccess) {
|
|
36
|
-
throw _errorHelpers.roomControlErrorHelper.createOperationError(
|
|
36
|
+
throw _errorHelpers.roomControlErrorHelper.createOperationError(`${operation}, please join room first`);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/es.array.push.js");
|
|
6
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
7
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
9
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
10
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
11
6
|
require("core-js/modules/esnext.map.emplace.js");
|
|
12
7
|
require("core-js/modules/esnext.map.every.js");
|
|
@@ -22,13 +17,10 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
22
17
|
require("core-js/modules/esnext.map.some.js");
|
|
23
18
|
require("core-js/modules/esnext.map.update.js");
|
|
24
19
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
25
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
26
20
|
Object.defineProperty(exports, "__esModule", {
|
|
27
21
|
value: true
|
|
28
22
|
});
|
|
29
23
|
exports.FcrSubRoomControlImpl = exports.FcrBaseRoomControlImpl = void 0;
|
|
30
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
31
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
32
24
|
var _imports = require("../imports");
|
|
33
25
|
var _type = require("../type");
|
|
34
26
|
var _type2 = require("./type");
|
|
@@ -45,7 +37,6 @@ var _logger = require("../utilities/logger");
|
|
|
45
37
|
var _2 = require("..");
|
|
46
38
|
var _helpers = require("./helpers");
|
|
47
39
|
var _errorHelpers = require("../utilities/error-helpers");
|
|
48
|
-
var _FcrBaseRoomControlImpl;
|
|
49
40
|
let _initProto; // Core SDK imports
|
|
50
41
|
// Service and API imports
|
|
51
42
|
// Type definitions
|
|
@@ -54,8 +45,6 @@ let _initProto; // Core SDK imports
|
|
|
54
45
|
// Error handling and utilities
|
|
55
46
|
// Core state
|
|
56
47
|
// Helpers and utilities
|
|
57
|
-
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; }
|
|
58
|
-
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; }
|
|
59
48
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
60
49
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
61
50
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -70,15 +59,18 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
70
59
|
* @internal
|
|
71
60
|
*/
|
|
72
61
|
class FcrBaseRoomControlImpl {
|
|
62
|
+
static {
|
|
63
|
+
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_imports.trace, 2, "start"], [_imports.trace, 2, "end"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getRoomState"], [_imports.trace, 2, "getRoomProperties"], [_imports.trace, 2, "getRoomPropertiesByKeyPath"], [_imports.trace, 2, "updateRoomProperties"], [_imports.trace, 2, "updateIncrementRoomProperties"], [_imports.trace, 2, "deleteRoomProperties"], [_imports.trace, 2, "startCloudRecording"], [_imports.trace, 2, "pauseCloudRecording"], [_imports.trace, 2, "resumeCloudRecording"], [_imports.trace, 2, "stopCloudRecording"], [_imports.trace, 2, "getLiveStreamingState"], [_imports.trace, 2, "getLiveStreamingConfig"], [_imports.trace, 2, "startLiveStreaming"], [_imports.trace, 2, "updateLiveStreamingLayout"], [_imports.trace, 2, "stopLiveStreaming"], [_imports.trace, 2, "getCloudRecordingState"], [_imports.trace, 2, "sendRoomMessage"]], []).e;
|
|
64
|
+
}
|
|
65
|
+
//@internal
|
|
66
|
+
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
67
|
+
prefix: 'FcrBaseRoomControlImpl'
|
|
68
|
+
}));
|
|
69
|
+
_observable = new _imports.AgoraObservable();
|
|
70
|
+
_joinRoomSuccess = false;
|
|
71
|
+
_joining = false;
|
|
72
|
+
_joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
73
73
|
constructor(_engine, _scene, _api, _config, _roomType, _chatConnection, _sharedCache, _chatRoomControl) {
|
|
74
|
-
//@internal
|
|
75
|
-
(0, _defineProperty2.default)(this, "logger", (_initProto(this), (0, _logger.createLogger)({
|
|
76
|
-
prefix: 'FcrBaseRoomControlImpl'
|
|
77
|
-
})));
|
|
78
|
-
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
79
|
-
(0, _defineProperty2.default)(this, "_joinRoomSuccess", false);
|
|
80
|
-
(0, _defineProperty2.default)(this, "_joining", false);
|
|
81
|
-
(0, _defineProperty2.default)(this, "_joinState", _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED);
|
|
82
74
|
this._engine = _engine;
|
|
83
75
|
this._scene = _scene;
|
|
84
76
|
this._api = _api;
|
|
@@ -102,9 +94,8 @@ class FcrBaseRoomControlImpl {
|
|
|
102
94
|
};
|
|
103
95
|
this._sceneObserver = {
|
|
104
96
|
onJoinSceneSuccess: (sceneId, localUser) => {
|
|
105
|
-
var _this$_chatRoomContro;
|
|
106
97
|
this._joinRoomSuccess = true;
|
|
107
|
-
|
|
98
|
+
this._chatRoomControl?.join();
|
|
108
99
|
this._userControl = new _userControl.FcrUserControlImpl(this._scene, this._api, this._sharedCache);
|
|
109
100
|
this._streamControl = new _streamControl.FcrStreamControlImpl(this._engine, this._scene, this._api, this._sharedCache);
|
|
110
101
|
this._roomSessionControl = new _roomSession.FcrRoomSessionControlImpl(this, this._api, localUser.getLocalUserId());
|
|
@@ -135,25 +126,22 @@ class FcrBaseRoomControlImpl {
|
|
|
135
126
|
this._observable.notifyObservers('onRoomMessageReceived', sceneId, message);
|
|
136
127
|
const payload = message.payload;
|
|
137
128
|
if (message.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_ROUTE_SWITCH) {
|
|
138
|
-
|
|
139
|
-
const localUserRole = (_this$_userControl = this._userControl) === null || _this$_userControl === void 0 ? void 0 : _this$_userControl.getLocalUser().userRole;
|
|
129
|
+
const localUserRole = this._userControl?.getLocalUser().userRole;
|
|
140
130
|
if (localUserRole && payload.targetRoles.includes(_type.FcrUserRoleToStringMap[localUserRole])) {
|
|
141
|
-
var _this$_userControl2;
|
|
142
131
|
this._observable.notifyObservers('onRoomRouteSwitched', {
|
|
143
132
|
targetRouting: {
|
|
144
133
|
roomId: payload.toRoom.roomUuid,
|
|
145
134
|
roomType: payload.toRoom.roomType,
|
|
146
135
|
isJoined: false
|
|
147
136
|
},
|
|
148
|
-
operatorUser:
|
|
137
|
+
operatorUser: this._userControl?.getUser(message.senderId)
|
|
149
138
|
});
|
|
150
139
|
this.leave();
|
|
151
140
|
}
|
|
152
141
|
}
|
|
153
142
|
},
|
|
154
143
|
onScenePropertiesUpdated: async (sceneId, event) => {
|
|
155
|
-
|
|
156
|
-
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.CLOUD_RECORDING) {
|
|
144
|
+
if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.CLOUD_RECORDING) {
|
|
157
145
|
const {
|
|
158
146
|
state,
|
|
159
147
|
ready,
|
|
@@ -162,7 +150,7 @@ class FcrBaseRoomControlImpl {
|
|
|
162
150
|
const recordState = this._formatRecordingState(state, ready, onhold);
|
|
163
151
|
this._observable.notifyObservers('onCloudRecordingStateUpdated', sceneId, recordState);
|
|
164
152
|
}
|
|
165
|
-
if (
|
|
153
|
+
if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_STATE_UPDATE) {
|
|
166
154
|
const schedule = event.changedProperties.schedule;
|
|
167
155
|
if (schedule.state === _helpers.ROOM_STATE_VALUES.ENDED) {
|
|
168
156
|
this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
@@ -170,7 +158,7 @@ class FcrBaseRoomControlImpl {
|
|
|
170
158
|
}
|
|
171
159
|
this._observable.notifyObservers('onRoomStateUpdated', sceneId, schedule.state);
|
|
172
160
|
}
|
|
173
|
-
if (
|
|
161
|
+
if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
174
162
|
const changedProperties = {};
|
|
175
163
|
for (const key in event.changedProperties) {
|
|
176
164
|
if (key.startsWith('flexProps')) {
|
|
@@ -179,17 +167,17 @@ class FcrBaseRoomControlImpl {
|
|
|
179
167
|
}
|
|
180
168
|
if (Object.keys(changedProperties).length > 0) {
|
|
181
169
|
const structure = (0, _collection.convertToStructure)(changedProperties);
|
|
182
|
-
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId,
|
|
170
|
+
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, {
|
|
171
|
+
...event,
|
|
183
172
|
changedProperties: structure['flexProps']
|
|
184
|
-
})
|
|
173
|
+
});
|
|
185
174
|
}
|
|
186
175
|
}
|
|
187
|
-
if (
|
|
188
|
-
var _event$cause5;
|
|
176
|
+
if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.LIVE_STREAMING_UPDATE) {
|
|
189
177
|
let liveStreamingState = _type.FcrLiveStreamingState.STOPPED;
|
|
190
178
|
let state = this._scene.getScenePropertiesByKeyPath('live.state');
|
|
191
179
|
let pageUrl = this._scene.getScenePropertiesByKeyPath('live.pageUrl');
|
|
192
|
-
const reason =
|
|
180
|
+
const reason = event.cause?.data?.reason;
|
|
193
181
|
if (state === _helpers.LIVE_STREAMING_STATE_VALUES.STARTED) {
|
|
194
182
|
liveStreamingState = _type.FcrLiveStreamingState.STARTED;
|
|
195
183
|
}
|
|
@@ -200,8 +188,7 @@ class FcrBaseRoomControlImpl {
|
|
|
200
188
|
}
|
|
201
189
|
},
|
|
202
190
|
onScenePropertiesDeleted: (sceneId, event) => {
|
|
203
|
-
|
|
204
|
-
if (((_event$cause6 = event.cause) === null || _event$cause6 === void 0 ? void 0 : _event$cause6.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
191
|
+
if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
205
192
|
this._observable.notifyObservers('onRoomPropertiesDeleted', sceneId, event);
|
|
206
193
|
}
|
|
207
194
|
},
|
|
@@ -212,8 +199,7 @@ class FcrBaseRoomControlImpl {
|
|
|
212
199
|
this._observable.notifyObservers('onNetworkStatsUpdated', sceneId, stats);
|
|
213
200
|
},
|
|
214
201
|
onUserPropertiesUpdated: (_, event) => {
|
|
215
|
-
|
|
216
|
-
if (((_event$cause7 = event.cause) === null || _event$cause7 === void 0 ? void 0 : _event$cause7.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.USER_KICK_OUT && event.modifiedUser.userId === this._scene.localUser.getLocalUserId()) {
|
|
202
|
+
if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.USER_KICK_OUT && event.modifiedUser.userId === this._scene.localUser.getLocalUserId()) {
|
|
217
203
|
this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
218
204
|
this._cleanup();
|
|
219
205
|
}
|
|
@@ -304,17 +290,16 @@ class FcrBaseRoomControlImpl {
|
|
|
304
290
|
* @returns 房间信息,如果未加入房间则返回 undefined
|
|
305
291
|
*/
|
|
306
292
|
getRoomInfo() {
|
|
307
|
-
var _userProperties$info, _passwordInfo$payload;
|
|
308
293
|
const sceneInfo = this._scene.getSceneInfo();
|
|
309
294
|
const passwordInfo = this._scene.getScenePropertiesByKeyPath('security.password');
|
|
310
295
|
const userProperties = this._scene.getUserPropertiesByUserId(this._scene.localUser.getLocalUserId());
|
|
311
|
-
const shareLink = userProperties
|
|
296
|
+
const shareLink = userProperties?.info?.shareLink;
|
|
312
297
|
const label = this._scene.getScenePropertiesByKeyPath('label');
|
|
313
298
|
return sceneInfo ? {
|
|
314
299
|
roomId: sceneInfo.sceneId,
|
|
315
300
|
roomName: sceneInfo.sceneName,
|
|
316
301
|
roomType: this._roomType,
|
|
317
|
-
password: passwordInfo
|
|
302
|
+
password: passwordInfo?.payload?.text,
|
|
318
303
|
inviteLink: shareLink,
|
|
319
304
|
label
|
|
320
305
|
} : void 0;
|
|
@@ -327,13 +312,13 @@ class FcrBaseRoomControlImpl {
|
|
|
327
312
|
* @throws {FcrError} 如果未加入房间
|
|
328
313
|
*/
|
|
329
314
|
getRoomSchedule() {
|
|
330
|
-
var _schedule$duration, _schedule$startTime;
|
|
331
315
|
(0, _helpers.validateRoomJoined)(this._joinRoomSuccess, 'get schedule info');
|
|
332
316
|
const schedule = this._scene.getScenePropertiesByKeyPath('schedule');
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
317
|
+
return {
|
|
318
|
+
...schedule,
|
|
319
|
+
duration: schedule.duration ?? 0,
|
|
320
|
+
startTime: Math.floor((schedule.startTime ?? 0) / 1000)
|
|
321
|
+
};
|
|
337
322
|
}
|
|
338
323
|
/**
|
|
339
324
|
* 加入房间
|
|
@@ -418,7 +403,7 @@ class FcrBaseRoomControlImpl {
|
|
|
418
403
|
async _handleRobotUserSetup(options) {
|
|
419
404
|
if (options.userRole === _type.FcrUserRole.ROBOT) {
|
|
420
405
|
const res = (0, _error.handleRequestError)(() => this._api.setCloudRecordingReady(this._scene.sceneId), _error.FcrErrorModuleCode.ROOM, 'set cloud recording ready failed');
|
|
421
|
-
this.logger.info(
|
|
406
|
+
this.logger.info(`set cloud recording ready, response: ${(0, _imports.jsonstring)(res)}`);
|
|
422
407
|
}
|
|
423
408
|
}
|
|
424
409
|
|
|
@@ -427,7 +412,7 @@ class FcrBaseRoomControlImpl {
|
|
|
427
412
|
* @private
|
|
428
413
|
*/
|
|
429
414
|
_handleJoinFailure(error) {
|
|
430
|
-
this.logger.error(
|
|
415
|
+
this.logger.error(`加入房间失败: ${error.message}`);
|
|
431
416
|
this._observable.notifyObservers('onJoinRoomFailure', this._scene.sceneId, error);
|
|
432
417
|
}
|
|
433
418
|
|
|
@@ -567,9 +552,9 @@ class FcrBaseRoomControlImpl {
|
|
|
567
552
|
this._scene.removeObserver(this._sceneObserver);
|
|
568
553
|
this._engine.removeObserver(this._engineObserver);
|
|
569
554
|
try {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
555
|
+
return await Promise.all([
|
|
556
|
+
// @ts-ignore
|
|
557
|
+
this._chatRoomControl?.leave(),
|
|
573
558
|
// this._whiteboardControl?.close(),
|
|
574
559
|
this._scene.leave()]);
|
|
575
560
|
} finally {
|
|
@@ -608,7 +593,5 @@ class FcrBaseRoomControlImpl {
|
|
|
608
593
|
* @internal
|
|
609
594
|
*/
|
|
610
595
|
exports.FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
|
|
611
|
-
_FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
|
|
612
|
-
[_initProto] = _applyDecs(_FcrBaseRoomControlImpl, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_imports.trace, 2, "start"], [_imports.trace, 2, "end"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getRoomState"], [_imports.trace, 2, "getRoomProperties"], [_imports.trace, 2, "getRoomPropertiesByKeyPath"], [_imports.trace, 2, "updateRoomProperties"], [_imports.trace, 2, "updateIncrementRoomProperties"], [_imports.trace, 2, "deleteRoomProperties"], [_imports.trace, 2, "startCloudRecording"], [_imports.trace, 2, "pauseCloudRecording"], [_imports.trace, 2, "resumeCloudRecording"], [_imports.trace, 2, "stopCloudRecording"], [_imports.trace, 2, "getLiveStreamingState"], [_imports.trace, 2, "getLiveStreamingConfig"], [_imports.trace, 2, "startLiveStreaming"], [_imports.trace, 2, "updateLiveStreamingLayout"], [_imports.trace, 2, "stopLiveStreaming"], [_imports.trace, 2, "getCloudRecordingState"], [_imports.trace, 2, "sendRoomMessage"]], []).e;
|
|
613
596
|
class FcrSubRoomControlImpl extends FcrBaseRoomControlImpl {}
|
|
614
597
|
exports.FcrSubRoomControlImpl = FcrSubRoomControlImpl;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/es.array.push.js");
|
|
6
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
7
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
@@ -26,8 +24,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
26
24
|
exports.FcrInterpreterControlImpl = void 0;
|
|
27
25
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
28
26
|
require("core-js/modules/esnext.iterator.map.js");
|
|
29
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
30
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
27
|
var _imports = require("../../imports");
|
|
32
28
|
var _room = require("./room");
|
|
33
29
|
var _types = require("./types");
|
|
@@ -36,25 +32,26 @@ var _logger = require("../../utilities/logger");
|
|
|
36
32
|
var _error = require("../../utilities/error");
|
|
37
33
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
38
34
|
var _schema = require("../../schema");
|
|
39
|
-
|
|
40
|
-
let _initProto, _createRoomControlDecs, _setInterpreterUsersDecs, _ref;
|
|
35
|
+
let _initProto, _createRoomControlDecs, _setInterpreterUsersDecs;
|
|
41
36
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
42
37
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
43
38
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
44
39
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
45
40
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
46
|
-
_ref = (_createRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setInterpreterUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrInterpreterUsersParamsArraySchema)], "logger");
|
|
47
41
|
/**
|
|
48
42
|
* @internal
|
|
49
43
|
*/
|
|
50
44
|
class FcrInterpreterControlImpl {
|
|
45
|
+
static {
|
|
46
|
+
[_initProto] = _applyDecs(this, [[_createRoomControlDecs, 2, "createRoomControl"], [_setInterpreterUsersDecs, 2, "setInterpreterUsers"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getState"], [_imports.trace, 2, "getInterpreterRoomList"], [_imports.trace, 2, "getInterpreterLanguageList"]], []).e;
|
|
47
|
+
}
|
|
48
|
+
//@internal
|
|
49
|
+
[(_createRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setInterpreterUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrInterpreterUsersParamsArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
50
|
+
prefix: 'FcrInterpreterControlImpl'
|
|
51
|
+
}));
|
|
52
|
+
_observable = new _imports.AgoraObservable();
|
|
53
|
+
_interpreterUserList = null;
|
|
51
54
|
constructor(_api, _scene, _config, _engine, _chatConnection, _sharedCache) {
|
|
52
|
-
//@internal
|
|
53
|
-
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
54
|
-
prefix: 'FcrInterpreterControlImpl'
|
|
55
|
-
})));
|
|
56
|
-
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
57
|
-
(0, _defineProperty2.default)(this, "_interpreterUserList", null);
|
|
58
55
|
this._api = _api;
|
|
59
56
|
this._scene = _scene;
|
|
60
57
|
this._config = _config;
|
|
@@ -74,12 +71,11 @@ class FcrInterpreterControlImpl {
|
|
|
74
71
|
await (0, _error.handleRequestError)(() => this._api.openInterpreter({
|
|
75
72
|
roomId: this._roomId,
|
|
76
73
|
data: {
|
|
77
|
-
interpreters: params.map(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
} = _ref2;
|
|
74
|
+
interpreters: params.map(({
|
|
75
|
+
userId: userUuid,
|
|
76
|
+
sourceLanguage,
|
|
77
|
+
targetLanguage
|
|
78
|
+
}) => {
|
|
83
79
|
return {
|
|
84
80
|
userUuid,
|
|
85
81
|
languagePair: [sourceLanguage, targetLanguage]
|
|
@@ -101,16 +97,13 @@ class FcrInterpreterControlImpl {
|
|
|
101
97
|
}
|
|
102
98
|
getInterpreterRoomList() {
|
|
103
99
|
const rooms = this._scene.getScenePropertiesByKeyPath('interpreter.rooms') || [];
|
|
104
|
-
return rooms.length > 0 ? rooms.map(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
language
|
|
112
|
-
};
|
|
113
|
-
}) : null;
|
|
100
|
+
return rooms.length > 0 ? rooms.map(({
|
|
101
|
+
roomUuid,
|
|
102
|
+
language
|
|
103
|
+
}) => ({
|
|
104
|
+
roomId: roomUuid,
|
|
105
|
+
language
|
|
106
|
+
})) : null;
|
|
114
107
|
}
|
|
115
108
|
_setInterpreterUserList() {
|
|
116
109
|
const interpreter = this._scene.getScenePropertiesByKeyPath('interpreter');
|
|
@@ -119,19 +112,16 @@ class FcrInterpreterControlImpl {
|
|
|
119
112
|
} = interpreter || {
|
|
120
113
|
translates: []
|
|
121
114
|
};
|
|
122
|
-
const results = translates.map(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
targetLanguage
|
|
133
|
-
};
|
|
134
|
-
});
|
|
115
|
+
const results = translates.map(({
|
|
116
|
+
userUuid: userId,
|
|
117
|
+
userName,
|
|
118
|
+
languagePair: [sourceLanguage, targetLanguage]
|
|
119
|
+
}) => ({
|
|
120
|
+
userId,
|
|
121
|
+
userName,
|
|
122
|
+
sourceLanguage,
|
|
123
|
+
targetLanguage
|
|
124
|
+
}));
|
|
135
125
|
this._interpreterUserList = results.length > 0 ? results : null;
|
|
136
126
|
}
|
|
137
127
|
getInterpreterUserList() {
|
|
@@ -150,8 +140,7 @@ class FcrInterpreterControlImpl {
|
|
|
150
140
|
_addInterpreterObservers() {
|
|
151
141
|
this._scene.addObserver({
|
|
152
142
|
onScenePropertiesUpdated: (_, event) => {
|
|
153
|
-
|
|
154
|
-
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 800) {
|
|
143
|
+
if (event.cause?.cmd === 800) {
|
|
155
144
|
const actionType = (0, _imports.get)(event.cause.data, 'actionType');
|
|
156
145
|
let operatorUser;
|
|
157
146
|
if (event.operatorUser) {
|
|
@@ -185,6 +174,4 @@ class FcrInterpreterControlImpl {
|
|
|
185
174
|
'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated', 'onInterpreterStateUpdated', 'onInterpreterUsersUpdated', 'onInterpreterRoomListUpdated']));
|
|
186
175
|
}
|
|
187
176
|
}
|
|
188
|
-
exports.FcrInterpreterControlImpl = FcrInterpreterControlImpl;
|
|
189
|
-
_FcrInterpreterControlImpl = FcrInterpreterControlImpl;
|
|
190
|
-
[_initProto] = _applyDecs(_FcrInterpreterControlImpl, [[_createRoomControlDecs, 2, "createRoomControl"], [_setInterpreterUsersDecs, 2, "setInterpreterUsers"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getState"], [_imports.trace, 2, "getInterpreterRoomList"], [_imports.trace, 2, "getInterpreterLanguageList"]], []).e;
|
|
177
|
+
exports.FcrInterpreterControlImpl = FcrInterpreterControlImpl;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.FcrInterpreterRoomControlImpl = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _ = require("..");
|
|
10
8
|
var _type = require("../type");
|
|
11
9
|
var _logger = require("../../utilities/logger");
|
|
@@ -13,12 +11,12 @@ var _logger = require("../../utilities/logger");
|
|
|
13
11
|
* @internal
|
|
14
12
|
*/
|
|
15
13
|
class FcrInterpreterRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
14
|
+
//@internal
|
|
15
|
+
logger = (0, _logger.createLogger)({
|
|
16
|
+
prefix: 'FcrInterpreterRoomControlImpl'
|
|
17
|
+
});
|
|
16
18
|
constructor(_engine, _scene, _api, _config, _sharedCache, _chatConnection, chatRoomControl) {
|
|
17
19
|
super(_engine, _scene, _api, _config, _type.FcrRoomType.Interpreterroom, _chatConnection, _sharedCache, chatRoomControl);
|
|
18
|
-
//@internal
|
|
19
|
-
(0, _defineProperty2.default)(this, "logger", (0, _logger.createLogger)({
|
|
20
|
-
prefix: 'FcrInterpreterRoomControlImpl'
|
|
21
|
-
}));
|
|
22
20
|
this._engine = _engine;
|
|
23
21
|
this._scene = _scene;
|
|
24
22
|
this._api = _api;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.FcrJoinBeforeHostWaitingRoomControlImpl = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _ = require("..");
|
|
10
8
|
var _type = require("../type");
|
|
11
9
|
var _logger = require("../../utilities/logger");
|
|
@@ -13,12 +11,12 @@ var _logger = require("../../utilities/logger");
|
|
|
13
11
|
* @internal
|
|
14
12
|
*/
|
|
15
13
|
class FcrJoinBeforeHostWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
14
|
+
//@internal
|
|
15
|
+
logger = (0, _logger.createLogger)({
|
|
16
|
+
prefix: 'FcrJoinBeforeHostWaitingRoomControlImpl'
|
|
17
|
+
});
|
|
16
18
|
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
|
|
17
19
|
super(engine, scene, api, config, _type.FcrRoomType.JoinBeforeHostWaitingRoom, chatConnection, sharedCache, chatRoomControl);
|
|
18
|
-
//@internal
|
|
19
|
-
(0, _defineProperty2.default)(this, "logger", (0, _logger.createLogger)({
|
|
20
|
-
prefix: 'FcrJoinBeforeHostWaitingRoomControlImpl'
|
|
21
|
-
}));
|
|
22
20
|
this._addLogObserver();
|
|
23
21
|
}
|
|
24
22
|
addObserver(observer) {
|