fcr-core 3.10.2 → 3.10.5
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 +102 -108
- package/lib/imports.js +1 -0
- package/lib/media-control/desktop.js +22 -13
- package/lib/media-control/mobile.js +27 -19
- package/lib/media-control/type.d.ts +3 -3
- package/lib/monitor-control/index.js +17 -7
- package/lib/peer-session/index.js +120 -121
- package/lib/plugins/chat/chatroom.js +119 -96
- package/lib/plugins/chat/connector.js +69 -48
- package/lib/remote-control/index.js +194 -216
- package/lib/room-control/ability-control/index.js +20 -10
- package/lib/room-control/application-control/index.js +82 -75
- package/lib/room-control/group-control/index.js +31 -30
- package/lib/room-control/helpers/board-init-info-helper.js +16 -10
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +70 -51
- package/lib/room-control/infinity-room-control/index.js +27 -19
- package/lib/room-control/interpreter-control/index.js +77 -65
- package/lib/room-control/interpreter-control/room.js +6 -4
- package/lib/room-control/join-before-host-waitingroom-control/index.js +6 -4
- package/lib/room-control/mainroom-control/index.js +37 -25
- package/lib/room-control/privilege-control/helper.js +28 -13
- package/lib/room-control/privilege-control/index.js +36 -28
- package/lib/room-control/room-connector-control/index.js +52 -49
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.js +10 -12
- package/lib/room-control/room-session/index.js +77 -74
- package/lib/room-control/shared-cache.js +63 -56
- package/lib/room-control/sharing-control/index.js +65 -57
- package/lib/room-control/stream-control/index.js +197 -193
- package/lib/room-control/stt-control/de-compress-gzip.js +10 -0
- package/lib/room-control/stt-control/index.js +93 -86
- package/lib/room-control/user-control/index.js +162 -155
- package/lib/room-control/waitingroom-control/index.js +18 -9
- package/lib/room-control/whiteboard-control/utils.js +4 -2
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
- package/lib/room-control/whiteboard-control-v1/board-window.js +120 -103
- package/lib/room-control/whiteboard-control-v1/factory.js +7 -4
- package/lib/room-control/whiteboard-control-v1/index.js +80 -67
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +4 -2
- package/lib/room-control/whiteboard-control-v1/utils.js +17 -14
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +14 -10
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +17 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +61 -53
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +39 -30
- package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +27 -11
- package/lib/room-control/widget-control/index.js +43 -33
- package/lib/room-router/index.js +66 -58
- package/lib/schema.d.ts +15 -15
- package/lib/service/api.js +446 -548
- package/lib/struct.js +5 -2
- package/lib/utilities/abortable-retry.js +3 -0
- package/lib/utilities/collection.js +15 -11
- package/lib/utilities/error-helpers.js +34 -27
- package/lib/utilities/error.js +4 -3
- package/lib/utilities/join-helper.js +37 -31
- package/lib/utilities/logger.js +8 -5
- package/lib/utilities/parameters.js +21 -10
- package/lib/utilities/retry-helpers.js +1 -0
- package/lib/utilities/stream.js +16 -11
- package/lib/utilities/user.js +4 -3
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.js +10 -5
- package/lib-es/engine/index.js +102 -108
- package/lib-es/media-control/desktop.js +22 -13
- package/lib-es/media-control/mobile.js +27 -19
- package/lib-es/monitor-control/index.js +16 -7
- package/lib-es/peer-session/index.js +120 -121
- package/lib-es/plugins/chat/chatroom.js +118 -95
- package/lib-es/plugins/chat/connector.js +67 -47
- package/lib-es/remote-control/index.js +194 -216
- package/lib-es/room-control/ability-control/index.js +19 -10
- package/lib-es/room-control/application-control/index.js +81 -75
- package/lib-es/room-control/group-control/index.js +31 -30
- package/lib-es/room-control/helpers/board-init-info-helper.js +15 -10
- package/lib-es/room-control/helpers/validation-helper.js +1 -1
- package/lib-es/room-control/index.js +69 -51
- package/lib-es/room-control/infinity-room-control/index.js +26 -19
- package/lib-es/room-control/interpreter-control/index.js +77 -65
- package/lib-es/room-control/interpreter-control/room.js +5 -4
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +5 -4
- package/lib-es/room-control/mainroom-control/index.js +37 -25
- package/lib-es/room-control/privilege-control/helper.js +27 -13
- package/lib-es/room-control/privilege-control/index.js +36 -28
- package/lib-es/room-control/room-connector-control/index.js +52 -49
- package/lib-es/room-control/room-control-factory.js +10 -12
- package/lib-es/room-control/room-session/index.js +77 -74
- package/lib-es/room-control/shared-cache.js +62 -56
- package/lib-es/room-control/sharing-control/index.js +64 -57
- package/lib-es/room-control/stream-control/index.js +197 -193
- package/lib-es/room-control/stt-control/de-compress-gzip.js +10 -0
- package/lib-es/room-control/stt-control/index.js +93 -86
- package/lib-es/room-control/user-control/index.js +162 -155
- package/lib-es/room-control/waitingroom-control/index.js +18 -9
- package/lib-es/room-control/whiteboard-control/utils.js +4 -2
- package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +120 -103
- package/lib-es/room-control/whiteboard-control-v1/factory.js +6 -4
- package/lib-es/room-control/whiteboard-control-v1/index.js +80 -67
- package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +3 -2
- package/lib-es/room-control/whiteboard-control-v1/utils.js +17 -14
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +13 -10
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +16 -8
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +60 -53
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +39 -30
- package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +26 -11
- package/lib-es/room-control/widget-control/index.js +42 -33
- package/lib-es/room-router/index.js +66 -58
- package/lib-es/service/api.js +445 -548
- package/lib-es/struct.js +4 -2
- package/lib-es/utilities/abortable-retry.js +3 -0
- package/lib-es/utilities/collection.js +14 -11
- package/lib-es/utilities/error-helpers.js +33 -26
- package/lib-es/utilities/error.js +4 -3
- package/lib-es/utilities/join-helper.js +36 -29
- package/lib-es/utilities/logger.js +7 -5
- package/lib-es/utilities/parameters.js +21 -10
- package/lib-es/utilities/retry-helpers.js +1 -0
- package/lib-es/utilities/stream.js +15 -11
- package/lib-es/utilities/user.js +4 -3
- package/lib-es/utilities/validate-params.js +1 -1
- package/lib-es/utilities/video-encoder-config.js +10 -5
- package/package.json +4 -4
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
|
1
3
|
import "core-js/modules/esnext.function.metadata.js";
|
|
4
|
+
import "core-js/modules/esnext.iterator.filter.js";
|
|
2
5
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
3
6
|
import "core-js/modules/esnext.map.emplace.js";
|
|
4
7
|
import "core-js/modules/esnext.map.every.js";
|
|
@@ -14,12 +17,19 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
14
17
|
import "core-js/modules/esnext.map.some.js";
|
|
15
18
|
import "core-js/modules/esnext.map.update.js";
|
|
16
19
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
17
|
-
|
|
20
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
21
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
22
|
+
var _FcrUserControlImpl;
|
|
23
|
+
let _initProto, _getUserDecs, _fetchUserListDecs, _updateUserNameDecs, _updateUserPropertiesDecs, _updateIncrementUserPropertiesDecs, _deleteUserPropertiesDecs, _getUserPropertiesByUserIdDecs, _getUserPropertiesByKeyPathDecs, _updateRemoteUserRoleDecs, _claimHostDecs, _kickOutDecs, _kickOutByUserIdsDecs, _kickOutByUserRolesDecs, _mergeAudioStreamDecs, _ref;
|
|
24
|
+
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; }
|
|
25
|
+
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
26
|
import "core-js/modules/es.array.push.js";
|
|
27
|
+
import "core-js/modules/es.object.from-entries.js";
|
|
19
28
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
20
29
|
import "core-js/modules/esnext.iterator.find.js";
|
|
21
30
|
import "core-js/modules/esnext.iterator.for-each.js";
|
|
22
31
|
import "core-js/modules/esnext.iterator.map.js";
|
|
32
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
23
33
|
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)]; } }; }
|
|
24
34
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
35
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -41,165 +51,157 @@ import { ErrorModuleCode } from '../../imports';
|
|
|
41
51
|
/**
|
|
42
52
|
* @internal
|
|
43
53
|
*/
|
|
54
|
+
_ref = (_getUserDecs = [bound, validateParams(stringSchema)], _fetchUserListDecs = [bound, trace(['params'])], _updateUserNameDecs = [bound, trace(['userId', 'userName']), validateParams(stringSchema, stringSchema)], _updateUserPropertiesDecs = [bound, trace(['properties', 'cause', 'userId']), validateParams(stringKeyUnknownValueSchema, stringKeyUnknownValueSchema, stringSchema)], _updateIncrementUserPropertiesDecs = [bound, trace(['increments', 'cause', 'userId']), validateParams(stringKeyNumberValueSchema, stringKeyUnknownValueSchema, stringSchema)], _deleteUserPropertiesDecs = [bound, trace(['keyPath', 'cause', 'userId']), validateParams(stringArraySchema, stringKeyUnknownValueSchema, stringSchema)], _getUserPropertiesByUserIdDecs = [bound, trace(['userId']), validateParams(stringSchema)], _getUserPropertiesByKeyPathDecs = [bound, trace(['keyPath', 'userId']), validateParams(stringSchema, stringSchema)], _updateRemoteUserRoleDecs = [bound, trace(['userId', 'userRole']), validateParams(stringSchema, fcrUserRoleSchema)], _claimHostDecs = [bound, trace(['hostKey']), validateParams(stringSchema)], _kickOutDecs = [bound, trace(['userId', 'type']), validateParams(stringSchema, fcrUserKickedOutTypeSchema)], _kickOutByUserIdsDecs = [trace(['userIds', 'type']), validateParams(stringArraySchema, fcrUserKickedOutTypeSchema)], _kickOutByUserRolesDecs = [trace(['userRoles', 'type']), validateParams(fcrUserRolesSchema, fcrUserKickedOutTypeSchema)], _mergeAudioStreamDecs = [trace(['userId']), validateParams(stringSchema)], "logger");
|
|
44
55
|
export class FcrUserControlImpl {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
56
|
+
constructor(_scene, _api, _sharedCache) {
|
|
57
|
+
//@internal
|
|
58
|
+
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
59
|
+
prefix: 'FcrUserControlImpl'
|
|
60
|
+
})));
|
|
61
|
+
//@internal
|
|
62
|
+
_defineProperty(this, "_observable", new AgoraObservable());
|
|
63
|
+
//@internal
|
|
64
|
+
_defineProperty(this, "_enableUserCount", true);
|
|
65
|
+
//@internal
|
|
66
|
+
_defineProperty(this, "_sceneObserver", {
|
|
67
|
+
onRemoteUsersJoined: (roomId, events) => {
|
|
68
|
+
events.forEach(event => {
|
|
69
|
+
const userProperties = this._scene.getUserPropertiesByUserId(event.userInfo.userId);
|
|
70
|
+
this._roomCache.setUserPlatform(event.userInfo.userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.platform);
|
|
71
|
+
this._roomCache.setUserAvatar(event.userInfo.userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.avatar);
|
|
72
|
+
});
|
|
73
|
+
const fcrUserEvents = events.map(e => {
|
|
74
|
+
return {
|
|
75
|
+
userInfo: e.userInfo && convertRteUserToFcrUser(e.userInfo, this._roomCache)
|
|
76
|
+
// operatorUser: e.operatorUser && convertRteUserToFcrUser(e.operatorUser, this._roomCache),
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
fcrUserEvents.forEach(event => {
|
|
80
|
+
const user = event.userInfo;
|
|
81
|
+
const exists = user.userId in this._roomCache.userMapByUserId;
|
|
82
|
+
if (exists) {
|
|
83
|
+
this.logger.warn("[FcrUserControl] user joined when the user already exists, userId: ".concat(user.userId));
|
|
84
|
+
} else {
|
|
85
|
+
this._roomCache.setUserMapByUserId(user.userId, user);
|
|
86
|
+
this._roomCache.addUserToList(user);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
this._observable.notifyObservers('onRemoteUsersJoined', roomId, fcrUserEvents);
|
|
90
|
+
},
|
|
91
|
+
onRemoteUsersLeft: (roomId, events) => {
|
|
92
|
+
const fcrUserEvents = events.map(e => {
|
|
93
|
+
var _e$cause;
|
|
94
|
+
return {
|
|
95
|
+
userInfo: e.userInfo && convertRteUserToFcrUser(e.userInfo, this._roomCache),
|
|
96
|
+
userProperties: e.userProperties,
|
|
97
|
+
operatorUser: e.operatorUser && convertRteUserToFcrUser(e.operatorUser, this._roomCache),
|
|
98
|
+
reason: ((_e$cause = e.cause) === null || _e$cause === void 0 ? void 0 : _e$cause.cmd) === 5 ? FcrUserLeftReason.kickOut : FcrUserLeftReason.LeaveRoom
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
fcrUserEvents.forEach(event => {
|
|
102
|
+
const user = event.userInfo;
|
|
103
|
+
const exists = this._roomCache.userMapByUserId.has(user.userId);
|
|
104
|
+
if (!exists) {
|
|
105
|
+
this.logger.warn("[FcrUserControl] user left when the user does not exist, userId: ".concat(user.userId));
|
|
106
|
+
} else {
|
|
107
|
+
this._roomCache.deleteUserMapByUserId(user.userId);
|
|
108
|
+
const index = this._roomCache.userList.findIndex(u => user.userId === u.userId);
|
|
109
|
+
if (index !== -1) {
|
|
110
|
+
this._roomCache.deleteUserList(index);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
events.forEach(event => {
|
|
115
|
+
this._roomCache.deleteUserPlatform(event.userInfo.userId);
|
|
116
|
+
this._roomCache.deleteUserAvatar(event.userInfo.userId);
|
|
117
|
+
});
|
|
118
|
+
this._observable.notifyObservers('onRemoteUsersLeft', roomId, fcrUserEvents);
|
|
119
|
+
},
|
|
120
|
+
onUserUpdated: (sceneId, event) => {
|
|
121
|
+
const fcrUserUpdatedEvent = {
|
|
122
|
+
modifiedUser: event.modifiedUser && convertRteUserToFcrUser(event.modifiedUser, this._roomCache),
|
|
123
|
+
operatorUser: event.operatorUser && convertRteUserToFcrUser(event.operatorUser, this._roomCache),
|
|
124
|
+
reason: event.reason
|
|
94
125
|
};
|
|
95
|
-
|
|
96
|
-
fcrUserEvents.forEach(event => {
|
|
97
|
-
const user = event.userInfo;
|
|
126
|
+
const user = fcrUserUpdatedEvent.modifiedUser;
|
|
98
127
|
const exists = this._roomCache.userMapByUserId.has(user.userId);
|
|
99
128
|
if (!exists) {
|
|
100
|
-
this.logger.warn(
|
|
129
|
+
this.logger.warn("[FcrUserControl] user updated when the user does not exist, userId: ".concat(user.userId));
|
|
101
130
|
} else {
|
|
102
|
-
this._roomCache.
|
|
131
|
+
this._roomCache.setUserMapByUserId(user.userId, user);
|
|
103
132
|
const index = this._roomCache.userList.findIndex(u => user.userId === u.userId);
|
|
104
133
|
if (index !== -1) {
|
|
105
134
|
this._roomCache.deleteUserList(index);
|
|
135
|
+
this._roomCache.insertUserToList(index, user);
|
|
106
136
|
}
|
|
107
137
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
this.
|
|
112
|
-
|
|
113
|
-
this._observable.notifyObservers('onRemoteUsersLeft', roomId, fcrUserEvents);
|
|
114
|
-
},
|
|
115
|
-
onUserUpdated: (sceneId, event) => {
|
|
116
|
-
const fcrUserUpdatedEvent = {
|
|
117
|
-
modifiedUser: event.modifiedUser && convertRteUserToFcrUser(event.modifiedUser, this._roomCache),
|
|
118
|
-
operatorUser: event.operatorUser && convertRteUserToFcrUser(event.operatorUser, this._roomCache),
|
|
119
|
-
reason: event.reason
|
|
120
|
-
};
|
|
121
|
-
const user = fcrUserUpdatedEvent.modifiedUser;
|
|
122
|
-
const exists = this._roomCache.userMapByUserId.has(user.userId);
|
|
123
|
-
if (!exists) {
|
|
124
|
-
this.logger.warn(`[FcrUserControl] user updated when the user does not exist, userId: ${user.userId}`);
|
|
125
|
-
} else {
|
|
126
|
-
this._roomCache.setUserMapByUserId(user.userId, user);
|
|
127
|
-
const index = this._roomCache.userList.findIndex(u => user.userId === u.userId);
|
|
128
|
-
if (index !== -1) {
|
|
129
|
-
this._roomCache.deleteUserList(index);
|
|
130
|
-
this._roomCache.insertUserToList(index, user);
|
|
138
|
+
this._observable.notifyObservers('onUserInfoUpdated', sceneId, fcrUserUpdatedEvent);
|
|
139
|
+
},
|
|
140
|
+
onAllUserCountUpdated: (sceneId, count) => {
|
|
141
|
+
if (!this._enableUserCount) {
|
|
142
|
+
return;
|
|
131
143
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
'0': FcrUserKickedOutType.Once,
|
|
148
|
-
'1': FcrUserKickedOutType.Forever,
|
|
149
|
-
'2': 2
|
|
150
|
-
};
|
|
151
|
-
const key = get(changedProperties, 'dirty.state');
|
|
152
|
-
const type = dirtyStateMap[key];
|
|
153
|
-
this._observable.notifyObservers('onLocalUserKickedOut', roomId, {
|
|
154
|
-
type
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
if (event.cause?.cmd === 8) {
|
|
158
|
-
const changedProperties = {};
|
|
159
|
-
for (const key in event.changedProperties) {
|
|
160
|
-
if (key.startsWith('flexProps')) {
|
|
161
|
-
changedProperties[key] = event.changedProperties[key];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (Object.keys(changedProperties).length > 0) {
|
|
165
|
-
const structure = convertToStructure(changedProperties);
|
|
166
|
-
this._observable.notifyObservers('onUserPropertiesUpdated', roomId, {
|
|
167
|
-
...event,
|
|
168
|
-
changedProperties: structure['flexProps']
|
|
144
|
+
this._observable.notifyObservers('onAllUserCountUpdated', sceneId, count);
|
|
145
|
+
},
|
|
146
|
+
onUserPropertiesUpdated: (roomId, event) => {
|
|
147
|
+
var _event$cause, _event$cause2;
|
|
148
|
+
if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 5 && event.modifiedUser.userId === this._localUserId) {
|
|
149
|
+
const changedProperties = event.changedProperties;
|
|
150
|
+
const dirtyStateMap = {
|
|
151
|
+
'0': FcrUserKickedOutType.Once,
|
|
152
|
+
'1': FcrUserKickedOutType.Forever,
|
|
153
|
+
'2': 2
|
|
154
|
+
};
|
|
155
|
+
const key = get(changedProperties, 'dirty.state');
|
|
156
|
+
const type = dirtyStateMap[key];
|
|
157
|
+
this._observable.notifyObservers('onLocalUserKickedOut', roomId, {
|
|
158
|
+
type
|
|
169
159
|
});
|
|
170
160
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
161
|
+
if (((_event$cause2 = event.cause) === null || _event$cause2 === void 0 ? void 0 : _event$cause2.cmd) === 8) {
|
|
162
|
+
const changedProperties = {};
|
|
163
|
+
for (const key in event.changedProperties) {
|
|
164
|
+
if (key.startsWith('flexProps')) {
|
|
165
|
+
changedProperties[key] = event.changedProperties[key];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (Object.keys(changedProperties).length > 0) {
|
|
169
|
+
const structure = convertToStructure(changedProperties);
|
|
170
|
+
this._observable.notifyObservers('onUserPropertiesUpdated', roomId, _objectSpread(_objectSpread({}, event), {}, {
|
|
171
|
+
changedProperties: structure['flexProps']
|
|
172
|
+
}));
|
|
179
173
|
}
|
|
180
174
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
},
|
|
176
|
+
onUserPropertiesDeleted: (roomId, event) => {
|
|
177
|
+
var _event$cause3;
|
|
178
|
+
if (((_event$cause3 = event.cause) === null || _event$cause3 === void 0 ? void 0 : _event$cause3.cmd) === 8) {
|
|
179
|
+
const changedKeyPaths = [];
|
|
180
|
+
for (const keyPath of event.changedKeyPaths) {
|
|
181
|
+
if (keyPath.startsWith('flexProps')) {
|
|
182
|
+
changedKeyPaths.push(keyPath);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (changedKeyPaths.length > 0) {
|
|
186
|
+
this._observable.notifyObservers('onUserPropertiesDeleted', roomId, _objectSpread(_objectSpread({}, event), {}, {
|
|
187
|
+
changedKeyPaths
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
186
190
|
}
|
|
191
|
+
},
|
|
192
|
+
onRemoteUsersSynced: (roomId, events) => {
|
|
193
|
+
this._observable.notifyObservers('onRemoteUsersSynced', roomId, events);
|
|
194
|
+
},
|
|
195
|
+
onRemoteUsersDesynced: (roomId, events) => {
|
|
196
|
+
this._observable.notifyObservers('onRemoteUsersDesynced', roomId, events);
|
|
197
|
+
},
|
|
198
|
+
onUserCountUpdatedByRole: (roomId, userRole, count) => {
|
|
199
|
+
if (!this._enableUserCount) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
this._observable.notifyObservers('onUserCountUpdatedByRole', roomId, userRole, count);
|
|
187
203
|
}
|
|
188
|
-
}
|
|
189
|
-
onRemoteUsersSynced: (roomId, events) => {
|
|
190
|
-
this._observable.notifyObservers('onRemoteUsersSynced', roomId, events);
|
|
191
|
-
},
|
|
192
|
-
onRemoteUsersDesynced: (roomId, events) => {
|
|
193
|
-
this._observable.notifyObservers('onRemoteUsersDesynced', roomId, events);
|
|
194
|
-
},
|
|
195
|
-
onUserCountUpdatedByRole: (roomId, userRole, count) => {
|
|
196
|
-
if (!this._enableUserCount) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
this._observable.notifyObservers('onUserCountUpdatedByRole', roomId, userRole, count);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
constructor(_scene, _api, _sharedCache) {
|
|
204
|
+
});
|
|
203
205
|
this._scene = _scene;
|
|
204
206
|
this._api = _api;
|
|
205
207
|
this._sharedCache = _sharedCache;
|
|
@@ -207,8 +209,8 @@ export class FcrUserControlImpl {
|
|
|
207
209
|
const users = this._scene.getUsers();
|
|
208
210
|
Object.keys(users).forEach(userId => {
|
|
209
211
|
const userProperties = this._scene.getUserPropertiesByUserId(userId);
|
|
210
|
-
this._roomCache.setUserAvatar(userId, userProperties
|
|
211
|
-
this._roomCache.setUserPlatform(userId, userProperties
|
|
212
|
+
this._roomCache.setUserAvatar(userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.avatar);
|
|
213
|
+
this._roomCache.setUserPlatform(userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.platform);
|
|
212
214
|
});
|
|
213
215
|
Object.keys(users).forEach(userId => {
|
|
214
216
|
this._roomCache.setUserMapByUserId(userId, convertRteUserToFcrUser(users[userId], this._roomCache));
|
|
@@ -236,7 +238,7 @@ export class FcrUserControlImpl {
|
|
|
236
238
|
}
|
|
237
239
|
getUserListByRole(role) {
|
|
238
240
|
const userList = this._scene.getUserListByRole(FcrUserRoleToStringMap[role]);
|
|
239
|
-
return userList
|
|
241
|
+
return userList === null || userList === void 0 ? void 0 : userList.map(user => convertRteUserToFcrUser(user, this._roomCache));
|
|
240
242
|
}
|
|
241
243
|
getUserCountByRole(role) {
|
|
242
244
|
if (!this._enableUserCount) {
|
|
@@ -254,9 +256,8 @@ export class FcrUserControlImpl {
|
|
|
254
256
|
return this._scene.getUserCount();
|
|
255
257
|
}
|
|
256
258
|
getWaterMarkContent() {
|
|
257
|
-
const
|
|
258
|
-
userId
|
|
259
|
-
} = this.getLocalUser();
|
|
259
|
+
const _this$getLocalUser = this.getLocalUser(),
|
|
260
|
+
userId = _this$getLocalUser.userId;
|
|
260
261
|
return get(this._scene.getUserPropertiesByUserId(userId), 'security.watermark.content');
|
|
261
262
|
}
|
|
262
263
|
async fetchUserList(params) {
|
|
@@ -297,12 +298,14 @@ export class FcrUserControlImpl {
|
|
|
297
298
|
const userProperties = this._scene.getUserProperties();
|
|
298
299
|
const res = {};
|
|
299
300
|
for (const userId in userProperties) {
|
|
300
|
-
|
|
301
|
+
var _userProperties$userI;
|
|
302
|
+
res[userId] = (_userProperties$userI = userProperties[userId]) === null || _userProperties$userI === void 0 ? void 0 : _userProperties$userI['flexProps'];
|
|
301
303
|
}
|
|
302
304
|
return res;
|
|
303
305
|
}
|
|
304
306
|
getUserPropertiesByUserId(userId) {
|
|
305
|
-
|
|
307
|
+
var _this$_scene$getUserP;
|
|
308
|
+
return (_this$_scene$getUserP = this._scene.getUserPropertiesByUserId(userId)) === null || _this$_scene$getUserP === void 0 ? void 0 : _this$_scene$getUserP['flexProps'];
|
|
306
309
|
}
|
|
307
310
|
getUserPropertiesByKeyPath(keyPath, userId) {
|
|
308
311
|
return this._scene.getUserPropertiesByKeyPath('flexProps.' + keyPath, userId);
|
|
@@ -326,9 +329,8 @@ export class FcrUserControlImpl {
|
|
|
326
329
|
}
|
|
327
330
|
}
|
|
328
331
|
async claimHost(hostKey) {
|
|
329
|
-
const
|
|
330
|
-
userId
|
|
331
|
-
} = this.getLocalUser();
|
|
332
|
+
const _this$getLocalUser2 = this.getLocalUser(),
|
|
333
|
+
userId = _this$getLocalUser2.userId;
|
|
332
334
|
return await handleRequestError(() => this._api.claimHost({
|
|
333
335
|
roomId: this._scene.sceneId,
|
|
334
336
|
hostKey,
|
|
@@ -368,4 +370,9 @@ export class FcrUserControlImpl {
|
|
|
368
370
|
_addLogObserver() {
|
|
369
371
|
this.addObserver(generateLogObserver(this.logger, [['onRemoteUsersJoined', ['roomId', 'events']], ['onRemoteUsersLeft', ['roomId', 'events']], ['onUserInfoUpdated', ['roomId', 'event']], ['onAllUserCountUpdated', ['roomId', 'count']], ['onLocalUserKickedOut', ['roomId', 'event']], ['onUserPropertiesUpdated', ['roomId', 'event']], ['onUserPropertiesDeleted', ['roomId', 'event']]]));
|
|
370
372
|
}
|
|
371
|
-
}
|
|
373
|
+
}
|
|
374
|
+
_FcrUserControlImpl = FcrUserControlImpl;
|
|
375
|
+
var _applyDecs$e = _applyDecs(_FcrUserControlImpl, [[bound, 2, "getLocalUser"], [bound, 2, "getUsers"], [bound, 2, "getUserList"], [bound, 2, "getUserListByRole"], [bound, 2, "getUserCountByRole"], [_getUserDecs, 2, "getUser"], [[bound, trace], 2, "getAllUserCount"], [bound, 2, "getWaterMarkContent"], [_fetchUserListDecs, 2, "fetchUserList"], [_updateUserNameDecs, 2, "updateUserName"], [_updateUserPropertiesDecs, 2, "updateUserProperties"], [_updateIncrementUserPropertiesDecs, 2, "updateIncrementUserProperties"], [_deleteUserPropertiesDecs, 2, "deleteUserProperties"], [[bound, trace], 2, "getUserProperties"], [_getUserPropertiesByUserIdDecs, 2, "getUserPropertiesByUserId"], [_getUserPropertiesByKeyPathDecs, 2, "getUserPropertiesByKeyPath"], [_updateRemoteUserRoleDecs, 2, "updateRemoteUserRole"], [[bound, trace], 2, "revokeHost"], [_claimHostDecs, 2, "claimHost"], [_kickOutDecs, 2, "kickOut"], [_kickOutByUserIdsDecs, 2, "kickOutByUserIds"], [_kickOutByUserRolesDecs, 2, "kickOutByUserRoles"], [_mergeAudioStreamDecs, 2, "mergeAudioStream"], [trace, 2, "release"]], []).e;
|
|
376
|
+
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
377
|
+
_initProto = _applyDecs$e2[0];
|
|
378
|
+
_applyDecs$e;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
|
1
3
|
import "core-js/modules/es.array.push.js";
|
|
2
4
|
import "core-js/modules/esnext.function.metadata.js";
|
|
3
5
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
@@ -15,7 +17,11 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
15
17
|
import "core-js/modules/esnext.map.some.js";
|
|
16
18
|
import "core-js/modules/esnext.map.update.js";
|
|
17
19
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
18
|
-
|
|
20
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
21
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
22
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
23
|
+
var _FcrWaitingRoomControlImpl;
|
|
24
|
+
let _initProto, _moveToMainRoomByUserIdsDecs, _moveToMainRoomByUserRolesDecs, _ref;
|
|
19
25
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
20
26
|
import "core-js/modules/esnext.iterator.map.js";
|
|
21
27
|
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)]; } }; }
|
|
@@ -35,16 +41,14 @@ import { FcrRoomType } from '../type';
|
|
|
35
41
|
/**
|
|
36
42
|
* @internal
|
|
37
43
|
*/
|
|
44
|
+
_ref = (_moveToMainRoomByUserIdsDecs = [trace(['userIds']), validateParams(stringArraySchema)], _moveToMainRoomByUserRolesDecs = [trace(['userRoles']), validateParams(fcrUserRolesSchema)], "logger");
|
|
38
45
|
export class FcrWaitingRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
39
|
-
static {
|
|
40
|
-
[_initProto] = _applyDecs(this, [[_moveToMainRoomByUserIdsDecs, 2, "moveToMainRoomByUserIds"], [_moveToMainRoomByUserRolesDecs, 2, "moveToMainRoomByUserRoles"]], [], 0, void 0, FcrBaseRoomControlImpl).e;
|
|
41
|
-
}
|
|
42
|
-
//@internal
|
|
43
|
-
[(_moveToMainRoomByUserIdsDecs = [trace(['userIds']), validateParams(stringArraySchema)], _moveToMainRoomByUserRolesDecs = [trace(['userRoles']), validateParams(fcrUserRolesSchema)], "logger")] = (_initProto(this), createLogger({
|
|
44
|
-
prefix: 'FcrWaitingRoomControlImpl'
|
|
45
|
-
}));
|
|
46
46
|
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
|
|
47
47
|
super(engine, scene, api, config, FcrRoomType.Waitingroom, chatConnection, sharedCache, chatRoomControl);
|
|
48
|
+
//@internal
|
|
49
|
+
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
50
|
+
prefix: 'FcrWaitingRoomControlImpl'
|
|
51
|
+
})));
|
|
48
52
|
this._addLogObserver();
|
|
49
53
|
}
|
|
50
54
|
addObserver(observer) {
|
|
@@ -65,4 +69,9 @@ export class FcrWaitingRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
65
69
|
// 'onNetworkStatsUpdated',
|
|
66
70
|
['onRoomMessageReceived', ['roomId', 'message']], ['onRoomPropertiesDeleted', ['roomId', 'event']], ['onRoomPropertiesUpdated', ['roomId', 'event']], ['onRoomStateUpdated', ['roomId', 'state']]]));
|
|
67
71
|
}
|
|
68
|
-
}
|
|
72
|
+
}
|
|
73
|
+
_FcrWaitingRoomControlImpl = FcrWaitingRoomControlImpl;
|
|
74
|
+
var _applyDecs$e = _applyDecs(_FcrWaitingRoomControlImpl, [[_moveToMainRoomByUserIdsDecs, 2, "moveToMainRoomByUserIds"], [_moveToMainRoomByUserRolesDecs, 2, "moveToMainRoomByUserRoles"]], [], 0, void 0, FcrBaseRoomControlImpl).e;
|
|
75
|
+
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
76
|
+
_initProto = _applyDecs$e2[0];
|
|
77
|
+
_applyDecs$e;
|
|
@@ -3,11 +3,13 @@ import "core-js/modules/esnext.iterator.some.js";
|
|
|
3
3
|
import { FcrPermissionAction } from '../privilege-control/type';
|
|
4
4
|
export const hasBoardWritePermission = permissions => {
|
|
5
5
|
return permissions.some(permission => {
|
|
6
|
-
|
|
6
|
+
var _permission$info;
|
|
7
|
+
return ((_permission$info = permission.info) === null || _permission$info === void 0 ? void 0 : _permission$info.action) === FcrPermissionAction.BoardWrite;
|
|
7
8
|
});
|
|
8
9
|
};
|
|
9
10
|
export const hasAnnotationWritePermission = permissions => {
|
|
10
11
|
return permissions.some(permission => {
|
|
11
|
-
|
|
12
|
+
var _permission$info2;
|
|
13
|
+
return ((_permission$info2 = permission.info) === null || _permission$info2 === void 0 ? void 0 : _permission$info2.action) === FcrPermissionAction.AnnotationWrite;
|
|
12
14
|
});
|
|
13
15
|
};
|
|
@@ -10,7 +10,8 @@ export class FcrBoardSubWindowImpl {
|
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
11
11
|
window.addEventListener('message', event => {
|
|
12
12
|
if (event.data.type === '@netless/_result_save_pdf_') {
|
|
13
|
-
|
|
13
|
+
var _event$data$result;
|
|
14
|
+
event.data.progress === 100 && resolve((_event$data$result = event.data.result) === null || _event$data$result === void 0 ? void 0 : _event$data$result.pdf);
|
|
14
15
|
}
|
|
15
16
|
});
|
|
16
17
|
});
|