fcr-core 3.8.2 → 3.9.0-alpha

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 (159) hide show
  1. package/lib/chat-connector/type.d.ts +40 -0
  2. package/lib/{chat-connection → chat-connector}/type.js +1 -1
  3. package/lib/engine/index.d.ts +10 -11
  4. package/lib/engine/index.js +63 -72
  5. package/lib/engine/type.d.ts +96 -0
  6. package/lib/engine/type.js +5 -0
  7. package/lib/imports.d.ts +7 -4
  8. package/lib/imports.js +30 -4
  9. package/lib/index.d.ts +3 -2
  10. package/lib/index.js +21 -2
  11. package/lib/media-control/desktop.js +12 -12
  12. package/lib/media-control/mobile.js +4 -0
  13. package/lib/media-control/type.d.ts +32 -33
  14. package/lib/monitor-control/index.js +3 -3
  15. package/lib/peer-session/index.js +14 -14
  16. package/lib/peer-session/type.d.ts +1 -1
  17. package/lib/plugins/chat/chatroom.js +417 -0
  18. package/lib/{chat-connection → plugins/chat}/config.d.ts +1 -0
  19. package/lib/{chat-connection → plugins/chat}/config.js +2 -1
  20. package/lib/plugins/chat/connector.d.ts +38 -0
  21. package/lib/{chat-connection/index.js → plugins/chat/connector.js} +181 -61
  22. package/lib/room-control/ability-control/index.js +5 -4
  23. package/lib/room-control/ability-control/type.d.ts +5 -1
  24. package/lib/room-control/ability-control/type.js +4 -0
  25. package/lib/room-control/chatroom-control/type.d.ts +44 -35
  26. package/lib/room-control/group-control/index.js +9 -9
  27. package/lib/room-control/index.js +37 -22
  28. package/lib/room-control/interpreter-control/index.js +7 -4
  29. package/lib/room-control/interpreter-control/room.js +3 -3
  30. package/lib/room-control/interpreter-control/types.d.ts +2 -2
  31. package/lib/room-control/join-before-host-waitingroom-control/index.js +3 -3
  32. package/lib/room-control/mainroom-control/index.js +15 -13
  33. package/lib/room-control/privilege-control/index.js +39 -24
  34. package/lib/room-control/privilege-control/type.d.ts +15 -15
  35. package/lib/room-control/room-connector-control/index.js +7 -5
  36. package/lib/room-control/room-connector-control/type.d.ts +1 -1
  37. package/lib/room-control/room-control-factory.d.ts +3 -3
  38. package/lib/room-control/room-control-factory.js +7 -7
  39. package/lib/room-control/room-session/index.js +17 -15
  40. package/lib/room-control/room-session/type.d.ts +3 -3
  41. package/lib/room-control/sharing-control/index.js +13 -7
  42. package/lib/room-control/stream-control/index.js +18 -16
  43. package/lib/room-control/stream-control/type.d.ts +5 -5
  44. package/lib/room-control/stt-control/index.js +38 -31
  45. package/lib/room-control/type.d.ts +19 -19
  46. package/lib/room-control/user-control/index.js +20 -22
  47. package/lib/room-control/user-control/type.d.ts +1 -1
  48. package/lib/room-control/waitingroom-control/index.js +11 -11
  49. package/lib/room-control/whiteboard-control-v1/board-window.d.ts +21 -20
  50. package/lib/room-control/whiteboard-control-v1/board-window.js +27 -8
  51. package/lib/room-control/whiteboard-control-v1/factory.js +1 -1
  52. package/lib/room-control/whiteboard-control-v1/index.js +26 -18
  53. package/lib/room-control/whiteboard-control-v1/type.d.ts +26 -25
  54. package/lib/room-control/whiteboard-control-v1/type.js +1 -0
  55. package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +15 -6
  56. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
  57. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +4 -5
  58. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +6 -5
  59. package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +7 -1
  60. package/lib/room-control/whiteboard-control-v2/base/index.d.ts +9 -8
  61. package/lib/room-control/whiteboard-control-v2/base/index.js +84 -42
  62. package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +16 -15
  63. package/lib/room-control/whiteboard-control-v2/base/main-window.js +23 -4
  64. package/lib/room-control/whiteboard-control-v2/type.d.ts +17 -17
  65. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +12 -6
  66. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +64 -18
  67. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +2 -2
  68. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
  69. package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -1
  70. package/lib/room-router/index.js +10 -7
  71. package/lib/room-router/type.d.ts +1 -1
  72. package/lib/schema.d.ts +24 -46
  73. package/lib/schema.js +1 -2
  74. package/lib/service/api.d.ts +5 -3
  75. package/lib/service/api.js +17 -12
  76. package/lib/type.d.ts +64 -45
  77. package/lib/type.js +76 -11
  78. package/lib/utilities/abortable-retry.d.ts +38 -0
  79. package/lib/utilities/abortable-retry.js +61 -0
  80. package/lib/utilities/dual-video-stream-config.d.ts +6 -0
  81. package/lib/utilities/dual-video-stream-config.js +25 -0
  82. package/lib/utilities/error-helpers.d.ts +10 -9
  83. package/lib/utilities/error-helpers.js +12 -11
  84. package/lib/utilities/error.d.ts +4 -40
  85. package/lib/utilities/error.js +20 -77
  86. package/lib/utilities/join-helper.js +2 -2
  87. package/lib/utilities/logger.d.ts +2 -2
  88. package/lib/utilities/logger.js +6 -25
  89. package/lib/utilities/package-info.d.ts +1 -2
  90. package/lib/utilities/package-info.js +4 -8
  91. package/lib/utilities/parameters.js +88 -15
  92. package/lib/utilities/validate-params.js +1 -1
  93. package/lib/utilities/video-encoder-config.d.ts +9 -0
  94. package/lib/utilities/video-encoder-config.js +109 -0
  95. package/lib-es/{chat-connection → chat-connector}/type.js +1 -1
  96. package/lib-es/engine/index.js +46 -56
  97. package/lib-es/engine/type.js +1 -0
  98. package/lib-es/imports.js +5 -3
  99. package/lib-es/index.js +2 -1
  100. package/lib-es/media-control/desktop.js +12 -12
  101. package/lib-es/media-control/mobile.js +4 -0
  102. package/lib-es/monitor-control/index.js +3 -3
  103. package/lib-es/peer-session/index.js +16 -15
  104. package/lib-es/plugins/chat/chatroom.js +409 -0
  105. package/lib-es/{chat-connection → plugins/chat}/config.js +2 -1
  106. package/lib-es/{chat-connection/index.js → plugins/chat/connector.js} +178 -58
  107. package/lib-es/room-control/ability-control/index.js +5 -4
  108. package/lib-es/room-control/ability-control/type.js +4 -0
  109. package/lib-es/room-control/group-control/index.js +11 -10
  110. package/lib-es/room-control/index.js +40 -26
  111. package/lib-es/room-control/interpreter-control/index.js +10 -5
  112. package/lib-es/room-control/interpreter-control/room.js +3 -3
  113. package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -3
  114. package/lib-es/room-control/mainroom-control/index.js +16 -17
  115. package/lib-es/room-control/privilege-control/index.js +43 -29
  116. package/lib-es/room-control/room-connector-control/index.js +9 -6
  117. package/lib-es/room-control/room-control-factory.js +6 -6
  118. package/lib-es/room-control/room-session/index.js +21 -22
  119. package/lib-es/room-control/sharing-control/index.js +13 -7
  120. package/lib-es/room-control/stream-control/index.js +21 -18
  121. package/lib-es/room-control/stt-control/index.js +23 -15
  122. package/lib-es/room-control/user-control/index.js +23 -23
  123. package/lib-es/room-control/waitingroom-control/index.js +10 -9
  124. package/lib-es/room-control/whiteboard-control-v1/board-window.js +27 -8
  125. package/lib-es/room-control/whiteboard-control-v1/factory.js +1 -1
  126. package/lib-es/room-control/whiteboard-control-v1/index.js +26 -17
  127. package/lib-es/room-control/whiteboard-control-v1/type.js +1 -0
  128. package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
  129. package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +7 -6
  130. package/lib-es/room-control/whiteboard-control-v2/base/index.js +86 -42
  131. package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +23 -4
  132. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +60 -13
  133. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
  134. package/lib-es/room-router/index.js +10 -6
  135. package/lib-es/schema.js +1 -2
  136. package/lib-es/service/api.js +17 -12
  137. package/lib-es/type.js +70 -18
  138. package/lib-es/utilities/abortable-retry.js +54 -0
  139. package/lib-es/utilities/dual-video-stream-config.js +19 -0
  140. package/lib-es/utilities/error-helpers.js +13 -12
  141. package/lib-es/utilities/error.js +9 -75
  142. package/lib-es/utilities/join-helper.js +4 -3
  143. package/lib-es/utilities/logger.js +7 -23
  144. package/lib-es/utilities/package-info.js +4 -6
  145. package/lib-es/utilities/parameters.js +88 -15
  146. package/lib-es/utilities/validate-params.js +3 -2
  147. package/lib-es/utilities/video-encoder-config.js +103 -0
  148. package/package.json +7 -7
  149. package/lib/chat-connection/index.d.ts +0 -24
  150. package/lib/chat-connection/type.d.ts +0 -17
  151. package/lib/plugins/chatroom.js +0 -454
  152. package/lib/room-control/chatroom-control/config.d.ts +0 -51
  153. package/lib/room-control/chatroom-control/config.js +0 -105
  154. package/lib/utilities/storage.d.ts +0 -8
  155. package/lib/utilities/storage.js +0 -33
  156. package/lib-es/plugins/chatroom.js +0 -446
  157. package/lib-es/room-control/chatroom-control/config.js +0 -100
  158. package/lib-es/utilities/storage.js +0 -27
  159. /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
