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