fcr-core 3.10.5 → 3.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/lib/engine/index.js +108 -102
  2. package/lib/imports.js +0 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/media-control/desktop.js +13 -22
  5. package/lib/media-control/mobile.js +13 -22
  6. package/lib/monitor-control/index.js +7 -17
  7. package/lib/peer-session/index.js +121 -120
  8. package/lib/plugins/chat/chatroom.js +96 -119
  9. package/lib/plugins/chat/connector.js +48 -69
  10. package/lib/remote-control/index.js +216 -194
  11. package/lib/room-control/ability-control/index.js +10 -20
  12. package/lib/room-control/application-control/index.js +75 -82
  13. package/lib/room-control/group-control/index.js +30 -31
  14. package/lib/room-control/helpers/board-init-info-helper.js +10 -16
  15. package/lib/room-control/helpers/validation-helper.js +1 -1
  16. package/lib/room-control/index.js +51 -70
  17. package/lib/room-control/infinity-room-control/index.js +19 -27
  18. package/lib/room-control/interpreter-control/index.js +65 -77
  19. package/lib/room-control/interpreter-control/room.js +4 -6
  20. package/lib/room-control/join-before-host-waitingroom-control/index.js +4 -6
  21. package/lib/room-control/mainroom-control/index.js +25 -37
  22. package/lib/room-control/privilege-control/helper.js +13 -28
  23. package/lib/room-control/privilege-control/index.js +28 -36
  24. package/lib/room-control/room-connector-control/index.js +47 -52
  25. package/lib/room-control/room-control-factory.js +12 -10
  26. package/lib/room-control/room-session/index.js +74 -77
  27. package/lib/room-control/shared-cache.js +56 -63
  28. package/lib/room-control/sharing-control/index.js +57 -65
  29. package/lib/room-control/stream-control/index.js +238 -203
  30. package/lib/room-control/stream-control/type.d.ts +11 -1
  31. package/lib/room-control/stt-control/de-compress-gzip.js +0 -10
  32. package/lib/room-control/stt-control/index.js +86 -93
  33. package/lib/room-control/user-control/index.js +155 -162
  34. package/lib/room-control/waitingroom-control/index.js +9 -18
  35. package/lib/room-control/whiteboard-control/utils.js +2 -4
  36. package/lib/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
  37. package/lib/room-control/whiteboard-control-v1/board-window.js +103 -120
  38. package/lib/room-control/whiteboard-control-v1/factory.js +4 -7
  39. package/lib/room-control/whiteboard-control-v1/index.js +67 -80
  40. package/lib/room-control/whiteboard-control-v1/mount-manager.js +2 -4
  41. package/lib/room-control/whiteboard-control-v1/utils.js +14 -17
  42. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +10 -14
  43. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -17
  44. package/lib/room-control/whiteboard-control-v2/base/index.js +53 -61
  45. package/lib/room-control/whiteboard-control-v2/base/main-window.js +30 -39
  46. package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
  47. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +33 -45
  48. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -27
  49. package/lib/room-control/widget-control/index.js +33 -43
  50. package/lib/room-router/index.js +58 -66
  51. package/lib/service/api.js +548 -446
  52. package/lib/struct.js +2 -5
  53. package/lib/type.d.ts +1 -1
  54. package/lib/utilities/abortable-retry.js +0 -3
  55. package/lib/utilities/collection.js +11 -15
  56. package/lib/utilities/error-helpers.js +27 -34
  57. package/lib/utilities/error.js +3 -4
  58. package/lib/utilities/join-helper.js +31 -37
  59. package/lib/utilities/logger.js +5 -8
  60. package/lib/utilities/parameters.js +10 -21
  61. package/lib/utilities/retry-helpers.js +0 -1
  62. package/lib/utilities/stream.js +11 -16
  63. package/lib/utilities/user.js +3 -4
  64. package/lib/utilities/validate-params.js +1 -1
  65. package/lib/utilities/video-encoder-config.js +5 -10
  66. package/lib-es/engine/index.js +108 -102
  67. package/lib-es/media-control/desktop.js +13 -22
  68. package/lib-es/media-control/mobile.js +13 -22
  69. package/lib-es/monitor-control/index.js +7 -16
  70. package/lib-es/peer-session/index.js +121 -120
  71. package/lib-es/plugins/chat/chatroom.js +95 -118
  72. package/lib-es/plugins/chat/connector.js +47 -67
  73. package/lib-es/remote-control/index.js +216 -194
  74. package/lib-es/room-control/ability-control/index.js +10 -19
  75. package/lib-es/room-control/application-control/index.js +75 -81
  76. package/lib-es/room-control/group-control/index.js +30 -31
  77. package/lib-es/room-control/helpers/board-init-info-helper.js +10 -15
  78. package/lib-es/room-control/helpers/validation-helper.js +1 -1
  79. package/lib-es/room-control/index.js +51 -69
  80. package/lib-es/room-control/infinity-room-control/index.js +19 -26
  81. package/lib-es/room-control/interpreter-control/index.js +65 -77
  82. package/lib-es/room-control/interpreter-control/room.js +4 -5
  83. package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -5
  84. package/lib-es/room-control/mainroom-control/index.js +25 -37
  85. package/lib-es/room-control/privilege-control/helper.js +13 -27
  86. package/lib-es/room-control/privilege-control/index.js +28 -36
  87. package/lib-es/room-control/room-connector-control/index.js +47 -52
  88. package/lib-es/room-control/room-control-factory.js +12 -10
  89. package/lib-es/room-control/room-session/index.js +74 -77
  90. package/lib-es/room-control/shared-cache.js +56 -62
  91. package/lib-es/room-control/sharing-control/index.js +57 -64
  92. package/lib-es/room-control/stream-control/index.js +240 -205
  93. package/lib-es/room-control/stt-control/de-compress-gzip.js +0 -10
  94. package/lib-es/room-control/stt-control/index.js +86 -93
  95. package/lib-es/room-control/user-control/index.js +155 -162
  96. package/lib-es/room-control/waitingroom-control/index.js +9 -18
  97. package/lib-es/room-control/whiteboard-control/utils.js +2 -4
  98. package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
  99. package/lib-es/room-control/whiteboard-control-v1/board-window.js +103 -120
  100. package/lib-es/room-control/whiteboard-control-v1/factory.js +4 -6
  101. package/lib-es/room-control/whiteboard-control-v1/index.js +67 -80
  102. package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +2 -3
  103. package/lib-es/room-control/whiteboard-control-v1/utils.js +14 -17
  104. package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +10 -13
  105. package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -16
  106. package/lib-es/room-control/whiteboard-control-v2/base/index.js +53 -60
  107. package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +30 -39
  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 +33 -45
  110. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -26
  111. package/lib-es/room-control/widget-control/index.js +33 -42
  112. package/lib-es/room-router/index.js +58 -66
  113. package/lib-es/service/api.js +548 -445
  114. package/lib-es/struct.js +2 -4
  115. package/lib-es/utilities/abortable-retry.js +0 -3
  116. package/lib-es/utilities/collection.js +11 -14
  117. package/lib-es/utilities/error-helpers.js +26 -33
  118. package/lib-es/utilities/error.js +3 -4
  119. package/lib-es/utilities/join-helper.js +29 -36
  120. package/lib-es/utilities/logger.js +5 -7
  121. package/lib-es/utilities/parameters.js +10 -21
  122. package/lib-es/utilities/retry-helpers.js +0 -1
  123. package/lib-es/utilities/stream.js +11 -15
  124. package/lib-es/utilities/user.js +3 -4
  125. package/lib-es/utilities/validate-params.js +1 -1
  126. package/lib-es/utilities/video-encoder-config.js +5 -10
  127. package/package.json +4 -4
