fcr-core 3.7.5 → 3.7.7-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chat-connection/index.js +34 -20
- package/lib/engine/index.js +62 -69
- package/lib/imports.js +1 -0
- package/lib/media-control/desktop.js +13 -8
- package/lib/media-control/mobile.js +17 -12
- package/lib/monitor-control/index.js +9 -4
- package/lib/peer-session/index.js +47 -38
- package/lib/plugins/chatroom.js +217 -202
- package/lib/room-control/ability-control/index.js +13 -8
- package/lib/room-control/group-control/index.js +20 -15
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +53 -36
- package/lib/room-control/interpreter-control/index.js +23 -17
- package/lib/room-control/interpreter-control/room.js +6 -4
- package/lib/room-control/join-before-host-waitingroom-control/index.js +6 -4
- package/lib/room-control/mainroom-control/index.js +24 -16
- package/lib/room-control/privilege-control/helper.js +8 -5
- package/lib/room-control/privilege-control/index.js +25 -18
- package/lib/room-control/room-connector-control/index.js +22 -15
- package/lib/room-control/room-control-factory.js +2 -1
- package/lib/room-control/room-session/index.js +47 -38
- package/lib/room-control/shared-cache.js +36 -29
- package/lib/room-control/sharing-control/index.js +40 -29
- package/lib/room-control/stream-control/index.js +177 -172
- package/lib/room-control/user-control/index.js +142 -135
- package/lib/room-control/waitingroom-control/index.js +13 -8
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +25 -18
- package/lib/room-control/whiteboard-control-v2/annotation-control/index.js +26 -15
- package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.js +62 -52
- package/lib/room-control/whiteboard-control-v2/index.js +35 -24
- package/lib/room-control/whiteboard-control-v2/main-window.js +27 -22
- package/lib/room-control/whiteboard-control-v2/utils.js +5 -5
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +32 -23
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +5 -3
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.js +53 -41
- package/lib/room-router/index.js +67 -34
- package/lib/room-router/type.d.ts +4 -0
- package/lib/service/api.d.ts +12 -1
- package/lib/service/api.js +98 -88
- package/lib/utilities/collection.js +3 -2
- package/lib/utilities/error-helpers.js +32 -26
- package/lib/utilities/error.js +9 -8
- package/lib/utilities/join-helper.js +22 -18
- package/lib/utilities/logger.js +2 -2
- package/lib/utilities/parameters.js +8 -4
- package/lib/utilities/retry-helpers.js +1 -0
- package/lib/utilities/shared-storage.js +1 -0
- package/lib/utilities/storage.js +1 -0
- package/lib/utilities/stream.js +16 -11
- package/lib/utilities/user.js +4 -3
- package/lib/utilities/validate-params.js +2 -1
- package/package.json +4 -4
|
@@ -1,5 +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");
|
|
3
5
|
require("core-js/modules/esnext.function.metadata.js");
|
|
4
6
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
5
7
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -25,28 +27,29 @@ require("core-js/modules/esnext.map.merge.js");
|
|
|
25
27
|
require("core-js/modules/esnext.map.reduce.js");
|
|
26
28
|
require("core-js/modules/esnext.map.some.js");
|
|
27
29
|
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"));
|
|
28
32
|
var _imports = require("../../imports");
|
|
29
33
|
var _user = require("../../utilities/user");
|
|
30
34
|
var _logger = require("../../utilities/logger");
|
|
31
35
|
var _error = require("../../utilities/error");
|
|
32
36
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
33
37
|
var _schema = require("../../schema");
|
|
34
|
-
var
|
|
35
|
-
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs;
|
|
38
|
+
var _FcrGroupControl;
|
|
39
|
+
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs, _ref;
|
|
36
40
|
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)]; } }; }
|
|
37
41
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
38
42
|
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); }
|
|
39
43
|
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; }
|
|
40
44
|
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");
|
|
41
46
|
class FcrGroupControl {
|
|
42
|
-
//@internal
|
|
43
|
-
[(_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)({
|
|
44
|
-
prefix: 'FcrGroupControl'
|
|
45
|
-
})))();
|
|
46
|
-
//@internal
|
|
47
|
-
|
|
48
|
-
_observable = (() => new _imports.AgoraObservable())();
|
|
49
47
|
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());
|
|
50
53
|
this._engine = _engine;
|
|
51
54
|
this._scene = _scene;
|
|
52
55
|
this._api = _api;
|
|
@@ -58,7 +61,8 @@ class FcrGroupControl {
|
|
|
58
61
|
_addSceneObserver() {
|
|
59
62
|
const observer = {
|
|
60
63
|
onScenePropertiesUpdated: (sceneId, event) => {
|
|
61
|
-
|
|
64
|
+
var _event$cause;
|
|
65
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 11) {
|
|
62
66
|
const data = event.cause.data;
|
|
63
67
|
const changedProperties = event.changedProperties;
|
|
64
68
|
const groupDetails = changedProperties.groups.details;
|
|
@@ -86,7 +90,8 @@ class FcrGroupControl {
|
|
|
86
90
|
this._observable.notifyObservers('onGroupsUpdated', groupEvents);
|
|
87
91
|
}
|
|
88
92
|
if (data.actionType === 4) {
|
|
89
|
-
|
|
93
|
+
var _data$changeGroups, _data$changeGroups2, _data$changeGroups3;
|
|
94
|
+
(_data$changeGroups = data.changeGroups) === null || _data$changeGroups === void 0 || _data$changeGroups.forEach(group => {
|
|
90
95
|
const {
|
|
91
96
|
removeUsers,
|
|
92
97
|
groupUuid
|
|
@@ -107,7 +112,7 @@ class FcrGroupControl {
|
|
|
107
112
|
}
|
|
108
113
|
});
|
|
109
114
|
const toGroupMap = new Map();
|
|
110
|
-
data.changeGroups
|
|
115
|
+
(_data$changeGroups2 = data.changeGroups) === null || _data$changeGroups2 === void 0 || _data$changeGroups2.forEach(group => {
|
|
111
116
|
const {
|
|
112
117
|
removeUsers
|
|
113
118
|
} = group;
|
|
@@ -150,7 +155,7 @@ class FcrGroupControl {
|
|
|
150
155
|
};
|
|
151
156
|
}));
|
|
152
157
|
});
|
|
153
|
-
data.changeGroups
|
|
158
|
+
(_data$changeGroups3 = data.changeGroups) === null || _data$changeGroups3 === void 0 || _data$changeGroups3.forEach(group => {
|
|
154
159
|
const {
|
|
155
160
|
addUsers,
|
|
156
161
|
groupUuid
|
|
@@ -256,7 +261,7 @@ class FcrGroupControl {
|
|
|
256
261
|
_addLogObserver() {
|
|
257
262
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onGroupsAdded', 'onGroupsUpdated', 'onGroupsRemoved', 'onUserListAddedToGroup', 'onUserListRemovedFromGroup', 'onUserListMoveToGroup']));
|
|
258
263
|
}
|
|
259
|
-
static #_ = (() => _staticBlock = () => [_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)();
|
|
260
264
|
}
|
|
261
265
|
exports.FcrGroupControl = FcrGroupControl;
|
|
262
|
-
|
|
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;
|
|
@@ -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("".concat(operation, ", please join room first"));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
|
3
5
|
require("core-js/modules/es.array.push.js");
|
|
4
6
|
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");
|
|
5
10
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
6
11
|
require("core-js/modules/esnext.map.emplace.js");
|
|
7
12
|
require("core-js/modules/esnext.map.every.js");
|
|
@@ -17,10 +22,13 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
17
22
|
require("core-js/modules/esnext.map.some.js");
|
|
18
23
|
require("core-js/modules/esnext.map.update.js");
|
|
19
24
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
25
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
20
26
|
Object.defineProperty(exports, "__esModule", {
|
|
21
27
|
value: true
|
|
22
28
|
});
|
|
23
29
|
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"));
|
|
24
32
|
var _imports = require("../imports");
|
|
25
33
|
var _type = require("../type");
|
|
26
34
|
var _type2 = require("./type");
|
|
@@ -37,7 +45,7 @@ var _logger = require("../utilities/logger");
|
|
|
37
45
|
var _2 = require("..");
|
|
38
46
|
var _helpers = require("./helpers");
|
|
39
47
|
var _errorHelpers = require("../utilities/error-helpers");
|
|
40
|
-
var
|
|
48
|
+
var _FcrBaseRoomControlImpl;
|
|
41
49
|
let _initProto; // Core SDK imports
|
|
42
50
|
// Service and API imports
|
|
43
51
|
// Type definitions
|
|
@@ -46,6 +54,8 @@ let _initProto; // Core SDK imports
|
|
|
46
54
|
// Error handling and utilities
|
|
47
55
|
// Core state
|
|
48
56
|
// 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; }
|
|
49
59
|
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)]; } }; }
|
|
50
60
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
51
61
|
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); }
|
|
@@ -60,15 +70,15 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
60
70
|
* @internal
|
|
61
71
|
*/
|
|
62
72
|
class FcrBaseRoomControlImpl {
|
|
63
|
-
//@internal
|
|
64
|
-
logger = (() => (_initProto(this), (0, _logger.createLogger)({
|
|
65
|
-
prefix: 'FcrBaseRoomControlImpl'
|
|
66
|
-
})))();
|
|
67
|
-
_observable = (() => new _imports.AgoraObservable())();
|
|
68
|
-
_joinRoomSuccess = false;
|
|
69
|
-
_joining = false;
|
|
70
|
-
_joinState = (() => _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED)();
|
|
71
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);
|
|
72
82
|
this._engine = _engine;
|
|
73
83
|
this._scene = _scene;
|
|
74
84
|
this._api = _api;
|
|
@@ -92,8 +102,9 @@ class FcrBaseRoomControlImpl {
|
|
|
92
102
|
};
|
|
93
103
|
this._sceneObserver = {
|
|
94
104
|
onJoinSceneSuccess: (sceneId, localUser) => {
|
|
105
|
+
var _this$_chatRoomContro;
|
|
95
106
|
this._joinRoomSuccess = true;
|
|
96
|
-
this._chatRoomControl
|
|
107
|
+
(_this$_chatRoomContro = this._chatRoomControl) === null || _this$_chatRoomContro === void 0 || _this$_chatRoomContro.join();
|
|
97
108
|
this._userControl = new _userControl.FcrUserControlImpl(this._scene, this._api, this._sharedCache);
|
|
98
109
|
this._streamControl = new _streamControl.FcrStreamControlImpl(this._engine, this._scene, this._api, this._sharedCache);
|
|
99
110
|
this._roomSessionControl = new _roomSession.FcrRoomSessionControlImpl(this, this._api, localUser.getLocalUserId());
|
|
@@ -124,22 +135,25 @@ class FcrBaseRoomControlImpl {
|
|
|
124
135
|
this._observable.notifyObservers('onRoomMessageReceived', sceneId, message);
|
|
125
136
|
const payload = message.payload;
|
|
126
137
|
if (message.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_ROUTE_SWITCH) {
|
|
127
|
-
|
|
138
|
+
var _this$_userControl;
|
|
139
|
+
const localUserRole = (_this$_userControl = this._userControl) === null || _this$_userControl === void 0 ? void 0 : _this$_userControl.getLocalUser().userRole;
|
|
128
140
|
if (localUserRole && payload.targetRoles.includes(_type.FcrUserRoleToStringMap[localUserRole])) {
|
|
141
|
+
var _this$_userControl2;
|
|
129
142
|
this._observable.notifyObservers('onRoomRouteSwitched', {
|
|
130
143
|
targetRouting: {
|
|
131
144
|
roomId: payload.toRoom.roomUuid,
|
|
132
145
|
roomType: payload.toRoom.roomType,
|
|
133
146
|
isJoined: false
|
|
134
147
|
},
|
|
135
|
-
operatorUser: this._userControl
|
|
148
|
+
operatorUser: (_this$_userControl2 = this._userControl) === null || _this$_userControl2 === void 0 ? void 0 : _this$_userControl2.getUser(message.senderId)
|
|
136
149
|
});
|
|
137
150
|
this.leave();
|
|
138
151
|
}
|
|
139
152
|
}
|
|
140
153
|
},
|
|
141
154
|
onScenePropertiesUpdated: async (sceneId, event) => {
|
|
142
|
-
|
|
155
|
+
var _event$cause, _event$cause2, _event$cause3, _event$cause4;
|
|
156
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.CLOUD_RECORDING) {
|
|
143
157
|
const {
|
|
144
158
|
state,
|
|
145
159
|
ready,
|
|
@@ -148,7 +162,7 @@ class FcrBaseRoomControlImpl {
|
|
|
148
162
|
const recordState = this._formatRecordingState(state, ready, onhold);
|
|
149
163
|
this._observable.notifyObservers('onCloudRecordingStateUpdated', sceneId, recordState);
|
|
150
164
|
}
|
|
151
|
-
if (event.cause
|
|
165
|
+
if (((_event$cause2 = event.cause) === null || _event$cause2 === void 0 ? void 0 : _event$cause2.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_STATE_UPDATE) {
|
|
152
166
|
const schedule = event.changedProperties.schedule;
|
|
153
167
|
if (schedule.state === _helpers.ROOM_STATE_VALUES.ENDED) {
|
|
154
168
|
this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
@@ -156,7 +170,7 @@ class FcrBaseRoomControlImpl {
|
|
|
156
170
|
}
|
|
157
171
|
this._observable.notifyObservers('onRoomStateUpdated', sceneId, schedule.state);
|
|
158
172
|
}
|
|
159
|
-
if (event.cause
|
|
173
|
+
if (((_event$cause3 = event.cause) === null || _event$cause3 === void 0 ? void 0 : _event$cause3.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
160
174
|
const changedProperties = {};
|
|
161
175
|
for (const key in event.changedProperties) {
|
|
162
176
|
if (key.startsWith('flexProps')) {
|
|
@@ -165,17 +179,17 @@ class FcrBaseRoomControlImpl {
|
|
|
165
179
|
}
|
|
166
180
|
if (Object.keys(changedProperties).length > 0) {
|
|
167
181
|
const structure = (0, _collection.convertToStructure)(changedProperties);
|
|
168
|
-
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, {
|
|
169
|
-
...event,
|
|
182
|
+
this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, _objectSpread(_objectSpread({}, event), {}, {
|
|
170
183
|
changedProperties: structure['flexProps']
|
|
171
|
-
});
|
|
184
|
+
}));
|
|
172
185
|
}
|
|
173
186
|
}
|
|
174
|
-
if (event.cause
|
|
187
|
+
if (((_event$cause4 = event.cause) === null || _event$cause4 === void 0 ? void 0 : _event$cause4.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.LIVE_STREAMING_UPDATE) {
|
|
188
|
+
var _event$cause5;
|
|
175
189
|
let liveStreamingState = _type.FcrLiveStreamingState.STOPPED;
|
|
176
190
|
let state = this._scene.getScenePropertiesByKeyPath('live.state');
|
|
177
191
|
let pageUrl = this._scene.getScenePropertiesByKeyPath('live.pageUrl');
|
|
178
|
-
const reason = event.cause
|
|
192
|
+
const reason = (_event$cause5 = event.cause) === null || _event$cause5 === void 0 || (_event$cause5 = _event$cause5.data) === null || _event$cause5 === void 0 ? void 0 : _event$cause5.reason;
|
|
179
193
|
if (state === _helpers.LIVE_STREAMING_STATE_VALUES.STARTED) {
|
|
180
194
|
liveStreamingState = _type.FcrLiveStreamingState.STARTED;
|
|
181
195
|
}
|
|
@@ -186,7 +200,8 @@ class FcrBaseRoomControlImpl {
|
|
|
186
200
|
}
|
|
187
201
|
},
|
|
188
202
|
onScenePropertiesDeleted: (sceneId, event) => {
|
|
189
|
-
|
|
203
|
+
var _event$cause6;
|
|
204
|
+
if (((_event$cause6 = event.cause) === null || _event$cause6 === void 0 ? void 0 : _event$cause6.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
|
|
190
205
|
this._observable.notifyObservers('onRoomPropertiesDeleted', sceneId, event);
|
|
191
206
|
}
|
|
192
207
|
},
|
|
@@ -197,7 +212,8 @@ class FcrBaseRoomControlImpl {
|
|
|
197
212
|
this._observable.notifyObservers('onNetworkStatsUpdated', sceneId, stats);
|
|
198
213
|
},
|
|
199
214
|
onUserPropertiesUpdated: (_, event) => {
|
|
200
|
-
|
|
215
|
+
var _event$cause7;
|
|
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()) {
|
|
201
217
|
this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
202
218
|
this._cleanup();
|
|
203
219
|
}
|
|
@@ -288,16 +304,17 @@ class FcrBaseRoomControlImpl {
|
|
|
288
304
|
* @returns 房间信息,如果未加入房间则返回 undefined
|
|
289
305
|
*/
|
|
290
306
|
getRoomInfo() {
|
|
307
|
+
var _userProperties$info, _passwordInfo$payload;
|
|
291
308
|
const sceneInfo = this._scene.getSceneInfo();
|
|
292
309
|
const passwordInfo = this._scene.getScenePropertiesByKeyPath('security.password');
|
|
293
310
|
const userProperties = this._scene.getUserPropertiesByUserId(this._scene.localUser.getLocalUserId());
|
|
294
|
-
const shareLink = userProperties
|
|
311
|
+
const shareLink = userProperties === null || userProperties === void 0 || (_userProperties$info = userProperties.info) === null || _userProperties$info === void 0 ? void 0 : _userProperties$info.shareLink;
|
|
295
312
|
const label = this._scene.getScenePropertiesByKeyPath('label');
|
|
296
313
|
return sceneInfo ? {
|
|
297
314
|
roomId: sceneInfo.sceneId,
|
|
298
315
|
roomName: sceneInfo.sceneName,
|
|
299
316
|
roomType: this._roomType,
|
|
300
|
-
password: passwordInfo
|
|
317
|
+
password: passwordInfo === null || passwordInfo === void 0 || (_passwordInfo$payload = passwordInfo.payload) === null || _passwordInfo$payload === void 0 ? void 0 : _passwordInfo$payload.text,
|
|
301
318
|
inviteLink: shareLink,
|
|
302
319
|
label
|
|
303
320
|
} : void 0;
|
|
@@ -310,13 +327,13 @@ class FcrBaseRoomControlImpl {
|
|
|
310
327
|
* @throws {FcrError} 如果未加入房间
|
|
311
328
|
*/
|
|
312
329
|
getRoomSchedule() {
|
|
330
|
+
var _schedule$duration, _schedule$startTime;
|
|
313
331
|
(0, _helpers.validateRoomJoined)(this._joinRoomSuccess, 'get schedule info');
|
|
314
332
|
const schedule = this._scene.getScenePropertiesByKeyPath('schedule');
|
|
315
|
-
return {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
};
|
|
333
|
+
return _objectSpread(_objectSpread({}, schedule), {}, {
|
|
334
|
+
duration: (_schedule$duration = schedule.duration) !== null && _schedule$duration !== void 0 ? _schedule$duration : 0,
|
|
335
|
+
startTime: Math.floor(((_schedule$startTime = schedule.startTime) !== null && _schedule$startTime !== void 0 ? _schedule$startTime : 0) / 1000)
|
|
336
|
+
});
|
|
320
337
|
}
|
|
321
338
|
/**
|
|
322
339
|
* 加入房间
|
|
@@ -401,7 +418,7 @@ class FcrBaseRoomControlImpl {
|
|
|
401
418
|
async _handleRobotUserSetup(options) {
|
|
402
419
|
if (options.userRole === _type.FcrUserRole.ROBOT) {
|
|
403
420
|
const res = (0, _error.handleRequestError)(() => this._api.setCloudRecordingReady(this._scene.sceneId), _error.FcrErrorModuleCode.ROOM, 'set cloud recording ready failed');
|
|
404
|
-
this.logger.info(
|
|
421
|
+
this.logger.info("set cloud recording ready, response: ".concat((0, _imports.jsonstring)(res)));
|
|
405
422
|
}
|
|
406
423
|
}
|
|
407
424
|
|
|
@@ -410,7 +427,7 @@ class FcrBaseRoomControlImpl {
|
|
|
410
427
|
* @private
|
|
411
428
|
*/
|
|
412
429
|
_handleJoinFailure(error) {
|
|
413
|
-
this.logger.error(
|
|
430
|
+
this.logger.error("\u52A0\u5165\u623F\u95F4\u5931\u8D25: ".concat(error.message));
|
|
414
431
|
this._observable.notifyObservers('onJoinRoomFailure', this._scene.sceneId, error);
|
|
415
432
|
}
|
|
416
433
|
|
|
@@ -550,9 +567,9 @@ class FcrBaseRoomControlImpl {
|
|
|
550
567
|
this._scene.removeObserver(this._sceneObserver);
|
|
551
568
|
this._engine.removeObserver(this._engineObserver);
|
|
552
569
|
try {
|
|
553
|
-
|
|
554
|
-
// @ts-ignore
|
|
555
|
-
this._chatRoomControl
|
|
570
|
+
var _this$_chatRoomContro2;
|
|
571
|
+
return await Promise.all([// @ts-ignore
|
|
572
|
+
(_this$_chatRoomContro2 = this._chatRoomControl) === null || _this$_chatRoomContro2 === void 0 ? void 0 : _this$_chatRoomContro2.leave(),
|
|
556
573
|
// this._whiteboardControl?.close(),
|
|
557
574
|
this._scene.leave()]);
|
|
558
575
|
} finally {
|
|
@@ -586,12 +603,12 @@ class FcrBaseRoomControlImpl {
|
|
|
586
603
|
throw _helpers.liveStreamingErrorHelper.createNetworkError(errorMessage);
|
|
587
604
|
}
|
|
588
605
|
}
|
|
589
|
-
static #_ = (() => _staticBlock = () => [_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)();
|
|
590
606
|
}
|
|
591
607
|
/**
|
|
592
608
|
* @internal
|
|
593
609
|
*/
|
|
594
610
|
exports.FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
|
|
595
|
-
|
|
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;
|
|
596
613
|
class FcrSubRoomControlImpl extends FcrBaseRoomControlImpl {}
|
|
597
614
|
exports.FcrSubRoomControlImpl = FcrSubRoomControlImpl;
|
|
@@ -1,5 +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");
|
|
3
5
|
require("core-js/modules/es.array.push.js");
|
|
4
6
|
require("core-js/modules/esnext.function.metadata.js");
|
|
5
7
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
@@ -24,6 +26,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
24
26
|
exports.FcrInterpreterControlImpl = void 0;
|
|
25
27
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
26
28
|
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"));
|
|
27
31
|
var _imports = require("../../imports");
|
|
28
32
|
var _room = require("./room");
|
|
29
33
|
var _types = require("./types");
|
|
@@ -32,24 +36,25 @@ var _logger = require("../../utilities/logger");
|
|
|
32
36
|
var _error = require("../../utilities/error");
|
|
33
37
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
34
38
|
var _schema = require("../../schema");
|
|
35
|
-
var
|
|
36
|
-
let _initProto, _createRoomControlDecs, _setInterpreterUsersDecs;
|
|
39
|
+
var _FcrInterpreterControlImpl;
|
|
40
|
+
let _initProto, _createRoomControlDecs, _setInterpreterUsersDecs, _ref;
|
|
37
41
|
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)]; } }; }
|
|
38
42
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
39
43
|
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); }
|
|
40
44
|
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; }
|
|
41
45
|
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");
|
|
42
47
|
/**
|
|
43
48
|
* @internal
|
|
44
49
|
*/
|
|
45
50
|
class FcrInterpreterControlImpl {
|
|
46
|
-
//@internal
|
|
47
|
-
[(_createRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setInterpreterUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrInterpreterUsersParamsArraySchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
|
|
48
|
-
prefix: 'FcrInterpreterControlImpl'
|
|
49
|
-
})))();
|
|
50
|
-
_observable = (() => new _imports.AgoraObservable())();
|
|
51
|
-
_interpreterUserList = null;
|
|
52
51
|
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);
|
|
53
58
|
this._api = _api;
|
|
54
59
|
this._scene = _scene;
|
|
55
60
|
this._config = _config;
|
|
@@ -69,12 +74,12 @@ class FcrInterpreterControlImpl {
|
|
|
69
74
|
await (0, _error.handleRequestError)(() => this._api.openInterpreter({
|
|
70
75
|
roomId: this._roomId,
|
|
71
76
|
data: {
|
|
72
|
-
interpreters: params.map(
|
|
77
|
+
interpreters: params.map(_ref2 => {
|
|
73
78
|
let {
|
|
74
79
|
userId: userUuid,
|
|
75
80
|
sourceLanguage,
|
|
76
81
|
targetLanguage
|
|
77
|
-
} =
|
|
82
|
+
} = _ref2;
|
|
78
83
|
return {
|
|
79
84
|
userUuid,
|
|
80
85
|
languagePair: [sourceLanguage, targetLanguage]
|
|
@@ -96,11 +101,11 @@ class FcrInterpreterControlImpl {
|
|
|
96
101
|
}
|
|
97
102
|
getInterpreterRoomList() {
|
|
98
103
|
const rooms = this._scene.getScenePropertiesByKeyPath('interpreter.rooms') || [];
|
|
99
|
-
return rooms.length > 0 ? rooms.map(
|
|
104
|
+
return rooms.length > 0 ? rooms.map(_ref3 => {
|
|
100
105
|
let {
|
|
101
106
|
roomUuid,
|
|
102
107
|
language
|
|
103
|
-
} =
|
|
108
|
+
} = _ref3;
|
|
104
109
|
return {
|
|
105
110
|
roomId: roomUuid,
|
|
106
111
|
language
|
|
@@ -114,12 +119,12 @@ class FcrInterpreterControlImpl {
|
|
|
114
119
|
} = interpreter || {
|
|
115
120
|
translates: []
|
|
116
121
|
};
|
|
117
|
-
const results = translates.map(
|
|
122
|
+
const results = translates.map(_ref4 => {
|
|
118
123
|
let {
|
|
119
124
|
userUuid: userId,
|
|
120
125
|
userName,
|
|
121
126
|
languagePair: [sourceLanguage, targetLanguage]
|
|
122
|
-
} =
|
|
127
|
+
} = _ref4;
|
|
123
128
|
return {
|
|
124
129
|
userId,
|
|
125
130
|
userName,
|
|
@@ -145,7 +150,8 @@ class FcrInterpreterControlImpl {
|
|
|
145
150
|
_addInterpreterObservers() {
|
|
146
151
|
this._scene.addObserver({
|
|
147
152
|
onScenePropertiesUpdated: (_, event) => {
|
|
148
|
-
|
|
153
|
+
var _event$cause;
|
|
154
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 800) {
|
|
149
155
|
const actionType = (0, _imports.get)(event.cause.data, 'actionType');
|
|
150
156
|
let operatorUser;
|
|
151
157
|
if (event.operatorUser) {
|
|
@@ -178,7 +184,7 @@ class FcrInterpreterControlImpl {
|
|
|
178
184
|
// 'onNetworkStatsUpdated',
|
|
179
185
|
'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated', 'onInterpreterStateUpdated', 'onInterpreterUsersUpdated', 'onInterpreterRoomListUpdated']));
|
|
180
186
|
}
|
|
181
|
-
static #_ = (() => _staticBlock = () => [_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)();
|
|
182
187
|
}
|
|
183
188
|
exports.FcrInterpreterControlImpl = FcrInterpreterControlImpl;
|
|
184
|
-
|
|
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;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.FcrInterpreterRoomControlImpl = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _ = require("..");
|
|
8
10
|
var _type = require("../type");
|
|
9
11
|
var _logger = require("../../utilities/logger");
|
|
@@ -11,12 +13,12 @@ var _logger = require("../../utilities/logger");
|
|
|
11
13
|
* @internal
|
|
12
14
|
*/
|
|
13
15
|
class FcrInterpreterRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
14
|
-
//@internal
|
|
15
|
-
logger = (() => (0, _logger.createLogger)({
|
|
16
|
-
prefix: 'FcrInterpreterRoomControlImpl'
|
|
17
|
-
}))();
|
|
18
16
|
constructor(_engine, _scene, _api, _config, _sharedCache, _chatConnection, chatRoomControl) {
|
|
19
17
|
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
|
+
}));
|
|
20
22
|
this._engine = _engine;
|
|
21
23
|
this._scene = _scene;
|
|
22
24
|
this._api = _api;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.FcrJoinBeforeHostWaitingRoomControlImpl = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _ = require("..");
|
|
8
10
|
var _type = require("../type");
|
|
9
11
|
var _logger = require("../../utilities/logger");
|
|
@@ -11,12 +13,12 @@ var _logger = require("../../utilities/logger");
|
|
|
11
13
|
* @internal
|
|
12
14
|
*/
|
|
13
15
|
class FcrJoinBeforeHostWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
14
|
-
//@internal
|
|
15
|
-
logger = (() => (0, _logger.createLogger)({
|
|
16
|
-
prefix: 'FcrJoinBeforeHostWaitingRoomControlImpl'
|
|
17
|
-
}))();
|
|
18
16
|
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
|
|
19
17
|
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
|
+
}));
|
|
20
22
|
this._addLogObserver();
|
|
21
23
|
}
|
|
22
24
|
addObserver(observer) {
|