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,5 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.symbol.description.js";
|
|
2
|
-
import "core-js/modules/es.error.cause.js";
|
|
3
1
|
import "core-js/modules/es.array.push.js";
|
|
4
2
|
import "core-js/modules/esnext.function.metadata.js";
|
|
5
3
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
@@ -17,11 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
17
15
|
import "core-js/modules/esnext.map.some.js";
|
|
18
16
|
import "core-js/modules/esnext.map.update.js";
|
|
19
17
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
20
|
-
|
|
21
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
22
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
23
|
-
var _FcrAbilityControlImpl;
|
|
24
|
-
let _initProto, _isPlatformAbilitySupportedDecs, _ref;
|
|
18
|
+
let _initProto, _isPlatformAbilitySupportedDecs;
|
|
25
19
|
import "core-js/modules/es.array.includes.js";
|
|
26
20
|
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)]; } }; }
|
|
27
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -31,21 +25,23 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
31
25
|
import { getPlatform, trace } from '../../imports';
|
|
32
26
|
import { FcrPlatform } from '../../type';
|
|
33
27
|
import { createLogger } from '../../utilities/logger';
|
|
34
|
-
_ref = (_isPlatformAbilitySupportedDecs = trace(['platform', 'ability']), "logger");
|
|
35
28
|
/**
|
|
36
29
|
* 平台能力控制的实现类
|
|
37
30
|
* @internal
|
|
38
31
|
*/
|
|
39
32
|
export class FcrAbilityControlImpl {
|
|
33
|
+
static {
|
|
34
|
+
[_initProto] = _applyDecs(this, [[_isPlatformAbilitySupportedDecs, 2, "isPlatformAbilitySupported"], [trace, 2, "release"]], []).e;
|
|
35
|
+
}
|
|
36
|
+
//@internal
|
|
37
|
+
[(_isPlatformAbilitySupportedDecs = trace(['platform', 'ability']), "logger")] = (_initProto(this), createLogger({
|
|
38
|
+
prefix: 'FcrAbilityControlImpl'
|
|
39
|
+
}));
|
|
40
40
|
constructor(_scene) {
|
|
41
|
-
//@internal
|
|
42
|
-
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
43
|
-
prefix: 'FcrAbilityControlImpl'
|
|
44
|
-
})));
|
|
45
41
|
this._scene = _scene;
|
|
46
42
|
}
|
|
47
43
|
getPlatformAbility(ability) {
|
|
48
|
-
const platforms = this._scene.getScenePropertiesByKeyPath(
|
|
44
|
+
const platforms = this._scene.getScenePropertiesByKeyPath(`setting.ability.${ability}`);
|
|
49
45
|
if (!Array.isArray(platforms)) {
|
|
50
46
|
return [FcrPlatform.WEB_DESKTOP, FcrPlatform.MACOS, FcrPlatform.WINDOWS, FcrPlatform.IOS, FcrPlatform.ANDROID, FcrPlatform.WEB_MOBILE, FcrPlatform.HARMONY, FcrPlatform.LINUX, FcrPlatform.CONNECTOR_PSTN, FcrPlatform.CONNECTOR_SIP, FcrPlatform.CONNECTOR_H323];
|
|
51
47
|
}
|
|
@@ -61,9 +57,4 @@ export class FcrAbilityControlImpl {
|
|
|
61
57
|
return platforms.includes(platform);
|
|
62
58
|
}
|
|
63
59
|
release() {}
|
|
64
|
-
}
|
|
65
|
-
_FcrAbilityControlImpl = FcrAbilityControlImpl;
|
|
66
|
-
var _applyDecs$e = _applyDecs(_FcrAbilityControlImpl, [[_isPlatformAbilitySupportedDecs, 2, "isPlatformAbilitySupported"], [trace, 2, "release"]], []).e;
|
|
67
|
-
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
68
|
-
_initProto = _applyDecs$e2[0];
|
|
69
|
-
_applyDecs$e;
|
|
60
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import "core-js/modules/es.symbol.description.js";
|
|
2
|
-
import "core-js/modules/es.error.cause.js";
|
|
3
1
|
import "core-js/modules/es.array.push.js";
|
|
4
2
|
import "core-js/modules/esnext.function.metadata.js";
|
|
5
|
-
import "core-js/modules/esnext.iterator.for-each.js";
|
|
6
3
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
7
4
|
import "core-js/modules/esnext.map.emplace.js";
|
|
8
5
|
import "core-js/modules/esnext.map.every.js";
|
|
@@ -18,13 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
18
15
|
import "core-js/modules/esnext.map.some.js";
|
|
19
16
|
import "core-js/modules/esnext.map.update.js";
|
|
20
17
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
21
|
-
|
|
22
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
23
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
24
|
-
var _FcrApplicationControlImpl;
|
|
25
|
-
let _initProto, _startApplicatioByRoleDecs, _cancelApplicationDecs, _acceptApplicationByUserIdDecs, _acceptAllApplicationDecs, _rejectApplicationByUserIdDecs, _rejectAllApplicationDecs, _getApplicationUserListDecs, _ref;
|
|
26
|
-
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; }
|
|
27
|
-
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) { _defineProperty(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; }
|
|
18
|
+
let _initProto, _startApplicatioByRoleDecs, _cancelApplicationDecs, _acceptApplicationByUserIdDecs, _acceptAllApplicationDecs, _rejectApplicationByUserIdDecs, _rejectAllApplicationDecs, _getApplicationUserListDecs;
|
|
28
19
|
import "core-js/modules/es.array.includes.js";
|
|
29
20
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
30
21
|
import "core-js/modules/esnext.iterator.filter.js";
|
|
@@ -40,60 +31,64 @@ import { handleRequestError } from '../../utilities/error';
|
|
|
40
31
|
import { FcrTargetUserTypeToStringMap } from '../privilege-control/type';
|
|
41
32
|
import { FcrApplicationCancelledReason } from './type';
|
|
42
33
|
import { createLogger, generateLogObserver } from '../../utilities/logger';
|
|
43
|
-
_ref = (_startApplicatioByRoleDecs = trace(['params', 'targetRoles']), _cancelApplicationDecs = trace(['applicationKey', 'cause']), _acceptApplicationByUserIdDecs = trace(['applicationKey', 'targetUserIds', 'cause']), _acceptAllApplicationDecs = trace(['applicationKey', 'cause']), _rejectApplicationByUserIdDecs = trace(['applicationKey', 'targetUserIds', 'cause']), _rejectAllApplicationDecs = trace(['applicationKey', 'cause']), _getApplicationUserListDecs = trace(['applicationKey']), "logger");
|
|
44
34
|
export class FcrApplicationControlImpl {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
static {
|
|
36
|
+
[_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;
|
|
37
|
+
}
|
|
38
|
+
//@internal
|
|
39
|
+
[(_startApplicatioByRoleDecs = trace(['params', 'targetRoles']), _cancelApplicationDecs = trace(['applicationKey', 'cause']), _acceptApplicationByUserIdDecs = trace(['applicationKey', 'targetUserIds', 'cause']), _acceptAllApplicationDecs = trace(['applicationKey', 'cause']), _rejectApplicationByUserIdDecs = trace(['applicationKey', 'targetUserIds', 'cause']), _rejectAllApplicationDecs = trace(['applicationKey', 'cause']), _getApplicationUserListDecs = trace(['applicationKey']), "logger")] = (_initProto(this), createLogger({
|
|
40
|
+
prefix: 'FcrApplicationControlImpl'
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
//@internal
|
|
44
|
+
_observable = new AgoraObservable();
|
|
45
|
+
|
|
46
|
+
//@internal
|
|
47
|
+
|
|
48
|
+
//@internal
|
|
49
|
+
_sceneObserver = {
|
|
50
|
+
onScenePropertiesUpdated: (roomId, events) => {
|
|
51
|
+
if (!events?.cause?.data) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const data = events.cause.data;
|
|
55
|
+
if (events.cause.cmd === 12) {
|
|
56
|
+
this._handleApplicationUserListAddedEvent(roomId, data);
|
|
57
|
+
if ([1, 2, 3, 4, 5].includes(data.reason)) {
|
|
58
|
+
const localUserId = this._scene.localUser.getLocalUserId();
|
|
59
|
+
const localUser = this._scene.getUser(localUserId);
|
|
60
|
+
if (!localUser) {
|
|
61
|
+
this.logger.error('onScenePropertiesUpdated local user is not found');
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (data.reason === 1) {
|
|
65
|
+
this._handleApplicationReceivedEvent(roomId, events, data, localUser);
|
|
66
|
+
}
|
|
67
|
+
const responderId = events.operatorUser.userId;
|
|
68
|
+
const isResponder = responderId == localUser.userId;
|
|
69
|
+
if (!isResponder) {
|
|
70
|
+
const applicationResponse = {
|
|
71
|
+
applicationKey: data.applicationKey,
|
|
72
|
+
responderId: events.operatorUser.userId,
|
|
73
|
+
cause: data.payload,
|
|
74
|
+
senderIds: data.removeApplicationUsers?.map(user => user.userUuid) || []
|
|
75
|
+
};
|
|
76
|
+
if (data.reason === 2) {
|
|
77
|
+
this._handleApplicationAcceptedEvent(roomId, applicationResponse, data, localUser);
|
|
68
78
|
}
|
|
69
|
-
if (data.reason ===
|
|
70
|
-
this.
|
|
79
|
+
if (data.reason === 4) {
|
|
80
|
+
this._handleApplicationRejectedEvent(roomId, applicationResponse, data, localUser);
|
|
71
81
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (!isResponder) {
|
|
75
|
-
var _data$removeApplicati;
|
|
76
|
-
const applicationResponse = {
|
|
77
|
-
applicationKey: data.applicationKey,
|
|
78
|
-
responderId: events.operatorUser.userId,
|
|
79
|
-
cause: data.payload,
|
|
80
|
-
senderIds: ((_data$removeApplicati = data.removeApplicationUsers) === null || _data$removeApplicati === void 0 ? void 0 : _data$removeApplicati.map(user => user.userUuid)) || []
|
|
81
|
-
};
|
|
82
|
-
if (data.reason === 2) {
|
|
83
|
-
this._handleApplicationAcceptedEvent(roomId, applicationResponse, data, localUser);
|
|
84
|
-
}
|
|
85
|
-
if (data.reason === 4) {
|
|
86
|
-
this._handleApplicationRejectedEvent(roomId, applicationResponse, data, localUser);
|
|
87
|
-
}
|
|
88
|
-
if ([3, 5].includes(data.reason)) {
|
|
89
|
-
this._handleApplicationCancelledEvent(roomId, applicationResponse, data, localUser);
|
|
90
|
-
}
|
|
82
|
+
if ([3, 5].includes(data.reason)) {
|
|
83
|
+
this._handleApplicationCancelledEvent(roomId, applicationResponse, data, localUser);
|
|
91
84
|
}
|
|
92
85
|
}
|
|
93
|
-
this._handleApplicationUserListRemovedEvent(roomId, data);
|
|
94
86
|
}
|
|
87
|
+
this._handleApplicationUserListRemovedEvent(roomId, data);
|
|
95
88
|
}
|
|
96
|
-
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
constructor(_scene, _api, _sharedCache) {
|
|
97
92
|
this._scene = _scene;
|
|
98
93
|
this._api = _api;
|
|
99
94
|
this._sharedCache = _sharedCache;
|
|
@@ -102,46 +97,52 @@ export class FcrApplicationControlImpl {
|
|
|
102
97
|
this._addLogObserver();
|
|
103
98
|
}
|
|
104
99
|
startApplicatioByRole(params, targetRoles) {
|
|
105
|
-
return handleRequestError(() => this._api.startApplicatioByRole(
|
|
100
|
+
return handleRequestError(() => this._api.startApplicatioByRole({
|
|
101
|
+
...this._getApiCommonParams(),
|
|
106
102
|
applicationKey: params.applicationKey,
|
|
107
103
|
targetRoles: targetRoles.map(role => FcrTargetUserTypeToStringMap[role]),
|
|
108
104
|
cause: params.body
|
|
109
|
-
})
|
|
105
|
+
}), ErrorModuleCode.FCR_ROOM_APPLICATION, 'start application failed');
|
|
110
106
|
}
|
|
111
107
|
cancelApplication(applicationKey, cause) {
|
|
112
|
-
return handleRequestError(() => this._api.cancelApplication(
|
|
108
|
+
return handleRequestError(() => this._api.cancelApplication({
|
|
109
|
+
...this._getApiCommonParams(),
|
|
113
110
|
applicationKey: applicationKey,
|
|
114
111
|
cause
|
|
115
|
-
})
|
|
112
|
+
}), ErrorModuleCode.FCR_ROOM_APPLICATION, 'cancel application failed');
|
|
116
113
|
}
|
|
117
114
|
acceptApplicationByUserId(applicationKey, targetUserIds, cause) {
|
|
118
|
-
return handleRequestError(() => this._api.acceptApplicationByUserId(
|
|
115
|
+
return handleRequestError(() => this._api.acceptApplicationByUserId({
|
|
116
|
+
...this._getApiCommonParams(),
|
|
119
117
|
applicationKey: applicationKey,
|
|
120
118
|
targetUserIds,
|
|
121
119
|
cause
|
|
122
|
-
})
|
|
120
|
+
}), ErrorModuleCode.FCR_ROOM_APPLICATION, 'accept application by user id failed');
|
|
123
121
|
}
|
|
124
122
|
acceptAllApplication(applicationKey, cause) {
|
|
125
|
-
return handleRequestError(() => this._api.acceptAllApplication(
|
|
123
|
+
return handleRequestError(() => this._api.acceptAllApplication({
|
|
124
|
+
...this._getApiCommonParams(),
|
|
126
125
|
applicationKey: applicationKey,
|
|
127
126
|
cause
|
|
128
|
-
})
|
|
127
|
+
}), ErrorModuleCode.FCR_ROOM_APPLICATION, 'accept all application failed');
|
|
129
128
|
}
|
|
130
129
|
rejectApplicationByUserId(applicationKey, targetUserIds, cause) {
|
|
131
|
-
return handleRequestError(() => this._api.rejectApplicationByUserId(
|
|
130
|
+
return handleRequestError(() => this._api.rejectApplicationByUserId({
|
|
131
|
+
...this._getApiCommonParams(),
|
|
132
132
|
applicationKey: applicationKey,
|
|
133
133
|
targetUserIds,
|
|
134
134
|
cause
|
|
135
|
-
})
|
|
135
|
+
}), ErrorModuleCode.FCR_ROOM_APPLICATION, 'reject application by user id failed');
|
|
136
136
|
}
|
|
137
137
|
rejectAllApplication(applicationKey, cause) {
|
|
138
|
-
return handleRequestError(() => this._api.rejectAllApplication(
|
|
138
|
+
return handleRequestError(() => this._api.rejectAllApplication({
|
|
139
|
+
...this._getApiCommonParams(),
|
|
139
140
|
applicationKey: applicationKey,
|
|
140
141
|
cause
|
|
141
|
-
})
|
|
142
|
+
}), ErrorModuleCode.FCR_ROOM_APPLICATION, 'accept all application failed');
|
|
142
143
|
}
|
|
143
144
|
getApplicationUserList(applicationKey) {
|
|
144
|
-
const users = this._scene.getScenePropertiesByKeyPath(
|
|
145
|
+
const users = this._scene.getScenePropertiesByKeyPath(`applications.${applicationKey}.users`);
|
|
145
146
|
if (!users) {
|
|
146
147
|
return undefined;
|
|
147
148
|
}
|
|
@@ -151,7 +152,7 @@ export class FcrApplicationControlImpl {
|
|
|
151
152
|
if (userInfo) {
|
|
152
153
|
return userInfo;
|
|
153
154
|
} else {
|
|
154
|
-
this.logger.error(
|
|
155
|
+
this.logger.error(` application user not found, userId: ${user.userUuid}`);
|
|
155
156
|
return {
|
|
156
157
|
userId: user.userUuid
|
|
157
158
|
};
|
|
@@ -176,8 +177,7 @@ export class FcrApplicationControlImpl {
|
|
|
176
177
|
return approveTargetUserIdCondition || approveTargetUserRoleCondition;
|
|
177
178
|
}
|
|
178
179
|
_getRemoveApplicationUserIdCondition(data, localUser) {
|
|
179
|
-
|
|
180
|
-
const removeApplicationUserIdCondition = (_data$removeApplicati2 = data.removeApplicationUsers) === null || _data$removeApplicati2 === void 0 ? void 0 : _data$removeApplicati2.find(user => user.userUuid === localUser.userId);
|
|
180
|
+
const removeApplicationUserIdCondition = data.removeApplicationUsers?.find(user => user.userUuid === localUser.userId);
|
|
181
181
|
return removeApplicationUserIdCondition;
|
|
182
182
|
}
|
|
183
183
|
_getApplicationCancelledReason(data) {
|
|
@@ -226,9 +226,8 @@ export class FcrApplicationControlImpl {
|
|
|
226
226
|
this._observable.notifyObservers('onApplicationCancelled', roomId, applicationResponse, reason);
|
|
227
227
|
}
|
|
228
228
|
_handleApplicationAcceptedEvent(roomId, applicationResponse, data, localUser) {
|
|
229
|
-
var _data$addApplicationU;
|
|
230
229
|
const approveTargetCondition = this._getApproveTargetCondition(data, localUser);
|
|
231
|
-
const addApplicationUsersCondition =
|
|
230
|
+
const addApplicationUsersCondition = data.addApplicationUsers?.find(user => user.userUuid === localUser.userId);
|
|
232
231
|
if (!approveTargetCondition && !addApplicationUsersCondition) {
|
|
233
232
|
return;
|
|
234
233
|
}
|
|
@@ -255,9 +254,4 @@ export class FcrApplicationControlImpl {
|
|
|
255
254
|
_addLogObserver() {
|
|
256
255
|
this.addObserver(generateLogObserver(this.logger, [['onApplicationReceived', ['roomId', 'application']], ['onApplicationCancelled', ['roomId', 'response', 'reason']], ['onApplicationAccepted', ['roomId', 'response']], ['onApplicationRejected', ['roomId', 'response']]]));
|
|
257
256
|
}
|
|
258
|
-
}
|
|
259
|
-
_FcrApplicationControlImpl = FcrApplicationControlImpl;
|
|
260
|
-
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;
|
|
261
|
-
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
262
|
-
_initProto = _applyDecs$e2[0];
|
|
263
|
-
_applyDecs$e;
|
|
257
|
+
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import "core-js/modules/es.symbol.description.js";
|
|
2
|
-
import "core-js/modules/es.error.cause.js";
|
|
3
1
|
import "core-js/modules/esnext.function.metadata.js";
|
|
4
2
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
5
|
-
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
var _FcrGroupControl;
|
|
8
|
-
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs, _ref;
|
|
3
|
+
let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs;
|
|
9
4
|
import "core-js/modules/es.array.push.js";
|
|
10
5
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
11
6
|
import "core-js/modules/esnext.iterator.for-each.js";
|
|
@@ -24,7 +19,6 @@ import "core-js/modules/esnext.map.merge.js";
|
|
|
24
19
|
import "core-js/modules/esnext.map.reduce.js";
|
|
25
20
|
import "core-js/modules/esnext.map.some.js";
|
|
26
21
|
import "core-js/modules/esnext.map.update.js";
|
|
27
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
28
22
|
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)]; } }; }
|
|
29
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
30
24
|
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,14 +33,18 @@ import { handleRequestError } from '../../utilities/error';
|
|
|
39
33
|
import validateParams from '../../utilities/validate-params';
|
|
40
34
|
import { fcrGroupUpdateOptionsArraySchema, fcrGroupCreateConfigArraySchema, stringArraySchema, stringSchema } from '../../schema';
|
|
41
35
|
import { ErrorModuleCode } from '../../imports';
|
|
42
|
-
_ref = (_getGroupUserListDecs = [trace(['groupId']), validateParams(stringSchema)], _addGroupsDecs = [trace(['groups']), validateParams(fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [trace(['groups']), validateParams(fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [trace(['groupIds']), validateParams(stringArraySchema)], _addUsersDecs = [trace(['userList', 'groupId']), validateParams(stringArraySchema, stringSchema)], _removeUsersDecs = [trace(['userList', 'groupId']), validateParams(stringArraySchema, stringSchema)], _moveUsersDecs = [trace(['userList', 'fromGroupId', 'toGroupId']), validateParams(stringArraySchema, stringSchema, stringSchema)], "logger");
|
|
43
36
|
export class FcrGroupControl {
|
|
37
|
+
static {
|
|
38
|
+
[_initProto] = _applyDecs(this, [[trace, 2, "getGroupList"], [_getGroupUserListDecs, 2, "getGroupUserList"], [_addGroupsDecs, 2, "addGroups"], [_updateGroupsDecs, 2, "updateGroups"], [_deleteGroupsDecs, 2, "deleteGroups"], [trace, 2, "deleteAllGroups"], [_addUsersDecs, 2, "addUsers"], [_removeUsersDecs, 2, "removeUsers"], [_moveUsersDecs, 2, "moveUsers"], [trace, 2, "release"]], []).e;
|
|
39
|
+
}
|
|
40
|
+
//@internal
|
|
41
|
+
[(_getGroupUserListDecs = [trace(['groupId']), validateParams(stringSchema)], _addGroupsDecs = [trace(['groups']), validateParams(fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [trace(['groups']), validateParams(fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [trace(['groupIds']), validateParams(stringArraySchema)], _addUsersDecs = [trace(['userList', 'groupId']), validateParams(stringArraySchema, stringSchema)], _removeUsersDecs = [trace(['userList', 'groupId']), validateParams(stringArraySchema, stringSchema)], _moveUsersDecs = [trace(['userList', 'fromGroupId', 'toGroupId']), validateParams(stringArraySchema, stringSchema, stringSchema)], "logger")] = (_initProto(this), createLogger({
|
|
42
|
+
prefix: 'FcrGroupControl'
|
|
43
|
+
}));
|
|
44
|
+
//@internal
|
|
45
|
+
|
|
46
|
+
_observable = new AgoraObservable();
|
|
44
47
|
constructor(_engine, _scene, _api, _sharedCache) {
|
|
45
|
-
//@internal
|
|
46
|
-
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
47
|
-
prefix: 'FcrGroupControl'
|
|
48
|
-
})));
|
|
49
|
-
_defineProperty(this, "_observable", new AgoraObservable());
|
|
50
48
|
this._engine = _engine;
|
|
51
49
|
this._scene = _scene;
|
|
52
50
|
this._api = _api;
|
|
@@ -58,8 +56,7 @@ export class FcrGroupControl {
|
|
|
58
56
|
_addSceneObserver() {
|
|
59
57
|
this._sceneObserver = {
|
|
60
58
|
onScenePropertiesUpdated: (sceneId, event) => {
|
|
61
|
-
|
|
62
|
-
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 11) {
|
|
59
|
+
if (event.cause?.cmd === 11) {
|
|
63
60
|
const data = event.cause.data;
|
|
64
61
|
const changedProperties = event.changedProperties;
|
|
65
62
|
const groupDetails = changedProperties.groups.details;
|
|
@@ -87,10 +84,11 @@ export class FcrGroupControl {
|
|
|
87
84
|
this._observable.notifyObservers('onGroupsUpdated', groupEvents);
|
|
88
85
|
}
|
|
89
86
|
if (data.actionType === 4) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
groupUuid
|
|
87
|
+
data.changeGroups?.forEach(group => {
|
|
88
|
+
const {
|
|
89
|
+
removeUsers,
|
|
90
|
+
groupUuid
|
|
91
|
+
} = group;
|
|
94
92
|
if (removeUsers) {
|
|
95
93
|
this._observable.notifyObservers('onUserListRemovedFromGroup', removeUsers.map(user => {
|
|
96
94
|
let operatorUser;
|
|
@@ -107,8 +105,10 @@ export class FcrGroupControl {
|
|
|
107
105
|
}
|
|
108
106
|
});
|
|
109
107
|
const toGroupMap = new Map();
|
|
110
|
-
|
|
111
|
-
const
|
|
108
|
+
data.changeGroups?.forEach(group => {
|
|
109
|
+
const {
|
|
110
|
+
removeUsers
|
|
111
|
+
} = group;
|
|
112
112
|
if (removeUsers) {
|
|
113
113
|
removeUsers.forEach(user => {
|
|
114
114
|
if (user.toGroupUuid) {
|
|
@@ -148,9 +148,11 @@ export class FcrGroupControl {
|
|
|
148
148
|
};
|
|
149
149
|
}));
|
|
150
150
|
});
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
151
|
+
data.changeGroups?.forEach(group => {
|
|
152
|
+
const {
|
|
153
|
+
addUsers,
|
|
154
|
+
groupUuid
|
|
155
|
+
} = group;
|
|
154
156
|
if (addUsers) {
|
|
155
157
|
this._observable.notifyObservers('onUserListAddedToGroup', addUsers.map(user => {
|
|
156
158
|
let operatorUser;
|
|
@@ -178,7 +180,9 @@ export class FcrGroupControl {
|
|
|
178
180
|
const groupDetails = this._getGroupDetails();
|
|
179
181
|
const list = [];
|
|
180
182
|
Object.keys(groupDetails).forEach(groupId => {
|
|
181
|
-
const
|
|
183
|
+
const {
|
|
184
|
+
groupName
|
|
185
|
+
} = groupDetails[groupId];
|
|
182
186
|
list.push({
|
|
183
187
|
groupId,
|
|
184
188
|
groupName
|
|
@@ -257,9 +261,4 @@ export class FcrGroupControl {
|
|
|
257
261
|
_addLogObserver() {
|
|
258
262
|
this.addObserver(generateLogObserver(this.logger, [['onGroupsAdded', ['events']], ['onGroupsUpdated', ['events']], ['onGroupsRemoved', ['events']], ['onUserListAddedToGroup', ['events']], ['onUserListRemovedFromGroup', ['events']], ['onUserListMoveToGroup', ['events']]]));
|
|
259
263
|
}
|
|
260
|
-
}
|
|
261
|
-
_FcrGroupControl = FcrGroupControl;
|
|
262
|
-
var _applyDecs$e = _applyDecs(_FcrGroupControl, [[trace, 2, "getGroupList"], [_getGroupUserListDecs, 2, "getGroupUserList"], [_addGroupsDecs, 2, "addGroups"], [_updateGroupsDecs, 2, "updateGroups"], [_deleteGroupsDecs, 2, "deleteGroups"], [trace, 2, "deleteAllGroups"], [_addUsersDecs, 2, "addUsers"], [_removeUsersDecs, 2, "removeUsers"], [_moveUsersDecs, 2, "moveUsers"], [trace, 2, "release"]], []).e;
|
|
263
|
-
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
264
|
-
_initProto = _applyDecs$e2[0];
|
|
265
|
-
_applyDecs$e;
|
|
264
|
+
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.array.push.js";
|
|
2
|
-
import "core-js/modules/esnext.iterator.constructor.js";
|
|
3
|
-
import "core-js/modules/esnext.iterator.filter.js";
|
|
4
|
-
import "core-js/modules/esnext.iterator.for-each.js";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
-
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; }
|
|
7
|
-
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) { _defineProperty(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; }
|
|
8
1
|
import { ErrorModuleCode, get, jsonstring } from '../../imports';
|
|
9
2
|
import { handleRequestError } from '../../utilities/error';
|
|
10
3
|
import { getBoardPerformance } from '../../utilities/scene-properties';
|
|
@@ -26,12 +19,13 @@ async function initAnnotationInfo(scene, api, logger) {
|
|
|
26
19
|
const userId = scene.localUser.getLocalUserId();
|
|
27
20
|
const boardToken = (await _getAnnotationToken(api, roomId, userId)).data;
|
|
28
21
|
if (!boardToken) {
|
|
29
|
-
logger.error(
|
|
22
|
+
logger.error(`get annotation board options failed, roomId: ${roomId}, userId: ${userId}, boardOptions: ${jsonstring(boardToken)}`);
|
|
30
23
|
} else {
|
|
31
|
-
const boardOptions =
|
|
24
|
+
const boardOptions = {
|
|
25
|
+
...boardToken,
|
|
32
26
|
boardPerformance: getBoardPerformance(scene)
|
|
33
|
-
}
|
|
34
|
-
logger.info(
|
|
27
|
+
};
|
|
28
|
+
logger.info(`get annotation board options success, roomId: ${roomId}, userId: ${userId}, boardOptions: ${jsonstring(boardOptions)}`);
|
|
35
29
|
setAnnotationBoardOptions(boardOptions);
|
|
36
30
|
}
|
|
37
31
|
}
|
|
@@ -40,12 +34,13 @@ async function initBoardInfo(scene, api, logger) {
|
|
|
40
34
|
const userId = scene.localUser.getLocalUserId();
|
|
41
35
|
const boardToken = (await _getBoardToken(api, roomId, userId)).data;
|
|
42
36
|
if (!boardToken) {
|
|
43
|
-
logger.error(
|
|
37
|
+
logger.error(`get whiteboard options failed, roomId: ${roomId}, userId: ${userId}, boardToken: ${jsonstring(boardToken)}`);
|
|
44
38
|
} else {
|
|
45
|
-
const boardOptions =
|
|
39
|
+
const boardOptions = {
|
|
40
|
+
...boardToken,
|
|
46
41
|
boardPerformance: getBoardPerformance(scene)
|
|
47
|
-
}
|
|
48
|
-
logger.info(
|
|
42
|
+
};
|
|
43
|
+
logger.info(`get whiteboard options success, roomId: ${roomId}, userId: ${userId}, boardOptions: ${jsonstring(boardOptions)}`);
|
|
49
44
|
setWhiteboardOptions(boardOptions);
|
|
50
45
|
}
|
|
51
46
|
}
|
|
@@ -26,7 +26,7 @@ export function validateControllerInitialized(controller, controllerType) {
|
|
|
26
26
|
*/
|
|
27
27
|
export function validateRoomJoined(joinRoomSuccess, operation) {
|
|
28
28
|
if (!joinRoomSuccess) {
|
|
29
|
-
throw roomControlErrorHelper.createOperationError(
|
|
29
|
+
throw roomControlErrorHelper.createOperationError(`${operation}, please join room first`);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|