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/utilities/logger.js
CHANGED
|
@@ -3,11 +3,53 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getLogger = exports.generateLogObserver = exports.createLogger = void 0;
|
|
6
|
+
exports.getLogger = exports.generateLogObserver = exports.createLogger = exports.FcrCoreLoggerManagerHolder = void 0;
|
|
7
7
|
var _imports = require("../imports");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
class FcrCoreLoggerManagerHolder {
|
|
9
|
+
static instance = null;
|
|
10
|
+
static isDestroying = false;
|
|
11
|
+
static label = 'fcr-core';
|
|
12
|
+
static initialize(opts) {
|
|
13
|
+
if (this.instance && !this.isDestroying) {
|
|
14
|
+
console.warn(`${this.label} LoggerManager is already initialized. Reinitializing...`);
|
|
15
|
+
}
|
|
16
|
+
this.destroy();
|
|
17
|
+
this.instance = new _imports.LoggerManager({
|
|
18
|
+
label: this.label,
|
|
19
|
+
maxSize: opts.maxSize
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
static getInstance() {
|
|
23
|
+
if (!this.instance) {
|
|
24
|
+
throw new Error(`LoggerManager is not initialized. Call ${this.label} LoggerManager.initialize() first.`);
|
|
25
|
+
}
|
|
26
|
+
return this.instance;
|
|
27
|
+
}
|
|
28
|
+
static createLogger(opts) {
|
|
29
|
+
return this.getInstance().createLogger(opts);
|
|
30
|
+
}
|
|
31
|
+
static getLogger() {
|
|
32
|
+
return this.getInstance().getLogger();
|
|
33
|
+
}
|
|
34
|
+
static generateLogObserver(logger, callbackMethods) {
|
|
35
|
+
return this.getInstance().generateLogObserver(logger, callbackMethods);
|
|
36
|
+
}
|
|
37
|
+
static destroy() {
|
|
38
|
+
if (this.instance && !this.isDestroying) {
|
|
39
|
+
this.isDestroying = true;
|
|
40
|
+
try {
|
|
41
|
+
this.instance.release();
|
|
42
|
+
} finally {
|
|
43
|
+
this.instance = null;
|
|
44
|
+
this.isDestroying = false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static isInitialized() {
|
|
49
|
+
return this.instance !== null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.FcrCoreLoggerManagerHolder = FcrCoreLoggerManagerHolder;
|
|
53
|
+
const getLogger = exports.getLogger = FcrCoreLoggerManagerHolder.getLogger.bind(FcrCoreLoggerManagerHolder);
|
|
54
|
+
const createLogger = exports.createLogger = FcrCoreLoggerManagerHolder.createLogger.bind(FcrCoreLoggerManagerHolder);
|
|
55
|
+
const generateLogObserver = exports.generateLogObserver = FcrCoreLoggerManagerHolder.generateLogObserver.bind(FcrCoreLoggerManagerHolder);
|
|
@@ -6,5 +6,9 @@ export declare const getCoreIpList: (parameters?: FcrCoreEngineParameters) => st
|
|
|
6
6
|
export declare const getEasemobChatIpList: (parameters?: FcrCoreEngineParameters) => string[];
|
|
7
7
|
export declare const getEasemobRestIpList: (parameters?: FcrCoreEngineParameters) => string[];
|
|
8
8
|
export declare const isEndpointRegionDisabled: (parameters?: FcrCoreEngineParameters) => boolean;
|
|
9
|
+
export declare const getNeedLogUpload: (parameters?: FcrCoreEngineParameters) => boolean;
|
|
10
|
+
export declare const getCoreLogFileSize: (parameters?: FcrCoreEngineParameters) => number;
|
|
11
|
+
export declare const getEasemobLogFileSize: (parameters?: FcrCoreEngineParameters) => number;
|
|
12
|
+
export declare const getNetlessLogFileSize: (parameters?: FcrCoreEngineParameters) => number;
|
|
9
13
|
export declare const getRtcPresetParameters: () => string[];
|
|
10
14
|
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isTrueValue = exports.isEndpointRegionDisabled = exports.getRtcPresetParameters = exports.getEasemobRestIpList = exports.getEasemobChatIpList = exports.getCoreIpList = void 0;
|
|
6
|
+
exports.isTrueValue = exports.isEndpointRegionDisabled = exports.getRtcPresetParameters = exports.getNetlessLogFileSize = exports.getNeedLogUpload = exports.getEasemobRestIpList = exports.getEasemobLogFileSize = exports.getEasemobChatIpList = exports.getCoreLogFileSize = exports.getCoreIpList = void 0;
|
|
7
7
|
require("core-js/modules/es.json.stringify.js");
|
|
8
8
|
require("core-js/modules/esnext.set.add-all.js");
|
|
9
9
|
require("core-js/modules/esnext.set.delete-all.js");
|
|
@@ -29,6 +29,7 @@ require("core-js/modules/esnext.set.symmetric-difference.js");
|
|
|
29
29
|
require("core-js/modules/esnext.set.union.v2.js");
|
|
30
30
|
require("core-js/modules/esnext.set.union.js");
|
|
31
31
|
var _imports = require("../imports");
|
|
32
|
+
const DEFAULT_LOG_FILE_SIZE = 512;
|
|
32
33
|
const isTrueValue = value => {
|
|
33
34
|
return value === 'true' || !!value;
|
|
34
35
|
};
|
|
@@ -106,8 +107,35 @@ const DESKTOP_COMMON_PARAMS = [
|
|
|
106
107
|
}, {
|
|
107
108
|
'che.video.lowest_dev_score_4_beauty': 0
|
|
108
109
|
}];
|
|
109
|
-
|
|
110
|
+
const getNeedLogUpload = parameters => {
|
|
111
|
+
if ((0, _imports.isBoolean)(parameters?.core?.needLogUpload)) {
|
|
112
|
+
return parameters.core.needLogUpload;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
};
|
|
116
|
+
exports.getNeedLogUpload = getNeedLogUpload;
|
|
117
|
+
const getCoreLogFileSize = parameters => {
|
|
118
|
+
if (!(0, _imports.isNumber)(parameters?.core?.coreLogFileSize)) {
|
|
119
|
+
return DEFAULT_LOG_FILE_SIZE;
|
|
120
|
+
}
|
|
121
|
+
return parameters.core.coreLogFileSize;
|
|
122
|
+
};
|
|
123
|
+
exports.getCoreLogFileSize = getCoreLogFileSize;
|
|
124
|
+
const getEasemobLogFileSize = parameters => {
|
|
125
|
+
if (!(0, _imports.isNumber)(parameters?.core?.easemobLogFileSize)) {
|
|
126
|
+
return DEFAULT_LOG_FILE_SIZE;
|
|
127
|
+
}
|
|
128
|
+
return parameters.core.easemobLogFileSize;
|
|
129
|
+
};
|
|
130
|
+
exports.getEasemobLogFileSize = getEasemobLogFileSize;
|
|
131
|
+
const getNetlessLogFileSize = parameters => {
|
|
132
|
+
if (!(0, _imports.isNumber)(parameters?.core?.netlessLogFileSize)) {
|
|
133
|
+
return DEFAULT_LOG_FILE_SIZE;
|
|
134
|
+
}
|
|
135
|
+
return parameters.core.netlessLogFileSize;
|
|
136
|
+
};
|
|
110
137
|
/** desktop platforms set */
|
|
138
|
+
exports.getNetlessLogFileSize = getNetlessLogFileSize;
|
|
111
139
|
const DESKTOP_PLATFORMS = new Set([_imports.FcrApplicationPlatform.WINDOWS, _imports.FcrApplicationPlatform.MACOS]);
|
|
112
140
|
const getRtcPresetParameters = () => {
|
|
113
141
|
const platform = (0, _imports.getPlatform)();
|
package/lib-es/engine/index.js
CHANGED
|
@@ -52,18 +52,16 @@ import { FcrCoreServiceApi } from '../service/api';
|
|
|
52
52
|
import { FcrReturnCode, FcrUserRoleToStringMap } from '../type';
|
|
53
53
|
import { CMD_PEER_MESSAGE } from '../utilities/cmd';
|
|
54
54
|
import { ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM, FcrError, handleRequestError } from '../utilities/error';
|
|
55
|
-
import {
|
|
55
|
+
import { FcrCoreLoggerManagerHolder, generateLogObserver } from '../utilities/logger';
|
|
56
56
|
import { getDependenciesInfo, getVersion } from '../utilities/package-info';
|
|
57
|
-
import { getCoreIpList, getEasemobChatIpList, getEasemobRestIpList, isEndpointRegionDisabled } from '../utilities/parameters';
|
|
57
|
+
import { getCoreIpList, getCoreLogFileSize, getEasemobChatIpList, getEasemobRestIpList, isEndpointRegionDisabled } from '../utilities/parameters';
|
|
58
58
|
import validateParams from '../utilities/validate-params';
|
|
59
59
|
export class FcrCoreEngineImpl {
|
|
60
60
|
static {
|
|
61
61
|
[_initProto] = _applyDecs(this, [[trace, 2, "release"], [trace, 2, "login"], [trace, 2, "logout"], [_renewUserTokenDecs, 2, "renewUserToken"], [trace, 2, "getVersion"], [_createMainRoomControlDecs, 2, "createMainRoomControl"], [_createWaitingRoomControlDecs, 2, "createWaitingRoomControl"], [_createRoomRouterDecs, 2, "createRoomRouter"], [_createRoomControlAndJoinDecs, 2, "createRoomControlAndJoin"], [trace, 2, "getDesktopMediaControl"], [trace, 2, "getMobileMediaControl"], [trace, 2, "getMonitorControl"], [trace, 2, "getPeerSessionControl"], [_sendPeerMessageDecs, 2, "sendPeerMessage"], [_setParametersDecs, 2, "setParameters"]], []).e;
|
|
62
62
|
}
|
|
63
63
|
// @internal
|
|
64
|
-
[(_renewUserTokenDecs = trace(['token'], true), _createMainRoomControlDecs = [trace(['roomId']), validateParams(stringSchema)], _createWaitingRoomControlDecs = [trace(['roomId']), validateParams(stringSchema)], _createRoomRouterDecs = [trace(['roomId']), validateParams(stringSchema)], _createRoomControlAndJoinDecs = [trace(['roomId', 'options']), validateParams(stringSchema, fcrRoomJoinOptionsSchema)], _sendPeerMessageDecs = [trace(['payload', 'guaranteedDelivery', 'receiverId'], true), validateParams(stringKeyUnknownValueSchema, booleanSchema, stringSchema)], _setParametersDecs = [trace(['parameters'], true), validateParams(stringKeyUnknownValueSchema)], "logger")] =
|
|
65
|
-
prefix: 'FcrCoreEngine'
|
|
66
|
-
}));
|
|
64
|
+
[(_renewUserTokenDecs = trace(['token'], true), _createMainRoomControlDecs = [trace(['roomId']), validateParams(stringSchema)], _createWaitingRoomControlDecs = [trace(['roomId']), validateParams(stringSchema)], _createRoomRouterDecs = [trace(['roomId']), validateParams(stringSchema)], _createRoomControlAndJoinDecs = [trace(['roomId', 'options']), validateParams(stringSchema, fcrRoomJoinOptionsSchema)], _sendPeerMessageDecs = [trace(['payload', 'guaranteedDelivery', 'receiverId'], true), validateParams(stringKeyUnknownValueSchema, booleanSchema, stringSchema)], _setParametersDecs = [trace(['parameters'], true), validateParams(stringKeyUnknownValueSchema)], "logger")] = void _initProto(this);
|
|
67
65
|
// @internal
|
|
68
66
|
|
|
69
67
|
// @internal
|
|
@@ -93,6 +91,13 @@ export class FcrCoreEngineImpl {
|
|
|
93
91
|
constructor(config) {
|
|
94
92
|
this._config = config;
|
|
95
93
|
resetSharedDomainHolder();
|
|
94
|
+
const rteLogFileSize = getCoreLogFileSize(config.parameters);
|
|
95
|
+
FcrCoreLoggerManagerHolder.initialize({
|
|
96
|
+
maxSize: rteLogFileSize
|
|
97
|
+
});
|
|
98
|
+
this.logger = FcrCoreLoggerManagerHolder.createLogger({
|
|
99
|
+
prefix: 'FcrCoreEngine'
|
|
100
|
+
});
|
|
96
101
|
this.logger.info('Fcr core engine is created, version: ', this.getVersion());
|
|
97
102
|
this._rteEngine = new AgoraRteEngine({
|
|
98
103
|
appId: config.appId,
|
|
@@ -147,9 +152,13 @@ export class FcrCoreEngineImpl {
|
|
|
147
152
|
return await this._rteEngine.login();
|
|
148
153
|
} finally {
|
|
149
154
|
this._isLoggingIn = false;
|
|
150
|
-
this.
|
|
151
|
-
|
|
152
|
-
|
|
155
|
+
if (this._monitorControl.needLogUpload) {
|
|
156
|
+
this._rteEngine.getMonitor().uploadLog({
|
|
157
|
+
userUuid: this._config.userId
|
|
158
|
+
});
|
|
159
|
+
} else {
|
|
160
|
+
this.logger.info('log upload is disabled');
|
|
161
|
+
}
|
|
153
162
|
}
|
|
154
163
|
});
|
|
155
164
|
}
|
|
@@ -197,7 +206,7 @@ export class FcrCoreEngineImpl {
|
|
|
197
206
|
const scene = this._rteEngine.createScene({
|
|
198
207
|
sceneId: roomId
|
|
199
208
|
});
|
|
200
|
-
return new FcrMainRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache, false));
|
|
209
|
+
return new FcrMainRoomControlImpl(this._rteEngine, scene, this._apiService, this._config, this._sharedCache, this._chatConnection, new FcrChatRoomControlImpl(scene, this._chatConnection, this._sharedCache, false), this._monitorControl);
|
|
201
210
|
}
|
|
202
211
|
|
|
203
212
|
/**
|
|
@@ -218,7 +227,7 @@ export class FcrCoreEngineImpl {
|
|
|
218
227
|
* @returns The room router.
|
|
219
228
|
*/
|
|
220
229
|
createRoomRouter(roomId) {
|
|
221
|
-
const roomRouter = new FcrRoomRouterImpl(this._rteEngine, this._apiService, this._config, this._chatConnection, this._sharedCache, roomId);
|
|
230
|
+
const roomRouter = new FcrRoomRouterImpl(this._rteEngine, this._apiService, this._config, this._chatConnection, this._sharedCache, roomId, this._monitorControl);
|
|
222
231
|
return roomRouter;
|
|
223
232
|
}
|
|
224
233
|
|
package/lib-es/imports.js
CHANGED
|
@@ -56,4 +56,6 @@ export const localStorage = window.localStorage;
|
|
|
56
56
|
export { v4 } from 'uuid';
|
|
57
57
|
export { default as merge } from 'lodash/merge';
|
|
58
58
|
export { DetailErrorCode, ErrorModuleCode, ErrorServiceType } from 'agora-foundation/lib/utilities/error/error-code';
|
|
59
|
-
export { FcrChatRoomControlImpl } from './plugins/chat/chatroom';
|
|
59
|
+
export { FcrChatRoomControlImpl } from './plugins/chat/chatroom';
|
|
60
|
+
export { default as isBoolean } from 'lodash/isBoolean';
|
|
61
|
+
export { default as isNumber } from 'lodash/isNumber';
|
|
@@ -22,21 +22,31 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
22
22
|
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; }
|
|
23
23
|
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; }
|
|
24
24
|
import { trace } from '../imports';
|
|
25
|
+
import { getNeedLogUpload } from '../utilities/parameters';
|
|
25
26
|
/**
|
|
26
27
|
* @internal
|
|
27
28
|
*/
|
|
28
29
|
export class FcrMonitorControlImpl {
|
|
29
30
|
static {
|
|
30
|
-
[_initProto] = _applyDecs(this, [[_uploadEventDecs, 2, "uploadEvent"]], []).e;
|
|
31
|
+
[_initProto] = _applyDecs(this, [[_uploadEventDecs, 2, "uploadEvent"], [trace, 2, "setNeedLogUpload"]], []).e;
|
|
31
32
|
}
|
|
32
33
|
[(_uploadEventDecs = trace(['event']), "_monitor")] = void _initProto(this);
|
|
34
|
+
_needLogUpload = true;
|
|
33
35
|
constructor(engine, _config) {
|
|
34
36
|
this._config = _config;
|
|
35
37
|
this._monitor = engine.getMonitor();
|
|
38
|
+
const needLogUpload = getNeedLogUpload(this._config.parameters);
|
|
39
|
+
this._needLogUpload = needLogUpload;
|
|
40
|
+
}
|
|
41
|
+
get needLogUpload() {
|
|
42
|
+
return this._needLogUpload;
|
|
36
43
|
}
|
|
37
44
|
async uploadEvent(event) {
|
|
38
45
|
return this._monitor.uploadEvent(event);
|
|
39
46
|
}
|
|
47
|
+
setNeedLogUpload(isNeed) {
|
|
48
|
+
this._needLogUpload = isNeed;
|
|
49
|
+
}
|
|
40
50
|
addObserver(observer) {
|
|
41
51
|
this._monitor.addObserver(observer);
|
|
42
52
|
}
|
|
@@ -110,10 +110,15 @@ export class FcrChatConnectorImpl {
|
|
|
110
110
|
EasemobChatSDK.logger.setConsoleLogVisibility(false);
|
|
111
111
|
this._conn = new EasemobChatSDK.connection(connParams);
|
|
112
112
|
this._addEventListeners(this._conn);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
try {
|
|
114
|
+
await this._conn.open({
|
|
115
|
+
accessToken: this._initConfig.token,
|
|
116
|
+
user: this._userId
|
|
117
|
+
});
|
|
118
|
+
} catch (error) {
|
|
119
|
+
this.logger.error('connection open error', error.message);
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
117
122
|
this.logger.info(`login success, token: ${this._initConfig.token}, userId: ${this._userId}`);
|
|
118
123
|
}, {
|
|
119
124
|
retriesMax: Infinity
|
|
@@ -208,6 +213,7 @@ export class FcrChatConnectorImpl {
|
|
|
208
213
|
if (this._chatIpList?.length || this._restIpList?.length) {
|
|
209
214
|
const privateConfig = {
|
|
210
215
|
isHttpDNS: false
|
|
216
|
+
// https: true,
|
|
211
217
|
};
|
|
212
218
|
if (this._chatIpList?.length) {
|
|
213
219
|
privateConfig.url = this._chatIpList[0];
|
|
@@ -215,6 +221,7 @@ export class FcrChatConnectorImpl {
|
|
|
215
221
|
if (this._restIpList?.length) {
|
|
216
222
|
privateConfig.apiUrl = this._restIpList[0];
|
|
217
223
|
}
|
|
224
|
+
privateConfig.url = 'wss://apaas-private-im.agoralab.co:13003/websocket';
|
|
218
225
|
return privateConfig;
|
|
219
226
|
}
|
|
220
227
|
}
|
|
@@ -10,6 +10,9 @@ export let FcrAbility = /*#__PURE__*/function (FcrAbility) {
|
|
|
10
10
|
FcrAbility["Board"] = "board";
|
|
11
11
|
FcrAbility["SettingVirtualBackground"] = "setting:virtualBackground";
|
|
12
12
|
FcrAbility["SettingBeautyMode"] = "setting:beautyMode";
|
|
13
|
-
FcrAbility["
|
|
13
|
+
FcrAbility["CallOutPstn"] = "callOut:pstn";
|
|
14
|
+
FcrAbility["CallOutVolte"] = "callOut:volte";
|
|
15
|
+
FcrAbility["CallOutH323"] = "callOut:h323";
|
|
16
|
+
FcrAbility["CallOutSip"] = "callOut:sip";
|
|
14
17
|
return FcrAbility;
|
|
15
18
|
}({});
|
|
@@ -56,8 +56,9 @@ export class FcrMainRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
56
56
|
onLocalUserPermissionInfoAdded: this._onLocalUserPermissionInfoAdded,
|
|
57
57
|
onLocalUserPermissionInfoDeleted: this._onLocalUserPermissionInfoDeleted
|
|
58
58
|
};
|
|
59
|
-
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
|
|
59
|
+
constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl, monitorControl) {
|
|
60
60
|
super(engine, scene, api, config, FcrRoomType.Mainroom, chatConnection, sharedCache, chatRoomControl);
|
|
61
|
+
this._monitorControl = monitorControl;
|
|
61
62
|
this._groupControl = new FcrGroupControl(engine, scene, api, sharedCache);
|
|
62
63
|
this._interpreterControl = new FcrInterpreterControlImpl(api, scene, config, engine, chatConnection, sharedCache);
|
|
63
64
|
this._addLogObserver();
|
|
@@ -100,18 +101,12 @@ export class FcrMainRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
100
101
|
const privilegeControl = this.getPrivilegeControl();
|
|
101
102
|
privilegeControl.addObserver(this._privilegeObserver);
|
|
102
103
|
const task = sharedScheduler.addIntervalTask(() => {
|
|
103
|
-
this.
|
|
104
|
-
userUuid: this._config.userId,
|
|
105
|
-
roomUuid: this._scene.sceneId
|
|
106
|
-
});
|
|
104
|
+
this._uploadLog();
|
|
107
105
|
}, Duration.minute(5), false);
|
|
108
106
|
this._logUploadTask = task;
|
|
109
107
|
return FcrReturnCode.SUCCESS;
|
|
110
108
|
} finally {
|
|
111
|
-
this.
|
|
112
|
-
userUuid: this._config.userId,
|
|
113
|
-
roomUuid: this._scene.sceneId
|
|
114
|
-
});
|
|
109
|
+
this._uploadLog();
|
|
115
110
|
}
|
|
116
111
|
}
|
|
117
112
|
async leave() {
|
|
@@ -121,10 +116,7 @@ export class FcrMainRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
121
116
|
return await super.leave();
|
|
122
117
|
} finally {
|
|
123
118
|
this._logUploadTask?.stop();
|
|
124
|
-
this.
|
|
125
|
-
userUuid: this._config.userId,
|
|
126
|
-
roomUuid: this._scene.sceneId
|
|
127
|
-
});
|
|
119
|
+
this._uploadLog();
|
|
128
120
|
}
|
|
129
121
|
}
|
|
130
122
|
addObserver(observer) {
|
|
@@ -239,6 +231,16 @@ export class FcrMainRoomControlImpl extends FcrBaseRoomControlImpl {
|
|
|
239
231
|
}
|
|
240
232
|
}
|
|
241
233
|
}
|
|
234
|
+
_uploadLog() {
|
|
235
|
+
if (this._monitorControl.needLogUpload) {
|
|
236
|
+
this._engine.getMonitor().uploadLog({
|
|
237
|
+
userUuid: this._config.userId,
|
|
238
|
+
roomUuid: this._scene.sceneId
|
|
239
|
+
});
|
|
240
|
+
} else {
|
|
241
|
+
this.logger.info('log upload is disabled');
|
|
242
|
+
}
|
|
243
|
+
}
|
|
242
244
|
_addLogObserver() {
|
|
243
245
|
this.addObserver(generateLogObserver(this.logger, [['onCloudRecordingStateUpdated', ['roomId', 'state']], ['onJoinRoomFailure', ['roomId', 'error']], ['onJoinRoomSuccess', ['roomId']], ['onLiveStreamingStateUpdated', ['roomId', 'state', 'url', 'reason']],
|
|
244
246
|
// 'onNetworkQualityUpdated',
|
|
@@ -92,6 +92,7 @@ export let FcrPermissionAction = /*#__PURE__*/function (FcrPermissionAction) {
|
|
|
92
92
|
FcrPermissionAction["CallInvite"] = "call:invite";
|
|
93
93
|
FcrPermissionAction["CallMerge"] = "call:merge";
|
|
94
94
|
FcrPermissionAction["CallSplit"] = "call:split";
|
|
95
|
+
FcrPermissionAction["CallOut"] = "call:callOut";
|
|
95
96
|
FcrPermissionAction["BoardStart"] = "board:start";
|
|
96
97
|
FcrPermissionAction["BoardClose"] = "board:close";
|
|
97
98
|
FcrPermissionAction["BoardWrite"] = "board:write";
|
|
@@ -24,7 +24,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
24
24
|
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); }
|
|
25
25
|
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; }
|
|
26
26
|
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; }
|
|
27
|
-
import { FcrIPConnectorSessionType, FcrRoomConnectorPhoneRegion, FcrRoomConnectorSessionReason, FcrRoomConnectorSessionState } from './type';
|
|
27
|
+
import { FcrIPConnectorSessionType, FcrPhoneConnectorSessionType, FcrRoomConnectorPhoneRegion, FcrRoomConnectorSessionReason, FcrRoomConnectorSessionState } from './type';
|
|
28
28
|
import { AgoraObservable, trace } from '../../imports';
|
|
29
29
|
import { createLogger, generateLogObserver } from '../../utilities/logger';
|
|
30
30
|
import { handleRequestError } from '../../utilities/error';
|
|
@@ -89,13 +89,18 @@ export class FcrRoomConnectorControlImpl {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
async startSessionByPhone(params) {
|
|
92
|
+
const callType = {
|
|
93
|
+
[FcrPhoneConnectorSessionType.PSTN]: 'pstn',
|
|
94
|
+
[FcrPhoneConnectorSessionType.VOLTE]: 'volte'
|
|
95
|
+
}[params.type];
|
|
92
96
|
const {
|
|
93
97
|
data
|
|
94
98
|
} = await handleRequestError(() => this._api.callPstn({
|
|
95
99
|
roomId: this._scene.sceneId,
|
|
96
100
|
callNumber: params.phoneNumber,
|
|
97
101
|
userId: params.phoneUserId,
|
|
98
|
-
userName: params.userName
|
|
102
|
+
userName: params.userName,
|
|
103
|
+
callType
|
|
99
104
|
}), ErrorModuleCode.FCR_ROOM, 'start session by phone failed');
|
|
100
105
|
return data.data.sessionUuid;
|
|
101
106
|
}
|
|
@@ -149,7 +154,7 @@ export class FcrRoomConnectorControlImpl {
|
|
|
149
154
|
7: FcrRoomConnectorSessionReason.SYSTEM_ERROR,
|
|
150
155
|
8: FcrRoomConnectorSessionReason.UNSUPPORTED
|
|
151
156
|
};
|
|
152
|
-
if (callType === 'pstn') {
|
|
157
|
+
if (callType === 'pstn' || callType === 'volte') {
|
|
153
158
|
const session = {
|
|
154
159
|
sessionId: sessionUuid,
|
|
155
160
|
phoneNumber: callNumber
|
|
@@ -3,6 +3,19 @@ export let FcrIPConnectorSessionType = /*#__PURE__*/function (FcrIPConnectorSess
|
|
|
3
3
|
FcrIPConnectorSessionType[FcrIPConnectorSessionType["SIP"] = 2] = "SIP";
|
|
4
4
|
return FcrIPConnectorSessionType;
|
|
5
5
|
}({});
|
|
6
|
+
export let FcrPhoneConnectorSessionType = /*#__PURE__*/function (FcrPhoneConnectorSessionType) {
|
|
7
|
+
FcrPhoneConnectorSessionType[FcrPhoneConnectorSessionType["PSTN"] = 1] = "PSTN";
|
|
8
|
+
FcrPhoneConnectorSessionType[FcrPhoneConnectorSessionType["VOLTE"] = 2] = "VOLTE";
|
|
9
|
+
return FcrPhoneConnectorSessionType;
|
|
10
|
+
}({});
|
|
11
|
+
export const FcrIPConnectorSessionTypeToStringMap = {
|
|
12
|
+
[FcrIPConnectorSessionType.H323]: 'h323',
|
|
13
|
+
[FcrIPConnectorSessionType.SIP]: 'sip'
|
|
14
|
+
};
|
|
15
|
+
export const FcrPhoneConnectorSessionTypeToStringMap = {
|
|
16
|
+
[FcrPhoneConnectorSessionType.PSTN]: 'pstn',
|
|
17
|
+
[FcrPhoneConnectorSessionType.VOLTE]: 'volte'
|
|
18
|
+
};
|
|
6
19
|
export let FcrRoomConnectorSessionReason = /*#__PURE__*/function (FcrRoomConnectorSessionReason) {
|
|
7
20
|
FcrRoomConnectorSessionReason[FcrRoomConnectorSessionReason["NONE"] = 0] = "NONE";
|
|
8
21
|
FcrRoomConnectorSessionReason[FcrRoomConnectorSessionReason["ACCEPTED"] = 1] = "ACCEPTED";
|
|
@@ -43,7 +43,8 @@ export class RoomControlFactory {
|
|
|
43
43
|
config,
|
|
44
44
|
chatConnection,
|
|
45
45
|
sharedCache,
|
|
46
|
-
roomResponse
|
|
46
|
+
roomResponse,
|
|
47
|
+
monitorControl
|
|
47
48
|
} = params;
|
|
48
49
|
const roomType = roomResponse.room.roomProperties.roomType;
|
|
49
50
|
const RoomControlImpl = ROOM_CONTROL_IMPLEMENTATIONS[roomType];
|
|
@@ -55,7 +56,7 @@ export class RoomControlFactory {
|
|
|
55
56
|
const chatRoomControl = new FcrChatRoomControlImpl(scene, chatConnection, sharedCache, false);
|
|
56
57
|
|
|
57
58
|
// 创建房间控制实例
|
|
58
|
-
return new RoomControlImpl(engine, scene, apiService, config, sharedCache, chatConnection, chatRoomControl);
|
|
59
|
+
return new RoomControlImpl(engine, scene, apiService, config, sharedCache, chatConnection, chatRoomControl, monitorControl);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
/**
|
|
@@ -15,7 +15,6 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
15
15
|
import "core-js/modules/esnext.map.some.js";
|
|
16
16
|
import "core-js/modules/esnext.map.update.js";
|
|
17
17
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
18
|
-
var _ref, _ref2;
|
|
19
18
|
let _initProto, _setBackgroundColorDecs, _initProto2;
|
|
20
19
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
21
20
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -36,9 +35,9 @@ import { FcrBoardPropertiesState } from '../../whiteboard-control/type';
|
|
|
36
35
|
import { FcrBaseWhiteboardControlImpl } from '../base';
|
|
37
36
|
import { WHITEBOARD_APP_ID } from '../constant';
|
|
38
37
|
import { WHITEBOARD_HEIGHT, WHITEBOARD_WIDTH } from '../utils';
|
|
39
|
-
export class FcrWhiteboardControlImpl extends
|
|
38
|
+
export class FcrWhiteboardControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
40
39
|
static {
|
|
41
|
-
[_initProto] = _applyDecs(this, [[trace, 2, "open"], [trace, 2, "close"], [trace, 2, "active"], [trace, 2, "inactive"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [trace, 2, "getBackgroundColor"], [trace, 2, "getActivity"], [trace, 2, "getOwnerId"], [bound, 2, "_onScenePropertiesUpdated"]], [], 0, void 0,
|
|
40
|
+
[_initProto] = _applyDecs(this, [[trace, 2, "open"], [trace, 2, "close"], [trace, 2, "active"], [trace, 2, "inactive"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [trace, 2, "getBackgroundColor"], [trace, 2, "getActivity"], [trace, 2, "getOwnerId"], [bound, 2, "_onScenePropertiesUpdated"]], [], 0, void 0, FcrBaseWhiteboardControlImpl).e;
|
|
42
41
|
}
|
|
43
42
|
[(_setBackgroundColorDecs = [trace(['backgroundColor']), validateParams(stringSchema)], "logger")] = (_initProto(this), createLogger({
|
|
44
43
|
prefix: 'FcrWhiteboardControlImpl'
|
|
@@ -180,9 +179,9 @@ export class FcrWhiteboardControlImpl extends (_ref = FcrBaseWhiteboardControlIm
|
|
|
180
179
|
this.addObserver(generateLogObserver(this.logger, [['onConnectionStateUpdated', ['state']], ['onActive', ['ownerId', 'operatorUser']], ['onInactive', ['reason', 'operatorUser']], ['onBackgroundColorUpdated', ['color', 'operatorUser']]]));
|
|
181
180
|
}
|
|
182
181
|
}
|
|
183
|
-
export class FcrStandaloneWhiteboardControlImpl extends
|
|
182
|
+
export class FcrStandaloneWhiteboardControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
184
183
|
static {
|
|
185
|
-
[_initProto2] = _applyDecs(this, [[trace, 2, "open"]], [], 0, void 0,
|
|
184
|
+
[_initProto2] = _applyDecs(this, [[trace, 2, "open"]], [], 0, void 0, FcrBaseWhiteboardControlImpl).e;
|
|
186
185
|
}
|
|
187
186
|
constructor(...args) {
|
|
188
187
|
super(...args);
|
|
@@ -64,12 +64,13 @@ export class FcrRoomRouterImpl {
|
|
|
64
64
|
|
|
65
65
|
// 接口中新增一个bypass字段,在第一次调用joinRoom的时候不传,在后续收到房间切换后的joinRoom时传true
|
|
66
66
|
_bypass = undefined;
|
|
67
|
-
constructor(_rteEngine, _apiService, _config, _chatConnection, _sharedCache, roomId) {
|
|
67
|
+
constructor(_rteEngine, _apiService, _config, _chatConnection, _sharedCache, roomId, _monitorControl) {
|
|
68
68
|
this._rteEngine = _rteEngine;
|
|
69
69
|
this._apiService = _apiService;
|
|
70
70
|
this._config = _config;
|
|
71
71
|
this._chatConnection = _chatConnection;
|
|
72
72
|
this._sharedCache = _sharedCache;
|
|
73
|
+
this._monitorControl = _monitorControl;
|
|
73
74
|
this._init(roomId);
|
|
74
75
|
this._addLogObserver();
|
|
75
76
|
}
|
|
@@ -243,7 +244,8 @@ export class FcrRoomRouterImpl {
|
|
|
243
244
|
config: this._config,
|
|
244
245
|
chatConnection: this._chatConnection,
|
|
245
246
|
sharedCache: this._sharedCache,
|
|
246
|
-
roomResponse
|
|
247
|
+
roomResponse,
|
|
248
|
+
monitorControl: this._monitorControl
|
|
247
249
|
});
|
|
248
250
|
}
|
|
249
251
|
_throwIfAborted(abortController) {
|
package/lib-es/schema.js
CHANGED
|
@@ -2,7 +2,7 @@ import "core-js/modules/esnext.iterator.constructor.js";
|
|
|
2
2
|
import "core-js/modules/esnext.iterator.some.js";
|
|
3
3
|
import { FcrLanguage } from './room-control/interpreter-control/types';
|
|
4
4
|
import { FcrPermissionAction, FcrPrivilegeUserRole, FcrSecurityAction } from './room-control/privilege-control/type';
|
|
5
|
-
import { FcrIPConnectorSessionType } from './room-control/room-connector-control/type';
|
|
5
|
+
import { FcrIPConnectorSessionType, FcrPhoneConnectorSessionType } from './room-control/room-connector-control/type';
|
|
6
6
|
import { FcrUserKickedOutType, FcrUserRole } from './room-control/user-control/type';
|
|
7
7
|
import { FcrBoardToolType } from './room-control/whiteboard-control-v2/enum';
|
|
8
8
|
import { FcrChatRoomMessageType } from './room-control/chatroom-control/type';
|
|
@@ -25,6 +25,7 @@ export const fcrUserKickedOutTypeSchema = z.nativeEnum(FcrUserKickedOutType);
|
|
|
25
25
|
export const fcrBoardToolTypeSchema = z.nativeEnum(FcrBoardToolType);
|
|
26
26
|
export const fcrLanguageSchema = z.nativeEnum(FcrLanguage);
|
|
27
27
|
export const fcrIPConnectorSessionTypeSchema = z.nativeEnum(FcrIPConnectorSessionType);
|
|
28
|
+
export const fcrPhoneConnectorSessionTypeSchema = z.nativeEnum(FcrPhoneConnectorSessionType);
|
|
28
29
|
export const fcrDeviceTypeSchema = z.nativeEnum(FcrDeviceType);
|
|
29
30
|
export const fcrChatRoomMessageTypeSchema = z.nativeEnum(FcrChatRoomMessageType);
|
|
30
31
|
// Native Enum Schemas
|
|
@@ -75,7 +76,8 @@ export const fcrSecuritySendChatPayloadSchema = z.object({
|
|
|
75
76
|
export const fcrPhoneConnectorSessionParamsSchema = z.object({
|
|
76
77
|
phoneNumber: stringSchema,
|
|
77
78
|
userName: stringSchema,
|
|
78
|
-
phoneUserId: stringSchema.optional()
|
|
79
|
+
phoneUserId: stringSchema.optional(),
|
|
80
|
+
type: fcrPhoneConnectorSessionTypeSchema
|
|
79
81
|
});
|
|
80
82
|
export const fcrIPConnectorSessionParamsSchema = z.object({
|
|
81
83
|
address: stringSchema,
|
package/lib-es/service/api.js
CHANGED
|
@@ -785,10 +785,11 @@ export class FcrCoreServiceApi {
|
|
|
785
785
|
roomId,
|
|
786
786
|
userName,
|
|
787
787
|
userId,
|
|
788
|
-
callNumber
|
|
788
|
+
callNumber,
|
|
789
|
+
callType
|
|
789
790
|
}) {
|
|
790
791
|
const res = await this._client.fetch({
|
|
791
|
-
path: `/v1/rooms/${roomId}/call
|
|
792
|
+
path: `/v1/rooms/${roomId}/call/${callType}`,
|
|
792
793
|
method: 'POST',
|
|
793
794
|
data: {
|
|
794
795
|
callNumber,
|
|
@@ -1,7 +1,48 @@
|
|
|
1
1
|
import { LoggerManager } from '../imports';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export class FcrCoreLoggerManagerHolder {
|
|
3
|
+
static instance = null;
|
|
4
|
+
static isDestroying = false;
|
|
5
|
+
static label = 'fcr-core';
|
|
6
|
+
static initialize(opts) {
|
|
7
|
+
if (this.instance && !this.isDestroying) {
|
|
8
|
+
console.warn(`${this.label} LoggerManager is already initialized. Reinitializing...`);
|
|
9
|
+
}
|
|
10
|
+
this.destroy();
|
|
11
|
+
this.instance = new LoggerManager({
|
|
12
|
+
label: this.label,
|
|
13
|
+
maxSize: opts.maxSize
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
static getInstance() {
|
|
17
|
+
if (!this.instance) {
|
|
18
|
+
throw new Error(`LoggerManager is not initialized. Call ${this.label} LoggerManager.initialize() first.`);
|
|
19
|
+
}
|
|
20
|
+
return this.instance;
|
|
21
|
+
}
|
|
22
|
+
static createLogger(opts) {
|
|
23
|
+
return this.getInstance().createLogger(opts);
|
|
24
|
+
}
|
|
25
|
+
static getLogger() {
|
|
26
|
+
return this.getInstance().getLogger();
|
|
27
|
+
}
|
|
28
|
+
static generateLogObserver(logger, callbackMethods) {
|
|
29
|
+
return this.getInstance().generateLogObserver(logger, callbackMethods);
|
|
30
|
+
}
|
|
31
|
+
static destroy() {
|
|
32
|
+
if (this.instance && !this.isDestroying) {
|
|
33
|
+
this.isDestroying = true;
|
|
34
|
+
try {
|
|
35
|
+
this.instance.release();
|
|
36
|
+
} finally {
|
|
37
|
+
this.instance = null;
|
|
38
|
+
this.isDestroying = false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static isInitialized() {
|
|
43
|
+
return this.instance !== null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export const getLogger = FcrCoreLoggerManagerHolder.getLogger.bind(FcrCoreLoggerManagerHolder);
|
|
47
|
+
export const createLogger = FcrCoreLoggerManagerHolder.createLogger.bind(FcrCoreLoggerManagerHolder);
|
|
48
|
+
export const generateLogObserver = FcrCoreLoggerManagerHolder.generateLogObserver.bind(FcrCoreLoggerManagerHolder);
|
|
@@ -22,7 +22,8 @@ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
|
|
|
22
22
|
import "core-js/modules/esnext.set.symmetric-difference.js";
|
|
23
23
|
import "core-js/modules/esnext.set.union.v2.js";
|
|
24
24
|
import "core-js/modules/esnext.set.union.js";
|
|
25
|
-
import { FcrApplicationPlatform, getPlatform } from '../imports';
|
|
25
|
+
import { FcrApplicationPlatform, getPlatform, isBoolean, isNumber } from '../imports';
|
|
26
|
+
const DEFAULT_LOG_FILE_SIZE = 512;
|
|
26
27
|
export const isTrueValue = value => {
|
|
27
28
|
return value === 'true' || !!value;
|
|
28
29
|
};
|
|
@@ -95,7 +96,30 @@ const DESKTOP_COMMON_PARAMS = [
|
|
|
95
96
|
}, {
|
|
96
97
|
'che.video.lowest_dev_score_4_beauty': 0
|
|
97
98
|
}];
|
|
98
|
-
|
|
99
|
+
export const getNeedLogUpload = parameters => {
|
|
100
|
+
if (isBoolean(parameters?.core?.needLogUpload)) {
|
|
101
|
+
return parameters.core.needLogUpload;
|
|
102
|
+
}
|
|
103
|
+
return true;
|
|
104
|
+
};
|
|
105
|
+
export const getCoreLogFileSize = parameters => {
|
|
106
|
+
if (!isNumber(parameters?.core?.coreLogFileSize)) {
|
|
107
|
+
return DEFAULT_LOG_FILE_SIZE;
|
|
108
|
+
}
|
|
109
|
+
return parameters.core.coreLogFileSize;
|
|
110
|
+
};
|
|
111
|
+
export const getEasemobLogFileSize = parameters => {
|
|
112
|
+
if (!isNumber(parameters?.core?.easemobLogFileSize)) {
|
|
113
|
+
return DEFAULT_LOG_FILE_SIZE;
|
|
114
|
+
}
|
|
115
|
+
return parameters.core.easemobLogFileSize;
|
|
116
|
+
};
|
|
117
|
+
export const getNetlessLogFileSize = parameters => {
|
|
118
|
+
if (!isNumber(parameters?.core?.netlessLogFileSize)) {
|
|
119
|
+
return DEFAULT_LOG_FILE_SIZE;
|
|
120
|
+
}
|
|
121
|
+
return parameters.core.netlessLogFileSize;
|
|
122
|
+
};
|
|
99
123
|
/** desktop platforms set */
|
|
100
124
|
const DESKTOP_PLATFORMS = new Set([FcrApplicationPlatform.WINDOWS, FcrApplicationPlatform.MACOS]);
|
|
101
125
|
export const getRtcPresetParameters = () => {
|