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.
Files changed (127) hide show
  1. package/lib/engine/index.js +102 -108
  2. package/lib/imports.js +1 -0
  3. package/lib/media-control/desktop.js +22 -13
  4. package/lib/media-control/mobile.js +27 -19
  5. package/lib/media-control/type.d.ts +3 -3
  6. package/lib/monitor-control/index.js +17 -7
  7. package/lib/peer-session/index.js +120 -121
  8. package/lib/plugins/chat/chatroom.js +119 -96
  9. package/lib/plugins/chat/connector.js +69 -48
  10. package/lib/remote-control/index.js +194 -216
  11. package/lib/room-control/ability-control/index.js +20 -10
  12. package/lib/room-control/application-control/index.js +82 -75
  13. package/lib/room-control/group-control/index.js +31 -30
  14. package/lib/room-control/helpers/board-init-info-helper.js +16 -10
  15. package/lib/room-control/helpers/validation-helper.js +1 -1
  16. package/lib/room-control/index.js +70 -51
  17. package/lib/room-control/infinity-room-control/index.js +27 -19
  18. package/lib/room-control/interpreter-control/index.js +77 -65
  19. package/lib/room-control/interpreter-control/room.js +6 -4
  20. package/lib/room-control/join-before-host-waitingroom-control/index.js +6 -4
  21. package/lib/room-control/mainroom-control/index.js +37 -25
  22. package/lib/room-control/privilege-control/helper.js +28 -13
  23. package/lib/room-control/privilege-control/index.js +36 -28
  24. package/lib/room-control/room-connector-control/index.js +52 -49
  25. package/lib/room-control/room-connector-control/type.d.ts +1 -1
  26. package/lib/room-control/room-control-factory.js +10 -12
  27. package/lib/room-control/room-session/index.js +77 -74
  28. package/lib/room-control/shared-cache.js +63 -56
  29. package/lib/room-control/sharing-control/index.js +65 -57
  30. package/lib/room-control/stream-control/index.js +197 -193
  31. package/lib/room-control/stt-control/de-compress-gzip.js +10 -0
  32. package/lib/room-control/stt-control/index.js +93 -86
  33. package/lib/room-control/user-control/index.js +162 -155
  34. package/lib/room-control/waitingroom-control/index.js +18 -9
  35. package/lib/room-control/whiteboard-control/utils.js +4 -2
  36. package/lib/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
  37. package/lib/room-control/whiteboard-control-v1/board-window.js +120 -103
  38. package/lib/room-control/whiteboard-control-v1/factory.js +7 -4
  39. package/lib/room-control/whiteboard-control-v1/index.js +80 -67
  40. package/lib/room-control/whiteboard-control-v1/mount-manager.js +4 -2
  41. package/lib/room-control/whiteboard-control-v1/utils.js +17 -14
  42. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +14 -10
  43. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +17 -8
  44. package/lib/room-control/whiteboard-control-v2/base/index.js +61 -53
  45. package/lib/room-control/whiteboard-control-v2/base/main-window.js +39 -30
  46. package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
  47. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
  48. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +27 -11
  49. package/lib/room-control/widget-control/index.js +43 -33
  50. package/lib/room-router/index.js +66 -58
  51. package/lib/schema.d.ts +15 -15
  52. package/lib/service/api.js +446 -548
  53. package/lib/struct.js +5 -2
  54. package/lib/utilities/abortable-retry.js +3 -0
  55. package/lib/utilities/collection.js +15 -11
  56. package/lib/utilities/error-helpers.js +34 -27
  57. package/lib/utilities/error.js +4 -3
  58. package/lib/utilities/join-helper.js +37 -31
  59. package/lib/utilities/logger.js +8 -5
  60. package/lib/utilities/parameters.js +21 -10
  61. package/lib/utilities/retry-helpers.js +1 -0
  62. package/lib/utilities/stream.js +16 -11
  63. package/lib/utilities/user.js +4 -3
  64. package/lib/utilities/validate-params.js +1 -1
  65. package/lib/utilities/video-encoder-config.js +10 -5
  66. package/lib-es/engine/index.js +102 -108
  67. package/lib-es/media-control/desktop.js +22 -13
  68. package/lib-es/media-control/mobile.js +27 -19
  69. package/lib-es/monitor-control/index.js +16 -7
  70. package/lib-es/peer-session/index.js +120 -121
  71. package/lib-es/plugins/chat/chatroom.js +118 -95
  72. package/lib-es/plugins/chat/connector.js +67 -47
  73. package/lib-es/remote-control/index.js +194 -216
  74. package/lib-es/room-control/ability-control/index.js +19 -10
  75. package/lib-es/room-control/application-control/index.js +81 -75
  76. package/lib-es/room-control/group-control/index.js +31 -30
  77. package/lib-es/room-control/helpers/board-init-info-helper.js +15 -10
  78. package/lib-es/room-control/helpers/validation-helper.js +1 -1
  79. package/lib-es/room-control/index.js +69 -51
  80. package/lib-es/room-control/infinity-room-control/index.js +26 -19
  81. package/lib-es/room-control/interpreter-control/index.js +77 -65
  82. package/lib-es/room-control/interpreter-control/room.js +5 -4
  83. package/lib-es/room-control/join-before-host-waitingroom-control/index.js +5 -4
  84. package/lib-es/room-control/mainroom-control/index.js +37 -25
  85. package/lib-es/room-control/privilege-control/helper.js +27 -13
  86. package/lib-es/room-control/privilege-control/index.js +36 -28
  87. package/lib-es/room-control/room-connector-control/index.js +52 -49
  88. package/lib-es/room-control/room-control-factory.js +10 -12
  89. package/lib-es/room-control/room-session/index.js +77 -74
  90. package/lib-es/room-control/shared-cache.js +62 -56
  91. package/lib-es/room-control/sharing-control/index.js +64 -57
  92. package/lib-es/room-control/stream-control/index.js +197 -193
  93. package/lib-es/room-control/stt-control/de-compress-gzip.js +10 -0
  94. package/lib-es/room-control/stt-control/index.js +93 -86
  95. package/lib-es/room-control/user-control/index.js +162 -155
  96. package/lib-es/room-control/waitingroom-control/index.js +18 -9
  97. package/lib-es/room-control/whiteboard-control/utils.js +4 -2
  98. package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
  99. package/lib-es/room-control/whiteboard-control-v1/board-window.js +120 -103
  100. package/lib-es/room-control/whiteboard-control-v1/factory.js +6 -4
  101. package/lib-es/room-control/whiteboard-control-v1/index.js +80 -67
  102. package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +3 -2
  103. package/lib-es/room-control/whiteboard-control-v1/utils.js +17 -14
  104. package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +13 -10
  105. package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +16 -8
  106. package/lib-es/room-control/whiteboard-control-v2/base/index.js +60 -53
  107. package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +39 -30
  108. package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
  109. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
  110. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +26 -11
  111. package/lib-es/room-control/widget-control/index.js +42 -33
  112. package/lib-es/room-router/index.js +66 -58
  113. package/lib-es/service/api.js +445 -548
  114. package/lib-es/struct.js +4 -2
  115. package/lib-es/utilities/abortable-retry.js +3 -0
  116. package/lib-es/utilities/collection.js +14 -11
  117. package/lib-es/utilities/error-helpers.js +33 -26
  118. package/lib-es/utilities/error.js +4 -3
  119. package/lib-es/utilities/join-helper.js +36 -29
  120. package/lib-es/utilities/logger.js +7 -5
  121. package/lib-es/utilities/parameters.js +21 -10
  122. package/lib-es/utilities/retry-helpers.js +1 -0
  123. package/lib-es/utilities/stream.js +15 -11
  124. package/lib-es/utilities/user.js +4 -3
  125. package/lib-es/utilities/validate-params.js +1 -1
  126. package/lib-es/utilities/video-encoder-config.js +10 -5
  127. package/package.json +4 -4
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.symbol.description.js");
4
+ require("core-js/modules/es.error.cause.js");
3
5
  require("core-js/modules/esnext.function.metadata.js");
