fcr-core 3.10.5 → 3.10.6
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/engine/index.js +108 -102
- package/lib/imports.js +0 -1
- package/lib/index.d.ts +1 -1
- package/lib/media-control/desktop.js +13 -22
- package/lib/media-control/mobile.js +13 -22
- package/lib/monitor-control/index.js +7 -17
- package/lib/peer-session/index.js +121 -120
- package/lib/plugins/chat/chatroom.js +96 -119
- package/lib/plugins/chat/connector.js +48 -69
- package/lib/remote-control/index.js +216 -194
- package/lib/room-control/ability-control/index.js +10 -20
- package/lib/room-control/application-control/index.js +75 -82
- package/lib/room-control/group-control/index.js +30 -31
- package/lib/room-control/helpers/board-init-info-helper.js +10 -16
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +51 -70
- package/lib/room-control/infinity-room-control/index.js +19 -27
- package/lib/room-control/interpreter-control/index.js +65 -77
- package/lib/room-control/interpreter-control/room.js +4 -6
- package/lib/room-control/join-before-host-waitingroom-control/index.js +4 -6
- package/lib/room-control/mainroom-control/index.js +25 -37
- package/lib/room-control/privilege-control/helper.js +13 -28
- package/lib/room-control/privilege-control/index.js +28 -36
- package/lib/room-control/room-connector-control/index.js +47 -52
- package/lib/room-control/room-control-factory.js +12 -10
- package/lib/room-control/room-session/index.js +74 -77
- package/lib/room-control/shared-cache.js +56 -63
- package/lib/room-control/sharing-control/index.js +57 -65
- package/lib/room-control/stream-control/index.js +238 -203
- package/lib/room-control/stream-control/type.d.ts +11 -1
- package/lib/room-control/stt-control/de-compress-gzip.js +0 -10
- package/lib/room-control/stt-control/index.js +86 -93
- package/lib/room-control/user-control/index.js +155 -162
- package/lib/room-control/waitingroom-control/index.js +9 -18
- package/lib/room-control/whiteboard-control/utils.js +2 -4
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
- package/lib/room-control/whiteboard-control-v1/board-window.js +103 -120
- package/lib/room-control/whiteboard-control-v1/factory.js +4 -7
- package/lib/room-control/whiteboard-control-v1/index.js +67 -80
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +2 -4
- package/lib/room-control/whiteboard-control-v1/utils.js +14 -17
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +10 -14
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -17
- package/lib/room-control/whiteboard-control-v2/base/index.js +53 -61
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +30 -39
- package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +33 -45
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -27
- package/lib/room-control/widget-control/index.js +33 -43
- package/lib/room-router/index.js +58 -66
- package/lib/service/api.js +548 -446
- package/lib/struct.js +2 -5
- package/lib/type.d.ts +1 -1
- package/lib/utilities/abortable-retry.js +0 -3
- package/lib/utilities/collection.js +11 -15
- package/lib/utilities/error-helpers.js +27 -34
- package/lib/utilities/error.js +3 -4
- package/lib/utilities/join-helper.js +31 -37
- package/lib/utilities/logger.js +5 -8
- package/lib/utilities/parameters.js +10 -21
- package/lib/utilities/retry-helpers.js +0 -1
- package/lib/utilities/stream.js +11 -16
- package/lib/utilities/user.js +3 -4
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.js +5 -10
- package/lib-es/engine/index.js +108 -102
- package/lib-es/media-control/desktop.js +13 -22
- package/lib-es/media-control/mobile.js +13 -22
- package/lib-es/monitor-control/index.js +7 -16
- package/lib-es/peer-session/index.js +121 -120
- package/lib-es/plugins/chat/chatroom.js +95 -118
- package/lib-es/plugins/chat/connector.js +47 -67
- package/lib-es/remote-control/index.js +216 -194
- package/lib-es/room-control/ability-control/index.js +10 -19
- package/lib-es/room-control/application-control/index.js +75 -81
- package/lib-es/room-control/group-control/index.js +30 -31
- package/lib-es/room-control/helpers/board-init-info-helper.js +10 -15
- package/lib-es/room-control/helpers/validation-helper.js +1 -1
- package/lib-es/room-control/index.js +51 -69
- package/lib-es/room-control/infinity-room-control/index.js +19 -26
- package/lib-es/room-control/interpreter-control/index.js +65 -77
- package/lib-es/room-control/interpreter-control/room.js +4 -5
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -5
- package/lib-es/room-control/mainroom-control/index.js +25 -37
- package/lib-es/room-control/privilege-control/helper.js +13 -27
- package/lib-es/room-control/privilege-control/index.js +28 -36
- package/lib-es/room-control/room-connector-control/index.js +47 -52
- package/lib-es/room-control/room-control-factory.js +12 -10
- package/lib-es/room-control/room-session/index.js +74 -77
- package/lib-es/room-control/shared-cache.js +56 -62
- package/lib-es/room-control/sharing-control/index.js +57 -64
- package/lib-es/room-control/stream-control/index.js +240 -205
- package/lib-es/room-control/stt-control/de-compress-gzip.js +0 -10
- package/lib-es/room-control/stt-control/index.js +86 -93
- package/lib-es/room-control/user-control/index.js +155 -162
- package/lib-es/room-control/waitingroom-control/index.js +9 -18
- package/lib-es/room-control/whiteboard-control/utils.js +2 -4
- package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +103 -120
- package/lib-es/room-control/whiteboard-control-v1/factory.js +4 -6
- package/lib-es/room-control/whiteboard-control-v1/index.js +67 -80
- package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +2 -3
- package/lib-es/room-control/whiteboard-control-v1/utils.js +14 -17
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +10 -13
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -16
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +53 -60
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +30 -39
- package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +33 -45
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -26
- package/lib-es/room-control/widget-control/index.js +33 -42
- package/lib-es/room-router/index.js +58 -66
- package/lib-es/service/api.js +548 -445
- package/lib-es/struct.js +2 -4
- package/lib-es/utilities/abortable-retry.js +0 -3
- package/lib-es/utilities/collection.js +11 -14
- package/lib-es/utilities/error-helpers.js +26 -33
- package/lib-es/utilities/error.js +3 -4
- package/lib-es/utilities/join-helper.js +29 -36
- package/lib-es/utilities/logger.js +5 -7
- package/lib-es/utilities/parameters.js +10 -21
- package/lib-es/utilities/retry-helpers.js +0 -1
- package/lib-es/utilities/stream.js +11 -15
- package/lib-es/utilities/user.js +3 -4
- package/lib-es/utilities/validate-params.js +1 -1
- package/lib-es/utilities/video-encoder-config.js +5 -10
- package/package.json +4 -4
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/es.array.push.js");
|
|
6
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
7
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
@@ -19,40 +17,37 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
19
17
|
require("core-js/modules/esnext.map.some.js");
|
|
20
18
|
require("core-js/modules/esnext.map.update.js");
|
|
21
19
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
22
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
24
20
|
Object.defineProperty(exports, "__esModule", {
|
|
25
21
|
value: true
|
|
26
22
|
});
|
|
27
23
|
exports.FcrAbilityControlImpl = void 0;
|
|
28
24
|
require("core-js/modules/es.array.includes.js");
|
|
29
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
30
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
25
|
var _imports = require("../../imports");
|
|
32
26
|
var _type = require("../../type");
|
|
33
27
|
var _logger = require("../../utilities/logger");
|
|
34
|
-
|
|
35
|
-
let _initProto, _isPlatformAbilitySupportedDecs, _ref;
|
|
28
|
+
let _initProto, _isPlatformAbilitySupportedDecs;
|
|
36
29
|
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
30
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
38
31
|
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
32
|
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
33
|
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; }
|
|
41
|
-
_ref = (_isPlatformAbilitySupportedDecs = (0, _imports.trace)(['platform', 'ability']), "logger");
|
|
42
34
|
/**
|
|
43
35
|
* 平台能力控制的实现类
|
|
44
36
|
* @internal
|
|
45
37
|
*/
|
|
46
38
|
class FcrAbilityControlImpl {
|
|
39
|
+
static {
|
|
40
|
+
[_initProto] = _applyDecs(this, [[_isPlatformAbilitySupportedDecs, 2, "isPlatformAbilitySupported"], [_imports.trace, 2, "release"]], []).e;
|
|
41
|
+
}
|
|
42
|
+
//@internal
|
|
43
|
+
[(_isPlatformAbilitySupportedDecs = (0, _imports.trace)(['platform', 'ability']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
44
|
+
prefix: 'FcrAbilityControlImpl'
|
|
45
|
+
}));
|
|
47
46
|
constructor(_scene) {
|
|
48
|
-
//@internal
|
|
49
|
-
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
50
|
-
prefix: 'FcrAbilityControlImpl'
|
|
51
|
-
})));
|
|
52
47
|
this._scene = _scene;
|
|
53
48
|
}
|
|
54
49
|
getPlatformAbility(ability) {
|
|
55
|
-
const platforms = this._scene.getScenePropertiesByKeyPath(
|
|
50
|
+
const platforms = this._scene.getScenePropertiesByKeyPath(`setting.ability.${ability}`);
|
|
56
51
|
if (!Array.isArray(platforms)) {
|
|
57
52
|
return [_type.FcrPlatform.WEB_DESKTOP, _type.FcrPlatform.MACOS, _type.FcrPlatform.WINDOWS, _type.FcrPlatform.IOS, _type.FcrPlatform.ANDROID, _type.FcrPlatform.WEB_MOBILE, _type.FcrPlatform.HARMONY, _type.FcrPlatform.LINUX, _type.FcrPlatform.CONNECTOR_PSTN, _type.FcrPlatform.CONNECTOR_SIP, _type.FcrPlatform.CONNECTOR_H323];
|
|
58
53
|
}
|
|
@@ -69,9 +64,4 @@ class FcrAbilityControlImpl {
|
|
|
69
64
|
}
|
|
70
65
|
release() {}
|
|
71
66
|
}
|
|
72
|
-
exports.FcrAbilityControlImpl = FcrAbilityControlImpl;
|
|
73
|
-
_FcrAbilityControlImpl = FcrAbilityControlImpl;
|
|
74
|
-
var _applyDecs$e = _applyDecs(_FcrAbilityControlImpl, [[_isPlatformAbilitySupportedDecs, 2, "isPlatformAbilitySupported"], [_imports.trace, 2, "release"]], []).e;
|
|
75
|
-
var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
|
|
76
|
-
_initProto = _applyDecs$e2[0];
|
|
77
|
-
_applyDecs$e;
|
|
67
|
+
exports.FcrAbilityControlImpl = FcrAbilityControlImpl;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/es.array.push.js");
|
|
6
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
7
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
8
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
9
6
|
require("core-js/modules/esnext.map.emplace.js");
|
|
10
7
|
require("core-js/modules/esnext.map.every.js");
|
|
@@ -20,8 +17,6 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
20
17
|
require("core-js/modules/esnext.map.some.js");
|
|
21
18
|
require("core-js/modules/esnext.map.update.js");
|
|
22
19
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
23
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
24
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
25
20
|
Object.defineProperty(exports, "__esModule", {
|
|
26
21
|
value: true
|
|
27
22
|
});
|
|
@@ -31,76 +26,75 @@ require("core-js/modules/esnext.iterator.constructor.js");
|
|
|
31
26
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
32
27
|
require("core-js/modules/esnext.iterator.find.js");
|
|
33
28
|
require("core-js/modules/esnext.iterator.map.js");
|
|
34
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
35
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
36
29
|
var _imports = require("../../imports");
|
|
37
30
|
var _error = require("../../utilities/error");
|
|
38
31
|
var _type = require("../privilege-control/type");
|
|
39
32
|
var _type2 = require("./type");
|
|
40
33
|
var _logger = require("../../utilities/logger");
|
|
41
|
-
|
|
42
|
-
let _initProto, _startApplicatioByRoleDecs, _cancelApplicationDecs, _acceptApplicationByUserIdDecs, _acceptAllApplicationDecs, _rejectApplicationByUserIdDecs, _rejectAllApplicationDecs, _getApplicationUserListDecs, _ref;
|
|
43
|
-
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; }
|
|
44
|
-
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; }
|
|
34
|
+
let _initProto, _startApplicatioByRoleDecs, _cancelApplicationDecs, _acceptApplicationByUserIdDecs, _acceptAllApplicationDecs, _rejectApplicationByUserIdDecs, _rejectAllApplicationDecs, _getApplicationUserListDecs;
|
|
45
35
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
46
36
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
47
37
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
48
38
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
49
39
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
50
|
-
_ref = (_startApplicatioByRoleDecs = (0, _imports.trace)(['params', 'targetRoles']), _cancelApplicationDecs = (0, _imports.trace)(['applicationKey', 'cause']), _acceptApplicationByUserIdDecs = (0, _imports.trace)(['applicationKey', 'targetUserIds', 'cause']), _acceptAllApplicationDecs = (0, _imports.trace)(['applicationKey', 'cause']), _rejectApplicationByUserIdDecs = (0, _imports.trace)(['applicationKey', 'targetUserIds', 'cause']), _rejectAllApplicationDecs = (0, _imports.trace)(['applicationKey', 'cause']), _getApplicationUserListDecs = (0, _imports.trace)(['applicationKey']), "logger");
|
|
51
40
|
class FcrApplicationControlImpl {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
41
|
+
static {
|
|
42
|
+
[_initProto] = _applyDecs(this, [[_startApplicatioByRoleDecs, 2, "startApplicatioByRole"], [_cancelApplicationDecs, 2, "cancelApplication"], [_acceptApplicationByUserIdDecs, 2, "acceptApplicationByUserId"], [_acceptAllApplicationDecs, 2, "acceptAllApplication"], [_rejectApplicationByUserIdDecs, 2, "rejectApplicationByUserId"], [_rejectAllApplicationDecs, 2, "rejectAllApplication"], [_getApplicationUserListDecs, 2, "getApplicationUserList"]], []).e;
|
|
43
|
+
}
|
|
44
|
+
//@internal
|
|
45
|
+
[(_startApplicatioByRoleDecs = (0, _imports.trace)(['params', 'targetRoles']), _cancelApplicationDecs = (0, _imports.trace)(['applicationKey', 'cause']), _acceptApplicationByUserIdDecs = (0, _imports.trace)(['applicationKey', 'targetUserIds', 'cause']), _acceptAllApplicationDecs = (0, _imports.trace)(['applicationKey', 'cause']), _rejectApplicationByUserIdDecs = (0, _imports.trace)(['applicationKey', 'targetUserIds', 'cause']), _rejectAllApplicationDecs = (0, _imports.trace)(['applicationKey', 'cause']), _getApplicationUserListDecs = (0, _imports.trace)(['applicationKey']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
46
|
+
prefix: 'FcrApplicationControlImpl'
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
//@internal
|
|
50
|
+
_observable = new _imports.AgoraObservable();
|
|
51
|
+
|
|
52
|
+
//@internal
|
|
53
|
+
|
|
54
|
+
//@internal
|
|
55
|
+
_sceneObserver = {
|
|
56
|
+
onScenePropertiesUpdated: (roomId, events) => {
|
|
57
|
+
if (!events?.cause?.data) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const data = events.cause.data;
|
|
61
|
+
if (events.cause.cmd === 12) {
|
|
62
|
+
this._handleApplicationUserListAddedEvent(roomId, data);
|
|
63
|
+
if ([1, 2, 3, 4, 5].includes(data.reason)) {
|
|
64
|
+
const localUserId = this._scene.localUser.getLocalUserId();
|
|
65
|
+
const localUser = this._scene.getUser(localUserId);
|
|
66
|
+
if (!localUser) {
|
|
67
|
+
this.logger.error('onScenePropertiesUpdated local user is not found');
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (data.reason === 1) {
|
|
71
|
+
this._handleApplicationReceivedEvent(roomId, events, data, localUser);
|
|
72
|
+
}
|
|
73
|
+
const responderId = events.operatorUser.userId;
|
|
74
|
+
const isResponder = responderId == localUser.userId;
|
|
75
|
+
if (!isResponder) {
|
|
76
|
+
const applicationResponse = {
|
|
77
|
+
applicationKey: data.applicationKey,
|
|
78
|
+
responderId: events.operatorUser.userId,
|
|
79
|
+
cause: data.payload,
|
|
80
|
+
senderIds: data.removeApplicationUsers?.map(user => user.userUuid) || []
|
|
81
|
+
};
|
|
82
|
+
if (data.reason === 2) {
|
|
83
|
+
this._handleApplicationAcceptedEvent(roomId, applicationResponse, data, localUser);
|
|
75
84
|
}
|
|
76
|
-
if (data.reason ===
|
|
77
|
-
this.
|
|
85
|
+
if (data.reason === 4) {
|
|
86
|
+
this._handleApplicationRejectedEvent(roomId, applicationResponse, data, localUser);
|
|
78
87
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (!isResponder) {
|
|
82
|
-
var _data$removeApplicati;
|
|
83
|
-
const applicationResponse = {
|
|
84
|
-
applicationKey: data.applicationKey,
|
|
85
|
-
responderId: events.operatorUser.userId,
|
|
86
|
-
cause: data.payload,
|
|
87
|
-
senderIds: ((_data$removeApplicati = data.removeApplicationUsers) === null || _data$removeApplicati === void 0 ? void 0 : _data$removeApplicati.map(user => user.userUuid)) || []
|
|
88
|
-
};
|
|
89
|
-
if (data.reason === 2) {
|
|
90
|
-
this._handleApplicationAcceptedEvent(roomId, applicationResponse, data, localUser);
|
|
91
|
-
}
|
|
92
|
-
if (data.reason === 4) {
|
|
93
|
-
this._handleApplicationRejectedEvent(roomId, applicationResponse, data, localUser);
|
|
94
|
-
}
|
|
95
|
-
if ([3, 5].includes(data.reason)) {
|
|
96
|
-
this._handleApplicationCancelledEvent(roomId, applicationResponse, data, localUser);
|
|
97
|
-
}
|
|
88
|
+
if ([3, 5].includes(data.reason)) {
|
|
89
|
+
this._handleApplicationCancelledEvent(roomId, applicationResponse, data, localUser);
|
|
98
90
|
}
|
|
99
91
|
}
|
|
100
|
-
this._handleApplicationUserListRemovedEvent(roomId, data);
|
|
101
92
|
}
|
|
93
|
+
this._handleApplicationUserListRemovedEvent(roomId, data);
|
|
102
94
|
}
|
|
103
|
-
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
constructor(_scene, _api, _sharedCache) {
|
|
104
98
|
this._scene = _scene;
|
|
105
99
|
this._api = _api;
|
|
106
100
|
this._sharedCache = _sharedCache;
|
|
@@ -109,46 +103,52 @@ class FcrApplicationControlImpl {
|
|
|
109
103
|
this._addLogObserver();
|
|
110
104
|
}
|
|
111
105
|
startApplicatioByRole(params, targetRoles) {
|
|
112
|
-
return (0, _error.handleRequestError)(() => this._api.startApplicatioByRole(
|
|
106
|
+
return (0, _error.handleRequestError)(() => this._api.startApplicatioByRole({
|
|
107
|
+
...this._getApiCommonParams(),
|
|
113
108
|
applicationKey: params.applicationKey,
|
|
114
109
|
targetRoles: targetRoles.map(role => _type.FcrTargetUserTypeToStringMap[role]),
|
|
115
110
|
cause: params.body
|
|
116
|
-
})
|
|
111
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_APPLICATION, 'start application failed');
|
|
117
112
|
}
|
|
118
113
|
cancelApplication(applicationKey, cause) {
|
|
119
|
-
return (0, _error.handleRequestError)(() => this._api.cancelApplication(
|
|
114
|
+
return (0, _error.handleRequestError)(() => this._api.cancelApplication({
|
|
115
|
+
...this._getApiCommonParams(),
|
|
120
116
|
applicationKey: applicationKey,
|
|
121
117
|
cause
|
|
122
|
-
})
|
|
118
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_APPLICATION, 'cancel application failed');
|
|
123
119
|
}
|
|
124
120
|
acceptApplicationByUserId(applicationKey, targetUserIds, cause) {
|
|
125
|
-
return (0, _error.handleRequestError)(() => this._api.acceptApplicationByUserId(
|
|
121
|
+
return (0, _error.handleRequestError)(() => this._api.acceptApplicationByUserId({
|
|
122
|
+
...this._getApiCommonParams(),
|
|
126
123
|
applicationKey: applicationKey,
|
|
127
124
|
targetUserIds,
|
|
128
125
|
cause
|
|
129
|
-
})
|
|
126
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_APPLICATION, 'accept application by user id failed');
|
|
130
127
|
}
|
|
131
128
|
acceptAllApplication(applicationKey, cause) {
|
|
132
|
-
return (0, _error.handleRequestError)(() => this._api.acceptAllApplication(
|
|
129
|
+
return (0, _error.handleRequestError)(() => this._api.acceptAllApplication({
|
|
130
|
+
...this._getApiCommonParams(),
|
|
133
131
|
applicationKey: applicationKey,
|
|
134
132
|
cause
|
|
135
|
-
})
|
|
133
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_APPLICATION, 'accept all application failed');
|
|
136
134
|
}
|
|
137
135
|
rejectApplicationByUserId(applicationKey, targetUserIds, cause) {
|
|
138
|
-
return (0, _error.handleRequestError)(() => this._api.rejectApplicationByUserId(
|
|
136
|
+
return (0, _error.handleRequestError)(() => this._api.rejectApplicationByUserId({
|
|
137
|
+
...this._getApiCommonParams(),
|
|
139
138
|
applicationKey: applicationKey,
|
|
140
139
|
targetUserIds,
|
|
141
140
|
cause
|
|
142
|
-
})
|
|
141
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_APPLICATION, 'reject application by user id failed');
|
|
143
142
|
}
|
|
144
143
|
rejectAllApplication(applicationKey, cause) {
|
|
145
|
-
return (0, _error.handleRequestError)(() => this._api.rejectAllApplication(
|
|
144
|
+
return (0, _error.handleRequestError)(() => this._api.rejectAllApplication({
|
|
145
|
+
...this._getApiCommonParams(),
|
|
146
146
|
applicationKey: applicationKey,
|
|
147
147
|
cause
|
|
148
|
-
})
|
|
148
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_APPLICATION, 'accept all application failed');
|
|
149
149
|
}
|
|
150
150
|
getApplicationUserList(applicationKey) {
|
|
151
|
-
const users = this._scene.getScenePropertiesByKeyPath(
|
|
151
|
+
const users = this._scene.getScenePropertiesByKeyPath(`applications.${applicationKey}.users`);
|
|
152
152
|
if (!users) {
|
|
153
153
|
return undefined;
|
|
154
154
|
}
|
|
@@ -158,7 +158,7 @@ class FcrApplicationControlImpl {
|
|
|
158
158
|
if (userInfo) {
|
|
159
159
|
return userInfo;
|
|
160
160
|
} else {
|
|
161
|
-
this.logger.error(
|
|
161
|
+
this.logger.error(` application user not found, userId: ${user.userUuid}`);
|
|
162
162
|
return {
|
|
163
163
|
userId: user.userUuid
|
|
164
164
|
};
|
|
@@ -183,8 +183,7 @@ class FcrApplicationControlImpl {
|
|
|
183
183
|
return approveTargetUserIdCondition || approveTargetUserRoleCondition;
|
|
184
184
|
}
|
|
185
185
|
_getRemoveApplicationUserIdCondition(data, localUser) {
|
|
186
|
-
|
|
187
|
-
const removeApplicationUserIdCondition = (_data$removeApplicati2 = data.removeApplicationUsers) === null || _data$removeApplicati2 === void 0 ? void 0 : _data$removeApplicati2.find(user => user.userUuid === localUser.userId);
|
|
186
|
+
const removeApplicationUserIdCondition = data.removeApplicationUsers?.find(user => user.userUuid === localUser.userId);
|
|
188
187
|
return removeApplicationUserIdCondition;
|
|
189
188
|
}
|
|
190
189
|
_getApplicationCancelledReason(data) {
|
|
@@ -233,9 +232,8 @@ class FcrApplicationControlImpl {
|
|
|
233
232
|
this._observable.notifyObservers('onApplicationCancelled', roomId, applicationResponse, reason);
|
|
234
233
|
}
|
|
235
234
|
_handleApplicationAcceptedEvent(roomId, applicationResponse, data, localUser) {
|
|
236
|
-
var _data$addApplicationU;
|
|
237
235
|
const approveTargetCondition = this._getApproveTargetCondition(data, localUser);
|
|
238
|
-
const addApplicationUsersCondition =
|
|
236
|
+
const addApplicationUsersCondition = data.addApplicationUsers?.find(user => user.userUuid === localUser.userId);
|
|
239
237
|
if (!approveTargetCondition && !addApplicationUsersCondition) {
|
|
240
238
|
return;
|
|
241
239
|
}
|
|
@@ -263,9 +261,4 @@ class FcrApplicationControlImpl {
|
|
|
263
261
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onApplicationReceived', ['roomId', 'application']], ['onApplicationCancelled', ['roomId', 'response', 'reason']], ['onApplicationAccepted', ['roomId', 'response']], ['onApplicationRejected', ['roomId', 'response']]]));
|
|
264
262
|
}
|
|
265
263
|
}
|
|
266
|
-
exports.FcrApplicationControlImpl = FcrApplicationControlImpl;
|
|
267
|
-
_FcrApplicationControlImpl = FcrApplicationControlImpl;
|
|
268
|
-
var _applyDecs$e = _applyDecs(_FcrApplicationControlImpl, [[_startApplicatioByRoleDecs, 2, "startApplicatioByRole"], [_cancelApplicationDecs, 2, "cancelApplication"], [_acceptApplicationByUserIdDecs, 2, "acceptApplicationByUserId"], [_acceptAllApplicationDecs, 2, "acceptAllApplication"], [_rejectApplicationByUserIdDecs, 2, "rejectApplicationByUserId"], [_rejectAllApplicationDecs, 2, "rejectAllApplication"], [_getApplicationUserListDecs, 2, "getApplicationUserList"]], []).e;
|
|
269
|
-
var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
|
|
270
|
-
_initProto = _applyDecs$e2[0];
|
|
271
|
-
_applyDecs$e;
|
|
264
|
+
exports.FcrApplicationControlImpl = FcrApplicationControlImpl;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/esnext.function.metadata.js");
|
|
6
4
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
7
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -27,9 +25,6 @@ require("core-js/modules/esnext.map.merge.js");
|
|
|
27
25
|
require("core-js/modules/esnext.map.reduce.js");
|
|
28
26
|
require("core-js/modules/esnext.map.some.js");
|
|
29
27
|
require("core-js/modules/esnext.map.update.js");
|
|
30
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
31
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
32
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
33
28
|
var _imports = require("../../imports");
|
|
34
29
|
var _type = require("../../type");
|
|
35
30
|
var _user = require("../../utilities/user");
|
|
@@ -37,21 +32,24 @@ var _logger = require("../../utilities/logger");
|
|
|
37
32
|
var _error = require("../../utilities/error");
|
|
38
33
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
39
34
|
var _schema = require("../../schema");
|
|
40
|
-
|
|
41
|
-
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs, _ref;
|
|
35
|
+
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs;
|
|
42
36
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
43
37
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
44
38
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
45
39
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
46
40
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
47
|
-
_ref = (_getGroupUserListDecs = [(0, _imports.trace)(['groupId']), (0, _validateParams.default)(_schema.stringSchema)], _addGroupsDecs = [(0, _imports.trace)(['groups']), (0, _validateParams.default)(_schema.fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [(0, _imports.trace)(['groups']), (0, _validateParams.default)(_schema.fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [(0, _imports.trace)(['groupIds']), (0, _validateParams.default)(_schema.stringArraySchema)], _addUsersDecs = [(0, _imports.trace)(['userList', 'groupId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _removeUsersDecs = [(0, _imports.trace)(['userList', 'groupId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _moveUsersDecs = [(0, _imports.trace)(['userList', 'fromGroupId', 'toGroupId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema, _schema.stringSchema)], "logger");
|
|
48
41
|
class FcrGroupControl {
|
|
42
|
+
static {
|
|
43
|
+
[_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"], [_imports.trace, 2, "release"]], []).e;
|
|
44
|
+
}
|
|
45
|
+
//@internal
|
|
46
|
+
[(_getGroupUserListDecs = [(0, _imports.trace)(['groupId']), (0, _validateParams.default)(_schema.stringSchema)], _addGroupsDecs = [(0, _imports.trace)(['groups']), (0, _validateParams.default)(_schema.fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [(0, _imports.trace)(['groups']), (0, _validateParams.default)(_schema.fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [(0, _imports.trace)(['groupIds']), (0, _validateParams.default)(_schema.stringArraySchema)], _addUsersDecs = [(0, _imports.trace)(['userList', 'groupId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _removeUsersDecs = [(0, _imports.trace)(['userList', 'groupId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _moveUsersDecs = [(0, _imports.trace)(['userList', 'fromGroupId', 'toGroupId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema, _schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
47
|
+
prefix: 'FcrGroupControl'
|
|
48
|
+
}));
|
|
49
|
+
//@internal
|
|
50
|
+
|
|
51
|
+
_observable = new _imports.AgoraObservable();
|
|
49
52
|
constructor(_engine, _scene, _api, _sharedCache) {
|
|
50
|
-
//@internal
|
|
51
|
-
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
52
|
-
prefix: 'FcrGroupControl'
|
|
53
|
-
})));
|
|
54
|
-
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
55
53
|
this._engine = _engine;
|
|
56
54
|
this._scene = _scene;
|
|
57
55
|
this._api = _api;
|
|
@@ -63,8 +61,7 @@ class FcrGroupControl {
|
|
|
63
61
|
_addSceneObserver() {
|
|
64
62
|
this._sceneObserver = {
|
|
65
63
|
onScenePropertiesUpdated: (sceneId, event) => {
|
|
66
|
-
|
|
67
|
-
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 11) {
|
|
64
|
+
if (event.cause?.cmd === 11) {
|
|
68
65
|
const data = event.cause.data;
|
|
69
66
|
const changedProperties = event.changedProperties;
|
|
70
67
|
const groupDetails = changedProperties.groups.details;
|
|
@@ -92,10 +89,11 @@ class FcrGroupControl {
|
|
|
92
89
|
this._observable.notifyObservers('onGroupsUpdated', groupEvents);
|
|
93
90
|
}
|
|
94
91
|
if (data.actionType === 4) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
groupUuid
|
|
92
|
+
data.changeGroups?.forEach(group => {
|
|
93
|
+
const {
|
|
94
|
+
removeUsers,
|
|
95
|
+
groupUuid
|
|
96
|
+
} = group;
|
|
99
97
|
if (removeUsers) {
|
|
100
98
|
this._observable.notifyObservers('onUserListRemovedFromGroup', removeUsers.map(user => {
|
|
101
99
|
let operatorUser;
|
|
@@ -112,8 +110,10 @@ class FcrGroupControl {
|
|
|
112
110
|
}
|
|
113
111
|
});
|
|
114
112
|
const toGroupMap = new Map();
|
|
115
|
-
|
|
116
|
-
const
|
|
113
|
+
data.changeGroups?.forEach(group => {
|
|
114
|
+
const {
|
|
115
|
+
removeUsers
|
|
116
|
+
} = group;
|
|
117
117
|
if (removeUsers) {
|
|
118
118
|
removeUsers.forEach(user => {
|
|
119
119
|
if (user.toGroupUuid) {
|
|
@@ -153,9 +153,11 @@ class FcrGroupControl {
|
|
|
153
153
|
};
|
|
154
154
|
}));
|
|
155
155
|
});
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
156
|
+
data.changeGroups?.forEach(group => {
|
|
157
|
+
const {
|
|
158
|
+
addUsers,
|
|
159
|
+
groupUuid
|
|
160
|
+
} = group;
|
|
159
161
|
if (addUsers) {
|
|
160
162
|
this._observable.notifyObservers('onUserListAddedToGroup', addUsers.map(user => {
|
|
161
163
|
let operatorUser;
|
|
@@ -183,7 +185,9 @@ class FcrGroupControl {
|
|
|
183
185
|
const groupDetails = this._getGroupDetails();
|
|
184
186
|
const list = [];
|
|
185
187
|
Object.keys(groupDetails).forEach(groupId => {
|
|
186
|
-
const
|
|
188
|
+
const {
|
|
189
|
+
groupName
|
|
190
|
+
} = groupDetails[groupId];
|
|
187
191
|
list.push({
|
|
188
192
|
groupId,
|
|
189
193
|
groupName
|
|
@@ -263,9 +267,4 @@ class FcrGroupControl {
|
|
|
263
267
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onGroupsAdded', ['events']], ['onGroupsUpdated', ['events']], ['onGroupsRemoved', ['events']], ['onUserListAddedToGroup', ['events']], ['onUserListRemovedFromGroup', ['events']], ['onUserListMoveToGroup', ['events']]]));
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
|
-
exports.FcrGroupControl = FcrGroupControl;
|
|
267
|
-
_FcrGroupControl = FcrGroupControl;
|
|
268
|
-
var _applyDecs$e = _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"], [_imports.trace, 2, "release"]], []).e;
|
|
269
|
-
var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
|
|
270
|
-
_initProto = _applyDecs$e2[0];
|
|
271
|
-
_applyDecs$e;
|
|
270
|
+
exports.FcrGroupControl = FcrGroupControl;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.array.push.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
5
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
6
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
7
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
8
3
|
Object.defineProperty(exports, "__esModule", {
|
|
9
4
|
value: true
|
|
10
5
|
});
|
|
11
6
|
exports.addBoardInitInfoObserver = addBoardInitInfoObserver;
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
7
|
var _imports = require("../../imports");
|
|
14
8
|
var _error = require("../../utilities/error");
|
|
15
9
|
var _sceneProperties = require("../../utilities/scene-properties");
|
|
16
10
|
var _sharedStorage = require("../../utilities/shared-storage");
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
11
|
async function _getAnnotationToken(api, roomId, userId) {
|
|
20
12
|
return await (0, _error.handleRequestError)(() => api.getAnnotationToken({
|
|
21
13
|
roomId,
|
|
@@ -33,12 +25,13 @@ async function initAnnotationInfo(scene, api, logger) {
|
|
|
33
25
|
const userId = scene.localUser.getLocalUserId();
|
|
34
26
|
const boardToken = (await _getAnnotationToken(api, roomId, userId)).data;
|
|
35
27
|
if (!boardToken) {
|
|
36
|
-
logger.error(
|
|
28
|
+
logger.error(`get annotation board options failed, roomId: ${roomId}, userId: ${userId}, boardOptions: ${(0, _imports.jsonstring)(boardToken)}`);
|
|
37
29
|
} else {
|
|
38
|
-
const boardOptions =
|
|
30
|
+
const boardOptions = {
|
|
31
|
+
...boardToken,
|
|
39
32
|
boardPerformance: (0, _sceneProperties.getBoardPerformance)(scene)
|
|
40
|
-
}
|
|
41
|
-
logger.info(
|
|
33
|
+
};
|
|
34
|
+
logger.info(`get annotation board options success, roomId: ${roomId}, userId: ${userId}, boardOptions: ${(0, _imports.jsonstring)(boardOptions)}`);
|
|
42
35
|
(0, _sharedStorage.setAnnotationBoardOptions)(boardOptions);
|
|
43
36
|
}
|
|
44
37
|
}
|
|
@@ -47,12 +40,13 @@ async function initBoardInfo(scene, api, logger) {
|
|
|
47
40
|
const userId = scene.localUser.getLocalUserId();
|
|
48
41
|
const boardToken = (await _getBoardToken(api, roomId, userId)).data;
|
|
49
42
|
if (!boardToken) {
|
|
50
|
-
logger.error(
|
|
43
|
+
logger.error(`get whiteboard options failed, roomId: ${roomId}, userId: ${userId}, boardToken: ${(0, _imports.jsonstring)(boardToken)}`);
|
|
51
44
|
} else {
|
|
52
|
-
const boardOptions =
|
|
45
|
+
const boardOptions = {
|
|
46
|
+
...boardToken,
|
|
53
47
|
boardPerformance: (0, _sceneProperties.getBoardPerformance)(scene)
|
|
54
|
-
}
|
|
55
|
-
logger.info(
|
|
48
|
+
};
|
|
49
|
+
logger.info(`get whiteboard options success, roomId: ${roomId}, userId: ${userId}, boardOptions: ${(0, _imports.jsonstring)(boardOptions)}`);
|
|
56
50
|
(0, _sharedStorage.setWhiteboardOptions)(boardOptions);
|
|
57
51
|
}
|
|
58
52
|
}
|
|
@@ -33,7 +33,7 @@ function validateControllerInitialized(controller, controllerType) {
|
|
|
33
33
|
*/
|
|
34
34
|
function validateRoomJoined(joinRoomSuccess, operation) {
|
|
35
35
|
if (!joinRoomSuccess) {
|
|
36
|
-
throw _errorHelpers.roomControlErrorHelper.createOperationError(
|
|
36
|
+
throw _errorHelpers.roomControlErrorHelper.createOperationError(`${operation}, please join room first`);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|