@@ -51,7 +51,7 @@ export interface FcrStreamControl {
51
51
  * @param streamId
52
52
  * @param volume
53
53
  */
54
- adjustRemoteAudioStreamVolume(streamId: string, volume: number): void;
54
+ adjustRemoteAudioStreamVolume(streamId: string, volume: number): number;
55
55
  /**
56
56
  * Sets the video encoder configuration for local a stream.
57
57
  * @param streamId
@@ -72,23 +72,23 @@ export interface FcrStreamControl {
72
72
  * @param config
73
73
  * @param element
74
74
  */
75
- startRenderRemoteVideoStream(streamId: string, type: FcrVideoStreamType, config: FcrVideoRenderConfig, element: FcrRenderView): void;
75
+ startRenderRemoteVideoStream(streamId: string, type: FcrVideoStreamType, config: FcrVideoRenderConfig, element: FcrRenderView): number;
76
76
  /**
77
77
  * Stops rendering the remote video stream.
78
78
  * @param streamId
79
79
  * @param element
80
80
  */
81
- stopRenderRemoteVideoStream(streamId: string, element: FcrRenderView): void;
81
+ stopRenderRemoteVideoStream(streamId: string, element: FcrRenderView): number;
82
82
  /**
83
83
  * Starts playing the remote audio stream.
84
84
  * @param streamId
85
85
  */
86
- startPlayRemoteAudioStream(streamId: string): void;
86
+ startPlayRemoteAudioStream(streamId: string): number;
87
87
  /**
88
88
  * Stops playing the remote audio stream.
89
89
  * @param streamId
90
90
  */
91
- stopPlayRemoteAudioStream(streamId: string): void;
91
+ stopPlayRemoteAudioStream(streamId: string): number;
92
92
  /**
93
93
  * Takes a snapshot of the remote video stream.
94
94
  * @param streamId
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  });
9
9
  exports.FcrSttControlImpl = void 0;
10
10
  require("core-js/modules/es.array.push.js");
11
+ require("core-js/modules/es.json.stringify.js");
11
12
  require("core-js/modules/esnext.iterator.constructor.js");
12
13
  require("core-js/modules/esnext.iterator.filter.js");
13
14
  require("core-js/modules/esnext.iterator.map.js");
@@ -26,14 +27,14 @@ require("core-js/modules/esnext.map.reduce.js");
26
27
  require("core-js/modules/esnext.map.some.js");
27
28
  require("core-js/modules/esnext.map.update.js");
28
29
  var _imports = require("../../imports");
29
- var _logger = require("../../utilities/logger");
30
30
  var _schema = require("../../schema");
31
- var _type = require("./type");
31
+ var _type = require("../../type");
32
32
  var _error = require("../../utilities/error");
33
- var _type2 = require("../../type");
34
- var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
33
+ var _logger = require("../../utilities/logger");
35
34
  var _user = require("../../utilities/user");
36
- var _type3 = require("../type");
35
+ var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
36
+ var _type2 = require("../type");
37
+ var _type3 = require("./type");
37
38
  let _initProto, _startCaptionDecs, _startTranscribingDecs, _updateSourceLanguageDecs, _subscribeTranscribingLanguageDecs;
38
39
  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)]; } }; }
39
40
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -48,7 +49,7 @@ class FcrSttControlImpl {
48
49
  [_initProto] = _applyDecs(this, [[_startCaptionDecs, 2, "startCaption"], [_imports.trace, 2, "stopCaption"], [_startTranscribingDecs, 2, "startTranscribing"], [_imports.trace, 2, "stopTranscribing"], [_updateSourceLanguageDecs, 2, "updateSourceLanguage"], [_subscribeTranscribingLanguageDecs, 2, "subscribeTranscribingLanguage"], [_imports.trace, 2, "unsubscribeTranscribingLanguage"], [_imports.trace, 2, "release"]], []).e;
49
50
  }
50
51
  //@internal
51
- [(_startCaptionDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrLanguageConfigSchema)], _startTranscribingDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrLanguageConfigSchema)], _updateSourceLanguageDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrLanguageSchema)], _subscribeTranscribingLanguageDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrLanguageSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
52
+ [(_startCaptionDecs = [(0, _imports.trace)(['config']), (0, _validateParams.default)(_schema.fcrLanguageConfigSchema)], _startTranscribingDecs = [(0, _imports.trace)(['config']), (0, _validateParams.default)(_schema.fcrLanguageConfigSchema)], _updateSourceLanguageDecs = [(0, _imports.trace)(['language']), (0, _validateParams.default)(_schema.fcrLanguageSchema)], _subscribeTranscribingLanguageDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrLanguageSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
52
53
  prefix: 'FcrUserControlImpl'
53
54
  }));
54
55
 
@@ -64,31 +65,36 @@ class FcrSttControlImpl {
64
65
  _sceneObserver = {
65
66
  onStreamMessageReceived: async (sceneId, data) => {
66
67
  const sttUids = this._scene.getScenePropertiesByKeyPath('widgets.stt.extra.pubBotUids');
68
+ if (!Array.isArray(sttUids)) {
69
+ this.logger.error('sttUids is not an array');
70
+ return;
71
+ }
67
72
  const isSttBot = sttUids.includes(Number(data.streamId));
68
73
  if (!isSttBot) {
69
74
  return;
70
75
  }
71
76
  const sttStreamMessageData = await (0, _imports.deCompressGzipToJson)(data.payload);
77
+ this.logger.info('onStreamMessageReceived sttStreamMessageData: ', JSON.stringify(sttStreamMessageData));
72
78
  this._handleSttStreamMessageData(sttStreamMessageData, sceneId);
73
79
  },
74
80
  onUserPropertiesUpdated: (sceneId, event) => {
75
81
  if (event.cause && event.cause.data) {
76
82
  const causeData = event.cause.data;
77
- if (causeData.widgetUuid == _type3.FcrWidgetUuid.STT && causeData.widgetCause && causeData.widgetCause.cmd == 3450) {
83
+ if (causeData.widgetUuid == _type2.FcrWidgetUuid.STT && causeData.widgetCause && causeData.widgetCause.cmd == 3450) {
78
84
  const localUserId = this._scene.localUser.getLocalUserId();
79
85
  if (event.operatorUser.userId !== localUserId) {
80
86
  return;
81
87
  }
82
88
  const operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
83
89
  if (causeData.widgetCause.reason === 0) {
84
- const isTranscribingStopped = this._getTranscribingState() === _type.FcrTranscribingState.STOPPED;
90
+ const isTranscribingStopped = this._getTranscribingState() === _type3.FcrTranscribingState.STOPPED;
85
91
  if (isTranscribingStopped) {
86
92
  this._sttEventWrapperListMap.clear();
87
93
  }
88
- this._observable.notifyObservers('onLocalCaptionStateUpdated', sceneId, _type.FcrCaptionState.STOPPED, operatorUser);
94
+ this._observable.notifyObservers('onLocalCaptionStateUpdated', sceneId, _type3.FcrCaptionState.STOPPED, operatorUser);
89
95
  }
90
96
  if (causeData.widgetCause.reason === 1) {
91
- this._observable.notifyObservers('onLocalCaptionStateUpdated', sceneId, _type.FcrCaptionState.STARTED, operatorUser);
97
+ this._observable.notifyObservers('onLocalCaptionStateUpdated', sceneId, _type3.FcrCaptionState.STARTED, operatorUser);
92
98
  }
93
99
  }
94
100
  }
@@ -99,20 +105,20 @@ class FcrSttControlImpl {
99
105
  if (!causeData.widgetCause) {
100
106
  return;
101
107
  }
102
- if (causeData.widgetUuid == _type3.FcrWidgetUuid.TRANSCRIBE && causeData.widgetCause.cmd == _type3.FcrWidgetCauseCmd.TRANSCRIBE) {
108
+ if (causeData.widgetUuid == _type2.FcrWidgetUuid.TRANSCRIBE && causeData.widgetCause.cmd == _type2.FcrWidgetCauseCmd.TRANSCRIBE) {
103
109
  const operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
104
110
  if (causeData.widgetCause.reason === 0) {
105
- const isCaptionStopped = this._getLocalCaptionState() === _type.FcrCaptionState.STOPPED;
111
+ const isCaptionStopped = this._getLocalCaptionState() === _type3.FcrCaptionState.STOPPED;
106
112
  if (isCaptionStopped) {
107
113
  this._sttEventWrapperListMap.clear();
108
114
  }
109
- this._observable.notifyObservers('onTranscribingStateUpdated', sceneId, _type.FcrTranscribingState.STOPPED, operatorUser);
115
+ this._observable.notifyObservers('onTranscribingStateUpdated', sceneId, _type3.FcrTranscribingState.STOPPED, operatorUser);
110
116
  }
111
117
  if (causeData.widgetCause.reason === 1) {
112
- this._observable.notifyObservers('onTranscribingStateUpdated', sceneId, _type.FcrTranscribingState.STARTED, operatorUser);
118
+ this._observable.notifyObservers('onTranscribingStateUpdated', sceneId, _type3.FcrTranscribingState.STARTED, operatorUser);
113
119
  }
114
120
  }
115
- if (causeData.widgetUuid == _type3.FcrWidgetUuid.STT && causeData.widgetCause.cmd == _type3.FcrWidgetCauseCmd.STT) {
121
+ if (causeData.widgetUuid == _type2.FcrWidgetUuid.STT && causeData.widgetCause.cmd == _type2.FcrWidgetCauseCmd.STT) {
116
122
  let operatorUser;
117
123
  if (event.operatorUser) {
118
124
  operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
@@ -137,46 +143,46 @@ class FcrSttControlImpl {
137
143
  roomUuid: this._scene.sceneId,
138
144
  userUuid: this._scene.localUser.getLocalUserId(),
139
145
  config
140
- }), _error.FcrErrorModuleCode.ROOM_STT, 'start caption failed');
146
+ }), _imports.ErrorModuleCode.FCR_ROOM_STT, 'start caption failed');
141
147
  }
142
148
  stopCaption() {
143
149
  return (0, _error.handleRequestError)(() => this._api.stopCaption({
144
150
  roomUuid: this._scene.sceneId,
145
151
  userUuid: this._scene.localUser.getLocalUserId()
146
- }), _error.FcrErrorModuleCode.ROOM_STT, 'stop caption failed');
152
+ }), _imports.ErrorModuleCode.FCR_ROOM_STT, 'stop caption failed');
147
153
  }
148
154
  startTranscribing(config) {
149
155
  return (0, _error.handleRequestError)(() => this._api.startTranscribing({
150
156
  roomUuid: this._scene.sceneId,
151
157
  userUuid: this._scene.localUser.getLocalUserId(),
152
158
  config
153
- }), _error.FcrErrorModuleCode.ROOM_STT, 'start transcribing failed');
159
+ }), _imports.ErrorModuleCode.FCR_ROOM_STT, 'start transcribing failed');
154
160
  }
155
161
  stopTranscribing() {
156
162
  return (0, _error.handleRequestError)(() => this._api.stopTranscribing({
157
163
  roomUuid: this._scene.sceneId,
158
164
  userUuid: this._scene.localUser.getLocalUserId()
159
- }), _error.FcrErrorModuleCode.ROOM_STT, 'stop transcribing failed');
165
+ }), _imports.ErrorModuleCode.FCR_ROOM_STT, 'stop transcribing failed');
160
166
  }
161
167
  updateSourceLanguage(language) {
162
168
  return (0, _error.handleRequestError)(() => this._api.updateSourceLanguage({
163
169
  roomUuid: this._scene.sceneId,
164
170
  userUuid: this._scene.localUser.getLocalUserId(),
165
171
  language
166
- }), _error.FcrErrorModuleCode.ROOM_STT, 'update source language failed');
172
+ }), _imports.ErrorModuleCode.FCR_ROOM_STT, 'update source language failed');
167
173
  }
168
174
  subscribeTranscribingLanguage(language) {
169
175
  return (0, _error.handleRequestError)(() => this._api.subscribeTranscribingLanguage({
170
176
  roomUuid: this._scene.sceneId,
171
177
  userUuid: this._scene.localUser.getLocalUserId(),
172
178
  language
173
- }), _error.FcrErrorModuleCode.ROOM_STT, 'subscribe transcribing language failed');
179
+ }), _imports.ErrorModuleCode.FCR_ROOM_STT, 'subscribe transcribing language failed');
174
180
  }
175
181
  unsubscribeTranscribingLanguage() {
176
182
  return (0, _error.handleRequestError)(() => this._api.unsubscribeTranscribingLanguage({
177
183
  roomUuid: this._scene.sceneId,
178
184
  userUuid: this._scene.localUser.getLocalUserId()
179
- }), _error.FcrErrorModuleCode.ROOM_STT, 'unsubscribe transcribing language failed');
185
+ }), _imports.ErrorModuleCode.FCR_ROOM_STT, 'unsubscribe transcribing language failed');
180
186
  }
181
187
  getLocalCaptionState() {
182
188
  return this._getLocalCaptionState();
@@ -186,7 +192,7 @@ class FcrSttControlImpl {
186
192
  }
187
193
  getSourceLanguage() {
188
194
  const transcribingState = this._getTranscribingState();
189
- if (transcribingState === _type.FcrTranscribingState.STOPPED) {
195
+ if (transcribingState === _type3.FcrTranscribingState.STOPPED) {
190
196
  return null;
191
197
  }
192
198
  return this._scene.getScenePropertiesByKeyPath('widgets.stt.extra.speechLanguage');
@@ -213,6 +219,7 @@ class FcrSttControlImpl {
213
219
  release() {
214
220
  this._sttEventWrapperListMap.clear();
215
221
  this._scene.removeObserver(this._sceneObserver);
222
+ return _type.FcrReturnCode.SUCCESS;
216
223
  }
217
224
  _getLocalCaptionState() {
218
225
  const captionState = this._scene.getUserPropertiesByKeyPath('widgets.stt.caption', this._scene.localUser.getLocalUserId());
@@ -223,13 +230,13 @@ class FcrSttControlImpl {
223
230
  }
224
231
  _handleSttStreamMessageData(sttStreamMessageData, sceneId) {
225
232
  const codeMap = {
226
- 'zh-CN': _type2.FcrLanguage.ZH,
227
- 'en-US': _type2.FcrLanguage.EN,
228
- 'ja-JP': _type2.FcrLanguage.JP,
229
- 'de-DE': _type2.FcrLanguage.DE,
230
- 'fr-FR': _type2.FcrLanguage.FR,
231
- 'pt-PT': _type2.FcrLanguage.PT,
232
- 'es-ES': _type2.FcrLanguage.ES
233
+ 'zh-CN': _type.FcrLanguage.ZH,
234
+ 'en-US': _type.FcrLanguage.EN,
235
+ 'ja-JP': _type.FcrLanguage.JP,
236
+ 'de-DE': _type.FcrLanguage.DE,
237
+ 'fr-FR': _type.FcrLanguage.FR,
238
+ 'pt-PT': _type.FcrLanguage.PT,
239
+ 'es-ES': _type.FcrLanguage.ES
233
240
  };
234
241
  const transcript = sttStreamMessageData.transcript;
235
242
  const translation = sttStreamMessageData.translation;
@@ -344,7 +351,7 @@ class FcrSttControlImpl {
344
351
  }
345
352
  }
346
353
  _addLogObserver() {
347
- this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onSttEventReceived', 'onLocalCaptionStateUpdated', 'onTranscribingStateUpdated', 'onSourceLanguageUpdated']));
354
+ this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onSttEventReceived', ['roomId', 'event']], ['onLocalCaptionStateUpdated', ['roomId', 'state', 'operatorUser']], ['onTranscribingStateUpdated', ['roomId', 'state', 'operatorUser']], ['onSourceLanguageUpdated', ['roomId', 'operatorUser']]]));
348
355
  }
349
356
  }
350
357
  exports.FcrSttControlImpl = FcrSttControlImpl;
@@ -60,25 +60,25 @@ export interface FcrBaseRoomControl {
60
60
  * Joins the room.
61
61
  * @param options
62
62
  */
63
- join(options: FcrRoomJoinSnapshotOptions): Promise<void>;
64
- join(options: FcrRoomJoinOptions): Promise<void>;
65
- join(options: FcrRoomJoinOptions | FcrRoomJoinSnapshotOptions): Promise<void>;
63
+ join(options: FcrRoomJoinSnapshotOptions): Promise<number>;
64
+ join(options: FcrRoomJoinOptions): Promise<number>;
65
+ join(options: FcrRoomJoinOptions | FcrRoomJoinSnapshotOptions): Promise<number>;
66
66
  /**
67
67
  * Leaves the room.
68
68
  */
69
- leave(): Promise<void>;
69
+ leave(): Promise<number>;
70
70
  /**
71
71
  * Starts the room.
72
72
  */
73
- start(): Promise<void>;
73
+ start(): Promise<number>;
74
74
  /**
75
75
  * Ends the room.
76
76
  */
77
- end(): Promise<void>;
77
+ end(): Promise<number>;
78
78
  /**
79
79
  * Closes the room.
80
80
  */
81
- close(): Promise<void>;
81
+ close(): Promise<number>;
82
82
  /**
83
83
  * Gets the room state.
84
84
  */
@@ -101,36 +101,36 @@ export interface FcrBaseRoomControl {
101
101
  * @param properties
102
102
  * @param cause
103
103
  */
104
- updateRoomProperties(properties: Record<string, unknown>, cause?: Record<string, unknown>): Promise<void>;
104
+ updateRoomProperties(properties: Record<string, unknown>, cause?: Record<string, unknown>): Promise<number>;
105
105
  /**
106
106
  * Updates the increment room properties.
107
107
  * @param increments
108
108
  * @param cause
109
109
  */
110
- updateIncrementRoomProperties(increments: Record<string, number>, cause?: Record<string, unknown>): Promise<void>;
110
+ updateIncrementRoomProperties(increments: Record<string, number>, cause?: Record<string, unknown>): Promise<number>;
111
111
  /**
112
112
  * Deletes the room properties.
113
113
  * @param keyPaths
114
114
  * @param cause
115
115
  */
116
- deleteRoomProperties(keyPaths: string[], cause?: Record<string, unknown>): Promise<void>;
116
+ deleteRoomProperties(keyPaths: string[], cause?: Record<string, unknown>): Promise<number>;
117
117
  /**
118
118
  * Starts the cloud recording.
119
119
  * @param config
120
120
  */
121
- startCloudRecording(config: FcrCloudRecordingConfig): Promise<void>;
121
+ startCloudRecording(config: FcrCloudRecordingConfig): Promise<number>;
122
122
  /**
123
123
  * Pauses the cloud recording.
124
124
  */
125
- pauseCloudRecording(): Promise<void>;
125
+ pauseCloudRecording(): Promise<number>;
126
126
  /**
127
127
  * Resumes the cloud recording.
128
128
  */
129
- resumeCloudRecording(): Promise<void>;
129
+ resumeCloudRecording(): Promise<number>;
130
130
  /**
131
131
  * Stops the cloud recording.
132
132
  */
133
- stopCloudRecording(): Promise<void>;
133
+ stopCloudRecording(): Promise<number>;
134
134
  /**
135
135
  * Gets the state of the live streaming.
136
136
  */
@@ -143,16 +143,16 @@ export interface FcrBaseRoomControl {
143
143
  * Starts the live streaming.
144
144
  * @param data
145
145
  */
146
- startLiveStreaming(data: FcrLiveStreamingConfig): Promise<void>;
146
+ startLiveStreaming(data: FcrLiveStreamingConfig): Promise<number>;
147
147
  /**
148
148
  * Updates the layout of live streaming.
149
149
  * @param layoutType
150
150
  */
151
- updateLiveStreamingLayout(layoutType: FcrLiveStreamingLayoutType): Promise<void>;
151
+ updateLiveStreamingLayout(layoutType: FcrLiveStreamingLayoutType): Promise<number>;
152
152
  /**
153
153
  * Stops the live streaming.
154
154
  */
155
- stopLiveStreaming(): Promise<void>;
155
+ stopLiveStreaming(): Promise<number>;
156
156
  /**
157
157
  * Gets the state of the cloud recording.
158
158
  */
@@ -162,7 +162,7 @@ export interface FcrBaseRoomControl {
162
162
  * @param payload
163
163
  * @param guaranteedDelivery
164
164
  */
165
- sendRoomMessage(payload: Record<string, unknown>, guaranteedDelivery?: boolean): Promise<void>;
165
+ sendRoomMessage(payload: Record<string, unknown>, guaranteedDelivery?: boolean): Promise<number>;
166
166
  /**
167
167
  * Check the room is host key enabled.
168
168
  */
@@ -181,7 +181,7 @@ export interface FcrBaseRoomControl {
181
181
  export interface FcrMainRoomControl extends FcrBaseRoomControl {
182
182
  getInterpreterControl(): FcrInterpreterControl;
183
183
  enableWaitingRoom(enable: boolean): Promise<void>;
184
- moveToWaitingRoomByUserIds(userIds: string[]): Promise<void>;
184
+ moveToWaitingRoomByUserIds(userIds: string[]): Promise<number>;
185
185
  moveToWaitingRoomByUserRoles(): Promise<void>;
186
186
  }
187
187
  export interface FcrSubRoomControl extends FcrBaseRoomControl {
@@ -36,7 +36,7 @@ var _logger = require("../../utilities/logger");
36
36
  var _error = require("../../utilities/error");
37
37
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
38
38
  var _schema = require("../../schema");
39
- let _initProto, _getUserDecs, _updateUserNameDecs, _updateUserPropertiesDecs, _updateIncrementUserPropertiesDecs, _deleteUserPropertiesDecs, _getUserPropertiesByUserIdDecs, _getUserPropertiesByKeyPathDecs, _updateRemoteUserRoleDecs, _claimHostDecs, _kickOutDecs, _kickOutByUserIdsDecs, _kickOutByUserRolesDecs, _mergeAudioStreamDecs;
39
+ let _initProto, _getUserDecs, _fetchUserListDecs, _updateUserNameDecs, _updateUserPropertiesDecs, _updateIncrementUserPropertiesDecs, _deleteUserPropertiesDecs, _getUserPropertiesByUserIdDecs, _getUserPropertiesByKeyPathDecs, _updateRemoteUserRoleDecs, _claimHostDecs, _kickOutDecs, _kickOutByUserIdsDecs, _kickOutByUserRolesDecs, _mergeAudioStreamDecs;
40
40
  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)]; } }; }
41
41
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
42
42
  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); }