6
+ require("core-js/modules/esnext.iterator.filter.js");
4
7
  require("core-js/modules/esnext.map.delete-all.js");
5
8
  require("core-js/modules/esnext.map.emplace.js");
6
9
  require("core-js/modules/esnext.map.every.js");
@@ -22,10 +25,14 @@ Object.defineProperty(exports, "__esModule", {
22
25
  });
23
26
  exports.FcrUserControlImpl = void 0;
24
27
  require("core-js/modules/es.array.push.js");
28
+ require("core-js/modules/es.object.from-entries.js");
25
29
  require("core-js/modules/esnext.iterator.constructor.js");
26
30
  require("core-js/modules/esnext.iterator.find.js");
27
31
  require("core-js/modules/esnext.iterator.for-each.js");
28
32
  require("core-js/modules/esnext.iterator.map.js");
33
+ require("core-js/modules/web.dom-collections.iterator.js");
34
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
35
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
36
  var _imports = require("../../imports");
30
37
  var _type = require("../../type");
31
38
  var _user = require("../../utilities/user");
@@ -35,7 +42,10 @@ var _logger = require("../../utilities/logger");
35
42
  var _error = require("../../utilities/error");
36
43
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
37
44
  var _schema = require("../../schema");
38
- let _initProto, _getUserDecs, _fetchUserListDecs, _updateUserNameDecs, _updateUserPropertiesDecs, _updateIncrementUserPropertiesDecs, _deleteUserPropertiesDecs, _getUserPropertiesByUserIdDecs, _getUserPropertiesByKeyPathDecs, _updateRemoteUserRoleDecs, _claimHostDecs, _kickOutDecs, _kickOutByUserIdsDecs, _kickOutByUserRolesDecs, _mergeAudioStreamDecs;
45
+ var _FcrUserControlImpl;
46
+ let _initProto, _getUserDecs, _fetchUserListDecs, _updateUserNameDecs, _updateUserPropertiesDecs, _updateIncrementUserPropertiesDecs, _deleteUserPropertiesDecs, _getUserPropertiesByUserIdDecs, _getUserPropertiesByKeyPathDecs, _updateRemoteUserRoleDecs, _claimHostDecs, _kickOutDecs, _kickOutByUserIdsDecs, _kickOutByUserRolesDecs, _mergeAudioStreamDecs, _ref;
47
+ 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; }
48
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
39
49
  function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
40
50
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
41
51
  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); }
@@ -44,165 +54,157 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
44
54
  /**
45
55
  * @internal
46
56
  */
