fcr-core 3.7.8 → 3.8.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.
- package/lib/chat-connection/index.d.ts +1 -1
- package/lib/engine/index.js +6 -5
- package/lib/imports.d.ts +7 -2
- package/lib/imports.js +25 -4
- package/lib/index.d.ts +2 -2
- package/lib/index.js +12 -0
- package/lib/media-control/desktop.js +4 -4
- package/lib/media-control/mobile.js +20 -20
- package/lib/media-control/type.d.ts +8 -0
- package/lib/plugins/chatroom.js +19 -3
- package/lib/room-control/ability-control/type.d.ts +4 -1
- package/lib/room-control/ability-control/type.js +3 -0
- package/lib/room-control/helpers/constants.d.ts +4 -0
- package/lib/room-control/helpers/constants.js +5 -1
- package/lib/room-control/index.js +16 -5
- package/lib/room-control/interpreter-control/index.js +2 -4
- package/lib/room-control/mainroom-control/index.js +66 -1
- package/lib/room-control/privilege-control/index.js +43 -3
- package/lib/room-control/privilege-control/type.d.ts +57 -10
- package/lib/room-control/privilege-control/type.js +17 -0
- package/lib/room-control/room-control-factory.js +1 -1
- package/lib/room-control/room-session/index.js +23 -13
- package/lib/room-control/room-session/type.d.ts +2 -2
- package/lib/room-control/sharing-control/index.d.ts +5 -5
- package/lib/room-control/sharing-control/index.js +43 -13
- package/lib/room-control/sharing-control/type.d.ts +9 -5
- package/lib/room-control/sharing-control/type.js +6 -1
- package/lib/room-control/stream-control/index.d.ts +8 -1
- package/lib/room-control/stream-control/index.js +139 -36
- package/lib/room-control/stream-control/type.d.ts +6 -0
- package/lib/room-control/stt-control/de-compress-gzip.d.ts +1 -0
- package/lib/room-control/stt-control/de-compress-gzip.js +49 -0
- package/lib/room-control/stt-control/index.d.ts +1 -0
- package/lib/room-control/stt-control/index.js +353 -0
- package/lib/room-control/stt-control/type.d.ts +142 -0
- package/lib/room-control/stt-control/type.js +16 -0
- package/lib/room-control/type.d.ts +15 -0
- package/lib/room-control/type.js +13 -1
- package/lib/room-control/whiteboard-control/enum.d.ts +15 -0
- package/lib/room-control/whiteboard-control/{types.js → enum.js} +12 -1
- package/lib/room-control/whiteboard-control/type.d.ts +38 -0
- package/lib/room-control/whiteboard-control/type.js +15 -0
- package/lib/room-control/whiteboard-control/utils.d.ts +3 -0
- package/lib/room-control/whiteboard-control/utils.js +23 -0
- package/lib/room-control/whiteboard-control-v1/board-subwindow.d.ts +6 -0
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +26 -0
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +58 -0
- package/lib/room-control/whiteboard-control-v1/board-window.js +571 -0
- package/lib/room-control/{whiteboard-control/enums.d.ts → whiteboard-control-v1/enum.d.ts} +3 -17
- package/lib/room-control/{whiteboard-control/enums.js → whiteboard-control-v1/enum.js} +3 -20
- package/lib/room-control/whiteboard-control-v1/factory.d.ts +9 -0
- package/lib/room-control/whiteboard-control-v1/factory.js +22 -0
- package/lib/room-control/whiteboard-control-v1/index.d.ts +1 -0
- package/lib/room-control/whiteboard-control-v1/index.js +440 -0
- package/lib/room-control/whiteboard-control-v1/mount-manager.d.ts +4 -0
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +15 -0
- package/lib/room-control/whiteboard-control-v1/type.d.ts +300 -0
- package/lib/room-control/whiteboard-control-v1/type.js +13 -0
- package/lib/room-control/whiteboard-control-v1/utils.d.ts +53 -0
- package/lib/room-control/whiteboard-control-v1/utils.js +290 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +17 -31
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -233
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +10 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +48 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +11 -19
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.js +1 -3
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +42 -0
- package/lib/room-control/whiteboard-control-v2/base/index.js +317 -0
- package/lib/room-control/whiteboard-control-v2/{main-window.d.ts → base/main-window.d.ts} +6 -4
- package/lib/room-control/whiteboard-control-v2/{main-window.js → base/main-window.js} +31 -18
- package/lib/room-control/whiteboard-control-v2/constant.d.ts +6 -0
- package/lib/room-control/whiteboard-control-v2/constant.js +15 -0
- package/lib/room-control/whiteboard-control-v2/enum.d.ts +26 -0
- package/lib/room-control/whiteboard-control-v2/enum.js +34 -0
- package/lib/room-control/{whiteboard-control/types.d.ts → whiteboard-control-v2/type.d.ts} +51 -165
- package/lib/room-control/whiteboard-control-v2/type.js +5 -0
- package/lib/room-control/whiteboard-control-v2/utils.d.ts +5 -4
- package/lib/room-control/whiteboard-control-v2/utils.js +22 -21
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +34 -33
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +124 -191
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +11 -0
- package/lib/room-control/whiteboard-control-v2/{annotation-control/index.js → whiteboard-control/factory.js} +35 -44
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +18 -30
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.js +1 -9
- package/lib/room-router/index.js +4 -0
- package/lib/schema.d.ts +23 -9
- package/lib/schema.js +10 -4
- package/lib/service/api.d.ts +75 -19
- package/lib/service/api.js +193 -24
- package/lib/type.d.ts +15 -2
- package/lib/type.js +13 -0
- package/lib/utilities/error-helpers.d.ts +2 -1
- package/lib/utilities/error-helpers.js +1 -0
- package/lib/utilities/error.d.ts +1 -0
- package/lib/utilities/error.js +1 -0
- package/lib/utilities/logger.d.ts +2 -2
- package/lib/utilities/shared-storage.d.ts +3 -1
- package/lib/utilities/shared-storage.js +9 -1
- package/package.json +11 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/index.d.ts +0 -19
- package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.d.ts +0 -36
- package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.js +0 -262
- package/lib/room-control/whiteboard-control-v2/index.d.ts +0 -38
- package/lib/room-control/whiteboard-control-v2/index.js +0 -286
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.d.ts +0 -17
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +0 -32
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.d.ts +0 -36
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.js +0 -252
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
|
5
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
6
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
7
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
8
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
exports.FcrSttControlImpl = void 0;
|
|
13
|
+
require("core-js/modules/es.array.push.js");
|
|
14
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
15
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
16
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
17
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
18
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
19
|
+
require("core-js/modules/esnext.map.every.js");
|
|
20
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
21
|
+
require("core-js/modules/esnext.map.find.js");
|
|
22
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
23
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
24
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
25
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
26
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
27
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
28
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
29
|
+
require("core-js/modules/esnext.map.some.js");
|
|
30
|
+
require("core-js/modules/esnext.map.update.js");
|
|
31
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
32
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
33
|
+
var _imports = require("../../imports");
|
|
34
|
+
var _logger = require("../../utilities/logger");
|
|
35
|
+
var _schema = require("../../schema");
|
|
36
|
+
var _type = require("./type");
|
|
37
|
+
var _error = require("../../utilities/error");
|
|
38
|
+
var _type2 = require("../../type");
|
|
39
|
+
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
40
|
+
var _user = require("../../utilities/user");
|
|
41
|
+
var _type3 = require("../type");
|
|
42
|
+
var _FcrSttControlImpl;
|
|
43
|
+
let _initProto, _startCaptionDecs, _startTranscribingDecs, _updateSourceLanguageDecs, _subscribeTranscribingLanguageDecs, _ref;
|
|
44
|
+
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; }
|
|
45
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
46
|
+
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)]; } }; }
|
|
47
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
48
|
+
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); }
|
|
49
|
+
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
50
|
+
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
_ref = (_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");
|
|
55
|
+
class FcrSttControlImpl {
|
|
56
|
+
constructor(_scene, _api, _sharedCache) {
|
|
57
|
+
//@internal
|
|
58
|
+
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
59
|
+
prefix: 'FcrUserControlImpl'
|
|
60
|
+
})));
|
|
61
|
+
//@internal
|
|
62
|
+
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
63
|
+
(0, _defineProperty2.default)(this, "_cacheMaxLimit", 10);
|
|
64
|
+
(0, _defineProperty2.default)(this, "_sttEventWrapperListMap", new Map());
|
|
65
|
+
//@internal
|
|
66
|
+
(0, _defineProperty2.default)(this, "_sceneObserver", {
|
|
67
|
+
onStreamMessageReceived: async (sceneId, data) => {
|
|
68
|
+
const sttUids = this._scene.getScenePropertiesByKeyPath('widgets.stt.extra.pubBotUids');
|
|
69
|
+
const isSttBot = sttUids.includes(Number(data.streamId));
|
|
70
|
+
if (!isSttBot) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const sttreamMessagetData = await (0, _imports.deCompressGzipToJson)(data.payload);
|
|
74
|
+
const sttEvent = this._parseSTT(sttreamMessagetData);
|
|
75
|
+
if (sttEvent) {
|
|
76
|
+
this._observable.notifyObservers('onSttEventReceived', sceneId, sttEvent);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
onUserPropertiesUpdated: (sceneId, event) => {
|
|
80
|
+
if (event.cause && event.cause.data) {
|
|
81
|
+
const causeData = event.cause.data;
|
|
82
|
+
if (causeData.widgetUuid == _type3.FcrWidgetUuid.STT && causeData.widgetCause && causeData.widgetCause.cmd == 3450) {
|
|
83
|
+
const localUserId = this._scene.localUser.getLocalUserId();
|
|
84
|
+
if (event.operatorUser.userId !== localUserId) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
|
|
88
|
+
if (causeData.widgetCause.reason === 0) {
|
|
89
|
+
const isTranscribingStopped = this._getTranscribingState() === _type.FcrTranscribingState.STOPPED;
|
|
90
|
+
if (isTranscribingStopped) {
|
|
91
|
+
this._sttEventWrapperListMap.clear();
|
|
92
|
+
}
|
|
93
|
+
this._observable.notifyObservers('onLocalCaptionStateUpdated', sceneId, _type.FcrCaptionState.STOPPED, operatorUser);
|
|
94
|
+
}
|
|
95
|
+
if (causeData.widgetCause.reason === 1) {
|
|
96
|
+
this._observable.notifyObservers('onLocalCaptionStateUpdated', sceneId, _type.FcrCaptionState.STARTED, operatorUser);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
onScenePropertiesUpdated: (sceneId, event) => {
|
|
102
|
+
if (event.cause && event.cause.data) {
|
|
103
|
+
const causeData = event.cause.data;
|
|
104
|
+
if (!causeData.widgetCause) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (causeData.widgetUuid == _type3.FcrWidgetUuid.TRANSCRIBE && causeData.widgetCause.cmd == _type3.FcrWidgetCauseCmd.TRANSCRIBE) {
|
|
108
|
+
const operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
|
|
109
|
+
if (causeData.widgetCause.reason === 0) {
|
|
110
|
+
const isCaptionStopped = this._getLocalCaptionState() === _type.FcrCaptionState.STOPPED;
|
|
111
|
+
if (isCaptionStopped) {
|
|
112
|
+
this._sttEventWrapperListMap.clear();
|
|
113
|
+
}
|
|
114
|
+
this._observable.notifyObservers('onTranscribingStateUpdated', sceneId, _type.FcrTranscribingState.STOPPED, operatorUser);
|
|
115
|
+
}
|
|
116
|
+
if (causeData.widgetCause.reason === 1) {
|
|
117
|
+
this._observable.notifyObservers('onTranscribingStateUpdated', sceneId, _type.FcrTranscribingState.STARTED, operatorUser);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (causeData.widgetUuid == _type3.FcrWidgetUuid.STT && causeData.widgetCause.cmd == _type3.FcrWidgetCauseCmd.STT) {
|
|
121
|
+
let operatorUser;
|
|
122
|
+
if (event.operatorUser) {
|
|
123
|
+
operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
|
|
124
|
+
}
|
|
125
|
+
if (causeData.widgetCause.reason === 2) {
|
|
126
|
+
this._observable.notifyObservers('onSourceLanguageUpdated', sceneId, operatorUser);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
this._scene = _scene;
|
|
133
|
+
this._api = _api;
|
|
134
|
+
this._sharedCache = _sharedCache;
|
|
135
|
+
this._roomCache = _sharedCache.getRoomCache(this._scene.sceneId);
|
|
136
|
+
this._scene.addObserver(this._sceneObserver);
|
|
137
|
+
this._addLogObserver();
|
|
138
|
+
}
|
|
139
|
+
startCaption(config) {
|
|
140
|
+
return (0, _error.handleRequestError)(() => this._api.startCaption({
|
|
141
|
+
roomUuid: this._scene.sceneId,
|
|
142
|
+
userUuid: this._scene.localUser.getLocalUserId(),
|
|
143
|
+
config
|
|
144
|
+
}), _error.FcrErrorModuleCode.ROOM_STT, 'start caption failed');
|
|
145
|
+
}
|
|
146
|
+
stopCaption() {
|
|
147
|
+
return (0, _error.handleRequestError)(() => this._api.stopCaption({
|
|
148
|
+
roomUuid: this._scene.sceneId,
|
|
149
|
+
userUuid: this._scene.localUser.getLocalUserId()
|
|
150
|
+
}), _error.FcrErrorModuleCode.ROOM_STT, 'stop caption failed');
|
|
151
|
+
}
|
|
152
|
+
startTranscribing(config) {
|
|
153
|
+
return (0, _error.handleRequestError)(() => this._api.startTranscribing({
|
|
154
|
+
roomUuid: this._scene.sceneId,
|
|
155
|
+
userUuid: this._scene.localUser.getLocalUserId(),
|
|
156
|
+
config
|
|
157
|
+
}), _error.FcrErrorModuleCode.ROOM_STT, 'start transcribing failed');
|
|
158
|
+
}
|
|
159
|
+
stopTranscribing() {
|
|
160
|
+
return (0, _error.handleRequestError)(() => this._api.stopTranscribing({
|
|
161
|
+
roomUuid: this._scene.sceneId,
|
|
162
|
+
userUuid: this._scene.localUser.getLocalUserId()
|
|
163
|
+
}), _error.FcrErrorModuleCode.ROOM_STT, 'stop transcribing failed');
|
|
164
|
+
}
|
|
165
|
+
updateSourceLanguage(language) {
|
|
166
|
+
return (0, _error.handleRequestError)(() => this._api.updateSourceLanguage({
|
|
167
|
+
roomUuid: this._scene.sceneId,
|
|
168
|
+
userUuid: this._scene.localUser.getLocalUserId(),
|
|
169
|
+
language
|
|
170
|
+
}), _error.FcrErrorModuleCode.ROOM_STT, 'update source language failed');
|
|
171
|
+
}
|
|
172
|
+
subscribeTranscribingLanguage(language) {
|
|
173
|
+
return (0, _error.handleRequestError)(() => this._api.subscribeTranscribingLanguage({
|
|
174
|
+
roomUuid: this._scene.sceneId,
|
|
175
|
+
userUuid: this._scene.localUser.getLocalUserId(),
|
|
176
|
+
language
|
|
177
|
+
}), _error.FcrErrorModuleCode.ROOM_STT, 'subscribe transcribing language failed');
|
|
178
|
+
}
|
|
179
|
+
unsubscribeTranscribingLanguage() {
|
|
180
|
+
return (0, _error.handleRequestError)(() => this._api.unsubscribeTranscribingLanguage({
|
|
181
|
+
roomUuid: this._scene.sceneId,
|
|
182
|
+
userUuid: this._scene.localUser.getLocalUserId()
|
|
183
|
+
}), _error.FcrErrorModuleCode.ROOM_STT, 'unsubscribe transcribing language failed');
|
|
184
|
+
}
|
|
185
|
+
getLocalCaptionState() {
|
|
186
|
+
return this._getLocalCaptionState();
|
|
187
|
+
}
|
|
188
|
+
getTranscribingState() {
|
|
189
|
+
return this._getTranscribingState();
|
|
190
|
+
}
|
|
191
|
+
getSourceLanguage() {
|
|
192
|
+
const transcribingState = this._getTranscribingState();
|
|
193
|
+
if (transcribingState === _type.FcrTranscribingState.STOPPED) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
return this._scene.getScenePropertiesByKeyPath('widgets.stt.extra.speechLanguage');
|
|
197
|
+
}
|
|
198
|
+
getConfig() {
|
|
199
|
+
const sourceLanguages = this._scene.getScenePropertiesByKeyPath('widgets.stt.extra.sourceLanguages');
|
|
200
|
+
const translateLanguages = this._scene.getScenePropertiesByKeyPath('widgets.stt.extra.translateLanguages');
|
|
201
|
+
const cacheMaxLimit = this._scene.getScenePropertiesByKeyPath('widgets.stt.extra.maxLimit');
|
|
202
|
+
if (!sourceLanguages || !translateLanguages || !cacheMaxLimit) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
sourceLanguages,
|
|
207
|
+
translateLanguages,
|
|
208
|
+
cacheMaxLimit
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
addObserver(observer) {
|
|
212
|
+
this._observable.addObserver(observer);
|
|
213
|
+
}
|
|
214
|
+
removeObserver(observer) {
|
|
215
|
+
this._observable.removeObserver(observer);
|
|
216
|
+
}
|
|
217
|
+
release() {
|
|
218
|
+
this._sttEventWrapperListMap.clear();
|
|
219
|
+
this._scene.removeObserver(this._sceneObserver);
|
|
220
|
+
}
|
|
221
|
+
_getLocalCaptionState() {
|
|
222
|
+
const captionState = this._scene.getUserPropertiesByKeyPath('widgets.stt.caption', this._scene.localUser.getLocalUserId());
|
|
223
|
+
return captionState;
|
|
224
|
+
}
|
|
225
|
+
_getTranscribingState() {
|
|
226
|
+
return this._scene.getScenePropertiesByKeyPath('widgets.transcribe.state');
|
|
227
|
+
}
|
|
228
|
+
_parseSTT(sttreamMessagetData) {
|
|
229
|
+
var _this$_scene$getStrea;
|
|
230
|
+
const codeMap = {
|
|
231
|
+
'zh-CN': _type2.FcrLanguage.ZH,
|
|
232
|
+
'en-US': _type2.FcrLanguage.EN,
|
|
233
|
+
'ja-JP': _type2.FcrLanguage.JP,
|
|
234
|
+
'de-DE': _type2.FcrLanguage.DE,
|
|
235
|
+
'fr-FR': _type2.FcrLanguage.FR,
|
|
236
|
+
'pt-PT': _type2.FcrLanguage.PT,
|
|
237
|
+
'es-ES': _type2.FcrLanguage.ES
|
|
238
|
+
};
|
|
239
|
+
const transcript = sttreamMessagetData.transcript;
|
|
240
|
+
const translation = sttreamMessagetData.translation;
|
|
241
|
+
const messageItem = transcript || translation;
|
|
242
|
+
const uid = messageItem === null || messageItem === void 0 ? void 0 : messageItem.uid;
|
|
243
|
+
if (!uid) {
|
|
244
|
+
this.logger.error('parseSTT failed, uid is null');
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
const owner = (_this$_scene$getStrea = this._scene.getStreamByStreamId(uid.toString())) === null || _this$_scene$getStrea === void 0 ? void 0 : _this$_scene$getStrea.owner;
|
|
248
|
+
if (!owner) {
|
|
249
|
+
this.logger.error('parseSTT failed, owner is null');
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
const userId = owner.userId;
|
|
253
|
+
if (!userId) {
|
|
254
|
+
this.logger.error('parseSTT failed, userId is null');
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
let sttEventWrapperList = this._sttEventWrapperListMap.get(userId);
|
|
258
|
+
let sttEventWrapper = null;
|
|
259
|
+
if (transcript) {
|
|
260
|
+
const sentenceId = transcript.uid + '-' + transcript.textTs;
|
|
261
|
+
const formatTranscript = {
|
|
262
|
+
id: sentenceId,
|
|
263
|
+
text: transcript.text,
|
|
264
|
+
language: codeMap[transcript.language],
|
|
265
|
+
owner: (0, _user.convertRteUserToFcrUser)(owner, this._roomCache),
|
|
266
|
+
timestamp: transcript.textTs,
|
|
267
|
+
isFinal: transcript.isFinal
|
|
268
|
+
};
|
|
269
|
+
if (!sttEventWrapperList || sttEventWrapperList.length === 0) {
|
|
270
|
+
sttEventWrapper = {
|
|
271
|
+
startTs: 0,
|
|
272
|
+
endTs: transcript.textTs,
|
|
273
|
+
event: {
|
|
274
|
+
transcript: formatTranscript,
|
|
275
|
+
translations: new Map()
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
sttEventWrapperList = [sttEventWrapper];
|
|
279
|
+
} else {
|
|
280
|
+
const lastSttEventWrapper = sttEventWrapperList[sttEventWrapperList.length - 1];
|
|
281
|
+
// add
|
|
282
|
+
if (lastSttEventWrapper.event.transcript.isFinal == true) {
|
|
283
|
+
sttEventWrapper = {
|
|
284
|
+
startTs: lastSttEventWrapper.endTs,
|
|
285
|
+
endTs: transcript.textTs,
|
|
286
|
+
event: {
|
|
287
|
+
transcript: formatTranscript,
|
|
288
|
+
translations: new Map()
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
sttEventWrapperList.push(sttEventWrapper);
|
|
292
|
+
// 超过 10 条,移除 oldest
|
|
293
|
+
if (sttEventWrapperList.length > this._cacheMaxLimit) {
|
|
294
|
+
// remove oldest
|
|
295
|
+
sttEventWrapperList.shift();
|
|
296
|
+
}
|
|
297
|
+
} else {
|
|
298
|
+
if (transcript.textTs >= lastSttEventWrapper.endTs) {
|
|
299
|
+
// update
|
|
300
|
+
sttEventWrapperList[sttEventWrapperList.length - 1] = {
|
|
301
|
+
startTs: lastSttEventWrapper.endTs,
|
|
302
|
+
endTs: transcript.textTs,
|
|
303
|
+
event: (0, _imports.merge)(lastSttEventWrapper.event, {
|
|
304
|
+
transcript: _objectSpread(_objectSpread({}, formatTranscript), {}, {
|
|
305
|
+
id: lastSttEventWrapper.event.transcript.id
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (translation) {
|
|
314
|
+
var _sttEventWrapperList;
|
|
315
|
+
// 获取缓存句子
|
|
316
|
+
sttEventWrapperList = (_sttEventWrapperList = sttEventWrapperList) === null || _sttEventWrapperList === void 0 ? void 0 : _sttEventWrapperList.map(wrapper => {
|
|
317
|
+
const formatTranslation = {
|
|
318
|
+
id: wrapper.event.transcript.id,
|
|
319
|
+
language: codeMap[translation.results0.language],
|
|
320
|
+
text: translation.results0.texts.join(''),
|
|
321
|
+
timestamp: translation.textTs,
|
|
322
|
+
isFinal: translation.isFinal,
|
|
323
|
+
owner: (0, _user.convertRteUserToFcrUser)(owner, this._roomCache)
|
|
324
|
+
};
|
|
325
|
+
if (translation.textTs > wrapper.startTs && translation.textTs <= wrapper.endTs) {
|
|
326
|
+
const transInfo = wrapper.event.translations.get(translation.results0.language);
|
|
327
|
+
if (!transInfo) {
|
|
328
|
+
wrapper.event.translations.set(formatTranslation.language, formatTranslation);
|
|
329
|
+
} else if (translation.textTs >= transInfo.timestamp) {
|
|
330
|
+
wrapper.event.translations.set(formatTranslation.language, _objectSpread(_objectSpread({}, formatTranslation), {}, {
|
|
331
|
+
id: wrapper.event.transcript.id
|
|
332
|
+
}));
|
|
333
|
+
} else if (transInfo.isFinal == true && wrapper.event.transcript.isFinal == true) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return wrapper;
|
|
338
|
+
}).filter(wrapper => wrapper !== null);
|
|
339
|
+
}
|
|
340
|
+
if (sttEventWrapperList) {
|
|
341
|
+
this._sttEventWrapperListMap.set(userId, sttEventWrapperList);
|
|
342
|
+
const lastSttEventWrapper = sttEventWrapperList[sttEventWrapperList.length - 1];
|
|
343
|
+
return lastSttEventWrapper.event;
|
|
344
|
+
}
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
_addLogObserver() {
|
|
348
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onSttEventReceived', 'onLocalCaptionStateUpdated', 'onTranscribingStateUpdated', 'onSourceLanguageUpdated']));
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
exports.FcrSttControlImpl = FcrSttControlImpl;
|
|
352
|
+
_FcrSttControlImpl = FcrSttControlImpl;
|
|
353
|
+
[_initProto] = _applyDecs(_FcrSttControlImpl, [[_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;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { FcrLanguage, FcrUserInfo } from '../../type';
|
|
2
|
+
export interface FcrSttControl {
|
|
3
|
+
/**
|
|
4
|
+
* Adds the observer.
|
|
5
|
+
* @param observer
|
|
6
|
+
*/
|
|
7
|
+
addObserver(observer: FcrSttObserver): void;
|
|
8
|
+
/**
|
|
9
|
+
* Removes the observer.
|
|
10
|
+
* @param observer
|
|
11
|
+
*/
|
|
12
|
+
removeObserver(observer: FcrSttObserver): void;
|
|
13
|
+
/**
|
|
14
|
+
* Starts the caption.
|
|
15
|
+
*/
|
|
16
|
+
startCaption(config: FcrLanguageConfig): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Stops the caption.
|
|
19
|
+
*/
|
|
20
|
+
stopCaption(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Starts the transcribing.
|
|
23
|
+
*/
|
|
24
|
+
startTranscribing(config: FcrLanguageConfig): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Stops the transcribing.
|
|
27
|
+
*/
|
|
28
|
+
stopTranscribing(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Updates the source language.
|
|
31
|
+
*/
|
|
32
|
+
updateSourceLanguage(language: FcrLanguage): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Subscribes the transcribing language.
|
|
35
|
+
*/
|
|
36
|
+
subscribeTranscribingLanguage(language: FcrLanguage): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Unsubscribes the transcribing language.
|
|
39
|
+
*/
|
|
40
|
+
unsubscribeTranscribingLanguage(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the source language.
|
|
43
|
+
*/
|
|
44
|
+
getSourceLanguage(): FcrLanguage | null;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the transcribing language.
|
|
47
|
+
*/
|
|
48
|
+
getLocalCaptionState(): FcrCaptionState;
|
|
49
|
+
/**
|
|
50
|
+
* Gets the transcribing language.
|
|
51
|
+
*/
|
|
52
|
+
getTranscribingState(): FcrTranscribingState;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the transcribing language.
|
|
55
|
+
*/
|
|
56
|
+
getConfig(): FcrSttConfig | null;
|
|
57
|
+
}
|
|
58
|
+
export interface FcrSttObserver {
|
|
59
|
+
/**
|
|
60
|
+
* Callback to receive the stt event.
|
|
61
|
+
* @param roomId
|
|
62
|
+
* @param event
|
|
63
|
+
*/
|
|
64
|
+
onSttEventReceived?: (roomId: string, event: FcrSttEvent) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Callback to receive the stt state changed.
|
|
67
|
+
* @param roomId
|
|
68
|
+
* @param state
|
|
69
|
+
*/
|
|
70
|
+
onLocalCaptionStateUpdated?: (roomId: string, state: FcrCaptionState, operatorUser?: FcrUserInfo) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Callback to receive the transcribing state changed.
|
|
73
|
+
* @param roomId
|
|
74
|
+
* @param state
|
|
75
|
+
*/
|
|
76
|
+
onTranscribingStateUpdated?: (roomId: string, state: FcrTranscribingState, operatorUser?: FcrUserInfo) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Callback to receive the source language changed.
|
|
79
|
+
* @param roomId
|
|
80
|
+
* @param operatorUser
|
|
81
|
+
*/
|
|
82
|
+
onSourceLanguageUpdated?: (roomId: string, operatorUser?: FcrUserInfo | null) => void;
|
|
83
|
+
}
|
|
84
|
+
export interface FcrLanguageConfig {
|
|
85
|
+
sourceLanguage: FcrLanguage;
|
|
86
|
+
targetLanguage?: FcrLanguage;
|
|
87
|
+
}
|
|
88
|
+
export declare enum FcrCaptionState {
|
|
89
|
+
STOPPED = 0,
|
|
90
|
+
STARTED = 1
|
|
91
|
+
}
|
|
92
|
+
export declare enum FcrTranscribingState {
|
|
93
|
+
STOPPED = 0,
|
|
94
|
+
STARTED = 1
|
|
95
|
+
}
|
|
96
|
+
export interface FcrCaptionConfig {
|
|
97
|
+
selectedSourceLanguage: FcrLanguage;
|
|
98
|
+
sourceLanguages: Array<FcrLanguage>;
|
|
99
|
+
translateLanguages?: Array<FcrLanguage>;
|
|
100
|
+
}
|
|
101
|
+
export interface FcrSttConfig {
|
|
102
|
+
sourceLanguages: Array<FcrLanguage>;
|
|
103
|
+
translateLanguages: Array<FcrLanguage>;
|
|
104
|
+
cacheMaxLimit: number;
|
|
105
|
+
}
|
|
106
|
+
export interface FcrSttEvent {
|
|
107
|
+
transcript: FcrSttInfo;
|
|
108
|
+
translations: Map<FcrLanguage, FcrSttInfo>;
|
|
109
|
+
}
|
|
110
|
+
export interface FcrSttEventWrapper {
|
|
111
|
+
startTs: number;
|
|
112
|
+
endTs: number;
|
|
113
|
+
event: FcrSttEvent;
|
|
114
|
+
}
|
|
115
|
+
export interface FcrSttInfo {
|
|
116
|
+
id: string;
|
|
117
|
+
text: string;
|
|
118
|
+
language: FcrLanguage;
|
|
119
|
+
owner: FcrUserInfo;
|
|
120
|
+
timestamp: number;
|
|
121
|
+
isFinal: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface FcrSttTranslation extends FcrSttMessageItem {
|
|
124
|
+
results0: {
|
|
125
|
+
texts: string[];
|
|
126
|
+
language: FcrLanguage;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export interface FcrSttMessageItem {
|
|
130
|
+
textTs: number;
|
|
131
|
+
isFinal: boolean;
|
|
132
|
+
uid: number;
|
|
133
|
+
offset: number;
|
|
134
|
+
}
|
|
135
|
+
export interface FcrSttTranscript extends FcrSttMessageItem {
|
|
136
|
+
text: string;
|
|
137
|
+
language: FcrLanguage;
|
|
138
|
+
}
|
|
139
|
+
export interface FcrSttreamMessagetData {
|
|
140
|
+
transcript?: FcrSttTranscript;
|
|
141
|
+
translation?: FcrSttTranslation;
|
|
142
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FcrTranscribingState = exports.FcrCaptionState = void 0;
|
|
7
|
+
let FcrCaptionState = exports.FcrCaptionState = /*#__PURE__*/function (FcrCaptionState) {
|
|
8
|
+
FcrCaptionState[FcrCaptionState["STOPPED"] = 0] = "STOPPED";
|
|
9
|
+
FcrCaptionState[FcrCaptionState["STARTED"] = 1] = "STARTED";
|
|
10
|
+
return FcrCaptionState;
|
|
11
|
+
}({});
|
|
12
|
+
let FcrTranscribingState = exports.FcrTranscribingState = /*#__PURE__*/function (FcrTranscribingState) {
|
|
13
|
+
FcrTranscribingState[FcrTranscribingState["STOPPED"] = 0] = "STOPPED";
|
|
14
|
+
FcrTranscribingState[FcrTranscribingState["STARTED"] = 1] = "STARTED";
|
|
15
|
+
return FcrTranscribingState;
|
|
16
|
+
}({});
|
|
@@ -10,7 +10,12 @@ import { FcrStreamControl } from './stream-control/type';
|
|
|
10
10
|
import { FcrUserControl, FcrUserRole } from './user-control/type';
|
|
11
11
|
import { FcrAbilityControl } from './ability-control/type';
|
|
12
12
|
import { FcrSharingControl } from './sharing-control/type';
|
|
13
|
+
import { FcrSttControl } from './stt-control/type';
|
|
13
14
|
export interface FcrBaseRoomControl {
|
|
15
|
+
/**
|
|
16
|
+
* Gets the caption control.
|
|
17
|
+
*/
|
|
18
|
+
getSttControl(): FcrSttControl;
|
|
14
19
|
/**
|
|
15
20
|
* Gets the user control.
|
|
16
21
|
*/
|
|
@@ -284,3 +289,13 @@ export declare enum FcrLineType {
|
|
|
284
289
|
SINGLE_ROW = 1,
|
|
285
290
|
MULTI_ROW = 2
|
|
286
291
|
}
|
|
292
|
+
export declare enum FcrWidgetUuid {
|
|
293
|
+
STT = "stt",
|
|
294
|
+
TRANSCRIBE = "transcribe",
|
|
295
|
+
ANNOTATION = "annotation"
|
|
296
|
+
}
|
|
297
|
+
export declare enum FcrWidgetCauseCmd {
|
|
298
|
+
STT = 3450,
|
|
299
|
+
TRANSCRIBE = 3430,
|
|
300
|
+
ANNOTATION = 1
|
|
301
|
+
}
|
package/lib/room-control/type.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.FcrRoomType = exports.FcrLiveStreamingStateUpdatedReason = exports.FcrLineType = void 0;
|
|
6
|
+
exports.FcrWidgetUuid = exports.FcrWidgetCauseCmd = exports.FcrRoomType = exports.FcrLiveStreamingStateUpdatedReason = exports.FcrLineType = void 0;
|
|
7
7
|
let FcrRoomType = exports.FcrRoomType = /*#__PURE__*/function (FcrRoomType) {
|
|
8
8
|
FcrRoomType[FcrRoomType["Mainroom"] = 11] = "Mainroom";
|
|
9
9
|
FcrRoomType[FcrRoomType["Waitingroom"] = 102] = "Waitingroom";
|
|
@@ -21,4 +21,16 @@ let FcrLineType = exports.FcrLineType = /*#__PURE__*/function (FcrLineType) {
|
|
|
21
21
|
FcrLineType[FcrLineType["SINGLE_ROW"] = 1] = "SINGLE_ROW";
|
|
22
22
|
FcrLineType[FcrLineType["MULTI_ROW"] = 2] = "MULTI_ROW";
|
|
23
23
|
return FcrLineType;
|
|
24
|
+
}({});
|
|
25
|
+
let FcrWidgetUuid = exports.FcrWidgetUuid = /*#__PURE__*/function (FcrWidgetUuid) {
|
|
26
|
+
FcrWidgetUuid["STT"] = "stt";
|
|
27
|
+
FcrWidgetUuid["TRANSCRIBE"] = "transcribe";
|
|
28
|
+
FcrWidgetUuid["ANNOTATION"] = "annotation";
|
|
29
|
+
return FcrWidgetUuid;
|
|
30
|
+
}({});
|
|
31
|
+
let FcrWidgetCauseCmd = exports.FcrWidgetCauseCmd = /*#__PURE__*/function (FcrWidgetCauseCmd) {
|
|
32
|
+
FcrWidgetCauseCmd[FcrWidgetCauseCmd["STT"] = 3450] = "STT";
|
|
33
|
+
FcrWidgetCauseCmd[FcrWidgetCauseCmd["TRANSCRIBE"] = 3430] = "TRANSCRIBE";
|
|
34
|
+
FcrWidgetCauseCmd[FcrWidgetCauseCmd["ANNOTATION"] = 1] = "ANNOTATION";
|
|
35
|
+
return FcrWidgetCauseCmd;
|
|
24
36
|
}({});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* common enums shared by whiteboard v1 and v2
|
|
3
|
+
*/
|
|
4
|
+
export declare enum FcrBoardInactiveReason {
|
|
5
|
+
CLOSE = 1,
|
|
6
|
+
TIMEOUT = 2,
|
|
7
|
+
SEIZE = 3
|
|
8
|
+
}
|
|
9
|
+
export declare enum FcrBoardRegion {
|
|
10
|
+
CN = "cn-hz",
|
|
11
|
+
US = "us-sv",
|
|
12
|
+
IN = "in-mum",
|
|
13
|
+
SG = "sg",
|
|
14
|
+
GB = "gb-lon"
|
|
15
|
+
}
|
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.FcrBoardInactiveReason = void 0;
|
|
6
|
+
exports.FcrBoardRegion = exports.FcrBoardInactiveReason = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* common enums shared by whiteboard v1 and v2
|
|
9
|
+
*/
|
|
7
10
|
let FcrBoardInactiveReason = exports.FcrBoardInactiveReason = /*#__PURE__*/function (FcrBoardInactiveReason) {
|
|
8
11
|
FcrBoardInactiveReason[FcrBoardInactiveReason["CLOSE"] = 1] = "CLOSE";
|
|
9
12
|
FcrBoardInactiveReason[FcrBoardInactiveReason["TIMEOUT"] = 2] = "TIMEOUT";
|
|
10
13
|
FcrBoardInactiveReason[FcrBoardInactiveReason["SEIZE"] = 3] = "SEIZE";
|
|
11
14
|
return FcrBoardInactiveReason;
|
|
15
|
+
}({});
|
|
16
|
+
let FcrBoardRegion = exports.FcrBoardRegion = /*#__PURE__*/function (FcrBoardRegion) {
|
|
17
|
+
FcrBoardRegion["CN"] = "cn-hz";
|
|
18
|
+
FcrBoardRegion["US"] = "us-sv";
|
|
19
|
+
FcrBoardRegion["IN"] = "in-mum";
|
|
20
|
+
FcrBoardRegion["SG"] = "sg";
|
|
21
|
+
FcrBoardRegion["GB"] = "gb-lon";
|
|
22
|
+
return FcrBoardRegion;
|
|
12
23
|
}({});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ColorSchema } from '../../schema';
|
|
2
|
+
import { FcrBoardInactiveReason, FcrBoardRegion } from './enum';
|
|
3
|
+
/**
|
|
4
|
+
* common types shared by whiteboard v1 and v2
|
|
5
|
+
*/
|
|
6
|
+
export type FcrBoardPageInfo = {
|
|
7
|
+
showIndex: number;
|
|
8
|
+
count: number;
|
|
9
|
+
};
|
|
10
|
+
export type FcrColor = ColorSchema;
|
|
11
|
+
export type FcrBoardActiveInfo = {
|
|
12
|
+
isActive: true;
|
|
13
|
+
ownerUserId: string;
|
|
14
|
+
reason?: FcrBoardInactiveReason;
|
|
15
|
+
} | {
|
|
16
|
+
isActive: false;
|
|
17
|
+
ownerUserId: null;
|
|
18
|
+
reason?: FcrBoardInactiveReason;
|
|
19
|
+
};
|
|
20
|
+
export type FcrBoardExtra = {
|
|
21
|
+
boardAppId: string;
|
|
22
|
+
boardId: string;
|
|
23
|
+
boardRegion: FcrBoardRegion;
|
|
24
|
+
boardToken: string;
|
|
25
|
+
};
|
|
26
|
+
export type FcrBoardInfo = {
|
|
27
|
+
state: FcrBoardPropertiesState;
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
ownerUserUuid: string;
|
|
30
|
+
extra: FcrBoardExtra & {
|
|
31
|
+
backgroundColor: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare enum FcrBoardPropertiesState {
|
|
35
|
+
ACTIVE = 1,
|
|
36
|
+
INACTIVE = 0,
|
|
37
|
+
BACKGROUND_COLOR_UPDATED = 100101
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FcrBoardPropertiesState = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* common types shared by whiteboard v1 and v2
|
|
9
|
+
*/
|
|
10
|
+
let FcrBoardPropertiesState = exports.FcrBoardPropertiesState = /*#__PURE__*/function (FcrBoardPropertiesState) {
|
|
11
|
+
FcrBoardPropertiesState[FcrBoardPropertiesState["ACTIVE"] = 1] = "ACTIVE";
|
|
12
|
+
FcrBoardPropertiesState[FcrBoardPropertiesState["INACTIVE"] = 0] = "INACTIVE";
|
|
13
|
+
FcrBoardPropertiesState[FcrBoardPropertiesState["BACKGROUND_COLOR_UPDATED"] = 100101] = "BACKGROUND_COLOR_UPDATED";
|
|
14
|
+
return FcrBoardPropertiesState;
|
|
15
|
+
}({});
|