@@ -1,10 +1,5 @@
1
- import "core-js/modules/es.symbol.description.js";
2
- import "core-js/modules/es.error.cause.js";
3
1
  import "core-js/modules/es.array.push.js";
4
2
  import "core-js/modules/esnext.function.metadata.js";
5
- import "core-js/modules/esnext.iterator.constructor.js";
6
- import "core-js/modules/esnext.iterator.filter.js";
7
- import "core-js/modules/esnext.iterator.for-each.js";
8
3
  import "core-js/modules/esnext.map.delete-all.js";
9
4
  import "core-js/modules/esnext.map.emplace.js";
10
5
  import "core-js/modules/esnext.map.every.js";
@@ -20,13 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
20
15
  import "core-js/modules/esnext.map.some.js";
21
16
  import "core-js/modules/esnext.map.update.js";
22
17
  import "core-js/modules/esnext.symbol.metadata.js";
23
- import "core-js/modules/web.dom-collections.iterator.js";
24
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
25
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
26
- var _FcrWhiteboardControlFactoryImpl;
27
- let _initProto, _createForSubProcessDecs, _createForMainProcessDecs, _ref;
28
- 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; }
29
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
+ let _initProto, _createForSubProcessDecs, _createForMainProcessDecs;
30
19
  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)]; } }; }
