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/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");
|
|
@@ -22,6 +24,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
22
24
|
value: true
|
|
23
25
|
});
|
|
24
26
|
exports.FcrMainRoomControlImpl = void 0;
|
|
27
|
+
require("core-js/modules/es.json.stringify.js");
|
|
28
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
29
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
30
|
var _imports = require("../../imports");
|
|
26
31
|
var _ = require("..");
|
|
27
32
|
var _groupControl = require("../group-control");
|
|
@@ -33,8 +38,8 @@ var _schema = require("../../schema");
|
|
|
33
38
|
var _logger = require("../../utilities/logger");
|
|
34
39
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
35
40
|
var _sharedStorage = require("../../utilities/shared-storage");
|
|
36
|
-
var
|
|
37
|
-
let _initProto, _enableWaitingRoomDecs, _moveToWaitingRoomByUserIdsDecs;
|
|
41
|
+
var _FcrMainRoomControlImpl;
|
|
42
|
+
let _initProto, _enableWaitingRoomDecs, _moveToWaitingRoomByUserIdsDecs, _ref;
|
|
38
43
|
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)]; } }; }
|
|
39
44
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
40
45
|
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); }
|
|
@@ -47,13 +52,14 @@ const {
|
|
|
47
52
|
/**
|
|
48
53
|
* @internal
|
|
49
54
|
*/
|
|
55
|
+
_ref = (_enableWaitingRoomDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema)], _moveToWaitingRoomByUserIdsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], "logger");
|
|
50
56
|
class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
51
|
-
//@internal
|
|
52
|
-
[(_enableWaitingRoomDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema)], _moveToWaitingRoomByUserIdsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
|
|
53
|
-
prefix: 'FcrMainRoomControlImpl'
|
|
54
|
-
})))();
|
|
55
57
|
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
|
|
56
58
|
super(engine, scene, api, config, _type2.FcrRoomType.Mainroom, chatConnection, sharedCache, chatRoomControl);
|
|
59
|
+
//@internal
|
|
60
|
+
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
61
|
+
prefix: 'FcrMainRoomControlImpl'
|
|
62
|
+
})));
|
|
57
63
|
this._groupControl = new _groupControl.FcrGroupControl(engine, scene, api, sharedCache);
|
|
58
64
|
this._interpreterControl = new _interpreterControl.FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
|
|
59
65
|
this._addLogObserver();
|
|
@@ -76,7 +82,7 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
76
82
|
this._initBoardInfo();
|
|
77
83
|
}
|
|
78
84
|
});
|
|
79
|
-
this.logger.info(
|
|
85
|
+
this.logger.info("initialized, room id: ".concat(this._scene.sceneId));
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
// @trace
|
|
@@ -111,7 +117,8 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
111
117
|
try {
|
|
112
118
|
return await super.leave();
|
|
113
119
|
} finally {
|
|
114
|
-
|
|
120
|
+
var _this$_logUploadTask;
|
|
121
|
+
(_this$_logUploadTask = this._logUploadTask) === null || _this$_logUploadTask === void 0 || _this$_logUploadTask.stop();
|
|
115
122
|
this._engine.getMonitor().uploadLog({
|
|
116
123
|
userUuid: this._config.userId,
|
|
117
124
|
roomUuid: this._scene.sceneId
|
|
@@ -133,9 +140,10 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
133
140
|
async moveToWaitingRoomByUserIds(userIds) {
|
|
134
141
|
const [error] = await (0, _imports.to)(this._api.moveToWaitingRoomByUserIds(userIds, this._scene.sceneId));
|
|
135
142
|
if (error) {
|
|
136
|
-
this.logger.error(
|
|
143
|
+
this.logger.error("[RoomControl] move to waiting room failed, ".concat(error.message, "-").concat(JSON.stringify(error)));
|
|
137
144
|
if (error instanceof _imports.AgoraRestfulClientError) {
|
|
138
|
-
|
|
145
|
+
var _error$serviceCode;
|
|
146
|
+
throw (0, _error.generateFcrCoreServerError)((_error$serviceCode = error.serviceCode) !== null && _error$serviceCode !== void 0 ? _error$serviceCode : -1, error.message, error);
|
|
139
147
|
}
|
|
140
148
|
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.ROOM, _error.FcrErrorCode.UNDEFINED_ERROR, 'move to waiting room failed', error);
|
|
141
149
|
}
|
|
@@ -148,9 +156,9 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
148
156
|
const userId = this._scene.localUser.getLocalUserId();
|
|
149
157
|
const boardOptions = (await this._getToken(roomId, userId)).data;
|
|
150
158
|
if (!boardOptions) {
|
|
151
|
-
this.logger.error(
|
|
159
|
+
this.logger.error("get annotation board options failed, roomId: ".concat(roomId, ", userId: ").concat(userId, ", boardOptions: ").concat((0, _imports.jsonstring)(boardOptions)));
|
|
152
160
|
} else {
|
|
153
|
-
this.logger.info(
|
|
161
|
+
this.logger.info("get annotation board options success, roomId: ".concat(roomId, ", userId: ").concat(userId, ", boardOptions: ").concat((0, _imports.jsonstring)(boardOptions)));
|
|
154
162
|
(0, _sharedStorage.setAnnotationBoardOptions)(boardOptions);
|
|
155
163
|
}
|
|
156
164
|
}
|
|
@@ -159,9 +167,9 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
159
167
|
const userId = this._scene.localUser.getLocalUserId();
|
|
160
168
|
const boardOptions = (await this._getBoardToken(roomId, userId)).data;
|
|
161
169
|
if (!boardOptions) {
|
|
162
|
-
this.logger.error(
|
|
170
|
+
this.logger.error("get whiteboard options failed, roomId: ".concat(roomId, ", userId: ").concat(userId, ", boardOptions: ").concat((0, _imports.jsonstring)(boardOptions)));
|
|
163
171
|
} else {
|
|
164
|
-
this.logger.info(
|
|
172
|
+
this.logger.info("get whiteboard options success, roomId: ".concat(roomId, ", userId: ").concat(userId, ", boardOptions: ").concat((0, _imports.jsonstring)(boardOptions)));
|
|
165
173
|
(0, _sharedStorage.setWhiteboardOptions)(boardOptions);
|
|
166
174
|
}
|
|
167
175
|
}
|
|
@@ -183,7 +191,7 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
183
191
|
// 'onNetworkStatsUpdated',
|
|
184
192
|
'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated']));
|
|
185
193
|
}
|
|
186
|
-
static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_enableWaitingRoomDecs, 2, "enableWaitingRoom"], [_moveToWaitingRoomByUserIdsDecs, 2, "moveToWaitingRoomByUserIds"], [_imports.trace, 2, "moveToWaitingRoomByUserRoles"], [_imports.bound, 2, "_getToken"], [_imports.bound, 2, "_getBoardToken"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e)();
|
|
187
194
|
}
|
|
188
195
|
exports.FcrMainRoomControlImpl = FcrMainRoomControlImpl;
|
|
189
|
-
|
|
196
|
+
_FcrMainRoomControlImpl = FcrMainRoomControlImpl;
|
|
197
|
+
[_initProto] = _applyDecs(_FcrMainRoomControlImpl, [[_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_enableWaitingRoomDecs, 2, "enableWaitingRoom"], [_moveToWaitingRoomByUserIdsDecs, 2, "moveToWaitingRoomByUserIds"], [_imports.trace, 2, "moveToWaitingRoomByUserRoles"], [_imports.bound, 2, "_getToken"], [_imports.bound, 2, "_getBoardToken"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
|
|
@@ -7,6 +7,7 @@ exports.getLocalUserPermissionInfo = exports.addLocalUserPermissionObserver = ex
|
|
|
7
7
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
8
|
require("core-js/modules/esnext.iterator.find.js");
|
|
9
9
|
require("core-js/modules/esnext.iterator.map.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
11
|
var _type = require("./type");
|
|
11
12
|
var _user = require("../../utilities/user");
|
|
12
13
|
// 初始化权限策略表达式:{module}:{action}-{k1=v1|v2;k2=v3}>{role1|role2}
|
|
@@ -46,7 +47,7 @@ class FcrPermission {
|
|
|
46
47
|
}
|
|
47
48
|
exports.FcrPermission = FcrPermission;
|
|
48
49
|
const getLocalUserPermissionInfo = (scene, action) => {
|
|
49
|
-
const permissionStringArray = scene.getUserPropertiesByKeyPath(
|
|
50
|
+
const permissionStringArray = scene.getUserPropertiesByKeyPath("permission.list", scene.localUser.getLocalUserId());
|
|
50
51
|
const permissionString = permissionStringArray.find(permission => permission.startsWith(action));
|
|
51
52
|
if (!permissionString) {
|
|
52
53
|
return {
|
|
@@ -70,7 +71,7 @@ const convertPermissionInfo = (permission, operateType) => {
|
|
|
70
71
|
enable: operateType === _type.FcrOperatePermissionType.ADD || operateType === _type.FcrOperatePermissionType.GET ? true : false,
|
|
71
72
|
info: {
|
|
72
73
|
targetRoles: permission.targetRoles.map(role => (0, _user.convertStringPrivilegeRoleToFcrPrivilegeRole)(role)),
|
|
73
|
-
action:
|
|
74
|
+
action: "".concat(module, ":").concat(action),
|
|
74
75
|
params: permission.conditions
|
|
75
76
|
}
|
|
76
77
|
};
|
|
@@ -79,11 +80,13 @@ const convertPermissionInfo = (permission, operateType) => {
|
|
|
79
80
|
const addLocalUserPermissionObserver = (scene, observer, cache) => {
|
|
80
81
|
scene.addObserver({
|
|
81
82
|
onUserPropertiesUpdated: (sceneId, event) => {
|
|
82
|
-
|
|
83
|
+
var _event$cause;
|
|
84
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 3200) {
|
|
83
85
|
if (event.modifiedUser.userId === scene.localUser.getLocalUserId()) {
|
|
86
|
+
var _data$addPermissions, _data$removePermissio;
|
|
84
87
|
const data = event.cause.data;
|
|
85
|
-
const addedPermissions = data.addPermissions
|
|
86
|
-
const removedPermissions = data.removePermissions
|
|
88
|
+
const addedPermissions = (_data$addPermissions = data.addPermissions) === null || _data$addPermissions === void 0 ? void 0 : _data$addPermissions.map(p => convertPermissionInfo(FcrPermission.fromString(p), _type.FcrOperatePermissionType.ADD));
|
|
89
|
+
const removedPermissions = (_data$removePermissio = data.removePermissions) === null || _data$removePermissio === void 0 ? void 0 : _data$removePermissio.map(p => convertPermissionInfo(FcrPermission.fromString(p), _type.FcrOperatePermissionType.DELETE));
|
|
87
90
|
if (removedPermissions && removedPermissions.length > 0) {
|
|
88
91
|
observer.onLocalUserPermissionInfoDeleted && observer.onLocalUserPermissionInfoDeleted(sceneId, {
|
|
89
92
|
permissionInfo: removedPermissions,
|
|
@@ -1,7 +1,10 @@
|
|
|
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.filter.js");
|
|
5
8
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
6
9
|
require("core-js/modules/esnext.map.emplace.js");
|
|
7
10
|
require("core-js/modules/esnext.map.every.js");
|
|
@@ -25,6 +28,8 @@ exports.FcrPrivilegeControlImpl = void 0;
|
|
|
25
28
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
26
29
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
27
30
|
require("core-js/modules/esnext.iterator.map.js");
|
|
31
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
32
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
28
33
|
var _imports = require("../../imports");
|
|
29
34
|
var _type = require("../../type");
|
|
30
35
|
var _user = require("../../utilities/user");
|
|
@@ -34,23 +39,26 @@ var _logger = require("../../utilities/logger");
|
|
|
34
39
|
var _error = require("../../utilities/error");
|
|
35
40
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
36
41
|
var _schema = require("../../schema");
|
|
37
|
-
var
|
|
38
|
-
let _initProto, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs;
|
|
42
|
+
var _FcrPrivilegeControlImpl;
|
|
43
|
+
let _initProto, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs, _ref;
|
|
44
|
+
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; }
|
|
45
|
+
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; }
|
|
39
46
|
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)]; } }; }
|
|
40
47
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
41
48
|
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); }
|
|
42
49
|
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; }
|
|
43
50
|
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; }
|
|
51
|
+
_ref = (_getSecurityInfoDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrSecurityActionSchema)], _getLocalUserPermissionInfoDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrPermissionActionSchema)], _enableLockedRoomDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowShareAndWriteDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowSendChatDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrSecuritySendChatPayloadSchema)], _allowStartAudioDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartVideoDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedAudioDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedVideoDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWatermarkDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrLineTypeSchema.optional())], _allowChangeUserNameDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], "logger");
|
|
44
52
|
/**
|
|
45
53
|
* @internal
|
|
46
54
|
*/
|
|
47
55
|
class FcrPrivilegeControlImpl {
|
|
48
|
-
//@internal
|
|
49
|
-
[(_getSecurityInfoDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrSecurityActionSchema)], _getLocalUserPermissionInfoDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrPermissionActionSchema)], _enableLockedRoomDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowShareAndWriteDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowSendChatDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrSecuritySendChatPayloadSchema)], _allowStartAudioDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartVideoDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedAudioDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedVideoDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWatermarkDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrLineTypeSchema.optional())], _allowChangeUserNameDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
|
|
50
|
-
prefix: 'FcrPrivilegeControlImpl'
|
|
51
|
-
})))();
|
|
52
|
-
_observable = (() => new _imports.AgoraObservable())();
|
|
53
56
|
constructor(_engine, _scene, _api, _sharedCache) {
|
|
57
|
+
//@internal
|
|
58
|
+
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
59
|
+
prefix: 'FcrPrivilegeControlImpl'
|
|
60
|
+
})));
|
|
61
|
+
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
54
62
|
this._engine = _engine;
|
|
55
63
|
this._scene = _scene;
|
|
56
64
|
this._api = _api;
|
|
@@ -70,7 +78,7 @@ class FcrPrivilegeControlImpl {
|
|
|
70
78
|
}), _error.FcrErrorModuleCode.ROOM_WHITEBOARD, 'allow annotation failed');
|
|
71
79
|
}
|
|
72
80
|
getSecurityInfo(action) {
|
|
73
|
-
const info = this._scene.getScenePropertiesByKeyPath(
|
|
81
|
+
const info = this._scene.getScenePropertiesByKeyPath("security.".concat(action));
|
|
74
82
|
return this._convertSecurityInfo(info, action);
|
|
75
83
|
}
|
|
76
84
|
// @trace
|
|
@@ -98,7 +106,7 @@ class FcrPrivilegeControlImpl {
|
|
|
98
106
|
|
|
99
107
|
// @trace
|
|
100
108
|
getAllLocalUserPermissionInfo() {
|
|
101
|
-
const permissionStringArray = this._scene.getUserPropertiesByKeyPath(
|
|
109
|
+
const permissionStringArray = this._scene.getUserPropertiesByKeyPath("permission.list", this._scene.localUser.getLocalUserId());
|
|
102
110
|
return permissionStringArray.map(permissionString => this._convertPermissionInfo(_helper.FcrPermission.fromString(permissionString), _type2.FcrOperatePermissionType.GET));
|
|
103
111
|
}
|
|
104
112
|
async enableLockedRoom(enable, targetRoles) {
|
|
@@ -192,7 +200,7 @@ class FcrPrivilegeControlImpl {
|
|
|
192
200
|
enable,
|
|
193
201
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role]),
|
|
194
202
|
payload: {
|
|
195
|
-
lineType: lineType
|
|
203
|
+
lineType: lineType !== null && lineType !== void 0 ? lineType : _type.FcrLineType.SINGLE_ROW
|
|
196
204
|
}
|
|
197
205
|
}), _error.FcrErrorModuleCode.ROOM_PRIVILEGE, 'allow water mark failed');
|
|
198
206
|
}
|
|
@@ -220,13 +228,12 @@ class FcrPrivilegeControlImpl {
|
|
|
220
228
|
payload
|
|
221
229
|
} = security;
|
|
222
230
|
if (action === _type2.FcrSecurityAction.Annotation) {
|
|
223
|
-
return {
|
|
231
|
+
return _objectSpread({
|
|
224
232
|
info: {
|
|
225
233
|
action: action,
|
|
226
234
|
payload
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
};
|
|
235
|
+
}
|
|
236
|
+
}, security);
|
|
230
237
|
}
|
|
231
238
|
return {
|
|
232
239
|
enable: !!security.enable,
|
|
@@ -251,7 +258,7 @@ class FcrPrivilegeControlImpl {
|
|
|
251
258
|
enable: operateType === _type2.FcrOperatePermissionType.ADD || operateType === _type2.FcrOperatePermissionType.GET ? true : false,
|
|
252
259
|
info: {
|
|
253
260
|
targetRoles: permission.targetRoles.map(role => (0, _user.convertStringPrivilegeRoleToFcrPrivilegeRole)(role)),
|
|
254
|
-
action:
|
|
261
|
+
action: "".concat(module, ":").concat(action),
|
|
255
262
|
params: permission.conditions
|
|
256
263
|
}
|
|
257
264
|
};
|
|
@@ -263,7 +270,7 @@ class FcrPrivilegeControlImpl {
|
|
|
263
270
|
if ('security' in event.changedProperties) {
|
|
264
271
|
const securityChangedKeys = Object.keys(event.changedProperties.security);
|
|
265
272
|
securityChangedKeys.forEach(key => {
|
|
266
|
-
const infoObj = (0, _imports.get)(event.changedProperties,
|
|
273
|
+
const infoObj = (0, _imports.get)(event.changedProperties, "security.".concat(key));
|
|
267
274
|
this._observable.notifyObservers('onSecurityInfoUpdated', sceneId, {
|
|
268
275
|
securityInfo: this._convertSecurityInfo(infoObj, key),
|
|
269
276
|
operatorUser: (0, _user.checkFcrUserRole)((0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache)),
|
|
@@ -285,7 +292,7 @@ class FcrPrivilegeControlImpl {
|
|
|
285
292
|
_addLogObserver() {
|
|
286
293
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onSecurityInfoUpdated', 'onLocalUserPermissionInfoAdded', 'onLocalUserPermissionInfoDeleted']));
|
|
287
294
|
}
|
|
288
|
-
static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_imports.trace, 2, "allowWriteAnnotation"], [_getSecurityInfoDecs, 2, "getSecurityInfo"], [_getLocalUserPermissionInfoDecs, 2, "getLocalUserPermissionInfo"], [_enableLockedRoomDecs, 2, "enableLockedRoom"], [_allowShareAndWriteDecs, 2, "allowShareAndWrite"], [_allowWriteBoardDecs, 2, "allowWriteBoard"], [_allowSendChatDecs, 2, "allowSendChat"], [_allowStartAudioDecs, 2, "allowStartAudio"], [_allowStartVideoDecs, 2, "allowStartVideo"], [_allowJoinWithMutedAudioDecs, 2, "allowJoinWithMutedAudio"], [_allowJoinWithMutedVideoDecs, 2, "allowJoinWithMutedVideo"], [_allowWatermarkDecs, 2, "allowWatermark"], [_allowChangeUserNameDecs, 2, "allowChangeUserName"]], []).e)();
|
|
289
295
|
}
|
|
290
296
|
exports.FcrPrivilegeControlImpl = FcrPrivilegeControlImpl;
|
|
291
|
-
|
|
297
|
+
_FcrPrivilegeControlImpl = FcrPrivilegeControlImpl;
|
|
298
|
+
[_initProto] = _applyDecs(_FcrPrivilegeControlImpl, [[_imports.trace, 2, "allowWriteAnnotation"], [_getSecurityInfoDecs, 2, "getSecurityInfo"], [_getLocalUserPermissionInfoDecs, 2, "getLocalUserPermissionInfo"], [_enableLockedRoomDecs, 2, "enableLockedRoom"], [_allowShareAndWriteDecs, 2, "allowShareAndWrite"], [_allowWriteBoardDecs, 2, "allowWriteBoard"], [_allowSendChatDecs, 2, "allowSendChat"], [_allowStartAudioDecs, 2, "allowStartAudio"], [_allowStartVideoDecs, 2, "allowStartVideo"], [_allowJoinWithMutedAudioDecs, 2, "allowJoinWithMutedAudio"], [_allowJoinWithMutedVideoDecs, 2, "allowJoinWithMutedVideo"], [_allowWatermarkDecs, 2, "allowWatermark"], [_allowChangeUserNameDecs, 2, "allowChangeUserName"]], []).e;
|
|
@@ -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.map.delete-all.js");
|
|
5
7
|
require("core-js/modules/esnext.map.emplace.js");
|
|
@@ -25,14 +27,16 @@ require("core-js/modules/es.array.push.js");
|
|
|
25
27
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
26
28
|
require("core-js/modules/esnext.iterator.map.js");
|
|
27
29
|
require("core-js/modules/esnext.iterator.reduce.js");
|
|
30
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
31
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
28
32
|
var _type = require("./type");
|
|
29
33
|
var _imports = require("../../imports");
|
|
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, _startSessionByPhoneDecs, _startSessionByIPDecs, _stopSessionDecs;
|
|
38
|
+
var _FcrRoomConnectorControlImpl;
|
|
39
|
+
let _initProto, _startSessionByPhoneDecs, _startSessionByIPDecs, _stopSessionDecs, _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); }
|
|
@@ -41,13 +45,14 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
41
45
|
/**
|
|
42
46
|
* @internal
|
|
43
47
|
*/
|
|
48
|
+
_ref = (_startSessionByPhoneDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrPhoneConnectorSessionParamsSchema)], _startSessionByIPDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrIPConnectorSessionParamsSchema)], _stopSessionDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger");
|
|
44
49
|
class FcrRoomConnectorControlImpl {
|
|
45
|
-
//@internal
|
|
46
|
-
[(_startSessionByPhoneDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrPhoneConnectorSessionParamsSchema)], _startSessionByIPDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrIPConnectorSessionParamsSchema)], _stopSessionDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
|
|
47
|
-
prefix: 'FcrRoomConnectorControlImpl'
|
|
48
|
-
})))();
|
|
49
|
-
_observable = (() => new _imports.AgoraObservable())();
|
|
50
50
|
constructor(_scene, _engine, _api) {
|
|
51
|
+
//@internal
|
|
52
|
+
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
53
|
+
prefix: 'FcrRoomConnectorControlImpl'
|
|
54
|
+
})));
|
|
55
|
+
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
51
56
|
this._scene = _scene;
|
|
52
57
|
this._engine = _engine;
|
|
53
58
|
this._api = _api;
|
|
@@ -57,17 +62,18 @@ class FcrRoomConnectorControlImpl {
|
|
|
57
62
|
});
|
|
58
63
|
}
|
|
59
64
|
getRoomConnectorPhoneInfo() {
|
|
65
|
+
var _ref2;
|
|
60
66
|
const mid = this._scene.getScenePropertiesByKeyPath('call.mid');
|
|
61
|
-
const callIn = this._scene.getScenePropertiesByKeyPath('call.callIn')
|
|
67
|
+
const callIn = (_ref2 = this._scene.getScenePropertiesByKeyPath('call.callIn')) !== null && _ref2 !== void 0 ? _ref2 : [];
|
|
62
68
|
const uid = this._scene.getUserPropertiesByKeyPath('call.uid', this._scene.getLocalUser().getLocalUserId());
|
|
63
69
|
const regionMap = {
|
|
64
70
|
cn: _type.FcrRoomConnectorPhoneRegion.CN
|
|
65
71
|
};
|
|
66
|
-
return Promise.resolve(callIn.map(
|
|
72
|
+
return Promise.resolve(callIn.map(_ref3 => {
|
|
67
73
|
let {
|
|
68
74
|
callNumbers,
|
|
69
75
|
region
|
|
70
|
-
} =
|
|
76
|
+
} = _ref3;
|
|
71
77
|
return {
|
|
72
78
|
region: regionMap[region],
|
|
73
79
|
phoneNumberList: callNumbers,
|
|
@@ -77,13 +83,14 @@ class FcrRoomConnectorControlImpl {
|
|
|
77
83
|
}));
|
|
78
84
|
}
|
|
79
85
|
getRoomConnectorIpInfo() {
|
|
86
|
+
var _ref4;
|
|
80
87
|
const mid = this._scene.getScenePropertiesByKeyPath('call.mid');
|
|
81
|
-
const callIn = this._scene.getScenePropertiesByKeyPath('call.callIn')
|
|
88
|
+
const callIn = (_ref4 = this._scene.getScenePropertiesByKeyPath('call.callIn')) !== null && _ref4 !== void 0 ? _ref4 : [];
|
|
82
89
|
return Promise.resolve({
|
|
83
|
-
addressList: callIn.reduce((prev,
|
|
90
|
+
addressList: callIn.reduce((prev, _ref5) => {
|
|
84
91
|
let {
|
|
85
92
|
ipAddresses
|
|
86
|
-
} =
|
|
93
|
+
} = _ref5;
|
|
87
94
|
if (Array.isArray(ipAddresses)) {
|
|
88
95
|
prev.push(...ipAddresses);
|
|
89
96
|
}
|
|
@@ -182,7 +189,7 @@ class FcrRoomConnectorControlImpl {
|
|
|
182
189
|
_addLogObserver() {
|
|
183
190
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onIPConnectorSessionStateUpdated', 'onPhoneConnectorSessionStateUpdated']));
|
|
184
191
|
}
|
|
185
|
-
static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_imports.trace, 2, "getRoomConnectorPhoneInfo"], [_imports.trace, 2, "getRoomConnectorIpInfo"], [_startSessionByPhoneDecs, 2, "startSessionByPhone"], [_startSessionByIPDecs, 2, "startSessionByIP"], [_stopSessionDecs, 2, "stopSession"]], []).e)();
|
|
186
192
|
}
|
|
187
193
|
exports.FcrRoomConnectorControlImpl = FcrRoomConnectorControlImpl;
|
|
188
|
-
|
|
194
|
+
_FcrRoomConnectorControlImpl = FcrRoomConnectorControlImpl;
|
|
195
|
+
[_initProto] = _applyDecs(_FcrRoomConnectorControlImpl, [[_imports.trace, 2, "getRoomConnectorPhoneInfo"], [_imports.trace, 2, "getRoomConnectorIpInfo"], [_startSessionByPhoneDecs, 2, "startSessionByPhone"], [_startSessionByIPDecs, 2, "startSessionByIP"], [_stopSessionDecs, 2, "stopSession"]], []).e;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.RoomControlFactory = void 0;
|
|
7
|
+
require("core-js/modules/es.error.cause.js");
|
|
7
8
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
9
|
require("core-js/modules/esnext.iterator.map.js");
|
|
9
10
|
var _type = require("./type");
|
|
@@ -53,7 +54,7 @@ class RoomControlFactory {
|
|
|
53
54
|
const roomType = roomResponse.room.roomProperties.roomType;
|
|
54
55
|
const RoomControlImpl = ROOM_CONTROL_IMPLEMENTATIONS[roomType];
|
|
55
56
|
if (!RoomControlImpl) {
|
|
56
|
-
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.ROOM, _error.FcrErrorCode.UNDEFINED_ERROR,
|
|
57
|
+
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.ROOM, _error.FcrErrorCode.UNDEFINED_ERROR, "Unsupported room types: ".concat(roomType), new Error("Unsupported room type: ".concat(roomType)));
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
// 创建聊天室控制
|