fcr-core 3.9.0-alpha → 3.9.1-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/engine/index.js +17 -8
- package/lib/imports.d.ts +2 -0
- package/lib/imports.js +14 -0
- package/lib/monitor-control/index.js +11 -1
- package/lib/monitor-control/type.d.ts +10 -0
- package/lib/plugins/chat/connector.js +11 -4
- package/lib/room-control/ability-control/type.d.ts +4 -1
- package/lib/room-control/ability-control/type.js +4 -1
- package/lib/room-control/mainroom-control/index.js +15 -13
- package/lib/room-control/privilege-control/type.d.ts +1 -0
- package/lib/room-control/privilege-control/type.js +1 -0
- package/lib/room-control/room-connector-control/index.js +7 -2
- package/lib/room-control/room-connector-control/type.d.ts +12 -0
- package/lib/room-control/room-connector-control/type.js +14 -1
- package/lib/room-control/room-control-factory.d.ts +2 -1
- package/lib/room-control/room-control-factory.js +3 -2
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +4 -5
- package/lib/room-router/index.js +4 -2
- package/lib/schema.d.ts +5 -1
- package/lib/schema.js +4 -2
- package/lib/service/api.d.ts +2 -1
- package/lib/service/api.js +3 -2
- package/lib/utilities/logger.d.ts +21 -6
- package/lib/utilities/logger.js +49 -7
- package/lib/utilities/parameters.d.ts +4 -0
- package/lib/utilities/parameters.js +30 -2
- package/lib-es/engine/index.js +19 -10
- package/lib-es/imports.js +3 -1
- package/lib-es/monitor-control/index.js +11 -1
- package/lib-es/plugins/chat/connector.js +11 -4
- package/lib-es/room-control/ability-control/type.js +4 -1
- package/lib-es/room-control/mainroom-control/index.js +15 -13
- package/lib-es/room-control/privilege-control/type.js +1 -0
- package/lib-es/room-control/room-connector-control/index.js +8 -3
- package/lib-es/room-control/room-connector-control/type.js +13 -0
- package/lib-es/room-control/room-control-factory.js +3 -2
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +4 -5
- package/lib-es/room-router/index.js +4 -2
- package/lib-es/schema.js +4 -2
- package/lib-es/service/api.js +3 -2
- package/lib-es/utilities/logger.js +47 -6
- package/lib-es/utilities/parameters.js +26 -2
- package/package.json +4 -4
package/lib/engine/index.js
CHANGED
|
@@ -68,9 +68,7 @@ class FcrCoreEngineImpl {
|
|
|
68
68
|
[_initProto] = _applyDecs(this, [[_decorator.trace, 2, "release"], [_decorator.trace, 2, "login"], [_decorator.trace, 2, "logout"], [_renewUserTokenDecs, 2, "renewUserToken"], [_decorator.trace, 2, "getVersion"], [_createMainRoomControlDecs, 2, "createMainRoomControl"], [_createWaitingRoomControlDecs, 2, "createWaitingRoomControl"], [_createRoomRouterDecs, 2, "createRoomRouter"], [_createRoomControlAndJoinDecs, 2, "createRoomControlAndJoin"], [_decorator.trace, 2, "getDesktopMediaControl"], [_decorator.trace, 2, "getMobileMediaControl"], [_decorator.trace, 2, "getMonitorControl"], [_decorator.trace, 2, "getPeerSessionControl"], [_sendPeerMessageDecs, 2, "sendPeerMessage"], [_setParametersDecs, 2, "setParameters"]], []).e;
|
|
69
69
|
}
|
|
70
70
|
// @internal
|
|
71
|
-
[(_renewUserTokenDecs = (0, _decorator.trace)(['token'], true), _createMainRoomControlDecs = [(0, _decorator.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _createWaitingRoomControlDecs = [(0, _decorator.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _createRoomRouterDecs = [(0, _decorator.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _createRoomControlAndJoinDecs = [(0, _decorator.trace)(['roomId', 'options']), (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRoomJoinOptionsSchema)], _sendPeerMessageDecs = [(0, _decorator.trace)(['payload', 'guaranteedDelivery', 'receiverId'], true), (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema, _schema.booleanSchema, _schema.stringSchema)], _setParametersDecs = [(0, _decorator.trace)(['parameters'], true), (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema)], "logger")] =
|
|
72
|
-
prefix: 'FcrCoreEngine'
|
|
73
|
-
}));
|
|
71
|
+
[(_renewUserTokenDecs = (0, _decorator.trace)(['token'], true), _createMainRoomControlDecs = [(0, _decorator.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _createWaitingRoomControlDecs = [(0, _decorator.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _createRoomRouterDecs = [(0, _decorator.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _createRoomControlAndJoinDecs = [(0, _decorator.trace)(['roomId', 'options']), (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRoomJoinOptionsSchema)], _sendPeerMessageDecs = [(0, _decorator.trace)(['payload', 'guaranteedDelivery', 'receiverId'], true), (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema, _schema.booleanSchema, _schema.stringSchema)], _setParametersDecs = [(0, _decorator.trace)(['parameters'], true), (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema)], "logger")] = void _initProto(this);
|
|
74
72
|
// @internal
|
|
75
73
|
|
|
76
74
|
// @internal
|
|
@@ -100,6 +98,13 @@ class FcrCoreEngineImpl {
|
|
|
100
98
|
constructor(config) {
|
|
101
99
|
this._config = config;
|
|
102
100
|
(0, _domainHolder.resetSharedDomainHolder)();
|
|
101
|
+
const rteLogFileSize = (0, _parameters.getCoreLogFileSize)(config.parameters);
|
|
102
|
+
_logger.FcrCoreLoggerManagerHolder.initialize({
|
|
103
|
+
maxSize: rteLogFileSize
|
|
104
|
+
});
|
|
105
|
+
this.logger = _logger.FcrCoreLoggerManagerHolder.createLogger({
|
|
106
|
+
prefix: 'FcrCoreEngine'
|
|
107
|
+
});
|
|
103
108
|
this.logger.info('Fcr core engine is created, version: ', this.getVersion());
|
|
104
109
|
this._rteEngine = new _agoraRteSdk.AgoraRteEngine({
|
|
105
110
|
appId: config.appId,
|
|
@@ -154,9 +159,13 @@ class FcrCoreEngineImpl {
|
|
|
154
159
|
return await this._rteEngine.login();
|
|
155
160
|
} finally {
|
|
156
161
|
this._isLoggingIn = false;
|
|
157
|
-
this.
|
|
158
|
-
|
|
159
|
-
|
|
162
|
+
if (this._monitorControl.needLogUpload) {
|
|
163
|
+
this._rteEngine.getMonitor().uploadLog({
|
|
164
|
+
userUuid: this._config.userId
|
|
165
|
+
});
|
|
166
|
+
} else {
|
|
167
|
+
this.logger.info('log upload is disabled');
|
|
168
|
+
}
|
|
160
169
|
}
|
|
161
170
|
});
|
|
162
171
|
}
|
|
@@ -204,7 +213,7 @@ class FcrCoreEngineImpl {
|
|
|
204
213
|
const scene = this._rteEngine.createScene({
|
|
205
214
|
sceneId: roomId
|
|
206
215
|
});
|
|
207
|
-
return new _mainroomControl.FcrMainRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new _chatroom.FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache, false));
|
|
216
|
+
return new _mainroomControl.FcrMainRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new _chatroom.FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache, false), this._monitorControl);
|
|
208
217
|
}
|
|
209
218
|
|
|
210
219
|
/**
|
|
@@ -225,7 +234,7 @@ class FcrCoreEngineImpl {
|
|
|
225
234
|
* @returns The room router.
|
|
226
235
|
*/
|
|
227
236
|
createRoomRouter(roomId) {
|
|
228
|
-
const roomRouter = new _roomRouter.FcrRoomRouterImpl(this._rteEngine, this._apiService, this._config, this._chatConnection, this._sharedCache, roomId);
|
|
237
|
+
const roomRouter = new _roomRouter.FcrRoomRouterImpl(this._rteEngine, this._apiService, this._config, this._chatConnection, this._sharedCache, roomId, this._monitorControl);
|
|
229
238
|
return roomRouter;
|
|
230
239
|
}
|
|
231
240
|
|
package/lib/imports.d.ts
CHANGED
|
@@ -69,3 +69,5 @@ export { default as merge } from 'lodash/merge';
|
|
|
69
69
|
export { DetailErrorCode, ErrorModuleCode, ErrorServiceType, } from 'agora-foundation/lib/utilities/error/error-code';
|
|
70
70
|
export { FcrChatRoomControlImpl } from './plugins/chat/chatroom';
|
|
71
71
|
export type Unknown = unknown;
|
|
72
|
+
export { default as isBoolean } from 'lodash/isBoolean';
|
|
73
|
+
export { default as isNumber } from 'lodash/isNumber';
|
package/lib/imports.js
CHANGED
|
@@ -408,6 +408,18 @@ Object.defineProperty(exports, "getVersion", {
|
|
|
408
408
|
return _packageInfo.getVersion;
|
|
409
409
|
}
|
|
410
410
|
});
|
|
411
|
+
Object.defineProperty(exports, "isBoolean", {
|
|
412
|
+
enumerable: true,
|
|
413
|
+
get: function () {
|
|
414
|
+
return _isBoolean.default;
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
Object.defineProperty(exports, "isNumber", {
|
|
418
|
+
enumerable: true,
|
|
419
|
+
get: function () {
|
|
420
|
+
return _isNumber.default;
|
|
421
|
+
}
|
|
422
|
+
});
|
|
411
423
|
Object.defineProperty(exports, "jsonstring", {
|
|
412
424
|
enumerable: true,
|
|
413
425
|
get: function () {
|
|
@@ -571,6 +583,8 @@ var _uuid = require("uuid");
|
|
|
571
583
|
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
572
584
|
var _errorCode = require("agora-foundation/lib/utilities/error/error-code");
|
|
573
585
|
var _chatroom = require("./plugins/chat/chatroom");
|
|
586
|
+
var _isBoolean = _interopRequireDefault(require("lodash/isBoolean"));
|
|
587
|
+
var _isNumber = _interopRequireDefault(require("lodash/isNumber"));
|
|
574
588
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
575
589
|
// Other utility exports
|
|
576
590
|
|
|
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
22
22
|
});
|
|
23
23
|
exports.FcrMonitorControlImpl = void 0;
|
|
24
24
|
var _imports = require("../imports");
|
|
25
|
+
var _parameters = require("../utilities/parameters");
|
|
25
26
|
let _initProto, _uploadEventDecs;
|
|
26
27
|
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)]; } }; }
|
|
27
28
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -33,16 +34,25 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
33
34
|
*/
|
|
34
35
|
class FcrMonitorControlImpl {
|
|
35
36
|
static {
|
|
36
|
-
[_initProto] = _applyDecs(this, [[_uploadEventDecs, 2, "uploadEvent"]], []).e;
|
|
37
|
+
[_initProto] = _applyDecs(this, [[_uploadEventDecs, 2, "uploadEvent"], [_imports.trace, 2, "setNeedLogUpload"]], []).e;
|
|
37
38
|
}
|
|
38
39
|
[(_uploadEventDecs = (0, _imports.trace)(['event']), "_monitor")] = void _initProto(this);
|
|
40
|
+
_needLogUpload = true;
|
|
39
41
|
constructor(engine, _config) {
|
|
40
42
|
this._config = _config;
|
|
41
43
|
this._monitor = engine.getMonitor();
|
|
44
|
+
const needLogUpload = (0, _parameters.getNeedLogUpload)(this._config.parameters);
|
|
45
|
+
this._needLogUpload = needLogUpload;
|
|
46
|
+
}
|
|
47
|
+
get needLogUpload() {
|
|
48
|
+
return this._needLogUpload;
|
|
42
49
|
}
|
|
43
50
|
async uploadEvent(event) {
|
|
44
51
|
return this._monitor.uploadEvent(event);
|
|
45
52
|
}
|
|
53
|
+
setNeedLogUpload(isNeed) {
|
|
54
|
+
this._needLogUpload = isNeed;
|
|
55
|
+
}
|
|
46
56
|
addObserver(observer) {
|
|
47
57
|
this._monitor.addObserver(observer);
|
|
48
58
|
}
|
|
@@ -3,6 +3,11 @@ export interface FcrMonitorObserver {
|
|
|
3
3
|
onPerformanceInfoUpdated?: (status: FcrPerformanceInfo) => void;
|
|
4
4
|
}
|
|
5
5
|
export interface FcrMonitorControl {
|
|
6
|
+
/**
|
|
7
|
+
* Get whether to upload the log.
|
|
8
|
+
* @returns Whether to upload the log.
|
|
9
|
+
*/
|
|
10
|
+
get needLogUpload(): boolean;
|
|
6
11
|
/**
|
|
7
12
|
* Uploads an event to the Agora Real-Time Engagement Monitor.
|
|
8
13
|
* @param event The event to be uploaded.
|
|
@@ -10,6 +15,11 @@ export interface FcrMonitorControl {
|
|
|
10
15
|
* @param failure Callback function to be called if the upload fails, with an error parameter.
|
|
11
16
|
*/
|
|
12
17
|
uploadEvent(event: FcrMonitorUploadEvent): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Set whether to upload the log.
|
|
20
|
+
* @param isNeed Whether to upload the log.
|
|
21
|
+
*/
|
|
22
|
+
setNeedLogUpload(isNeed: boolean): void;
|
|
13
23
|
/**
|
|
14
24
|
* Add an observer to the monitor.
|
|
15
25
|
* @param observer
|
|
@@ -116,10 +116,15 @@ class FcrChatConnectorImpl {
|
|
|
116
116
|
_imports.EasemobChatSDK.logger.setConsoleLogVisibility(false);
|
|
117
117
|
this._conn = new _imports.EasemobChatSDK.connection(connParams);
|
|
118
118
|
this._addEventListeners(this._conn);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
try {
|
|
120
|
+
await this._conn.open({
|
|
121
|
+
accessToken: this._initConfig.token,
|
|
122
|
+
user: this._userId
|
|
123
|
+
});
|
|
124
|
+
} catch (error) {
|
|
125
|
+
this.logger.error('connection open error', error.message);
|
|
126
|
+
throw error;
|
|
127
|
+
}
|
|
123
128
|
this.logger.info(`login success, token: ${this._initConfig.token}, userId: ${this._userId}`);
|
|
124
129
|
}, {
|
|
125
130
|
retriesMax: Infinity
|
|
@@ -214,6 +219,7 @@ class FcrChatConnectorImpl {
|
|
|
214
219
|
if (this._chatIpList?.length || this._restIpList?.length) {
|
|
215
220
|
const privateConfig = {
|
|
216
221
|
isHttpDNS: false
|
|
222
|
+
// https: true,
|
|
217
223
|
};
|
|
218
224
|
if (this._chatIpList?.length) {
|
|
219
225
|
privateConfig.url = this._chatIpList[0];
|
|
@@ -221,6 +227,7 @@ class FcrChatConnectorImpl {
|
|
|
221
227
|
if (this._restIpList?.length) {
|
|
222
228
|
privateConfig.apiUrl = this._restIpList[0];
|
|
223
229
|
}
|
|
230
|
+
privateConfig.url = 'wss://apaas-private-im.agoralab.co:13003/websocket';
|
|
224
231
|
return privateConfig;
|
|
225
232
|
}
|
|
226
233
|
}
|
|
@@ -11,7 +11,10 @@ export declare enum FcrAbility {
|
|
|
11
11
|
Board = "board",
|
|
12
12
|
SettingVirtualBackground = "setting:virtualBackground",
|
|
13
13
|
SettingBeautyMode = "setting:beautyMode",
|
|
14
|
-
|
|
14
|
+
CallOutPstn = "callOut:pstn",
|
|
15
|
+
CallOutVolte = "callOut:volte",
|
|
16
|
+
CallOutH323 = "callOut:h323",
|
|
17
|
+
CallOutSip = "callOut:sip"
|
|
15
18
|
}
|
|
16
19
|
export interface FcrAbilityControl {
|
|
17
20
|
isAbilitySupported(ability: FcrAbility): boolean;
|
|
@@ -16,6 +16,9 @@ let FcrAbility = exports.FcrAbility = /*#__PURE__*/function (FcrAbility) {
|
|
|
16
16
|
FcrAbility["Board"] = "board";
|
|
17
17
|
FcrAbility["SettingVirtualBackground"] = "setting:virtualBackground";
|
|
18
18
|
FcrAbility["SettingBeautyMode"] = "setting:beautyMode";
|
|
19
|
-
FcrAbility["
|
|
19
|
+
FcrAbility["CallOutPstn"] = "callOut:pstn";
|
|
20
|
+
FcrAbility["CallOutVolte"] = "callOut:volte";
|
|
21
|
+
FcrAbility["CallOutH323"] = "callOut:h323";
|
|
22
|
+
FcrAbility["CallOutSip"] = "callOut:sip";
|
|
20
23
|
return FcrAbility;
|
|
21
24
|
}({});
|
|
@@ -63,8 +63,9 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
63
63
|
onLocalUserPermissionInfoAdded: this._onLocalUserPermissionInfoAdded,
|
|
64
64
|
onLocalUserPermissionInfoDeleted: this._onLocalUserPermissionInfoDeleted
|
|
65
65
|
};
|
|
66
|
-
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
|
|
66
|
+
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl, monitorControl) {
|
|
67
67
|
super(engine, scene, api, config, _type2.FcrRoomType.Mainroom, chatConnection, sharedCache, chatRoomControl);
|
|
68
|
+
this._monitorControl = monitorControl;
|
|
68
69
|
this._groupControl = new _groupControl.FcrGroupControl(engine, scene, api, sharedCache);
|
|
69
70
|
this._interpreterControl = new _interpreterControl.FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
|
|
70
71
|
this._addLogObserver();
|
|
@@ -107,18 +108,12 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
107
108
|
const privilegeControl = this.getPrivilegeControl();
|
|
108
109
|
privilegeControl.addObserver(this._privilegeObserver);
|
|
109
110
|
const task = sharedScheduler.addIntervalTask(() => {
|
|
110
|
-
this.
|
|
111
|
-
userUuid: this._config.userId,
|
|
112
|
-
roomUuid: this._scene.sceneId
|
|
113
|
-
});
|
|
111
|
+
this._uploadLog();
|
|
114
112
|
}, Duration.minute(5), false);
|
|
115
113
|
this._logUploadTask = task;
|
|
116
114
|
return _type.FcrReturnCode.SUCCESS;
|
|
117
115
|
} finally {
|
|
118
|
-
this.
|
|
119
|
-
userUuid: this._config.userId,
|
|
120
|
-
roomUuid: this._scene.sceneId
|
|
121
|
-
});
|
|
116
|
+
this._uploadLog();
|
|
122
117
|
}
|
|
123
118
|
}
|
|
124
119
|
async leave() {
|
|
@@ -128,10 +123,7 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
128
123
|
return await super.leave();
|
|
129
124
|
} finally {
|
|
130
125
|
this._logUploadTask?.stop();
|
|
131
|
-
this.
|
|
132
|
-
userUuid: this._config.userId,
|
|
133
|
-
roomUuid: this._scene.sceneId
|
|
134
|
-
});
|
|
126
|
+
this._uploadLog();
|
|
135
127
|
}
|
|
136
128
|
}
|
|
137
129
|
addObserver(observer) {
|
|
@@ -246,6 +238,16 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
246
238
|
}
|
|
247
239
|
}
|
|
248
240
|
}
|
|
241
|
+
_uploadLog() {
|
|
242
|
+
if (this._monitorControl.needLogUpload) {
|
|
243
|
+
this._engine.getMonitor().uploadLog({
|
|
244
|
+
userUuid: this._config.userId,
|
|
245
|
+
roomUuid: this._scene.sceneId
|
|
246
|
+
});
|
|
247
|
+
} else {
|
|
248
|
+
this.logger.info('log upload is disabled');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
249
251
|
_addLogObserver() {
|
|
250
252
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onCloudRecordingStateUpdated', ['roomId', 'state']], ['onJoinRoomFailure', ['roomId', 'error']], ['onJoinRoomSuccess', ['roomId']], ['onLiveStreamingStateUpdated', ['roomId', 'state', 'url', 'reason']],
|
|
251
253
|
// 'onNetworkQualityUpdated',
|
|
@@ -282,6 +282,7 @@ export declare enum FcrPermissionAction {
|
|
|
282
282
|
CallInvite = "call:invite",
|
|
283
283
|
CallMerge = "call:merge",
|
|
284
284
|
CallSplit = "call:split",
|
|
285
|
+
CallOut = "call:callOut",
|
|
285
286
|
BoardStart = "board:start",
|
|
286
287
|
BoardClose = "board:close",
|
|
287
288
|
BoardWrite = "board:write",
|
|
@@ -98,6 +98,7 @@ let FcrPermissionAction = exports.FcrPermissionAction = /*#__PURE__*/function (F
|
|
|
98
98
|
FcrPermissionAction["CallInvite"] = "call:invite";
|
|
99
99
|
FcrPermissionAction["CallMerge"] = "call:merge";
|
|
100
100
|
FcrPermissionAction["CallSplit"] = "call:split";
|
|
101
|
+
FcrPermissionAction["CallOut"] = "call:callOut";
|
|
101
102
|
FcrPermissionAction["BoardStart"] = "board:start";
|
|
102
103
|
FcrPermissionAction["BoardClose"] = "board:close";
|
|
103
104
|
FcrPermissionAction["BoardWrite"] = "board:write";
|
|
@@ -94,13 +94,18 @@ class FcrRoomConnectorControlImpl {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
async startSessionByPhone(params) {
|
|
97
|
+
const callType = {
|
|
98
|
+
[_type.FcrPhoneConnectorSessionType.PSTN]: 'pstn',
|
|
99
|
+
[_type.FcrPhoneConnectorSessionType.VOLTE]: 'volte'
|
|
100
|
+
}[params.type];
|
|
97
101
|
const {
|
|
98
102
|
data
|
|
99
103
|
} = await (0, _error.handleRequestError)(() => this._api.callPstn({
|
|
100
104
|
roomId: this._scene.sceneId,
|
|
101
105
|
callNumber: params.phoneNumber,
|
|
102
106
|
userId: params.phoneUserId,
|
|
103
|
-
userName: params.userName
|
|
107
|
+
userName: params.userName,
|
|
108
|
+
callType
|
|
104
109
|
}), _imports.ErrorModuleCode.FCR_ROOM, 'start session by phone failed');
|
|
105
110
|
return data.data.sessionUuid;
|
|
106
111
|
}
|
|
@@ -154,7 +159,7 @@ class FcrRoomConnectorControlImpl {
|
|
|
154
159
|
7: _type.FcrRoomConnectorSessionReason.SYSTEM_ERROR,
|
|
155
160
|
8: _type.FcrRoomConnectorSessionReason.UNSUPPORTED
|
|
156
161
|
};
|
|
157
|
-
if (callType === 'pstn') {
|
|
162
|
+
if (callType === 'pstn' || callType === 'volte') {
|
|
158
163
|
const session = {
|
|
159
164
|
sessionId: sessionUuid,
|
|
160
165
|
phoneNumber: callNumber
|
|
@@ -3,6 +3,18 @@ export declare enum FcrIPConnectorSessionType {
|
|
|
3
3
|
H323 = 1,
|
|
4
4
|
SIP = 2
|
|
5
5
|
}
|
|
6
|
+
export declare enum FcrPhoneConnectorSessionType {
|
|
7
|
+
PSTN = 1,
|
|
8
|
+
VOLTE = 2
|
|
9
|
+
}
|
|
10
|
+
export declare const FcrIPConnectorSessionTypeToStringMap: {
|
|
11
|
+
readonly 1: "h323";
|
|
12
|
+
readonly 2: "sip";
|
|
13
|
+
};
|
|
14
|
+
export declare const FcrPhoneConnectorSessionTypeToStringMap: {
|
|
15
|
+
readonly 1: "pstn";
|
|
16
|
+
readonly 2: "volte";
|
|
17
|
+
};
|
|
6
18
|
export declare enum FcrRoomConnectorSessionReason {
|
|
7
19
|
NONE = 0,
|
|
8
20
|
ACCEPTED = 1,
|
|
@@ -3,12 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.FcrRoomConnectorSessionState = exports.FcrRoomConnectorSessionReason = exports.FcrRoomConnectorPhoneRegion = exports.FcrIPConnectorSessionType = void 0;
|
|
6
|
+
exports.FcrRoomConnectorSessionState = exports.FcrRoomConnectorSessionReason = exports.FcrRoomConnectorPhoneRegion = exports.FcrPhoneConnectorSessionTypeToStringMap = exports.FcrPhoneConnectorSessionType = exports.FcrIPConnectorSessionTypeToStringMap = exports.FcrIPConnectorSessionType = void 0;
|
|
7
7
|
let FcrIPConnectorSessionType = exports.FcrIPConnectorSessionType = /*#__PURE__*/function (FcrIPConnectorSessionType) {
|
|
8
8
|
FcrIPConnectorSessionType[FcrIPConnectorSessionType["H323"] = 1] = "H323";
|
|
9
9
|
FcrIPConnectorSessionType[FcrIPConnectorSessionType["SIP"] = 2] = "SIP";
|
|
10
10
|
return FcrIPConnectorSessionType;
|
|
11
11
|
}({});
|
|
12
|
+
let FcrPhoneConnectorSessionType = exports.FcrPhoneConnectorSessionType = /*#__PURE__*/function (FcrPhoneConnectorSessionType) {
|
|
13
|
+
FcrPhoneConnectorSessionType[FcrPhoneConnectorSessionType["PSTN"] = 1] = "PSTN";
|
|
14
|
+
FcrPhoneConnectorSessionType[FcrPhoneConnectorSessionType["VOLTE"] = 2] = "VOLTE";
|
|
15
|
+
return FcrPhoneConnectorSessionType;
|
|
16
|
+
}({});
|
|
17
|
+
const FcrIPConnectorSessionTypeToStringMap = exports.FcrIPConnectorSessionTypeToStringMap = {
|
|
18
|
+
[FcrIPConnectorSessionType.H323]: 'h323',
|
|
19
|
+
[FcrIPConnectorSessionType.SIP]: 'sip'
|
|
20
|
+
};
|
|
21
|
+
const FcrPhoneConnectorSessionTypeToStringMap = exports.FcrPhoneConnectorSessionTypeToStringMap = {
|
|
22
|
+
[FcrPhoneConnectorSessionType.PSTN]: 'pstn',
|
|
23
|
+
[FcrPhoneConnectorSessionType.VOLTE]: 'volte'
|
|
24
|
+
};
|
|
12
25
|
let FcrRoomConnectorSessionReason = exports.FcrRoomConnectorSessionReason = /*#__PURE__*/function (FcrRoomConnectorSessionReason) {
|
|
13
26
|
FcrRoomConnectorSessionReason[FcrRoomConnectorSessionReason["NONE"] = 0] = "NONE";
|
|
14
27
|
FcrRoomConnectorSessionReason[FcrRoomConnectorSessionReason["ACCEPTED"] = 1] = "ACCEPTED";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FcrChatConnector } from '../chat-connector/type';
|
|
2
2
|
import { AgoraRteEngine, AgoraRteEntryRoomResponse, AgoraRteScene } from '../imports';
|
|
3
3
|
import { FcrCoreServiceApi } from '../service/api';
|
|
4
|
-
import { FcrCoreEngineConfig } from '../type';
|
|
4
|
+
import { FcrCoreEngineConfig, FcrMonitorControl } from '../type';
|
|
5
5
|
import { FcrSharedCache } from './shared-cache';
|
|
6
6
|
import { FcrRoomType } from './type';
|
|
7
7
|
/**
|
|
@@ -15,6 +15,7 @@ export interface RoomControlCreationParams {
|
|
|
15
15
|
chatConnection: FcrChatConnector;
|
|
16
16
|
sharedCache: FcrSharedCache;
|
|
17
17
|
roomResponse: AgoraRteEntryRoomResponse;
|
|
18
|
+
monitorControl: FcrMonitorControl;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* 房间控制工厂类
|
|
@@ -48,7 +48,8 @@ class RoomControlFactory {
|
|
|
48
48
|
config,
|
|
49
49
|
chatConnection,
|
|
50
50
|
sharedCache,
|
|
51
|
-
roomResponse
|
|
51
|
+
roomResponse,
|
|
52
|
+
monitorControl
|
|
52
53
|
} = params;
|
|
53
54
|
const roomType = roomResponse.room.roomProperties.roomType;
|
|
54
55
|
const RoomControlImpl = ROOM_CONTROL_IMPLEMENTATIONS[roomType];
|
|
@@ -60,7 +61,7 @@ class RoomControlFactory {
|
|
|
60
61
|
const chatRoomControl = new _imports.FcrChatRoomControlImpl(scene, chatConnection, sharedCache, false);
|
|
61
62
|
|
|
62
63
|
// 创建房间控制实例
|
|
63
|
-
return new RoomControlImpl(engine, scene, apiService, config, sharedCache, chatConnection, chatRoomControl);
|
|
64
|
+
return new RoomControlImpl(engine, scene, apiService, config, sharedCache, chatConnection, chatRoomControl, monitorControl);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
/**
|
|
@@ -35,16 +35,15 @@ var _type3 = require("../../whiteboard-control/type");
|
|
|
35
35
|
var _base = require("../base");
|
|
36
36
|
var _constant = require("../constant");
|
|
37
37
|
var _utils = require("../utils");
|
|
38
|
-
var _ref, _ref2;
|
|
39
38
|
let _initProto, _setBackgroundColorDecs, _initProto2;
|
|
40
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)]; } }; }
|
|
41
40
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
42
41
|
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); }
|
|
43
42
|
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; }
|
|
44
43
|
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; }
|
|
45
|
-
class FcrWhiteboardControlImpl extends
|
|
44
|
+
class FcrWhiteboardControlImpl extends _base.FcrBaseWhiteboardControlImpl {
|
|
46
45
|
static {
|
|
47
|
-
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "open"], [_imports.trace, 2, "close"], [_imports.trace, 2, "active"], [_imports.trace, 2, "inactive"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [_imports.trace, 2, "getBackgroundColor"], [_imports.trace, 2, "getActivity"], [_imports.trace, 2, "getOwnerId"], [_imports.bound, 2, "_onScenePropertiesUpdated"]], [], 0, void 0,
|
|
46
|
+
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "open"], [_imports.trace, 2, "close"], [_imports.trace, 2, "active"], [_imports.trace, 2, "inactive"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [_imports.trace, 2, "getBackgroundColor"], [_imports.trace, 2, "getActivity"], [_imports.trace, 2, "getOwnerId"], [_imports.bound, 2, "_onScenePropertiesUpdated"]], [], 0, void 0, _base.FcrBaseWhiteboardControlImpl).e;
|
|
48
47
|
}
|
|
49
48
|
[(_setBackgroundColorDecs = [(0, _imports.trace)(['backgroundColor']), (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
50
49
|
prefix: 'FcrWhiteboardControlImpl'
|
|
@@ -187,9 +186,9 @@ class FcrWhiteboardControlImpl extends (_ref = _base.FcrBaseWhiteboardControlImp
|
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
exports.FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
190
|
-
class FcrStandaloneWhiteboardControlImpl extends
|
|
189
|
+
class FcrStandaloneWhiteboardControlImpl extends _base.FcrBaseWhiteboardControlImpl {
|
|
191
190
|
static {
|
|
192
|
-
[_initProto2] = _applyDecs(this, [[_imports.trace, 2, "open"]], [], 0, void 0,
|
|
191
|
+
[_initProto2] = _applyDecs(this, [[_imports.trace, 2, "open"]], [], 0, void 0, _base.FcrBaseWhiteboardControlImpl).e;
|
|
193
192
|
}
|
|
194
193
|
constructor(...args) {
|
|
195
194
|
super(...args);
|
package/lib/room-router/index.js
CHANGED
|
@@ -69,12 +69,13 @@ class FcrRoomRouterImpl {
|
|
|
69
69
|
|
|
70
70
|
// 接口中新增一个bypass字段,在第一次调用joinRoom的时候不传,在后续收到房间切换后的joinRoom时传true
|
|
71
71
|
_bypass = undefined;
|
|
72
|
-
constructor(_rteEngine, _apiService, _config, _chatConnection, _sharedCache, roomId) {
|
|
72
|
+
constructor(_rteEngine, _apiService, _config, _chatConnection, _sharedCache, roomId, _monitorControl) {
|
|
73
73
|
this._rteEngine = _rteEngine;
|
|
74
74
|
this._apiService = _apiService;
|
|
75
75
|
this._config = _config;
|
|
76
76
|
this._chatConnection = _chatConnection;
|
|
77
77
|
this._sharedCache = _sharedCache;
|
|
78
|
+
this._monitorControl = _monitorControl;
|
|
78
79
|
this._init(roomId);
|
|
79
80
|
this._addLogObserver();
|
|
80
81
|
}
|
|
@@ -248,7 +249,8 @@ class FcrRoomRouterImpl {
|
|
|
248
249
|
config: this._config,
|
|
249
250
|
chatConnection: this._chatConnection,
|
|
250
251
|
sharedCache: this._sharedCache,
|
|
251
|
-
roomResponse
|
|
252
|
+
roomResponse,
|
|
253
|
+
monitorControl: this._monitorControl
|
|
252
254
|
});
|
|
253
255
|
}
|
|
254
256
|
_throwIfAborted(abortController) {
|
package/lib/schema.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FcrLanguage } from './room-control/interpreter-control/types';
|
|
2
2
|
import { FcrPermissionAction, FcrPrivilegeUserRole, FcrSecurityAction } from './room-control/privilege-control/type';
|
|
3
|
-
import { FcrIPConnectorSessionType } from './room-control/room-connector-control/type';
|
|
3
|
+
import { FcrIPConnectorSessionType, FcrPhoneConnectorSessionType } from './room-control/room-connector-control/type';
|
|
4
4
|
import { FcrUserKickedOutType, FcrUserRole } from './room-control/user-control/type';
|
|
5
5
|
import { FcrBoardToolType } from './room-control/whiteboard-control-v2/enum';
|
|
6
6
|
import { FcrChatRoomMessageType } from './room-control/chatroom-control/type';
|
|
@@ -31,6 +31,7 @@ export type FcrBoardToolTypeSchema = z.infer<typeof fcrBoardToolTypeSchema>;
|
|
|
31
31
|
export declare const fcrLanguageSchema: z.ZodNativeEnum<typeof FcrLanguage>;
|
|
32
32
|
export type FcrLanguageSchema = z.infer<typeof fcrLanguageSchema>;
|
|
33
33
|
export declare const fcrIPConnectorSessionTypeSchema: z.ZodNativeEnum<typeof FcrIPConnectorSessionType>;
|
|
34
|
+
export declare const fcrPhoneConnectorSessionTypeSchema: z.ZodNativeEnum<typeof FcrPhoneConnectorSessionType>;
|
|
34
35
|
export type FcrIPConnectorSessionTypeSchema = z.infer<typeof fcrIPConnectorSessionTypeSchema>;
|
|
35
36
|
export declare const fcrDeviceTypeSchema: z.ZodNativeEnum<typeof FcrDeviceType>;
|
|
36
37
|
export type FcrDeviceTypeSchema = z.infer<typeof fcrDeviceTypeSchema>;
|
|
@@ -163,11 +164,14 @@ export declare const fcrPhoneConnectorSessionParamsSchema: z.ZodObject<{
|
|
|
163
164
|
phoneNumber: z.ZodString;
|
|
164
165
|
userName: z.ZodString;
|
|
165
166
|
phoneUserId: z.ZodOptional<z.ZodString>;
|
|
167
|
+
type: z.ZodNativeEnum<typeof FcrPhoneConnectorSessionType>;
|
|
166
168
|
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
type: FcrPhoneConnectorSessionType;
|
|
167
170
|
userName: string;
|
|
168
171
|
phoneNumber: string;
|
|
169
172
|
phoneUserId?: string | undefined;
|
|
170
173
|
}, {
|
|
174
|
+
type: FcrPhoneConnectorSessionType;
|
|
171
175
|
userName: string;
|
|
172
176
|
phoneNumber: string;
|
|
173
177
|
phoneUserId?: string | undefined;
|
package/lib/schema.js
CHANGED
|
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "createUnionSchema", {
|
|
|
35
35
|
return _imports.createUnionSchema;
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
exports.fcrRenderModeSchema = exports.fcrRenderConfigSchema = exports.fcrPrivilegeUserRoleSchema = exports.fcrPrivilegeUserRoleArraySchema = exports.fcrPhoneConnectorSessionParamsSchema = exports.fcrPermissionActionSchema = exports.fcrPeerSessionParamsSchema = exports.fcrMobileDeviceIdOrNameSchema = exports.fcrMediaStreamTypeSchema = exports.fcrMediaStreamCreateConfigSchema = exports.fcrMediaSourceStateSchema = exports.fcrLocalStreamCreateArrayConfigSchema = exports.fcrLineTypeSchema = exports.fcrLatencyLevelTypeSchema = exports.fcrLanguageSchema = exports.fcrLanguageConfigSchema = exports.fcrInterpreterUsersParamsSchema = exports.fcrInterpreterUsersParamsArraySchema = exports.fcrIPConnectorSessionTypeSchema = exports.fcrIPConnectorSessionParamsSchema = exports.fcrGroupUpdateOptionsSchema = exports.fcrGroupUpdateOptionsArraySchema = exports.fcrGroupCreateConfigSchema = exports.fcrGroupCreateConfigArraySchema = exports.fcrEncryptionModeSchema = exports.fcrDeviceTypeSchema = exports.fcrChatRoomSendTextMessageSchema = exports.fcrChatRoomSendImageMessageSchema = exports.fcrChatRoomSendBaseMessageSchema = exports.fcrChatRoomMessageTypeSchema = exports.fcrChatRoomFileSchema = exports.fcrCapabilitySchema = exports.fcrBoardToolTypeSchema = exports.fcrAudioSourceTypeSchema = void 0;
|
|
38
|
+
exports.fcrRenderModeSchema = exports.fcrRenderConfigSchema = exports.fcrPrivilegeUserRoleSchema = exports.fcrPrivilegeUserRoleArraySchema = exports.fcrPhoneConnectorSessionTypeSchema = exports.fcrPhoneConnectorSessionParamsSchema = exports.fcrPermissionActionSchema = exports.fcrPeerSessionParamsSchema = exports.fcrMobileDeviceIdOrNameSchema = exports.fcrMediaStreamTypeSchema = exports.fcrMediaStreamCreateConfigSchema = exports.fcrMediaSourceStateSchema = exports.fcrLocalStreamCreateArrayConfigSchema = exports.fcrLineTypeSchema = exports.fcrLatencyLevelTypeSchema = exports.fcrLanguageSchema = exports.fcrLanguageConfigSchema = exports.fcrInterpreterUsersParamsSchema = exports.fcrInterpreterUsersParamsArraySchema = exports.fcrIPConnectorSessionTypeSchema = exports.fcrIPConnectorSessionParamsSchema = exports.fcrGroupUpdateOptionsSchema = exports.fcrGroupUpdateOptionsArraySchema = exports.fcrGroupCreateConfigSchema = exports.fcrGroupCreateConfigArraySchema = exports.fcrEncryptionModeSchema = exports.fcrDeviceTypeSchema = exports.fcrChatRoomSendTextMessageSchema = exports.fcrChatRoomSendImageMessageSchema = exports.fcrChatRoomSendBaseMessageSchema = exports.fcrChatRoomMessageTypeSchema = exports.fcrChatRoomFileSchema = exports.fcrCapabilitySchema = exports.fcrBoardToolTypeSchema = exports.fcrAudioSourceTypeSchema = void 0;
|
|
39
39
|
Object.defineProperty(exports, "fcrRenderViewSchema", {
|
|
40
40
|
enumerable: true,
|
|
41
41
|
get: function () {
|
|
@@ -95,6 +95,7 @@ const fcrUserKickedOutTypeSchema = exports.fcrUserKickedOutTypeSchema = _imports
|
|
|
95
95
|
const fcrBoardToolTypeSchema = exports.fcrBoardToolTypeSchema = _imports.z.nativeEnum(_enum.FcrBoardToolType);
|
|
96
96
|
const fcrLanguageSchema = exports.fcrLanguageSchema = _imports.z.nativeEnum(_types.FcrLanguage);
|
|
97
97
|
const fcrIPConnectorSessionTypeSchema = exports.fcrIPConnectorSessionTypeSchema = _imports.z.nativeEnum(_type2.FcrIPConnectorSessionType);
|
|
98
|
+
const fcrPhoneConnectorSessionTypeSchema = exports.fcrPhoneConnectorSessionTypeSchema = _imports.z.nativeEnum(_type2.FcrPhoneConnectorSessionType);
|
|
98
99
|
const fcrDeviceTypeSchema = exports.fcrDeviceTypeSchema = _imports.z.nativeEnum(_type5.FcrDeviceType);
|
|
99
100
|
const fcrChatRoomMessageTypeSchema = exports.fcrChatRoomMessageTypeSchema = _imports.z.nativeEnum(_type4.FcrChatRoomMessageType);
|
|
100
101
|
// Native Enum Schemas
|
|
@@ -145,7 +146,8 @@ const fcrSecuritySendChatPayloadSchema = exports.fcrSecuritySendChatPayloadSchem
|
|
|
145
146
|
const fcrPhoneConnectorSessionParamsSchema = exports.fcrPhoneConnectorSessionParamsSchema = _imports.z.object({
|
|
146
147
|
phoneNumber: _imports.stringSchema,
|
|
147
148
|
userName: _imports.stringSchema,
|
|
148
|
-
phoneUserId: _imports.stringSchema.optional()
|
|
149
|
+
phoneUserId: _imports.stringSchema.optional(),
|
|
150
|
+
type: fcrPhoneConnectorSessionTypeSchema
|
|
149
151
|
});
|
|
150
152
|
const fcrIPConnectorSessionParamsSchema = exports.fcrIPConnectorSessionParamsSchema = _imports.z.object({
|
|
151
153
|
address: _imports.stringSchema,
|
package/lib/service/api.d.ts
CHANGED
|
@@ -229,11 +229,12 @@ export declare class FcrCoreServiceApi {
|
|
|
229
229
|
callType: string;
|
|
230
230
|
ipAddress: string;
|
|
231
231
|
}): Promise<any>;
|
|
232
|
-
callPstn({ roomId, userName, userId, callNumber, }: {
|
|
232
|
+
callPstn({ roomId, userName, userId, callNumber, callType, }: {
|
|
233
233
|
roomId: string;
|
|
234
234
|
userId?: string;
|
|
235
235
|
userName: string;
|
|
236
236
|
callNumber: string;
|
|
237
|
+
callType: string;
|
|
237
238
|
}): Promise<any>;
|
|
238
239
|
hangup({ roomId, userId, callId }: {
|
|
239
240
|
roomId: string;
|
package/lib/service/api.js
CHANGED
|
@@ -791,10 +791,11 @@ class FcrCoreServiceApi {
|
|
|
791
791
|
roomId,
|
|
792
792
|
userName,
|
|
793
793
|
userId,
|
|
794
|
-
callNumber
|
|
794
|
+
callNumber,
|
|
795
|
+
callType
|
|
795
796
|
}) {
|
|
796
797
|
const res = await this._client.fetch({
|
|
797
|
-
path: `/v1/rooms/${roomId}/call
|
|
798
|
+
path: `/v1/rooms/${roomId}/call/${callType}`,
|
|
798
799
|
method: 'POST',
|
|
799
800
|
data: {
|
|
800
801
|
callNumber,
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Logger, LoggerManager } from '../imports';
|
|
2
|
+
export declare class FcrCoreLoggerManagerHolder {
|
|
3
|
+
private static instance;
|
|
4
|
+
private static isDestroying;
|
|
5
|
+
private static label;
|
|
6
|
+
static initialize(opts: {
|
|
7
|
+
maxSize?: number;
|
|
8
|
+
}): void;
|
|
9
|
+
static getInstance(): LoggerManager;
|
|
10
|
+
static createLogger(opts: {
|
|
11
|
+
prefix: string;
|
|
12
|
+
database?: boolean;
|
|
13
|
+
}): Logger;
|
|
14
|
+
static getLogger(): Logger;
|
|
15
|
+
static generateLogObserver<T>(logger: Logger, callbackMethods: (keyof T | [keyof T, string[]])[]): T;
|
|
16
|
+
static destroy(): void;
|
|
17
|
+
static isInitialized(): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const getLogger: typeof FcrCoreLoggerManagerHolder.getLogger;
|
|
20
|
+
export declare const createLogger: typeof FcrCoreLoggerManagerHolder.createLogger;
|
|
21
|
+
export declare const generateLogObserver: typeof FcrCoreLoggerManagerHolder.generateLogObserver;
|