31
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
32
21
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -39,18 +28,18 @@ import { createLogger } from '../../../utilities/logger';
39
28
  import { getWhiteboardOptions } from '../../../utilities/shared-storage';
40
29
  import { FcrStandaloneWhiteboardControlImpl, FcrWhiteboardControlImpl } from './control';
41
30
  import { getBoardPerformance } from '../../../utilities/scene-properties';
42
- _ref = (_createForSubProcessDecs = trace(['rtmClient', 'boardConfig']), _createForMainProcessDecs = trace(['rtmClient', 'boardConfig', 'scene', 'api', 'sharedCache']), "logger");
43
31
  export class FcrWhiteboardControlFactoryImpl {
44
- constructor() {
45
- _defineProperty(this, _ref, (_initProto(this), createLogger({
46
- prefix: 'FcrWhiteboardControlFactory'
47
- })));
32
+ static {
33
+ [_initProto] = _applyDecs(this, [[_createForSubProcessDecs, 2, "createForSubProcess"], [_createForMainProcessDecs, 2, "createForMainProcess"]], []).e;
48
34
  }
35
+ [(_createForSubProcessDecs = trace(['rtmClient', 'boardConfig']), _createForMainProcessDecs = trace(['rtmClient', 'boardConfig', 'scene', 'api', 'sharedCache']), "logger")] = (_initProto(this), createLogger({
36
+ prefix: 'FcrWhiteboardControlFactory'
37
+ }));
49
38
  createForSubProcess(rtmClient, boardConfig) {
50
39
  return new FcrStandaloneWhiteboardControlImpl(rtmClient, boardConfig, () => {
51
40
  const forgeInitConfig = getWhiteboardOptions();
52
41
  if (!forgeInitConfig) {
53
- throw generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM_WHITEBOARD, DetailErrorCode.UNDEFINED_ERROR, "whiteboard init config is not exist");
42
+ throw generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM_WHITEBOARD, DetailErrorCode.UNDEFINED_ERROR, `whiteboard init config is not exist`);
54
43
  }
55
44
  return Promise.resolve(forgeInitConfig);
56
45
  });
@@ -68,14 +57,10 @@ export class FcrWhiteboardControlFactoryImpl {
68
57
  };
69
58
  return async () => {
70
59
  const response = await getObjectInitConfig(roomId, userId);
71
- return _objectSpread(_objectSpread({}, response.data), {}, {
60
+ return {
61
+ ...response.data,
72
62
  boardPerformance
73
- });
63
+ };
74
64
  };
75
65
  }
76
- }
77
- _FcrWhiteboardControlFactoryImpl = FcrWhiteboardControlFactoryImpl;
78
- var _applyDecs$e = _applyDecs(_FcrWhiteboardControlFactoryImpl, [[_createForSubProcessDecs, 2, "createForSubProcess"], [_createForMainProcessDecs, 2, "createForMainProcess"]], []).e;
79
- var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
80
- _initProto = _applyDecs$e2[0];
81
- _applyDecs$e;
66
+ }
@@ -1,5 +1,3 @@
1
- import "core-js/modules/es.symbol.description.js";
2
- import "core-js/modules/es.error.cause.js";
3
1
  import "core-js/modules/es.array.push.js";
4
2
  import "core-js/modules/esnext.function.metadata.js";
5
3
  import "core-js/modules/esnext.map.delete-all.js";
@@ -17,11 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
17
15
  import "core-js/modules/esnext.map.some.js";
18
16
  import "core-js/modules/esnext.map.update.js";
19
17
  import "core-js/modules/esnext.symbol.metadata.js";