@@ -47,10 +47,10 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
47
47
  */
48
48
  class FcrUserControlImpl {
49
49
  static {
50
- [_initProto] = _applyDecs(this, [[_imports.bound, 2, "getLocalUser"], [_imports.bound, 2, "getUsers"], [_imports.bound, 2, "getUserList"], [_getUserDecs, 2, "getUser"], [[_imports.bound, _imports.trace], 2, "getAllUserCount"], [_imports.bound, 2, "getWaterMarkContent"], [[_imports.bound, _imports.trace], 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"]], []).e;
50
+ [_initProto] = _applyDecs(this, [[_imports.bound, 2, "getLocalUser"], [_imports.bound, 2, "getUsers"], [_imports.bound, 2, "getUserList"], [_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"]], []).e;
51
51
  }
52
52
  //@internal
53
- [(_getUserDecs = [_imports.bound, (0, _validateParams.default)(_schema.stringSchema)], _updateUserNameDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _updateUserPropertiesDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _updateIncrementUserPropertiesDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringKeyNumberValueSchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _deleteUserPropertiesDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringKeyUnknownValueSchema, _schema.stringSchema)], _getUserPropertiesByUserIdDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _getUserPropertiesByKeyPathDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _updateRemoteUserRoleDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrUserRoleSchema)], _claimHostDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _kickOutDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrUserKickedOutTypeSchema)], _kickOutByUserIdsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.fcrUserKickedOutTypeSchema)], _kickOutByUserRolesDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrUserRolesSchema, _schema.fcrUserKickedOutTypeSchema)], _mergeAudioStreamDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
53
+ [(_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)({
54
54
  prefix: 'FcrUserControlImpl'
55
55
  }));