57
+ _ref = (_getUserDecs = [_imports.bound, (0, _validateParams.default)(_schema.stringSchema)], _fetchUserListDecs = [_imports.bound, (0, _imports.trace)(['params'])], _updateUserNameDecs = [_imports.bound, (0, _imports.trace)(['userId', 'userName']), (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _updateUserPropertiesDecs = [_imports.bound, (0, _imports.trace)(['properties', 'cause', 'userId']), (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _updateIncrementUserPropertiesDecs = [_imports.bound, (0, _imports.trace)(['increments', 'cause', 'userId']), (0, _validateParams.default)(_schema.stringKeyNumberValueSchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _deleteUserPropertiesDecs = [_imports.bound, (0, _imports.trace)(['keyPath', 'cause', 'userId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _getUserPropertiesByUserIdDecs = [_imports.bound, (0, _imports.trace)(['userId']), (0, _validateParams.default)(_schema.stringSchema)], _getUserPropertiesByKeyPathDecs = [_imports.bound, (0, _imports.trace)(['keyPath', 'userId']), (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _updateRemoteUserRoleDecs = [_imports.bound, (0, _imports.trace)(['userId', 'userRole']), (0, _validateParams.default)(_schema.stringSchema, _schema.fcrUserRoleSchema)], _claimHostDecs = [_imports.bound, (0, _imports.trace)(['hostKey']), (0, _validateParams.default)(_schema.stringSchema)], _kickOutDecs = [_imports.bound, (0, _imports.trace)(['userId', 'type']), (0, _validateParams.default)(_schema.stringSchema, _schema.fcrUserKickedOutTypeSchema)], _kickOutByUserIdsDecs = [(0, _imports.trace)(['userIds', 'type']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.fcrUserKickedOutTypeSchema)], _kickOutByUserRolesDecs = [(0, _imports.trace)(['userRoles', 'type']), (0, _validateParams.default)(_schema.fcrUserRolesSchema, _schema.fcrUserKickedOutTypeSchema)], _mergeAudioStreamDecs = [(0, _imports.trace)(['userId']), (0, _validateParams.default)(_schema.stringSchema)], "logger");
47
58
  class FcrUserControlImpl {
48
- static {
49
- [_initProto] = _applyDecs(this, [[_imports.bound, 2, "getLocalUser"], [_imports.bound, 2, "getUsers"], [_imports.bound, 2, "getUserList"], [_imports.bound, 2, "getUserListByRole"], [_imports.bound, 2, "getUserCountByRole"], [_getUserDecs, 2, "getUser"], [[_imports.bound, _imports.trace], 2, "getAllUserCount"], [_imports.bound, 2, "getWaterMarkContent"], [_fetchUserListDecs, 2, "fetchUserList"], [_updateUserNameDecs, 2, "updateUserName"], [_updateUserPropertiesDecs, 2, "updateUserProperties"], [_updateIncrementUserPropertiesDecs, 2, "updateIncrementUserProperties"], [_deleteUserPropertiesDecs, 2, "deleteUserProperties"], [[_imports.bound, _imports.trace], 2, "getUserProperties"], [_getUserPropertiesByUserIdDecs, 2, "getUserPropertiesByUserId"], [_getUserPropertiesByKeyPathDecs, 2, "getUserPropertiesByKeyPath"], [_updateRemoteUserRoleDecs, 2, "updateRemoteUserRole"], [[_imports.bound, _imports.trace], 2, "revokeHost"], [_claimHostDecs, 2, "claimHost"], [_kickOutDecs, 2, "kickOut"], [_kickOutByUserIdsDecs, 2, "kickOutByUserIds"], [_kickOutByUserRolesDecs, 2, "kickOutByUserRoles"], [_mergeAudioStreamDecs, 2, "mergeAudioStream"], [_imports.trace, 2, "release"]], []).e;
50
- }
51
- //@internal
52
- [(_getUserDecs = [_imports.bound, (0, _validateParams.default)(_schema.stringSchema)], _fetchUserListDecs = [_imports.bound, (0, _imports.trace)(['params'])], _updateUserNameDecs = [_imports.bound, (0, _imports.trace)(['userId', 'userName']), (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _updateUserPropertiesDecs = [_imports.bound, (0, _imports.trace)(['properties', 'cause', 'userId']), (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _updateIncrementUserPropertiesDecs = [_imports.bound, (0, _imports.trace)(['increments', 'cause', 'userId']), (0, _validateParams.default)(_schema.stringKeyNumberValueSchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _deleteUserPropertiesDecs = [_imports.bound, (0, _imports.trace)(['keyPath', 'cause', 'userId']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _getUserPropertiesByUserIdDecs = [_imports.bound, (0, _imports.trace)(['userId']), (0, _validateParams.default)(_schema.stringSchema)], _getUserPropertiesByKeyPathDecs = [_imports.bound, (0, _imports.trace)(['keyPath', 'userId']), (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _updateRemoteUserRoleDecs = [_imports.bound, (0, _imports.trace)(['userId', 'userRole']), (0, _validateParams.default)(_schema.stringSchema, _schema.fcrUserRoleSchema)], _claimHostDecs = [_imports.bound, (0, _imports.trace)(['hostKey']), (0, _validateParams.default)(_schema.stringSchema)], _kickOutDecs = [_imports.bound, (0, _imports.trace)(['userId', 'type']), (0, _validateParams.default)(_schema.stringSchema, _schema.fcrUserKickedOutTypeSchema)], _kickOutByUserIdsDecs = [(0, _imports.trace)(['userIds', 'type']), (0, _validateParams.default)(_schema.stringArraySchema, _schema.fcrUserKickedOutTypeSchema)], _kickOutByUserRolesDecs = [(0, _imports.trace)(['userRoles', 'type']), (0, _validateParams.default)(_schema.fcrUserRolesSchema, _schema.fcrUserKickedOutTypeSchema)], _mergeAudioStreamDecs = [(0, _imports.trace)(['userId']), (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
53
- prefix: 'FcrUserControlImpl'
54
- }));
55
- //@internal
56
- _observable = new _imports.AgoraObservable();
57
- //@internal
58
-
59
- //@internal
60
-
61
- //@internal
62
- _enableUserCount = true;
63
-
64
- //@internal
65
- _sceneObserver = {
66
- onRemoteUsersJoined: (roomId, events) => {
67
- events.forEach(event => {
68
- const userProperties = this._scene.getUserPropertiesByUserId(event.userInfo.userId);
69
- this._roomCache.setUserPlatform(event.userInfo.userId, userProperties?.platform);
70
- this._roomCache.setUserAvatar(event.userInfo.userId, userProperties?.avatar);
71
- });
72
- const fcrUserEvents = events.map(e => {
73
- return {
74
- userInfo: e.userInfo && (0, _user.convertRteUserToFcrUser)(e.userInfo, this._roomCache)
75
- // operatorUser: e.operatorUser && convertRteUserToFcrUser(e.operatorUser, this._roomCache),
76
- };
77
- });
78
- fcrUserEvents.forEach(event => {
79
- const user = event.userInfo;
80
- const exists = user.userId in this._roomCache.userMapByUserId;
81
- if (exists) {
82
- this.logger.warn(`[FcrUserControl] user joined when the user already exists, userId: ${user.userId}`);
83
- } else {
84
- this._roomCache.setUserMapByUserId(user.userId, user);
85
- this._roomCache.addUserToList(user);
86
- }
87
- });
88
- this._observable.notifyObservers('onRemoteUsersJoined', roomId, fcrUserEvents);
89
- },
90
- onRemoteUsersLeft: (roomId, events) => {
91
- const fcrUserEvents = events.map(e => {
92
- return {
93
- userInfo: e.userInfo && (0, _user.convertRteUserToFcrUser)(e.userInfo, this._roomCache),
94
- userProperties: e.userProperties,
95
- operatorUser: e.operatorUser && (0, _user.convertRteUserToFcrUser)(e.operatorUser, this._roomCache),
96
- reason: e.cause?.cmd === 5 ? _type2.FcrUserLeftReason.kickOut : _type2.FcrUserLeftReason.LeaveRoom
59
+ constructor(_scene, _api, _sharedCache) {
60
+ //@internal
61
+ (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
62
+ prefix: 'FcrUserControlImpl'
63
+ })));
64
+ //@internal
65
+ (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
66
+ //@internal
67
+ (0, _defineProperty2.default)(this, "_enableUserCount", true);
68
+ //@internal
69
+ (0, _defineProperty2.default)(this, "_sceneObserver", {
70
+ onRemoteUsersJoined: (roomId, events) => {
71
+ events.forEach(event => {
72
+ const userProperties = this._scene.getUserPropertiesByUserId(event.userInfo.userId);
73
+ this._roomCache.setUserPlatform(event.userInfo.userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.platform);
74
+ this._roomCache.setUserAvatar(event.userInfo.userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.avatar);
75
+ });
76
+ const fcrUserEvents = events.map(e => {
77
+ return {
78
+ userInfo: e.userInfo && (0, _user.convertRteUserToFcrUser)(e.userInfo, this._roomCache)
79
+ // operatorUser: e.operatorUser && convertRteUserToFcrUser(e.operatorUser, this._roomCache),
80
+ };
81
+ });
82
+ fcrUserEvents.forEach(event => {
83
+ const user = event.userInfo;
84
+ const exists = user.userId in this._roomCache.userMapByUserId;
85
+ if (exists) {
86
+ this.logger.warn("[FcrUserControl] user joined when the user already exists, userId: ".concat(user.userId));
87
+ } else {
88
+ this._roomCache.setUserMapByUserId(user.userId, user);
89
+ this._roomCache.addUserToList(user);
90
+ }
91
+ });
92
+ this._observable.notifyObservers('onRemoteUsersJoined', roomId, fcrUserEvents);
93
+ },
94
+ onRemoteUsersLeft: (roomId, events) => {
95
+ const fcrUserEvents = events.map(e => {
96
+ var _e$cause;
97
+ return {
98
+ userInfo: e.userInfo && (0, _user.convertRteUserToFcrUser)(e.userInfo, this._roomCache),
99
+ userProperties: e.userProperties,
100
+ operatorUser: e.operatorUser && (0, _user.convertRteUserToFcrUser)(e.operatorUser, this._roomCache),
101
+ reason: ((_e$cause = e.cause) === null || _e$cause === void 0 ? void 0 : _e$cause.cmd) === 5 ? _type2.FcrUserLeftReason.kickOut : _type2.FcrUserLeftReason.LeaveRoom
102
+ };
103
+ });
104
+ fcrUserEvents.forEach(event => {
105
+ const user = event.userInfo;
106
+ const exists = this._roomCache.userMapByUserId.has(user.userId);
107
+ if (!exists) {
108
+ this.logger.warn("[FcrUserControl] user left when the user does not exist, userId: ".concat(user.userId));
109
+ } else {
110
+ this._roomCache.deleteUserMapByUserId(user.userId);
111
+ const index = this._roomCache.userList.findIndex(u => user.userId === u.userId);
112
+ if (index !== -1) {
113
+ this._roomCache.deleteUserList(index);
114
+ }
115
+ }
116
+ });
117
+ events.forEach(event => {
118
+ this._roomCache.deleteUserPlatform(event.userInfo.userId);
119
+ this._roomCache.deleteUserAvatar(event.userInfo.userId);
120
+ });
121
+ this._observable.notifyObservers('onRemoteUsersLeft', roomId, fcrUserEvents);
122
+ },
123
+ onUserUpdated: (sceneId, event) => {
124
+ const fcrUserUpdatedEvent = {
125
+ modifiedUser: event.modifiedUser && (0, _user.convertRteUserToFcrUser)(event.modifiedUser, this._roomCache),
126
+ operatorUser: event.operatorUser && (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache),
127
+ reason: event.reason
97
128
  };
98
- });
99
- fcrUserEvents.forEach(event => {
100
- const user = event.userInfo;
129
+ const user = fcrUserUpdatedEvent.modifiedUser;
101
130
  const exists = this._roomCache.userMapByUserId.has(user.userId);
102
131
  if (!exists) {
103
- this.logger.warn(`[FcrUserControl] user left when the user does not exist, userId: ${user.userId}`);
132
+ this.logger.warn("[FcrUserControl] user updated when the user does not exist, userId: ".concat(user.userId));
104
133
  } else {
105
- this._roomCache.deleteUserMapByUserId(user.userId);
134
+ this._roomCache.setUserMapByUserId(user.userId, user);
106
135
  const index = this._roomCache.userList.findIndex(u => user.userId === u.userId);
107
136
  if (index !== -1) {
108
137
  this._roomCache.deleteUserList(index);
138
+ this._roomCache.insertUserToList(index, user);
109
139
  }
110
140
  }
111
- });
112
- events.forEach(event => {
113
- this._roomCache.deleteUserPlatform(event.userInfo.userId);
114
- this._roomCache.deleteUserAvatar(event.userInfo.userId);
115
- });
116
- this._observable.notifyObservers('onRemoteUsersLeft', roomId, fcrUserEvents);
117
- },
118
- onUserUpdated: (sceneId, event) => {
119
- const fcrUserUpdatedEvent = {
120
- modifiedUser: event.modifiedUser && (0, _user.convertRteUserToFcrUser)(event.modifiedUser, this._roomCache),
121
- operatorUser: event.operatorUser && (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache),
122
- reason: event.reason
123
- };
124
- const user = fcrUserUpdatedEvent.modifiedUser;
125
- const exists = this._roomCache.userMapByUserId.has(user.userId);
126
- if (!exists) {
127
- this.logger.warn(`[FcrUserControl] user updated when the user does not exist, userId: ${user.userId}`);
128
- } else {
129
- this._roomCache.setUserMapByUserId(user.userId, user);
130
- const index = this._roomCache.userList.findIndex(u => user.userId === u.userId);
131
- if (index !== -1) {
132
- this._roomCache.deleteUserList(index);
133
- this._roomCache.insertUserToList(index, user);
141
+ this._observable.notifyObservers('onUserInfoUpdated', sceneId, fcrUserUpdatedEvent);
142
+ },
143
+ onAllUserCountUpdated: (sceneId, count) => {
144
+ if (!this._enableUserCount) {
145
+ return;
134
146
  }
135
- }
136
- this._observable.notifyObservers('onUserInfoUpdated', sceneId, fcrUserUpdatedEvent);
137
- },
138
- onAllUserCountUpdated: (sceneId, count) => {
139
- if (!this._enableUserCount) {
140
- return;
141
- }
142
- this._observable.notifyObservers('onAllUserCountUpdated', sceneId, count);
143
- },
144
- onUserPropertiesUpdated: (roomId, event) => {
145
- if (event.cause?.cmd === 5 && event.modifiedUser.userId === this._localUserId) {
146
- const {
147
- changedProperties
148
- } = event;
149
- const dirtyStateMap = {
150
- '0': _type2.FcrUserKickedOutType.Once,
151
- '1': _type2.FcrUserKickedOutType.Forever,
152
- '2': 2
153
- };
154
- const key = (0, _imports.get)(changedProperties, 'dirty.state');
155
- const type = dirtyStateMap[key];
156
- this._observable.notifyObservers('onLocalUserKickedOut', roomId, {
157
- type
158
- });
159
- }
160
- if (event.cause?.cmd === 8) {
161
- const changedProperties = {};
162
- for (const key in event.changedProperties) {
163
- if (key.startsWith('flexProps')) {
164
- changedProperties[key] = event.changedProperties[key];
165
- }
166
- }
167
- if (Object.keys(changedProperties).length > 0) {
168
- const structure = (0, _collection.convertToStructure)(changedProperties);
169
- this._observable.notifyObservers('onUserPropertiesUpdated', roomId, {
170
- ...event,
171
- changedProperties: structure['flexProps']
147
+ this._observable.notifyObservers('onAllUserCountUpdated', sceneId, count);
148
+ },
149
+ onUserPropertiesUpdated: (roomId, event) => {
150
+ var _event$cause, _event$cause2;
151
+ if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 5 && event.modifiedUser.userId === this._localUserId) {
152
+ const changedProperties = event.changedProperties;
153
+ const dirtyStateMap = {
154
+ '0': _type2.FcrUserKickedOutType.Once,
155
+ '1': _type2.FcrUserKickedOutType.Forever,
156
+ '2': 2
157
+ };
158
+ const key = (0, _imports.get)(changedProperties, 'dirty.state');
159
+ const type = dirtyStateMap[key];
160
+ this._observable.notifyObservers('onLocalUserKickedOut', roomId, {
161
+ type
172
162
  });
173
163
  }
174
- }
175
- },
176
- onUserPropertiesDeleted: (roomId, event) => {
177
- if (event.cause?.cmd === 8) {
178
- const changedKeyPaths = [];
179
- for (const keyPath of event.changedKeyPaths) {
180
- if (keyPath.startsWith('flexProps')) {
181
- changedKeyPaths.push(keyPath);
164
+ if (((_event$cause2 = event.cause) === null || _event$cause2 === void 0 ? void 0 : _event$cause2.cmd) === 8) {
165
+ const changedProperties = {};
166
+ for (const key in event.changedProperties) {
167
+ if (key.startsWith('flexProps')) {
168
+ changedProperties[key] = event.changedProperties[key];
169
+ }
170
+ }
171
+ if (Object.keys(changedProperties).length > 0) {
172
+ const structure = (0, _collection.convertToStructure)(changedProperties);
173
+ this._observable.notifyObservers('onUserPropertiesUpdated', roomId, _objectSpread(_objectSpread({}, event), {}, {
174
+ changedProperties: structure['flexProps']
175
+ }));
182
176
  }
183
177
  }
184
- if (changedKeyPaths.length > 0) {
185
- this._observable.notifyObservers('onUserPropertiesDeleted', roomId, {
186
- ...event,
187
- changedKeyPaths
188
- });
178
+ },
179
+ onUserPropertiesDeleted: (roomId, event) => {
180
+ var _event$cause3;
181
+ if (((_event$cause3 = event.cause) === null || _event$cause3 === void 0 ? void 0 : _event$cause3.cmd) === 8) {
182
+ const changedKeyPaths = [];
183
+ for (const keyPath of event.changedKeyPaths) {
184
+ if (keyPath.startsWith('flexProps')) {
185
+ changedKeyPaths.push(keyPath);
186
+ }
187
+ }
188
+ if (changedKeyPaths.length > 0) {
189
+ this._observable.notifyObservers('onUserPropertiesDeleted', roomId, _objectSpread(_objectSpread({}, event), {}, {
190
+ changedKeyPaths
191
+ }));
192
+ }
189
193
  }
194
+ },
195
+ onRemoteUsersSynced: (roomId, events) => {
196
+ this._observable.notifyObservers('onRemoteUsersSynced', roomId, events);
197
+ },
198
+ onRemoteUsersDesynced: (roomId, events) => {
199
+ this._observable.notifyObservers('onRemoteUsersDesynced', roomId, events);
200
+ },
201
+ onUserCountUpdatedByRole: (roomId, userRole, count) => {
202
+ if (!this._enableUserCount) {
203
+ return;
204
+ }
205
+ this._observable.notifyObservers('onUserCountUpdatedByRole', roomId, userRole, count);
190
206
  }
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);
203
- }
204
- };
205
- constructor(_scene, _api, _sharedCache) {
207
+ });
206
208
  this._scene = _scene;
207
209
  this._api = _api;
208
210
  this._sharedCache = _sharedCache;
@@ -210,8 +212,8 @@ class FcrUserControlImpl {
210
212
  const users = this._scene.getUsers();
211
213
  Object.keys(users).forEach(userId => {
212
214
  const userProperties = this._scene.getUserPropertiesByUserId(userId);
213
- this._roomCache.setUserAvatar(userId, userProperties?.avatar);
214
- this._roomCache.setUserPlatform(userId, userProperties?.platform);
215
+ this._roomCache.setUserAvatar(userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.avatar);
216
+ this._roomCache.setUserPlatform(userId, userProperties === null || userProperties === void 0 ? void 0 : userProperties.platform);
215
217
  });
216
218
  Object.keys(users).forEach(userId => {
217
219
  this._roomCache.setUserMapByUserId(userId, (0, _user.convertRteUserToFcrUser)(users[userId], this._roomCache));
@@ -239,7 +241,7 @@ class FcrUserControlImpl {
239
241
  }
240
242
  getUserListByRole(role) {
241
243
  const userList = this._scene.getUserListByRole(_type.FcrUserRoleToStringMap[role]);
242
- return userList?.map(user => (0, _user.convertRteUserToFcrUser)(user, this._roomCache));
244
+ return userList === null || userList === void 0 ? void 0 : userList.map(user => (0, _user.convertRteUserToFcrUser)(user, this._roomCache));
243
245
  }
244
246
  getUserCountByRole(role) {
245
247
  if (!this._enableUserCount) {
@@ -257,9 +259,8 @@ class FcrUserControlImpl {
257
259
  return this._scene.getUserCount();
258
260
  }
259
261
  getWaterMarkContent() {
260
- const {
261
- userId
262
- } = this.getLocalUser();
262
+ const _this$getLocalUser = this.getLocalUser(),
263
+ userId = _this$getLocalUser.userId;
263
264
  return (0, _imports.get)(this._scene.getUserPropertiesByUserId(userId), 'security.watermark.content');
264
265
  }
265
266
  async fetchUserList(params) {
@@ -300,12 +301,14 @@ class FcrUserControlImpl {
300
301
  const userProperties = this._scene.getUserProperties();
301
302
  const res = {};
302
303
  for (const userId in userProperties) {
303
- res[userId] = userProperties[userId]?.['flexProps'];
304
+ var _userProperties$userI;
305
+ res[userId] = (_userProperties$userI = userProperties[userId]) === null || _userProperties$userI === void 0 ? void 0 : _userProperties$userI['flexProps'];
304
306
  }
305
307
  return res;
306
308
  }
307
309
  getUserPropertiesByUserId(userId) {
308
- return this._scene.getUserPropertiesByUserId(userId)?.['flexProps'];
310
+ var _this$_scene$getUserP;
311
+ return (_this$_scene$getUserP = this._scene.getUserPropertiesByUserId(userId)) === null || _this$_scene$getUserP === void 0 ? void 0 : _this$_scene$getUserP['flexProps'];
309
312
  }
310
313
  getUserPropertiesByKeyPath(keyPath, userId) {
311
314
  return this._scene.getUserPropertiesByKeyPath('flexProps.' + keyPath, userId);
@@ -329,9 +332,8 @@ class FcrUserControlImpl {
329
332
  }
330
333
  }
331
334
  async claimHost(hostKey) {
332
- const {
333
- userId
334
- } = this.getLocalUser();
335
+ const _this$getLocalUser2 = this.getLocalUser(),
336
+ userId = _this$getLocalUser2.userId;
335
337
  return await (0, _error.handleRequestError)(() => this._api.claimHost({
336
338
  roomId: this._scene.sceneId,
337
339
  hostKey,
@@ -372,4 +374,9 @@ class FcrUserControlImpl {
372
374
  this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onRemoteUsersJoined', ['roomId', 'events']], ['onRemoteUsersLeft', ['roomId', 'events']], ['onUserInfoUpdated', ['roomId', 'event']], ['onAllUserCountUpdated', ['roomId', 'count']], ['onLocalUserKickedOut', ['roomId', 'event']], ['onUserPropertiesUpdated', ['roomId', 'event']], ['onUserPropertiesDeleted', ['roomId', 'event']]]));
373
375
  }
374
376
  }
375
- exports.FcrUserControlImpl = FcrUserControlImpl;
377
+ exports.FcrUserControlImpl = FcrUserControlImpl;
378
+ _FcrUserControlImpl = FcrUserControlImpl;
379
+ var _applyDecs$e = _applyDecs(_FcrUserControlImpl, [[_imports.bound, 2, "getLocalUser"], [_imports.bound, 2, "getUsers"], [_imports.bound, 2, "getUserList"], [_imports.bound, 2, "getUserListByRole"], [_imports.bound, 2, "getUserCountByRole"], [_getUserDecs, 2, "getUser"], [[_imports.bound, _imports.trace], 2, "getAllUserCount"], [_imports.bound, 2, "getWaterMarkContent"], [_fetchUserListDecs, 2, "fetchUserList"], [_updateUserNameDecs, 2, "updateUserName"], [_updateUserPropertiesDecs, 2, "updateUserProperties"], [_updateIncrementUserPropertiesDecs, 2, "updateIncrementUserProperties"], [_deleteUserPropertiesDecs, 2, "deleteUserProperties"], [[_imports.bound, _imports.trace], 2, "getUserProperties"], [_getUserPropertiesByUserIdDecs, 2, "getUserPropertiesByUserId"], [_getUserPropertiesByKeyPathDecs, 2, "getUserPropertiesByKeyPath"], [_updateRemoteUserRoleDecs, 2, "updateRemoteUserRole"], [[_imports.bound, _imports.trace], 2, "revokeHost"], [_claimHostDecs, 2, "claimHost"], [_kickOutDecs, 2, "kickOut"], [_kickOutByUserIdsDecs, 2, "kickOutByUserIds"], [_kickOutByUserRolesDecs, 2, "kickOutByUserRoles"], [_mergeAudioStreamDecs, 2, "mergeAudioStream"], [_imports.trace, 2, "release"]], []).e;
380
+ var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
381
+ _initProto = _applyDecs$e2[0];
382
+ _applyDecs$e;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.symbol.description.js");
4
+ require("core-js/modules/es.error.cause.js");
3
5
  require("core-js/modules/es.array.push.js");
4
6
  require("core-js/modules/esnext.function.metadata.js");
5
7
  require("core-js/modules/esnext.map.delete-all.js");
@@ -17,6 +19,7 @@ require("core-js/modules/esnext.map.reduce.js");
17
19
  require("core-js/modules/esnext.map.some.js");
18
20
  require("core-js/modules/esnext.map.update.js");
19
21
  require("core-js/modules/esnext.symbol.metadata.js");
22
+ require("core-js/modules/web.dom-collections.iterator.js");
20
23
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
21
24
  Object.defineProperty(exports, "__esModule", {
22
25
  value: true
@@ -24,6 +27,8 @@ Object.defineProperty(exports, "__esModule", {
24
27
  exports.FcrWaitingRoomControlImpl = void 0;
25
28
  require("core-js/modules/esnext.iterator.constructor.js");
26
29
  require("core-js/modules/esnext.iterator.map.js");
30
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
31
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
32
  var _ = require("..");
28
33
  var _imports = require("../../imports");
29
34
  var _schema = require("../../schema");
@@ -32,7 +37,8 @@ var _error = require("../../utilities/error");
32
37
  var _logger = require("../../utilities/logger");
33
38
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
34
39
  var _type2 = require("../type");
35
- let _initProto, _moveToMainRoomByUserIdsDecs, _moveToMainRoomByUserRolesDecs;
40
+ var _FcrWaitingRoomControlImpl;
41
+ let _initProto, _moveToMainRoomByUserIdsDecs, _moveToMainRoomByUserRolesDecs, _ref;
36
42
  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
43
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
38
44
  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,16 +47,14 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
41
47
  /**
42
48
  * @internal
43
49
  */
50
+ _ref = (_moveToMainRoomByUserIdsDecs = [(0, _imports.trace)(['userIds']), (0, _validateParams.default)(_schema.stringArraySchema)], _moveToMainRoomByUserRolesDecs = [(0, _imports.trace)(['userRoles']), (0, _validateParams.default)(_schema.fcrUserRolesSchema)], "logger");
44
51
  class FcrWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
45
- static {
46
- [_initProto] = _applyDecs(this, [[_moveToMainRoomByUserIdsDecs, 2, "moveToMainRoomByUserIds"], [_moveToMainRoomByUserRolesDecs, 2, "moveToMainRoomByUserRoles"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
47
- }
48
- //@internal
49
- [(_moveToMainRoomByUserIdsDecs = [(0, _imports.trace)(['userIds']), (0, _validateParams.default)(_schema.stringArraySchema)], _moveToMainRoomByUserRolesDecs = [(0, _imports.trace)(['userRoles']), (0, _validateParams.default)(_schema.fcrUserRolesSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
50
- prefix: 'FcrWaitingRoomControlImpl'
51
- }));
52
52
  constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
53
53
  super(engine, scene, api, config, _type2.FcrRoomType.Waitingroom, chatConnection, sharedCache, chatRoomControl);
54
+ //@internal
55
+ (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
56
+ prefix: 'FcrWaitingRoomControlImpl'
57
+ })));
54
58
  this._addLogObserver();
55
59
  }
56
60
  addObserver(observer) {
@@ -72,4 +76,9 @@ class FcrWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
72
76
  ['onRoomMessageReceived', ['roomId', 'message']], ['onRoomPropertiesDeleted', ['roomId', 'event']], ['onRoomPropertiesUpdated', ['roomId', 'event']], ['onRoomStateUpdated', ['roomId', 'state']]]));
73
77
  }
74
78
  }
75
- exports.FcrWaitingRoomControlImpl = FcrWaitingRoomControlImpl;
79
+ exports.FcrWaitingRoomControlImpl = FcrWaitingRoomControlImpl;
80
+ _FcrWaitingRoomControlImpl = FcrWaitingRoomControlImpl;
81
+ var _applyDecs$e = _applyDecs(_FcrWaitingRoomControlImpl, [[_moveToMainRoomByUserIdsDecs, 2, "moveToMainRoomByUserIds"], [_moveToMainRoomByUserRolesDecs, 2, "moveToMainRoomByUserRoles"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
82
+ var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
83
+ _initProto = _applyDecs$e2[0];
84
+ _applyDecs$e;
@@ -9,13 +9,15 @@ require("core-js/modules/esnext.iterator.some.js");
9
9
  var _type = require("../privilege-control/type");
10
10
  const hasBoardWritePermission = permissions => {
11
11
  return permissions.some(permission => {
12
- return permission.info?.action === _type.FcrPermissionAction.BoardWrite;
12
+ var _permission$info;
13
+ return ((_permission$info = permission.info) === null || _permission$info === void 0 ? void 0 : _permission$info.action) === _type.FcrPermissionAction.BoardWrite;
13
14
  });
14
15
  };
15
16
  exports.hasBoardWritePermission = hasBoardWritePermission;
16
17
  const hasAnnotationWritePermission = permissions => {
17
18
  return permissions.some(permission => {
18
- return permission.info?.action === _type.FcrPermissionAction.AnnotationWrite;
19
+ var _permission$info2;
20
+ return ((_permission$info2 = permission.info) === null || _permission$info2 === void 0 ? void 0 : _permission$info2.action) === _type.FcrPermissionAction.AnnotationWrite;
19
21
  });
20
22
  };
21
23
  exports.hasAnnotationWritePermission = hasAnnotationWritePermission;
@@ -16,7 +16,8 @@ class FcrBoardSubWindowImpl {
16
16
  return new Promise((resolve, reject) => {
17
17
  window.addEventListener('message', event => {
18
18
  if (event.data.type === '@netless/_result_save_pdf_') {
19
- event.data.progress === 100 && resolve(event.data.result?.pdf);
19
+ var _event$data$result;
20
+ event.data.progress === 100 && resolve((_event$data$result = event.data.result) === null || _event$data$result === void 0 ? void 0 : _event$data$result.pdf);
20
21
  }
21
22
  });
22
23
  });