20
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
21
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
22
- var _FcrWidgetControlImpl;
23
- let _initProto, _getActivityDecs, _activeDecs, _inactiveDecs, _ref;
24
- import "core-js/modules/web.dom-collections.iterator.js";
18
+ let _initProto, _getActivityDecs, _activeDecs, _inactiveDecs;
25
19
  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)]; } }; }
26
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
27
21
  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); }
@@ -42,44 +36,46 @@ var WidgetState = /*#__PURE__*/function (WidgetState) {
42
36
  /**
43
37
  * @internal
44
38
  */
45
- _ref = (_getActivityDecs = trace(['widgetId']), _activeDecs = trace(['widgetId']), _inactiveDecs = trace(['widgetId']), "logger");
46
39
  export class FcrWidgetControlImpl {
47
- constructor(_scene, _api, _sharedCache) {
48
- //@internal
49
- _defineProperty(this, _ref, (_initProto(this), createLogger({
50
- prefix: 'FcrWidgetControlImpl'
51
- })));
52
- //@internal
53
- _defineProperty(this, "_observable", new AgoraObservable());
54
- //@internal
55
- _defineProperty(this, "_sceneObserver", {
56
- onScenePropertiesUpdated: (sceneId, event) => {
57
- var _event$cause, _event$changedPropert;
58
- if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) !== WIDGET_SCENE_PROPERTIES_CMD) {
59
- return;
60
- }
61
- const changedWidgets = (_event$changedPropert = event.changedProperties) === null || _event$changedPropert === void 0 ? void 0 : _event$changedPropert.flexWidgets;
62
- if (!changedWidgets || typeof changedWidgets !== 'object') {
63
- return;
64
- }
65
- for (const widgetId of Object.keys(changedWidgets)) {
66
- var _changedWidgets$widge;
67
- const state = (_changedWidgets$widge = changedWidgets[widgetId]) === null || _changedWidgets$widge === void 0 ? void 0 : _changedWidgets$widge.state;
68
- if (state === WidgetState.ACTIVE) {
69
- this._observable.notifyObservers('onWidgetActive', sceneId, widgetId);
70
- } else if (state === WidgetState.INACTIVE) {
71
- this._observable.notifyObservers('onWidgetInactive', sceneId, widgetId);
72
- }
40
+ static {
41
+ [_initProto] = _applyDecs(this, [[_getActivityDecs, 2, "getActivity"], [_activeDecs, 2, "active"], [_inactiveDecs, 2, "inactive"], [trace, 2, "release"]], []).e;
42
+ }
43
+ //@internal
44
+ [(_getActivityDecs = trace(['widgetId']), _activeDecs = trace(['widgetId']), _inactiveDecs = trace(['widgetId']), "logger")] = (_initProto(this), createLogger({
45
+ prefix: 'FcrWidgetControlImpl'
46
+ }));
47
+
48
+ //@internal
49
+ _observable = new AgoraObservable();
50
+
51
+ //@internal
52
+ _sceneObserver = {
53
+ onScenePropertiesUpdated: (sceneId, event) => {
54
+ if (event.cause?.cmd !== WIDGET_SCENE_PROPERTIES_CMD) {
55
+ return;
56
+ }
57
+ const changedWidgets = event.changedProperties?.flexWidgets;
58
+ if (!changedWidgets || typeof changedWidgets !== 'object') {
59
+ return;
60
+ }
61
+ for (const widgetId of Object.keys(changedWidgets)) {
62
+ const state = changedWidgets[widgetId]?.state;
63
+ if (state === WidgetState.ACTIVE) {
64
+ this._observable.notifyObservers('onWidgetActive', sceneId, widgetId);
65
+ } else if (state === WidgetState.INACTIVE) {
66
+ this._observable.notifyObservers('onWidgetInactive', sceneId, widgetId);
73
67
  }
74
68
  }
75
- });
69
+ }
70
+ };
71
+ constructor(_scene, _api, _sharedCache) {
76
72
  this._scene = _scene;
77
73
  this._api = _api;
78
74
  this._scene.addObserver(this._sceneObserver);
79
75
  this._addLogObserver();
80
76
  }
81
77
  getActivity(widgetId) {
82
- const state = this._scene.getScenePropertiesByKeyPath("flexWidgets.".concat(widgetId, ".state"));
78
+ const state = this._scene.getScenePropertiesByKeyPath(`flexWidgets.${widgetId}.state`);
83
79
  return state === WidgetState.ACTIVE;
84
80
  }
85
81
  active(widgetId) {
@@ -110,9 +106,4 @@ export class FcrWidgetControlImpl {
110
106
  _addLogObserver() {
111
107
  this.addObserver(generateLogObserver(this.logger, [['onWidgetActive', ['roomId', 'widgetId']], ['onWidgetInactive', ['roomId', 'widgetId']]]));
112
108
  }
113
- }
114
- _FcrWidgetControlImpl = FcrWidgetControlImpl;
115
- var _applyDecs$e = _applyDecs(_FcrWidgetControlImpl, [[_getActivityDecs, 2, "getActivity"], [_activeDecs, 2, "active"], [_inactiveDecs, 2, "inactive"], [trace, 2, "release"]], []).e;
116
- var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
117
- _initProto = _applyDecs$e2[0];
118
- _applyDecs$e;
109
+ }
@@ -1,9 +1,5 @@
1
- import "core-js/modules/es.symbol.description.js";
2
1
  import "core-js/modules/es.array.push.js";
3
2
  import "core-js/modules/esnext.function.metadata.js";
4
- import "core-js/modules/esnext.iterator.constructor.js";
5
- import "core-js/modules/esnext.iterator.filter.js";
6
- import "core-js/modules/esnext.iterator.for-each.js";
7
3
  import "core-js/modules/esnext.map.delete-all.js";
8
4
  import "core-js/modules/esnext.map.emplace.js";
9
5
  import "core-js/modules/esnext.map.every.js";
@@ -19,15 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
19
15
  import "core-js/modules/esnext.map.some.js";
20
16
  import "core-js/modules/esnext.map.update.js";
21
17
  import "core-js/modules/esnext.symbol.metadata.js";
22
- import "core-js/modules/web.dom-collections.iterator.js";
23
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
24
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
25
- var _FcrRoomRouterImpl;
26
- let _initProto, _initDecs, _joinRoomDecs, _ref;
27
- 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; }
28
- 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; }
29
- import "core-js/modules/es.error.cause.js";
30
- import "core-js/modules/es.regexp.exec.js";
18
+ let _initProto, _initDecs, _joinRoomDecs;
31
19
  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)]; } }; }