56
56
  //@internal
@@ -247,7 +247,7 @@ class FcrUserControlImpl {
247
247
  roomId: this._scene.sceneId,
248
248
  userId,
249
249
  userName
250
- }), _error.FcrErrorModuleCode.ROOM_USER, 'update user name failed');
250
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'update user name failed');
251
251
  }
252
252
  updateUserProperties(properties, cause, userId) {
253
253
  return (0, _error.handleRequestError)(() => this._api.updateUserProperties({
@@ -255,7 +255,7 @@ class FcrUserControlImpl {
255
255
  userUuid: userId,
256
256
  properties,
257
257
  cause
258
- }), _error.FcrErrorModuleCode.ROOM_USER, 'update user properties failed');
258
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'update user properties failed');
259
259
  }
260
260
  updateIncrementUserProperties(increments, cause, userId) {
261
261
  return (0, _error.handleRequestError)(() => this._api.updateUserProperties({
@@ -263,15 +263,15 @@ class FcrUserControlImpl {
263
263
  userUuid: userId,
264
264
  increments,
265
265
  cause
266
- }), _error.FcrErrorModuleCode.ROOM_USER, 'update increment user properties failed');
266
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'update increment user properties failed');
267
267
  }
268
268
  async deleteUserProperties(keyPath, cause, userId) {
269
- await (0, _error.handleRequestError)(() => this._api.deleteUserProperties({
269
+ return (0, _error.handleRequestError)(() => this._api.deleteUserProperties({
270
270
  roomId: this._scene.sceneId,
271
271
  userUuid: userId,
272
272
  properties: keyPath,
273
273
  cause
274
- }), _error.FcrErrorModuleCode.ROOM_USER, 'delete user properties failed');
274
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'delete user properties failed');
275
275
  }
276
276
  getUserProperties() {
277
277
  const userProperties = this._scene.getUserProperties();
@@ -288,23 +288,21 @@ class FcrUserControlImpl {
288
288
  return this._scene.getUserPropertiesByKeyPath('flexProps.' + keyPath, userId);
289
289
  }
290
290
  async updateRemoteUserRole(userId, userRole) {
291
- await (0, _error.handleRequestError)(() => this._api.updateUserRole({
291
+ return (0, _error.handleRequestError)(() => this._api.updateUserRole({
292
292
  roomId: this._scene.sceneId,
293
293
  userId,
294
294
  localRole: userRole === _type.FcrUserRole.HOST ? _type.FcrUserRoleToStringMap[_type.FcrUserRole.PARTICIPANT] : undefined,
295
295
  remoteRole: _type.FcrUserRoleToStringMap[userRole]
296
- }), _error.FcrErrorModuleCode.ROOM_USER, 'update remote user role failed');
296
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'update remote user role failed');
297
297
  }
298
298
  async revokeHost() {
299
299
  const userList = this.getUserList();
300
300
  const originHostUser = userList.find(user => user.userRole === _type.FcrUserRole.HOST);
301
301
  if (originHostUser) {
302
- await (0, _error.handleRequestError)(() => this._api.revokeUserRole({
302
+ return (0, _error.handleRequestError)(() => this._api.revokeUserRole({
303
303
  roomId: this._scene.sceneId,
304
- localRole: _type.FcrUserRoleToStringMap[_type.FcrUserRole.HOST],
305
- remoteRole: _type.FcrUserRoleToStringMap[_type.FcrUserRole.PARTICIPANT],
306
- userId: originHostUser?.userId
307
- }), _error.FcrErrorModuleCode.ROOM_USER, 'revoke host failed');
304
+ remoteRole: _type.FcrUserRoleToStringMap[_type.FcrUserRole.PARTICIPANT]
305
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'revoke host failed');
308
306
  }
309
307
  }
310
308
  async claimHost(hostKey) {
@@ -315,27 +313,27 @@ class FcrUserControlImpl {
315
313
  roomId: this._scene.sceneId,
316
314
  hostKey,
317
315
  userId
318
- }), _error.FcrErrorModuleCode.ROOM_USER, 'claim host by ticket failed');
316
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'claim host by ticket failed');
319
317
  }
320
318
  async kickOut(userId, type) {
321
- await (0, _error.handleRequestError)(() => this._api.kickOut(userId, type, {
319
+ return (0, _error.handleRequestError)(() => this._api.kickOut(userId, type, {
322
320
  roomId: this._scene.sceneId
323
- }), _error.FcrErrorModuleCode.ROOM_USER, 'kick out failed');
321
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'kick out failed');
324
322
  }
325
323
  async kickOutByUserIds(userIds, type) {
326
324
  return (0, _error.handleRequestError)(() => this._api.kickOutByUserIds(userIds, type, {
327
325
  roomId: this._scene.sceneId
328
- }), _error.FcrErrorModuleCode.ROOM_USER, 'kick out by user ids failed');
326
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'kick out by user ids failed');
329
327
  }
330
328
  async kickOutByUserRoles(userRoles, type) {
331
329
  return (0, _error.handleRequestError)(() => this._api.kickOutByUserRoles(type, {
332
330
  roomId: this._scene.sceneId
333
- }, userRoles.map(role => _type.FcrUserRoleToStringMap[role])), _error.FcrErrorModuleCode.ROOM_USER, 'kick out by user roles failed');
331
+ }, userRoles.map(role => _type.FcrUserRoleToStringMap[role])), _imports.ErrorModuleCode.FCR_ROOM_USER, 'kick out by user roles failed');
334
332
  }
335
333
  mergeAudioStream(userId) {
336
334
  return (0, _error.handleRequestError)(() => this._api.mergeAudioStream(userId, {
337
335
  roomId: this._scene.sceneId
338
- }), _error.FcrErrorModuleCode.ROOM_USER, 'merge audio stream failed');
336
+ }), _imports.ErrorModuleCode.FCR_ROOM_USER, 'merge audio stream failed');
339
337
  }
