fcr-core 3.8.2 → 3.9.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chat-connector/type.d.ts +40 -0
- package/lib/{chat-connection → chat-connector}/type.js +1 -1
- package/lib/engine/index.d.ts +10 -11
- package/lib/engine/index.js +63 -72
- package/lib/engine/type.d.ts +96 -0
- package/lib/engine/type.js +5 -0
- package/lib/imports.d.ts +7 -4
- package/lib/imports.js +30 -4
- package/lib/index.d.ts +3 -2
- package/lib/index.js +21 -2
- package/lib/media-control/desktop.js +12 -12
- package/lib/media-control/mobile.js +4 -0
- package/lib/media-control/type.d.ts +32 -33
- package/lib/monitor-control/index.js +3 -3
- package/lib/peer-session/index.js +14 -14
- package/lib/peer-session/type.d.ts +1 -1
- package/lib/plugins/chat/chatroom.js +417 -0
- package/lib/{chat-connection → plugins/chat}/config.d.ts +1 -0
- package/lib/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib/plugins/chat/connector.d.ts +38 -0
- package/lib/{chat-connection/index.js → plugins/chat/connector.js} +181 -61
- package/lib/room-control/ability-control/index.js +5 -4
- package/lib/room-control/ability-control/type.d.ts +5 -1
- package/lib/room-control/ability-control/type.js +4 -0
- package/lib/room-control/chatroom-control/type.d.ts +44 -35
- package/lib/room-control/group-control/index.js +9 -9
- package/lib/room-control/index.js +37 -22
- package/lib/room-control/interpreter-control/index.js +7 -4
- package/lib/room-control/interpreter-control/room.js +3 -3
- package/lib/room-control/interpreter-control/types.d.ts +2 -2
- package/lib/room-control/join-before-host-waitingroom-control/index.js +3 -3
- package/lib/room-control/mainroom-control/index.js +15 -13
- package/lib/room-control/privilege-control/index.js +39 -24
- package/lib/room-control/privilege-control/type.d.ts +15 -15
- package/lib/room-control/room-connector-control/index.js +7 -5
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.d.ts +3 -3
- package/lib/room-control/room-control-factory.js +7 -7
- package/lib/room-control/room-session/index.js +17 -15
- package/lib/room-control/room-session/type.d.ts +3 -3
- package/lib/room-control/sharing-control/index.js +13 -7
- package/lib/room-control/stream-control/index.js +18 -16
- package/lib/room-control/stream-control/type.d.ts +5 -5
- package/lib/room-control/stt-control/index.js +38 -31
- package/lib/room-control/type.d.ts +19 -19
- package/lib/room-control/user-control/index.js +20 -22
- package/lib/room-control/user-control/type.d.ts +1 -1
- package/lib/room-control/waitingroom-control/index.js +11 -11
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +21 -20
- package/lib/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib/room-control/whiteboard-control-v1/index.js +26 -18
- package/lib/room-control/whiteboard-control-v1/type.d.ts +26 -25
- package/lib/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +15 -6
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +4 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +6 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +7 -1
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +9 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +84 -42
- package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +16 -15
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib/room-control/whiteboard-control-v2/type.d.ts +17 -17
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +12 -6
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +64 -18
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +2 -2
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -1
- package/lib/room-router/index.js +10 -7
- package/lib/room-router/type.d.ts +1 -1
- package/lib/schema.d.ts +24 -46
- package/lib/schema.js +1 -2
- package/lib/service/api.d.ts +5 -3
- package/lib/service/api.js +17 -12
- package/lib/type.d.ts +64 -45
- package/lib/type.js +76 -11
- package/lib/utilities/abortable-retry.d.ts +38 -0
- package/lib/utilities/abortable-retry.js +61 -0
- package/lib/utilities/dual-video-stream-config.d.ts +6 -0
- package/lib/utilities/dual-video-stream-config.js +25 -0
- package/lib/utilities/error-helpers.d.ts +10 -9
- package/lib/utilities/error-helpers.js +12 -11
- package/lib/utilities/error.d.ts +4 -40
- package/lib/utilities/error.js +20 -77
- package/lib/utilities/join-helper.js +2 -2
- package/lib/utilities/logger.d.ts +2 -2
- package/lib/utilities/logger.js +6 -25
- package/lib/utilities/package-info.d.ts +1 -2
- package/lib/utilities/package-info.js +4 -8
- package/lib/utilities/parameters.js +88 -15
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.d.ts +9 -0
- package/lib/utilities/video-encoder-config.js +109 -0
- package/lib-es/{chat-connection → chat-connector}/type.js +1 -1
- package/lib-es/engine/index.js +46 -56
- package/lib-es/engine/type.js +1 -0
- package/lib-es/imports.js +5 -3
- package/lib-es/index.js +2 -1
- package/lib-es/media-control/desktop.js +12 -12
- package/lib-es/media-control/mobile.js +4 -0
- package/lib-es/monitor-control/index.js +3 -3
- package/lib-es/peer-session/index.js +16 -15
- package/lib-es/plugins/chat/chatroom.js +409 -0
- package/lib-es/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib-es/{chat-connection/index.js → plugins/chat/connector.js} +178 -58
- package/lib-es/room-control/ability-control/index.js +5 -4
- package/lib-es/room-control/ability-control/type.js +4 -0
- package/lib-es/room-control/group-control/index.js +11 -10
- package/lib-es/room-control/index.js +40 -26
- package/lib-es/room-control/interpreter-control/index.js +10 -5
- package/lib-es/room-control/interpreter-control/room.js +3 -3
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -3
- package/lib-es/room-control/mainroom-control/index.js +16 -17
- package/lib-es/room-control/privilege-control/index.js +43 -29
- package/lib-es/room-control/room-connector-control/index.js +9 -6
- package/lib-es/room-control/room-control-factory.js +6 -6
- package/lib-es/room-control/room-session/index.js +21 -22
- package/lib-es/room-control/sharing-control/index.js +13 -7
- package/lib-es/room-control/stream-control/index.js +21 -18
- package/lib-es/room-control/stt-control/index.js +23 -15
- package/lib-es/room-control/user-control/index.js +23 -23
- package/lib-es/room-control/waitingroom-control/index.js +10 -9
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib-es/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib-es/room-control/whiteboard-control-v1/index.js +26 -17
- package/lib-es/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +7 -6
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +86 -42
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +60 -13
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib-es/room-router/index.js +10 -6
- package/lib-es/schema.js +1 -2
- package/lib-es/service/api.js +17 -12
- package/lib-es/type.js +70 -18
- package/lib-es/utilities/abortable-retry.js +54 -0
- package/lib-es/utilities/dual-video-stream-config.js +19 -0
- package/lib-es/utilities/error-helpers.js +13 -12
- package/lib-es/utilities/error.js +9 -75
- package/lib-es/utilities/join-helper.js +4 -3
- package/lib-es/utilities/logger.js +7 -23
- package/lib-es/utilities/package-info.js +4 -6
- package/lib-es/utilities/parameters.js +88 -15
- package/lib-es/utilities/validate-params.js +3 -2
- package/lib-es/utilities/video-encoder-config.js +103 -0
- package/package.json +7 -7
- package/lib/chat-connection/index.d.ts +0 -24
- package/lib/chat-connection/type.d.ts +0 -17
- package/lib/plugins/chatroom.js +0 -454
- package/lib/room-control/chatroom-control/config.d.ts +0 -51
- package/lib/room-control/chatroom-control/config.js +0 -105
- package/lib/utilities/storage.d.ts +0 -8
- package/lib/utilities/storage.js +0 -33
- package/lib-es/plugins/chatroom.js +0 -446
- package/lib-es/room-control/chatroom-control/config.js +0 -100
- package/lib-es/utilities/storage.js +0 -27
- /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
package/lib/utilities/error.d.ts
CHANGED
|
@@ -1,44 +1,8 @@
|
|
|
1
|
+
import { ErrorModuleCode } from '../imports';
|
|
1
2
|
import { FcrError } from '../imports';
|
|
2
3
|
export { FcrError } from '../imports';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
SERVER = 7
|
|
6
|
-
}
|
|
7
|
-
export declare enum FcrErrorModuleCode {
|
|
8
|
-
ENGINE = 10,
|
|
9
|
-
ENGINE_PEER_SESSION = 11,
|
|
10
|
-
ROOM = 20,
|
|
11
|
-
ROOM_USER = 21,
|
|
12
|
-
ROOM_STREAM = 22,
|
|
13
|
-
ROOM_GROUP = 23,
|
|
14
|
-
ROOM_CHATROOM = 24,
|
|
15
|
-
ROOM_SESSION = 25,
|
|
16
|
-
ROOM_PRIVILEGE = 26,
|
|
17
|
-
ROOM_WHITEBOARD = 27,
|
|
18
|
-
ROOM_CONNECTOR = 28,
|
|
19
|
-
ROOM_INTERPRETER = 29,
|
|
20
|
-
MEDIA_CONTROL = 30,
|
|
21
|
-
MEDIA_CONTROL_CAMERA = 31,
|
|
22
|
-
MEDIA_CONTROL_MICROPHONE = 32,
|
|
23
|
-
MEDIA_CONTROL_LOOPBACK = 33,
|
|
24
|
-
MEDIA_CONTROL_SCREEN = 34,
|
|
25
|
-
ROOM_STT = 35,
|
|
26
|
-
MONITOR = 40,
|
|
27
|
-
ROOM_LIVE_STREAMING = 41
|
|
28
|
-
}
|
|
29
|
-
export declare enum FcrErrorCode {
|
|
30
|
-
UNDEFINED_ERROR = 1,
|
|
31
|
-
INVALID_PARAMS = 10,
|
|
32
|
-
JSON_PARSE_ERROR = 11,
|
|
33
|
-
LOCAL_HTTP_REQUEST_FAILED = 12,
|
|
34
|
-
NOT_LOGGED_IN = 13,
|
|
35
|
-
NOT_JOINED_ROOM = 14,
|
|
36
|
-
JOIN_CONFLICT = 15,
|
|
37
|
-
EXPIRED = 15
|
|
38
|
-
}
|
|
39
|
-
export declare const generateFcrCoreClientError: (module: FcrErrorModuleCode, code: number, message: string, origin?: Error) => FcrError;
|
|
4
|
+
export { DetailErrorCode as FcrErrorCode, ErrorModuleCode as FcrErrorModuleCode } from '../imports';
|
|
5
|
+
export declare const generateFcrCoreClientError: (module: ErrorModuleCode, code: number, message: string, origin?: Error) => FcrError;
|
|
40
6
|
export declare const generateFcrCoreServerError: (code: number, message: string, origin?: Error) => FcrError;
|
|
41
|
-
export declare const handleRequestError: <T extends () => Promise<any>>(action: T, errorModuleCode:
|
|
7
|
+
export declare const handleRequestError: <T extends () => Promise<any>>(action: T, errorModuleCode: ErrorModuleCode, errorMessage?: string) => Promise<Awaited<ReturnType<T>>>;
|
|
42
8
|
export declare const ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM: number[];
|
|
43
|
-
export declare const generateFcrCoreClientErrorNew: (module: FcrErrorModuleCode, code: number, message: string) => FcrError;
|
|
44
|
-
export declare const generateFcrCoreServerErrorNew: (code: number, message: string) => FcrError;
|
package/lib/utilities/error.js
CHANGED
|
@@ -10,62 +10,29 @@ Object.defineProperty(exports, "FcrError", {
|
|
|
10
10
|
return _imports.FcrError;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
Object.defineProperty(exports, "FcrErrorCode", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _imports.DetailErrorCode;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "FcrErrorModuleCode", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _imports.ErrorModuleCode;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
exports.handleRequestError = exports.generateFcrCoreServerError = exports.generateFcrCoreClientError = void 0;
|
|
14
26
|
var _imports = require("../imports");
|
|
15
|
-
|
|
16
|
-
FcrErrorCodeType[FcrErrorCodeType["CLIENT"] = 6] = "CLIENT";
|
|
17
|
-
FcrErrorCodeType[FcrErrorCodeType["SERVER"] = 7] = "SERVER";
|
|
18
|
-
return FcrErrorCodeType;
|
|
19
|
-
}({});
|
|
20
|
-
let FcrErrorModuleCode = exports.FcrErrorModuleCode = /*#__PURE__*/function (FcrErrorModuleCode) {
|
|
21
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ENGINE"] = 10] = "ENGINE";
|
|
22
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ENGINE_PEER_SESSION"] = 11] = "ENGINE_PEER_SESSION";
|
|
23
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM"] = 20] = "ROOM";
|
|
24
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_USER"] = 21] = "ROOM_USER";
|
|
25
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_STREAM"] = 22] = "ROOM_STREAM";
|
|
26
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_GROUP"] = 23] = "ROOM_GROUP";
|
|
27
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_CHATROOM"] = 24] = "ROOM_CHATROOM";
|
|
28
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_SESSION"] = 25] = "ROOM_SESSION";
|
|
29
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_PRIVILEGE"] = 26] = "ROOM_PRIVILEGE";
|
|
30
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_WHITEBOARD"] = 27] = "ROOM_WHITEBOARD";
|
|
31
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_CONNECTOR"] = 28] = "ROOM_CONNECTOR";
|
|
32
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_INTERPRETER"] = 29] = "ROOM_INTERPRETER";
|
|
33
|
-
FcrErrorModuleCode[FcrErrorModuleCode["MEDIA_CONTROL"] = 30] = "MEDIA_CONTROL";
|
|
34
|
-
FcrErrorModuleCode[FcrErrorModuleCode["MEDIA_CONTROL_CAMERA"] = 31] = "MEDIA_CONTROL_CAMERA";
|
|
35
|
-
FcrErrorModuleCode[FcrErrorModuleCode["MEDIA_CONTROL_MICROPHONE"] = 32] = "MEDIA_CONTROL_MICROPHONE";
|
|
36
|
-
FcrErrorModuleCode[FcrErrorModuleCode["MEDIA_CONTROL_LOOPBACK"] = 33] = "MEDIA_CONTROL_LOOPBACK";
|
|
37
|
-
FcrErrorModuleCode[FcrErrorModuleCode["MEDIA_CONTROL_SCREEN"] = 34] = "MEDIA_CONTROL_SCREEN";
|
|
38
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_STT"] = 35] = "ROOM_STT";
|
|
39
|
-
FcrErrorModuleCode[FcrErrorModuleCode["MONITOR"] = 40] = "MONITOR";
|
|
40
|
-
FcrErrorModuleCode[FcrErrorModuleCode["ROOM_LIVE_STREAMING"] = 41] = "ROOM_LIVE_STREAMING";
|
|
41
|
-
return FcrErrorModuleCode;
|
|
42
|
-
}({});
|
|
43
|
-
let FcrErrorCode = exports.FcrErrorCode = /*#__PURE__*/function (FcrErrorCode) {
|
|
44
|
-
FcrErrorCode[FcrErrorCode["UNDEFINED_ERROR"] = 1] = "UNDEFINED_ERROR";
|
|
45
|
-
FcrErrorCode[FcrErrorCode["INVALID_PARAMS"] = 10] = "INVALID_PARAMS";
|
|
46
|
-
FcrErrorCode[FcrErrorCode["JSON_PARSE_ERROR"] = 11] = "JSON_PARSE_ERROR";
|
|
47
|
-
FcrErrorCode[FcrErrorCode["LOCAL_HTTP_REQUEST_FAILED"] = 12] = "LOCAL_HTTP_REQUEST_FAILED";
|
|
48
|
-
FcrErrorCode[FcrErrorCode["NOT_LOGGED_IN"] = 13] = "NOT_LOGGED_IN";
|
|
49
|
-
FcrErrorCode[FcrErrorCode["NOT_JOINED_ROOM"] = 14] = "NOT_JOINED_ROOM";
|
|
50
|
-
FcrErrorCode[FcrErrorCode["JOIN_CONFLICT"] = 15] = "JOIN_CONFLICT";
|
|
51
|
-
FcrErrorCode[FcrErrorCode["EXPIRED"] = 15] = "EXPIRED";
|
|
52
|
-
return FcrErrorCode;
|
|
53
|
-
}({}); // helpers
|
|
54
|
-
const generateFcrCoreClientError = (module, code, message, origin) => {
|
|
55
|
-
const errorType = (0, _imports.padEnd)(String(FcrErrorCodeType.CLIENT), 3, '0'); // 如:'100'
|
|
56
|
-
const moduleCode = (0, _imports.padStart)(String(module), 3, '0'); // 如:'020'
|
|
57
|
-
const errorCode = (0, _imports.padStart)(String(code), 3, '0'); // 如:'001'
|
|
58
|
-
const fullErrorCode = Number(`${errorType}${moduleCode}${errorCode}`); // 如:'100020001'
|
|
27
|
+
// Export aliases for compatibility
|
|
59
28
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
message: errorMessage
|
|
64
|
-
});
|
|
29
|
+
// helpers
|
|
30
|
+
const generateFcrCoreClientError = (module, code, message, origin) => {
|
|
31
|
+
return _imports.FcrError.create(_imports.ErrorServiceType.FCR_CLIENT, module, code, message, origin);
|
|
65
32
|
};
|
|
66
33
|
exports.generateFcrCoreClientError = generateFcrCoreClientError;
|
|
67
34
|
const generateFcrCoreServerError = (code, message, origin) => {
|
|
68
|
-
const errorCode = Number(`${
|
|
35
|
+
const errorCode = Number(`${_imports.ErrorServiceType.FCR_SERVER}${(0, _imports.padStart)(String(code), 8, '0')}`);
|
|
69
36
|
const error = new _imports.FcrError({
|
|
70
37
|
message: message,
|
|
71
38
|
code: errorCode
|
|
@@ -83,7 +50,7 @@ const handleRequestError = async (action, errorModuleCode, errorMessage) => {
|
|
|
83
50
|
throw generateFcrCoreServerError(e.serviceCode ?? -1, e.message, e);
|
|
84
51
|
}
|
|
85
52
|
const error = e;
|
|
86
|
-
throw generateFcrCoreClientError(errorModuleCode,
|
|
53
|
+
throw generateFcrCoreClientError(errorModuleCode, _imports.DetailErrorCode.UNDEFINED_ERROR, errorMessage ?? error.message, error);
|
|
87
54
|
}
|
|
88
55
|
};
|
|
89
56
|
|
|
@@ -97,28 +64,4 @@ const handleRequestError = async (action, errorModuleCode, errorMessage) => {
|
|
|
97
64
|
// 730403100 // 被永久踢出房间
|
|
98
65
|
// error codes that cannot be retried when joining a room
|
|
99
66
|
exports.handleRequestError = handleRequestError;
|
|
100
|
-
const ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM = exports.ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM = [720410100, 720404100, 732403100, 732403101, 100050051, 300000010, 400000010, 730403100];
|
|
101
|
-
|
|
102
|
-
// New
|
|
103
|
-
const generateFcrCoreClientErrorNew = (module, code, message) => {
|
|
104
|
-
const errorType = (0, _imports.padEnd)(String(FcrErrorCodeType.CLIENT), 3, '0'); // 如:'100'
|
|
105
|
-
const moduleCode = (0, _imports.padStart)(String(module), 3, '0'); // 如:'020'
|
|
106
|
-
const errorCode = (0, _imports.padStart)(String(code), 3, '0'); // 如:'001'
|
|
107
|
-
const fullErrorCode = Number(`${errorType}${moduleCode}${errorCode}`); // 如:'100020001'
|
|
108
|
-
|
|
109
|
-
const errorMessage = `domain: RTE-CLIENT, info: ${message}`;
|
|
110
|
-
return new _imports.FcrError({
|
|
111
|
-
code: fullErrorCode,
|
|
112
|
-
message: errorMessage
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
exports.generateFcrCoreClientErrorNew = generateFcrCoreClientErrorNew;
|
|
116
|
-
const generateFcrCoreServerErrorNew = (code, message) => {
|
|
117
|
-
const errorCode = Number(`${FcrErrorCodeType.SERVER}${(0, _imports.padStart)(String(code), 8, '0')}`);
|
|
118
|
-
const error = new _imports.FcrError({
|
|
119
|
-
message: message,
|
|
120
|
-
code: errorCode
|
|
121
|
-
});
|
|
122
|
-
return error;
|
|
123
|
-
};
|
|
124
|
-
exports.generateFcrCoreServerErrorNew = generateFcrCoreServerErrorNew;
|
|
67
|
+
const ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM = exports.ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM = [720410100, 720404100, 732403100, 732403101, 100050051, 300000010, 400000010, 730403100];
|
|
@@ -121,7 +121,7 @@ class FcrJoinHelper {
|
|
|
121
121
|
const checkInParams = this._buildCheckInParams(options, extraParams);
|
|
122
122
|
const apiCall = useInternalApi ? () => this._api.checkInInternal(checkInParams) : () => this._api.checkIn(checkInParams);
|
|
123
123
|
const errorMessage = useInternalApi ? 'check in internal failed' : 'check in failed';
|
|
124
|
-
const res = await (0, _error.handleRequestError)(apiCall,
|
|
124
|
+
const res = await (0, _error.handleRequestError)(apiCall, _imports.ErrorModuleCode.FCR_ROOM, errorMessage);
|
|
125
125
|
return res;
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -174,7 +174,7 @@ class FcrJoinHelper {
|
|
|
174
174
|
* @private
|
|
175
175
|
*/
|
|
176
176
|
async _joinScene(streamLatency, streamEncryptionConfig, snapshot, timestamp, onJoinAborted) {
|
|
177
|
-
await this._scene.
|
|
177
|
+
await this._scene.joinWithSnapshot({
|
|
178
178
|
streamLatency: streamLatency,
|
|
179
179
|
streamEncryptionConfig,
|
|
180
180
|
snapshot,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getLogger as _getLogger } from '../imports';
|
|
2
1
|
export declare const getLogger: () => import("agora-foundation/lib/logger/type").Logger;
|
|
3
2
|
export declare const createLogger: (opts: {
|
|
4
3
|
prefix: string;
|
|
4
|
+
database?: boolean;
|
|
5
5
|
}) => import("agora-foundation/lib/logger/type").Logger;
|
|
6
|
-
export declare const generateLogObserver: <T>(logger:
|
|
6
|
+
export declare const generateLogObserver: <T>(logger: import("agora-foundation/lib/logger/type").Logger, callbackMethods: (keyof T | [keyof T, string[]])[]) => T;
|
package/lib/utilities/logger.js
CHANGED
|
@@ -4,29 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getLogger = exports.generateLogObserver = exports.createLogger = void 0;
|
|
7
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
9
7
|
var _imports = require("../imports");
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.
|
|
16
|
-
const createLogger = opts => {
|
|
17
|
-
return (0, _imports.createLogger)({
|
|
18
|
-
label: 'fcr-core',
|
|
19
|
-
prefix: `${opts.prefix}@${(0, _imports.randomString)(5)}`
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
exports.createLogger = createLogger;
|
|
23
|
-
const generateLogObserver = (logger, callbackMethods) => {
|
|
24
|
-
const observer = {};
|
|
25
|
-
callbackMethods.forEach(method => {
|
|
26
|
-
observer[method] = (...args) => {
|
|
27
|
-
logger.info(`[API Callback] ${method} [parameters: ${(0, _imports.serializeArgs)(args)}]`);
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
return observer;
|
|
31
|
-
};
|
|
32
|
-
exports.generateLogObserver = generateLogObserver;
|
|
8
|
+
const loggerManager = new _imports.LoggerManager({
|
|
9
|
+
label: 'fcr-core'
|
|
10
|
+
});
|
|
11
|
+
const getLogger = exports.getLogger = loggerManager.getLogger.bind(loggerManager);
|
|
12
|
+
const createLogger = exports.createLogger = loggerManager.createLogger.bind(loggerManager);
|
|
13
|
+
const generateLogObserver = exports.generateLogObserver = loggerManager.generateLogObserver.bind(loggerManager);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import packageInfo from '../../package.json';
|
|
2
1
|
export declare const getVersion: () => string;
|
|
3
|
-
export declare const getDependenciesInfo: (packageName:
|
|
2
|
+
export declare const getDependenciesInfo: (packageName: string) => string;
|
|
@@ -6,11 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getVersion = exports.getDependenciesInfo = void 0;
|
|
8
8
|
var _package = _interopRequireDefault(require("../../package.json"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.
|
|
13
|
-
const getDependenciesInfo = packageName => {
|
|
14
|
-
return _package.default.dependencies[packageName];
|
|
15
|
-
};
|
|
16
|
-
exports.getDependenciesInfo = getDependenciesInfo;
|
|
9
|
+
var _packageInfo = require("agora-foundation/lib/utilities/package-info");
|
|
10
|
+
const packageInfoObj = new _packageInfo.PackageInfo(_package.default);
|
|
11
|
+
const getVersion = exports.getVersion = packageInfoObj.getVersion.bind(packageInfoObj);
|
|
12
|
+
const getDependenciesInfo = exports.getDependenciesInfo = packageInfoObj.getDependenciesInfo.bind(packageInfoObj);
|
|
@@ -4,7 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isTrueValue = exports.isEndpointRegionDisabled = exports.getRtcPresetParameters = exports.getEasemobRestIpList = exports.getEasemobChatIpList = exports.getCoreIpList = void 0;
|
|
7
|
-
require("core-js/modules/es.
|
|
7
|
+
require("core-js/modules/es.json.stringify.js");
|
|
8
|
+
require("core-js/modules/esnext.set.add-all.js");
|
|
9
|
+
require("core-js/modules/esnext.set.delete-all.js");
|
|
10
|
+
require("core-js/modules/esnext.set.difference.v2.js");
|
|
11
|
+
require("core-js/modules/esnext.set.difference.js");
|
|
12
|
+
require("core-js/modules/esnext.set.every.js");
|
|
13
|
+
require("core-js/modules/esnext.set.filter.js");
|
|
14
|
+
require("core-js/modules/esnext.set.find.js");
|
|
15
|
+
require("core-js/modules/esnext.set.intersection.v2.js");
|
|
16
|
+
require("core-js/modules/esnext.set.intersection.js");
|
|
17
|
+
require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
|
|
18
|
+
require("core-js/modules/esnext.set.is-disjoint-from.js");
|
|
19
|
+
require("core-js/modules/esnext.set.is-subset-of.v2.js");
|
|
20
|
+
require("core-js/modules/esnext.set.is-subset-of.js");
|
|
21
|
+
require("core-js/modules/esnext.set.is-superset-of.v2.js");
|
|
22
|
+
require("core-js/modules/esnext.set.is-superset-of.js");
|
|
23
|
+
require("core-js/modules/esnext.set.join.js");
|
|
24
|
+
require("core-js/modules/esnext.set.map.js");
|
|
25
|
+
require("core-js/modules/esnext.set.reduce.js");
|
|
26
|
+
require("core-js/modules/esnext.set.some.js");
|
|
27
|
+
require("core-js/modules/esnext.set.symmetric-difference.v2.js");
|
|
28
|
+
require("core-js/modules/esnext.set.symmetric-difference.js");
|
|
29
|
+
require("core-js/modules/esnext.set.union.v2.js");
|
|
30
|
+
require("core-js/modules/esnext.set.union.js");
|
|
8
31
|
var _imports = require("../imports");
|
|
9
32
|
const isTrueValue = value => {
|
|
10
33
|
return value === 'true' || !!value;
|
|
@@ -25,21 +48,71 @@ exports.getEasemobRestIpList = getEasemobRestIpList;
|
|
|
25
48
|
const isEndpointRegionDisabled = parameters => {
|
|
26
49
|
return isTrueValue(parameters?.core?.disableEndpointRegion);
|
|
27
50
|
};
|
|
51
|
+
|
|
52
|
+
/** RTC preset parameters configuration mapping table */
|
|
28
53
|
exports.isEndpointRegionDisabled = isEndpointRegionDisabled;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
const RTC_PRESET_PARAMS_MAP = {
|
|
55
|
+
[_imports.FcrApplicationPlatform.WINDOWS]: [{
|
|
56
|
+
'rtc.video.default_hw_decoder_thres': 921600
|
|
57
|
+
}],
|
|
58
|
+
[_imports.FcrApplicationPlatform.MACOS]: [{
|
|
59
|
+
'che.video.screenCaptureMode': 1
|
|
60
|
+
}, {
|
|
61
|
+
'che.video.screen_disable_frame_transparent_check': true
|
|
62
|
+
}],
|
|
63
|
+
[_imports.FcrApplicationPlatform.WEB_DESKTOP]: [{
|
|
64
|
+
RESTRICTION_SET_PLAYBACK_DEVICE: false
|
|
65
|
+
}]
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** desktop common parameters */
|
|
69
|
+
const DESKTOP_COMMON_PARAMS = [
|
|
70
|
+
// audio parameters settings
|
|
71
|
+
{
|
|
72
|
+
'che.audio.bitrate_level': 1
|
|
73
|
+
}, {
|
|
74
|
+
'che.audio.reset_apm_capture_state_for_microphone_track': false
|
|
75
|
+
},
|
|
76
|
+
// video parameters settings
|
|
77
|
+
{
|
|
78
|
+
'rtc.video.color_space_enable': true
|
|
79
|
+
}, {
|
|
80
|
+
'rtc.video.videoFullrange': 1
|
|
81
|
+
}, {
|
|
82
|
+
'rtc.video.matrixCoefficients': 5
|
|
83
|
+
}, {
|
|
84
|
+
'rtc.video.new_complexity': true
|
|
85
|
+
}, {
|
|
86
|
+
'rtc.video.default_complexity': 1027
|
|
87
|
+
}, {
|
|
88
|
+
'che.video.videoCodecIndex': 1
|
|
89
|
+
}, {
|
|
90
|
+
'rtc.video.low_stream_enable_hw_encoder': true
|
|
91
|
+
}, {
|
|
92
|
+
'rtc.video.enable_doc_screen_share_sr': true
|
|
93
|
+
}, {
|
|
94
|
+
'rtc.video.enable_pvc': false
|
|
95
|
+
}, {
|
|
96
|
+
'rtc.video.enable_sr': {
|
|
97
|
+
enabled: false,
|
|
98
|
+
mode: 2
|
|
42
99
|
}
|
|
43
|
-
|
|
100
|
+
}, {
|
|
101
|
+
'che.video.brightness_detection_enable': false
|
|
102
|
+
}, {
|
|
103
|
+
'che.video.lowest_dev_score_4_seg': 0
|
|
104
|
+
}, {
|
|
105
|
+
'rtc.video.downMaxRetryTimes': 5
|
|
106
|
+
}, {
|
|
107
|
+
'che.video.lowest_dev_score_4_beauty': 0
|
|
108
|
+
}];
|
|
109
|
+
|
|
110
|
+
/** desktop platforms set */
|
|
111
|
+
const DESKTOP_PLATFORMS = new Set([_imports.FcrApplicationPlatform.WINDOWS, _imports.FcrApplicationPlatform.MACOS]);
|
|
112
|
+
const getRtcPresetParameters = () => {
|
|
113
|
+
const platform = (0, _imports.getPlatform)();
|
|
114
|
+
const platformParams = RTC_PRESET_PARAMS_MAP[platform] ?? [];
|
|
115
|
+
const desktopParams = DESKTOP_PLATFORMS.has(platform) ? DESKTOP_COMMON_PARAMS : [];
|
|
116
|
+
return [...platformParams, ...desktopParams].map(p => JSON.stringify(p));
|
|
44
117
|
};
|
|
45
118
|
exports.getRtcPresetParameters = getRtcPresetParameters;
|
|
@@ -9,5 +9,5 @@ var _error = require("./error");
|
|
|
9
9
|
var _default = exports.default = (0, _imports.validateParams)(error => {
|
|
10
10
|
const message = `invalid params: ${error.message}`;
|
|
11
11
|
const fcrErrorModuleCode = '00';
|
|
12
|
-
return (0, _error.generateFcrCoreClientError)(fcrErrorModuleCode,
|
|
12
|
+
return (0, _error.generateFcrCoreClientError)(fcrErrorModuleCode, _imports.DetailErrorCode.INVALID_PARAMS, message);
|
|
13
13
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AgoraRteVideoEncoderConfig } from '../imports';
|
|
2
|
+
export type FcrVideoEncoderConfig = AgoraRteVideoEncoderConfig;
|
|
3
|
+
export declare namespace FcrVideoEncoderConfig {
|
|
4
|
+
function createDefaultHighCameraConfig(): FcrVideoEncoderConfig;
|
|
5
|
+
function createDefaultLowCameraConfig(): FcrVideoEncoderConfig;
|
|
6
|
+
function createDefaultFullHighCameraConfig(): FcrVideoEncoderConfig;
|
|
7
|
+
function createDefaultClarityScreenConfig(): FcrVideoEncoderConfig;
|
|
8
|
+
function createDefaultSmoothScreenConfig(): FcrVideoEncoderConfig;
|
|
9
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FcrVideoEncoderConfig = void 0;
|
|
7
|
+
var _imports = require("../imports");
|
|
8
|
+
const COMMON_HIGH_CAMERA_CONFIG = {
|
|
9
|
+
dimensions: {
|
|
10
|
+
width: 1280,
|
|
11
|
+
height: 720
|
|
12
|
+
},
|
|
13
|
+
bitrate: 1250,
|
|
14
|
+
frameRate: 24
|
|
15
|
+
};
|
|
16
|
+
const COMMON_LOW_CAMERA_CONFIG = {
|
|
17
|
+
dimensions: {
|
|
18
|
+
width: 480,
|
|
19
|
+
height: 270
|
|
20
|
+
},
|
|
21
|
+
bitrate: 350,
|
|
22
|
+
frameRate: 15
|
|
23
|
+
};
|
|
24
|
+
const COMMON_FULL_HIGH_CAMERA_CONFIG = {
|
|
25
|
+
dimensions: {
|
|
26
|
+
width: 1920,
|
|
27
|
+
height: 1080
|
|
28
|
+
},
|
|
29
|
+
bitrate: 2500,
|
|
30
|
+
frameRate: 20
|
|
31
|
+
};
|
|
32
|
+
const COMMON_CLARITY_SCREEN_CONFIG = {
|
|
33
|
+
dimensions: {
|
|
34
|
+
width: 1920,
|
|
35
|
+
height: 1080
|
|
36
|
+
},
|
|
37
|
+
bitrate: 1500,
|
|
38
|
+
frameRate: 15
|
|
39
|
+
};
|
|
40
|
+
const COMMON_SMOOTH_SCREEN_CONFIG = {
|
|
41
|
+
dimensions: {
|
|
42
|
+
width: 1920,
|
|
43
|
+
height: 1080
|
|
44
|
+
},
|
|
45
|
+
bitrate: 1500,
|
|
46
|
+
frameRate: 30
|
|
47
|
+
};
|
|
48
|
+
const MOBILE_HIGH_CAMERA_CONFIG = {
|
|
49
|
+
dimensions: {
|
|
50
|
+
width: 960,
|
|
51
|
+
height: 540
|
|
52
|
+
},
|
|
53
|
+
bitrate: 1000,
|
|
54
|
+
frameRate: 24
|
|
55
|
+
};
|
|
56
|
+
const HIGH_CAMERA_CONFIG_MAP = {
|
|
57
|
+
[_imports.FcrApplicationPlatform.HARMONY]: MOBILE_HIGH_CAMERA_CONFIG,
|
|
58
|
+
[_imports.FcrApplicationPlatform.WEB_MOBILE]: MOBILE_HIGH_CAMERA_CONFIG
|
|
59
|
+
};
|
|
60
|
+
const LOW_CAMERA_CONFIG_MAP = {};
|
|
61
|
+
const FULL_HIGH_CAMERA_CONFIG_MAP = {};
|
|
62
|
+
const CLARITY_SCREEN_CONFIG_MAP = {
|
|
63
|
+
[_imports.FcrApplicationPlatform.WEB_DESKTOP]: {
|
|
64
|
+
dimensions: {
|
|
65
|
+
width: 1920,
|
|
66
|
+
height: 1080
|
|
67
|
+
},
|
|
68
|
+
bitrate: 1950,
|
|
69
|
+
frameRate: 15
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const SMOOTH_SCREEN_CONFIG_MAP = {
|
|
73
|
+
[_imports.FcrApplicationPlatform.WEB_DESKTOP]: {
|
|
74
|
+
dimensions: {
|
|
75
|
+
width: 1920,
|
|
76
|
+
height: 1080
|
|
77
|
+
},
|
|
78
|
+
bitrate: 1950,
|
|
79
|
+
frameRate: 30
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
let FcrVideoEncoderConfig = exports.FcrVideoEncoderConfig = void 0;
|
|
83
|
+
(function (_FcrVideoEncoderConfig) {
|
|
84
|
+
function createDefaultHighCameraConfig() {
|
|
85
|
+
const platform = (0, _imports.getPlatform)();
|
|
86
|
+
return HIGH_CAMERA_CONFIG_MAP[platform] ?? COMMON_HIGH_CAMERA_CONFIG;
|
|
87
|
+
}
|
|
88
|
+
_FcrVideoEncoderConfig.createDefaultHighCameraConfig = createDefaultHighCameraConfig;
|
|
89
|
+
function createDefaultLowCameraConfig() {
|
|
90
|
+
const platform = (0, _imports.getPlatform)();
|
|
91
|
+
return LOW_CAMERA_CONFIG_MAP[platform] ?? COMMON_LOW_CAMERA_CONFIG;
|
|
92
|
+
}
|
|
93
|
+
_FcrVideoEncoderConfig.createDefaultLowCameraConfig = createDefaultLowCameraConfig;
|
|
94
|
+
function createDefaultFullHighCameraConfig() {
|
|
95
|
+
const platform = (0, _imports.getPlatform)();
|
|
96
|
+
return FULL_HIGH_CAMERA_CONFIG_MAP[platform] ?? COMMON_FULL_HIGH_CAMERA_CONFIG;
|
|
97
|
+
}
|
|
98
|
+
_FcrVideoEncoderConfig.createDefaultFullHighCameraConfig = createDefaultFullHighCameraConfig;
|
|
99
|
+
function createDefaultClarityScreenConfig() {
|
|
100
|
+
const platform = (0, _imports.getPlatform)();
|
|
101
|
+
return CLARITY_SCREEN_CONFIG_MAP[platform] ?? COMMON_CLARITY_SCREEN_CONFIG;
|
|
102
|
+
}
|
|
103
|
+
_FcrVideoEncoderConfig.createDefaultClarityScreenConfig = createDefaultClarityScreenConfig;
|
|
104
|
+
function createDefaultSmoothScreenConfig() {
|
|
105
|
+
const platform = (0, _imports.getPlatform)();
|
|
106
|
+
return SMOOTH_SCREEN_CONFIG_MAP[platform] ?? COMMON_SMOOTH_SCREEN_CONFIG;
|
|
107
|
+
}
|
|
108
|
+
_FcrVideoEncoderConfig.createDefaultSmoothScreenConfig = createDefaultSmoothScreenConfig;
|
|
109
|
+
})(FcrVideoEncoderConfig || (exports.FcrVideoEncoderConfig = FcrVideoEncoderConfig = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export let FcrChatConnectionState = /*#__PURE__*/function (FcrChatConnectionState) {
|
|
2
2
|
FcrChatConnectionState[FcrChatConnectionState["DISCONNECTED"] = 0] = "DISCONNECTED";
|
|
3
|
-
FcrChatConnectionState[FcrChatConnectionState["
|
|
3
|
+
FcrChatConnectionState[FcrChatConnectionState["CONNECTING"] = 1] = "CONNECTING";
|
|
4
4
|
FcrChatConnectionState[FcrChatConnectionState["CONNECTED"] = 2] = "CONNECTED";
|
|
5
5
|
return FcrChatConnectionState;
|
|
6
6
|
}({});
|