32
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
33
21
  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); }
@@ -50,30 +38,34 @@ import { convertServerRoomTypeToFcrRoomType } from '../utilities/convertRoomType
50
38
  /**
51
39
  * @internal
52
40
  */
53
- _ref = (_initDecs = [trace(['roomId']), validateParams(stringSchema)], _joinRoomDecs = [trace(['options']), validateParams(fcrRoomJoinOptionsSchema)], "logger");
41
+
54
42
  export class FcrRoomRouterImpl {
43
+ static {
44
+ [_initProto] = _applyDecs(this, [[_initDecs, 2, "_init"], [_joinRoomDecs, 2, "joinRoom"], [trace, 2, "leaveRoom"]], []).e;
45
+ }
46
+ [(_initDecs = [trace(['roomId']), validateParams(stringSchema)], _joinRoomDecs = [trace(['options']), validateParams(fcrRoomJoinOptionsSchema)], "logger")] = (_initProto(this), createLogger({
47
+ prefix: 'FcrRoomRouterImpl'
48
+ }));
49
+ _abortController = null;
50
+ _observable = new AgoraObservable();
51
+ _roomControlObservable = {
52
+ onRoomRouteSwitched: async event => {
53
+ this._nextRoomRoute = event.targetRouting;
54
+ this._observable.notifyObservers('onRoomRouteSwitched', this._nextRoomRoute);
55
+ this.roomControl.removeObserver(this._roomControlObservable);
56
+ this._roomControl = null;
57
+ }
58
+ };
59
+ _roomControl = null;
60
+ _nextRoomRoute = {
61
+ roomId: '',
62
+ roomType: FcrRoomType.Mainroom,
63
+ isJoined: false
64
+ };
65
+
66
+ // 接口中新增一个bypass字段,在第一次调用joinRoom的时候不传,在后续收到房间切换后的joinRoom时传true
67
+ _bypass = undefined;
55
68
  constructor(_rteEngine, _apiService, _config, _chatConnection, _sharedCache, roomId, _monitorControl) {
56
- _defineProperty(this, _ref, (_initProto(this), createLogger({
57
- prefix: 'FcrRoomRouterImpl'
58
- })));
59
- _defineProperty(this, "_abortController", null);
60
- _defineProperty(this, "_observable", new AgoraObservable());
61
- _defineProperty(this, "_roomControlObservable", {
62
- onRoomRouteSwitched: async event => {
63
- this._nextRoomRoute = event.targetRouting;
64
- this._observable.notifyObservers('onRoomRouteSwitched', this._nextRoomRoute);
65
- this.roomControl.removeObserver(this._roomControlObservable);
66
- this._roomControl = null;
67
- }
68
- });
69
- _defineProperty(this, "_roomControl", null);
70
- _defineProperty(this, "_nextRoomRoute", {
71
- roomId: '',
72
- roomType: FcrRoomType.Mainroom,
73
- isJoined: false
74
- });
75
- // 接口中新增一个bypass字段,在第一次调用joinRoom的时候不传,在后续收到房间切换后的joinRoom时传true
76
- _defineProperty(this, "_bypass", undefined);
77
69
  this._rteEngine = _rteEngine;
78
70
  this._apiService = _apiService;
79
71
  this._config = _config;
@@ -101,9 +93,7 @@ export class FcrRoomRouterImpl {
101
93
  async joinRoom(options) {
102
94
  this._abortController = new AbortController();
103
95
  this._validateRoomJoinState();
104
- const _await$to = await to(this._executeJoinRoomWithRetry(options)),
105
- _await$to2 = _slicedToArray(_await$to, 1),
106
- error = _await$to2[0];
96
+ const [error] = await to(this._executeJoinRoomWithRetry(options));
107
97
  this._abortController = null;
108
98
  if (error) {
109
99
  this._handleJoinRoomError(error);
@@ -115,10 +105,9 @@ export class FcrRoomRouterImpl {
115
105
  return Promise.resolve(this._roomControl);
116
106
  }
117
107
  async leaveRoom() {
118
- var _this$_abortControlle, _this$_roomControl;
119
- (_this$_abortControlle = this._abortController) === null || _this$_abortControlle === void 0 || _this$_abortControlle.abort();
108
+ this._abortController?.abort();
120
109
  this._abortController = null;
121
- (_this$_roomControl = this._roomControl) === null || _this$_roomControl === void 0 || _this$_roomControl.leave();
110
+ this._roomControl?.leave();
122
111
  this._roomControl = null;
123
112
  return FcrReturnCode.SUCCESS;
124
113
  }
@@ -141,10 +130,11 @@ export class FcrRoomRouterImpl {
141
130
  const abortController = this._abortController;
142
131
  return retryAttempt(() => this._performSingleJoinAttempt(options), [], {
143
132
  retriesMax: ROOM_ROUTER_CONSTANTS.MAX_JOIN_ATTEMPTS
144
- }).fail(async _ref2 => {
145
- let error = _ref2.error,
146
- waitBeforeRetry = _ref2.timeFn,
147
- attemptCount = _ref2.currentRetry;
133
+ }).fail(async ({
134
+ error,
135
+ timeFn: waitBeforeRetry,
136
+ currentRetry: attemptCount
137
+ }) => {
148
138
  return handleJoinRetryFailure(error, waitBeforeRetry, attemptCount, canRetryJoinError, () => {
149
139
  this._throwIfAborted(abortController);
150
140
  }, 'join room via router');
@@ -169,15 +159,17 @@ export class FcrRoomRouterImpl {
169
159
  * @private
170
160
  */
171
161
  async _performCheckIn(options) {
172
- const _this$_rteEngine$getC = this._rteEngine.getConfig(),
173
- userId = _this$_rteEngine$getC.userId;
162
+ const {
163
+ userId
164
+ } = this._rteEngine.getConfig();
174
165
  const checkInParams = FcrJoinHelper.buildCheckInParams(options, userId, this._nextRoomRoute.roomId, {
175
166
  bypass: this._bypass,
176
167
  avatar: options.avatar
177
168
  });
178
- const _await$handleRequestE = await handleRequestError(() => this._apiService.checkIn(checkInParams), ErrorModuleCode.FCR_ENGINE),
179
- data = _await$handleRequestE.data,
180
- ts = _await$handleRequestE.ts;
169
+ const {
170
+ data,
171
+ ts
172
+ } = await handleRequestError(() => this._apiService.checkIn(checkInParams), ErrorModuleCode.FCR_ENGINE);
181
173
  return {
182
174
  data,
183
175
  ts
@@ -189,19 +181,22 @@ export class FcrRoomRouterImpl {
189
181
  * @private
190
182
  */
191
183
  async _joinRoomControl(options, roomResponse) {
192
- const data = roomResponse.data,
193
- ts = roomResponse.ts;
184
+ const {
185
+ data,
186
+ ts
187
+ } = roomResponse;
194
188
  const abortController = this._abortController;
195
189
  const roomControl = this._createRoomControl(data);
196
- abortController === null || abortController === void 0 || abortController.signal.addEventListener('abort', () => {
190
+ abortController?.signal.addEventListener('abort', () => {
197
191
  roomControl.leave();
198
192
  });
199
- await roomControl.join(_objectSpread(_objectSpread({}, options), {}, {
193
+ await roomControl.join({
194
+ ...options,
200
195
  snapshot: data,
201
196
  timestamp: ts,
202
197
  createStreamConfigs: options.createStreamConfigs,
203
198
  roomToken: options.roomToken || this._config.token
204
- }));
199
+ });
205
200
  return roomControl;
206
201
  }
207
202
 
@@ -210,10 +205,12 @@ export class FcrRoomRouterImpl {
210
205
  * @private
211
206
  */
212
207
  _updateRoomState(roomResponse, roomControl) {
213
- const data = roomResponse.data;
208
+ const {
209
+ data
210
+ } = roomResponse;
214
211
  const fcrRoomType = convertServerRoomTypeToFcrRoomType(data.room.roomProperties.roomType);
215
212
  if (fcrRoomType === null) {
216
- const fcrError = generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM, DetailErrorCode.UNDEFINED_ERROR, "update room state failed: Unknown room type: ".concat(data.room.roomProperties.roomType));
213
+ const fcrError = generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM, DetailErrorCode.UNDEFINED_ERROR, `update room state failed: Unknown room type: ${data.room.roomProperties.roomType}`);
217
214
  throw fcrError;
218
215
  }
219
216
  this._nextRoomRoute = {
@@ -232,8 +229,8 @@ export class FcrRoomRouterImpl {
232
229
  * @private
233
230
  */
234
231
  _handleJoinRoomError(error) {
235
- this.logger.error("Failed to join the room: ".concat(error.message));
236
- const fcrError = generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM, DetailErrorCode.LOCAL_HTTP_REQUEST_FAILED, "join room failed: ".concat(error.message));
232
+ this.logger.error(`Failed to join the room: ${error.message}`);
233
+ const fcrError = generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM, DetailErrorCode.LOCAL_HTTP_REQUEST_FAILED, `join room failed: ${error.message}`);
237
234
  this._observable.notifyObservers('onErrorOccurred', fcrError);
238
235
  }
239
236
 
@@ -259,7 +256,7 @@ export class FcrRoomRouterImpl {
259
256
  });
260
257
  }
261
258
  _throwIfAborted(abortController) {
262
- if (abortController !== null && abortController !== void 0 && abortController.signal.aborted) {
259
+ if (abortController?.signal.aborted) {
263
260
  throw new Error('Join room attempt aborted');
264
261
  }
265
262
  }
@@ -272,9 +269,4 @@ export class FcrRoomRouterImpl {
272
269
  removeObserver(observer) {
273
270
  this._observable.removeObserver(observer);
274
271
  }
275
- }
276
- _FcrRoomRouterImpl = FcrRoomRouterImpl;
277
- var _applyDecs$e = _applyDecs(_FcrRoomRouterImpl, [[_initDecs, 2, "_init"], [_joinRoomDecs, 2, "joinRoom"], [trace, 2, "leaveRoom"]], []).e;
278
- var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
279
- _initProto = _applyDecs$e2[0];
280
- _applyDecs$e;
272
+ }