340
338
  addObserver(observer) {
341
339
  this._observable.addObserver(observer);
@@ -344,7 +342,7 @@ class FcrUserControlImpl {
344
342
  this._observable.removeObserver(observer);
345
343
  }
346
344
  _addLogObserver() {
347
- this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onRemoteUsersJoined', 'onRemoteUsersLeft', 'onUserInfoUpdated', 'onAllUserCountUpdated', 'onLocalUserKickedOut', 'onUserPropertiesUpdated', 'onUserPropertiesDeleted']));
345
+ 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']]]));
348
346
  }
349
347
  }
350
348
  exports.FcrUserControlImpl = FcrUserControlImpl;
@@ -91,7 +91,7 @@ export interface FcrUserControl {
91
91
  */
92
92
  kickOut(userId: string, type: FcrUserKickedOutType): Promise<void>;
93
93
  kickOutByUserRoles(userRoles: FcrUserRole[], type: FcrUserKickedOutType): Promise<void>;
94
- kickOutByUserIds(userId: string[], type: FcrUserKickedOutType): Promise<void>;
94
+ kickOutByUserIds(userIds: string[], type: FcrUserKickedOutType): Promise<void>;
95
95
  /**
96
96
  * Adds an observer.
97
97
  * @param observer
@@ -24,14 +24,14 @@ Object.defineProperty(exports, "__esModule", {
24
24
  exports.FcrWaitingRoomControlImpl = void 0;
25
25
  require("core-js/modules/esnext.iterator.constructor.js");
26
26
  require("core-js/modules/esnext.iterator.map.js");
27
- var _imports = require("../../imports");
28
27
  var _ = require("..");
29
- var _type = require("../type");
30
- var _type2 = require("../../type");
31
- var _logger = require("../../utilities/logger");
28
+ var _imports = require("../../imports");
29
+ var _schema = require("../../schema");
30
+ var _type = require("../../type");
32
31
  var _error = require("../../utilities/error");
32
+ var _logger = require("../../utilities/logger");
33
33
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
34
- var _schema = require("../../schema");
34
+ var _type2 = require("../type");
35
35
  let _initProto, _moveToMainRoomByUserIdsDecs, _moveToMainRoomByUserRolesDecs;
36
36
  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
37
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -46,11 +46,11 @@ class FcrWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
46
46
  [_initProto] = _applyDecs(this, [[_moveToMainRoomByUserIdsDecs, 2, "moveToMainRoomByUserIds"], [_moveToMainRoomByUserRolesDecs, 2, "moveToMainRoomByUserRoles"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
47
47
  }
48
48
  //@internal
49
- [(_moveToMainRoomByUserIdsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _moveToMainRoomByUserRolesDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrUserRolesSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
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
50
  prefix: 'FcrWaitingRoomControlImpl'
51
51
  }));
52
52
  constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
53
- super(engine, scene, api, config, _type.FcrRoomType.Waitingroom, chatConnection, sharedCache, chatRoomControl);
53
+ super(engine, scene, api, config, _type2.FcrRoomType.Waitingroom, chatConnection, sharedCache, chatRoomControl);
54
54
  this._addLogObserver();
55
55
  }
56
56
  addObserver(observer) {
@@ -60,16 +60,16 @@ class FcrWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
60
60
  super.removeObserver(observer);
61
61
  }
62
62
  async moveToMainRoomByUserIds(userIds) {
63
- return (0, _error.handleRequestError)(() => this._api.moveToMainRoomByUserIds(userIds, this._scene.getScenePropertiesByKeyPath('info.mainRoomUuid')), _error.FcrErrorModuleCode.ROOM, 'move to main room by user ids failed');
63
+ return (0, _error.handleRequestError)(() => this._api.moveToMainRoomByUserIds(userIds, this._scene.getScenePropertiesByKeyPath('info.mainRoomUuid')), _imports.ErrorModuleCode.FCR_ROOM, 'move to main room by user ids failed');
64
64
  }
65
65
  async moveToMainRoomByUserRoles(userRoles) {
66
- return (0, _error.handleRequestError)(() => this._api.moveToMainRoomByUserRoles(userRoles.map(role => _type2.FcrUserRoleToStringMap[role]), this._scene.getScenePropertiesByKeyPath('info.mainRoomUuid')), _error.FcrErrorModuleCode.ROOM, 'move to main room by user roles failed');
66
+ return (0, _error.handleRequestError)(() => this._api.moveToMainRoomByUserRoles(userRoles.map(role => _type.FcrUserRoleToStringMap[role]), this._scene.getScenePropertiesByKeyPath('info.mainRoomUuid')), _imports.ErrorModuleCode.FCR_ROOM, 'move to main room by user roles failed');
67
67
  }
68
68
  _addLogObserver() {
69
- this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onCloudRecordingStateUpdated', 'onJoinRoomFailure', 'onJoinRoomSuccess', 'onLiveStreamingStateUpdated',
69
+ this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onCloudRecordingStateUpdated', ['roomId', 'state']], ['onJoinRoomFailure', ['roomId', 'error']], ['onJoinRoomSuccess', ['roomId']], ['onLiveStreamingStateUpdated', ['roomId', 'state', 'url', 'reason']],
70
70
  // 'onNetworkQualityUpdated',
71
71
  // 'onNetworkStatsUpdated',
72
- 'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated']));
72
+ ['onRoomMessageReceived', ['roomId', 'message']], ['onRoomPropertiesDeleted', ['roomId', 'event']], ['onRoomPropertiesUpdated', ['roomId', 'event']], ['onRoomStateUpdated', ['roomId', 'state']]]));
73
73
  }
74
74
  }
75
75
  exports.FcrWaitingRoomControlImpl = FcrWaitingRoomControlImpl;