fcr-core 3.8.1 → 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/{room-control/chatroom-control → 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/base-session.js +1 -0
- package/lib-es/chat-connector/type.js +6 -0
- package/lib-es/engine/index.js +412 -0
- package/lib-es/engine/type.js +1 -0
- package/lib-es/imports.js +59 -0
- package/lib-es/index.js +8 -0
- package/lib-es/media-control/desktop.js +172 -0
- package/lib-es/media-control/mobile.js +198 -0
- package/lib-es/media-control/type.js +6 -0
- package/lib-es/monitor-control/index.js +46 -0
- package/lib-es/monitor-control/type.js +1 -0
- package/lib-es/peer-session/index.js +279 -0
- package/lib-es/peer-session/type.js +1 -0
- package/lib-es/plugins/chat/chatroom.js +409 -0
- package/{lib/chat-connection → lib-es/plugins/chat}/config.js +5 -9
- package/lib-es/plugins/chat/connector.js +269 -0
- package/lib-es/plugins/electron-rtc-plugin.js +1 -0
- package/lib-es/plugins/rtm-plugin.js +1 -0
- package/lib-es/plugins/web-rtc-plugin.js +1 -0
- package/lib-es/room-control/ability-control/index.js +58 -0
- package/lib-es/room-control/ability-control/type.js +15 -0
- package/lib-es/room-control/chatroom-control/type.js +12 -0
- package/lib-es/room-control/group-control/index.js +256 -0
- package/lib-es/room-control/helpers/constants.js +92 -0
- package/lib-es/room-control/helpers/index.js +20 -0
- package/lib-es/room-control/helpers/validation-helper.js +46 -0
- package/lib-es/room-control/index.js +623 -0
- package/lib-es/room-control/interpreter-control/index.js +172 -0
- package/lib-es/room-control/interpreter-control/room.js +28 -0
- package/lib-es/room-control/interpreter-control/types.js +26 -0
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +29 -0
- package/lib-es/room-control/mainroom-control/index.js +248 -0
- package/lib-es/room-control/privilege-control/helper.js +97 -0
- package/lib-es/room-control/privilege-control/index.js +339 -0
- package/lib-es/room-control/privilege-control/type.js +159 -0
- package/lib-es/room-control/room-connector-control/index.js +182 -0
- package/lib-es/room-control/room-connector-control/type.js +28 -0
- package/lib-es/room-control/room-control-factory.js +77 -0
- package/lib-es/room-control/room-session/index.js +292 -0
- package/lib-es/room-control/room-session/type.js +1 -0
- package/lib-es/room-control/shared-cache.js +47 -0
- package/lib-es/room-control/sharing-control/index.js +307 -0
- package/lib-es/room-control/sharing-control/type.js +16 -0
- package/lib-es/room-control/stream-control/index.js +536 -0
- package/lib-es/room-control/stream-control/type.js +1 -0
- package/lib-es/room-control/stt-control/de-compress-gzip.js +33 -0
- package/lib-es/room-control/stt-control/index.js +350 -0
- package/lib-es/room-control/stt-control/type.js +10 -0
- package/lib-es/room-control/type.js +30 -0
- package/lib-es/room-control/user-control/index.js +344 -0
- package/lib-es/room-control/user-control/type.js +21 -0
- package/lib-es/room-control/waitingroom-control/index.js +68 -0
- package/lib-es/room-control/whiteboard-control/enum.js +18 -0
- package/lib-es/room-control/whiteboard-control/type.js +10 -0
- package/lib-es/room-control/whiteboard-control/utils.js +13 -0
- package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +18 -0
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +573 -0
- package/lib-es/room-control/whiteboard-control-v1/enum.js +157 -0
- package/lib-es/room-control/whiteboard-control-v1/factory.js +12 -0
- package/lib-es/room-control/whiteboard-control-v1/index.js +427 -0
- package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +6 -0
- package/lib-es/room-control/whiteboard-control-v1/type.js +8 -0
- package/lib-es/room-control/whiteboard-control-v1/utils.js +273 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +76 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +37 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/type.js +1 -0
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +347 -0
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +269 -0
- package/lib-es/room-control/whiteboard-control-v2/constant.js +9 -0
- package/lib-es/room-control/whiteboard-control-v2/enum.js +28 -0
- package/lib-es/room-control/whiteboard-control-v2/type.js +1 -0
- package/lib-es/room-control/whiteboard-control-v2/utils.js +92 -0
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +204 -0
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +61 -0
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/type.js +1 -0
- package/lib-es/room-router/index.js +263 -0
- package/lib-es/room-router/type.js +5 -0
- package/lib-es/schema.js +231 -0
- package/lib-es/service/api.js +1211 -0
- package/lib-es/service/type.js +1 -0
- package/lib-es/type.js +222 -0
- package/lib-es/utilities/abortable-retry.js +54 -0
- package/lib-es/utilities/cmd.js +1 -0
- package/lib-es/utilities/collection.js +64 -0
- package/lib-es/utilities/dual-video-stream-config.js +19 -0
- package/lib-es/utilities/error-helpers.js +224 -0
- package/lib-es/utilities/error.js +43 -0
- package/lib-es/utilities/join-helper.js +219 -0
- package/lib-es/utilities/logger.js +7 -0
- package/lib-es/utilities/package-info.js +5 -0
- package/lib-es/utilities/parameters.js +106 -0
- package/lib-es/utilities/retry-helpers.js +66 -0
- package/lib-es/utilities/shared-storage.js +31 -0
- package/lib-es/utilities/stream.js +18 -0
- package/lib-es/utilities/user.js +30 -0
- package/lib-es/utilities/validate-params.js +8 -0
- package/lib-es/utilities/video-encoder-config.js +103 -0
- package/package.json +11 -10
- 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/utilities/storage.d.ts +0 -8
- package/lib/utilities/storage.js +0 -33
- /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface FcrChatConnector {
|
|
2
|
+
/**
|
|
3
|
+
* Logs in to chat service
|
|
4
|
+
*/
|
|
5
|
+
login(): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Logs out from chat service
|
|
8
|
+
*/
|
|
9
|
+
logout(): number;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the connection state
|
|
12
|
+
*/
|
|
13
|
+
getConnectionState(): FcrChatConnectionState;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the chat connection instance
|
|
16
|
+
*/
|
|
17
|
+
getConnectionInstance(): unknown;
|
|
18
|
+
/**
|
|
19
|
+
* Adds an observer
|
|
20
|
+
* @param observer
|
|
21
|
+
*/
|
|
22
|
+
addObserver(observer: FcrChatConnectionObserver): void;
|
|
23
|
+
/**
|
|
24
|
+
* Removes an observer
|
|
25
|
+
* @param observer
|
|
26
|
+
*/
|
|
27
|
+
removeObserver(observer: FcrChatConnectionObserver): void;
|
|
28
|
+
}
|
|
29
|
+
export interface FcrChatConnectionObserver {
|
|
30
|
+
/**
|
|
31
|
+
* Called when connection state is updated
|
|
32
|
+
* @param state
|
|
33
|
+
*/
|
|
34
|
+
onConnectionStateUpdated(state: FcrChatConnectionState): void;
|
|
35
|
+
}
|
|
36
|
+
export declare enum FcrChatConnectionState {
|
|
37
|
+
DISCONNECTED = 0,
|
|
38
|
+
CONNECTING = 1,
|
|
39
|
+
CONNECTED = 2
|
|
40
|
+
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.FcrChatConnectionState = void 0;
|
|
7
7
|
let FcrChatConnectionState = exports.FcrChatConnectionState = /*#__PURE__*/function (FcrChatConnectionState) {
|
|
8
8
|
FcrChatConnectionState[FcrChatConnectionState["DISCONNECTED"] = 0] = "DISCONNECTED";
|
|
9
|
-
FcrChatConnectionState[FcrChatConnectionState["
|
|
9
|
+
FcrChatConnectionState[FcrChatConnectionState["CONNECTING"] = 1] = "CONNECTING";
|
|
10
10
|
FcrChatConnectionState[FcrChatConnectionState["CONNECTED"] = 2] = "CONNECTED";
|
|
11
11
|
return FcrChatConnectionState;
|
|
12
12
|
}({});
|
package/lib/engine/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { FcrCoreEngineConfig
|
|
2
|
-
import { FcrMainRoomControl, FcrRoomJoinOptions, FcrWaitingRoomControl } from '../room-control/type';
|
|
3
|
-
import { FcrPeerSessionControl } from '../peer-session/type';
|
|
4
|
-
import { FcrMonitorControl } from '../monitor-control/type';
|
|
1
|
+
import { FcrCoreEngineConfig } from '..';
|
|
5
2
|
import { FcrDesktopMediaControl, FcrMobileMediaControl } from '../media-control/type';
|
|
3
|
+
import { FcrMonitorControl } from '../monitor-control/type';
|
|
4
|
+
import { FcrMainRoomControl, FcrRoomJoinOptions, FcrWaitingRoomControl } from '../room-control/type';
|
|
6
5
|
import { FcrRoomRouter } from '../room-router/type';
|
|
7
|
-
|
|
6
|
+
import { FcrCoreEngine, FcrCoreEngineObserver, FcrPeerSessionControl } from '../type';
|
|
7
|
+
import { Unknown } from '../imports';
|
|
8
|
+
export declare class FcrCoreEngineImpl implements FcrCoreEngine {
|
|
8
9
|
constructor(config: FcrCoreEngineConfig);
|
|
9
10
|
/**
|
|
10
11
|
* Releases the engine and all its resources.
|
|
11
12
|
*/
|
|
12
|
-
release():
|
|
13
|
+
release(): number;
|
|
13
14
|
/**
|
|
14
15
|
* Logins to the RTE service.
|
|
15
16
|
*/
|
|
@@ -22,7 +23,7 @@ export declare class FcrCoreEngine {
|
|
|
22
23
|
* Renews the user token.
|
|
23
24
|
* @param token
|
|
24
25
|
*/
|
|
25
|
-
renewUserToken(token: string):
|
|
26
|
+
renewUserToken(token: string): Promise<number>;
|
|
26
27
|
/**
|
|
27
28
|
* Gets the version of the SDK.
|
|
28
29
|
* @returns The version of the SDK.
|
|
@@ -79,12 +80,12 @@ export declare class FcrCoreEngine {
|
|
|
79
80
|
* @param guaranteedDelivery
|
|
80
81
|
* @param receiverId
|
|
81
82
|
*/
|
|
82
|
-
sendPeerMessage(payload: Record<string,
|
|
83
|
+
sendPeerMessage(payload: Record<string, Unknown>, guaranteedDelivery: boolean, receiverId: string): Promise<number>;
|
|
83
84
|
/**
|
|
84
85
|
* Sets the parameters.
|
|
85
86
|
* @param parameters
|
|
86
87
|
*/
|
|
87
|
-
setParameters(parameters: Record<string,
|
|
88
|
+
setParameters(parameters: Record<string, Unknown>): number;
|
|
88
89
|
/**
|
|
89
90
|
* Adds an observer.
|
|
90
91
|
* @param observer
|
|
@@ -100,6 +101,4 @@ export declare class FcrCoreEngine {
|
|
|
100
101
|
private _setupCoreIpList;
|
|
101
102
|
private _setupChatConnection;
|
|
102
103
|
private _createChatConnection;
|
|
103
|
-
private _presetParameters;
|
|
104
|
-
private _mergeRtcPresetParameters;
|
|
105
104
|
}
|
package/lib/engine/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.array.push.js");
|
|
3
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
4
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
5
6
|
require("core-js/modules/esnext.map.emplace.js");
|
|
@@ -20,49 +21,54 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
20
21
|
Object.defineProperty(exports, "__esModule", {
|
|
21
22
|
value: true
|
|
22
23
|
});
|
|
23
|
-
exports.
|
|
24
|
-
require("core-js/modules/es.array.push.js");
|
|
24
|
+
exports.FcrCoreEngineImpl = void 0;
|
|
25
25
|
require("core-js/modules/es.json.stringify.js");
|
|
26
26
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
27
27
|
require("core-js/modules/esnext.iterator.map.js");
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
28
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
29
|
+
var _asyncRetry = require("agora-foundation/lib/utilities/async-retry");
|
|
30
|
+
var _env = require("agora-foundation/lib/utilities/env");
|
|
31
|
+
var _errorCode = require("agora-foundation/lib/utilities/error/error-code");
|
|
32
|
+
var _observable = require("agora-foundation/lib/utilities/observable");
|
|
33
|
+
var _mutex = require("agora-foundation/lib/worker/mutex");
|
|
34
|
+
var _agoraRteSdk = require("agora-rte-sdk");
|
|
35
|
+
var _type = require("agora-rte-sdk/lib/core/rtc/type");
|
|
36
|
+
var _type2 = require("agora-rte-sdk/lib/core/rtm/type");
|
|
37
|
+
var _domainHolder = require("agora-rte-sdk/lib/core/services/domain-holder");
|
|
38
|
+
var _awaitToJs = _interopRequireDefault(require("await-to-js"));
|
|
39
|
+
var _ = require("..");
|
|
32
40
|
var _desktop = require("../media-control/desktop");
|
|
41
|
+
var _mobile = require("../media-control/mobile");
|
|
42
|
+
var _monitorControl = require("../monitor-control");
|
|
33
43
|
var _peerSession = require("../peer-session");
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var _cmd = require("../utilities/cmd");
|
|
37
|
-
var _type2 = require("../room-control/type");
|
|
38
|
-
var _chatConnection = require("../chat-connection");
|
|
44
|
+
var _chatroom = require("../plugins/chat/chatroom");
|
|
45
|
+
var _connector = require("../plugins/chat/connector");
|
|
39
46
|
var _mainroomControl = require("../room-control/mainroom-control");
|
|
47
|
+
var _sharedCache = require("../room-control/shared-cache");
|
|
48
|
+
var _type3 = require("../room-control/type");
|
|
40
49
|
var _waitingroomControl = require("../room-control/waitingroom-control");
|
|
41
|
-
var _ = require("..");
|
|
42
|
-
var _domainHolder = require("agora-rte-sdk/lib/core/services/domain-holder");
|
|
43
|
-
var _agoraRteSdk = require("agora-rte-sdk");
|
|
44
|
-
var _helper = require("agora-rte-sdk/lib/core/scene/helper");
|
|
45
|
-
var _mobile = require("../media-control/mobile");
|
|
46
|
-
var _chatroom = require("../plugins/chatroom");
|
|
47
|
-
var _logger = require("../utilities/logger");
|
|
48
|
-
var _validateParams = _interopRequireDefault(require("../utilities/validate-params"));
|
|
49
|
-
var _schema = require("../schema");
|
|
50
|
-
var _error2 = require("agora-rte-sdk/lib/core/utilities/error");
|
|
51
50
|
var _roomRouter = require("../room-router");
|
|
52
|
-
var
|
|
51
|
+
var _schema = require("../schema");
|
|
52
|
+
var _api = require("../service/api");
|
|
53
|
+
var _type4 = require("../type");
|
|
54
|
+
var _cmd = require("../utilities/cmd");
|
|
55
|
+
var _error = require("../utilities/error");
|
|
56
|
+
var _logger = require("../utilities/logger");
|
|
53
57
|
var _packageInfo = require("../utilities/package-info");
|
|
54
|
-
|
|
58
|
+
var _parameters = require("../utilities/parameters");
|
|
59
|
+
var _validateParams = _interopRequireDefault(require("../utilities/validate-params"));
|
|
60
|
+
let _initProto, _renewUserTokenDecs, _createMainRoomControlDecs, _createWaitingRoomControlDecs, _createRoomRouterDecs, _createRoomControlAndJoinDecs, _sendPeerMessageDecs, _setParametersDecs;
|
|
55
61
|
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)]; } }; }
|
|
56
62
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
57
63
|
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); }
|
|
58
64
|
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; }
|
|
59
65
|
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; }
|
|
60
|
-
class
|
|
66
|
+
class FcrCoreEngineImpl {
|
|
61
67
|
static {
|
|
62
|
-
[_initProto] = _applyDecs(this, [[
|
|
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;
|
|
63
69
|
}
|
|
64
70
|
// @internal
|
|
65
|
-
[(_createMainRoomControlDecs = [
|
|
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")] = (_initProto(this), (0, _logger.createLogger)({
|
|
66
72
|
prefix: 'FcrCoreEngine'
|
|
67
73
|
}));
|
|
68
74
|
// @internal
|
|
@@ -88,30 +94,30 @@ class FcrCoreEngine {
|
|
|
88
94
|
// @internal
|
|
89
95
|
_sharedCache = new _sharedCache.FcrSharedCache();
|
|
90
96
|
// @internal
|
|
91
|
-
_lock = new
|
|
97
|
+
_lock = new _mutex.Mutex();
|
|
92
98
|
// @internal
|
|
93
|
-
_observable = new
|
|
99
|
+
_observable = new _observable.AgoraObservable();
|
|
94
100
|
constructor(config) {
|
|
95
101
|
this._config = config;
|
|
96
102
|
(0, _domainHolder.resetSharedDomainHolder)();
|
|
97
103
|
this.logger.info('Fcr core engine is created, version: ', this.getVersion());
|
|
98
|
-
|
|
99
|
-
this._rteEngine = new _imports.AgoraRteEngine({
|
|
104
|
+
this._rteEngine = new _agoraRteSdk.AgoraRteEngine({
|
|
100
105
|
appId: config.appId,
|
|
101
106
|
userId: config.userId,
|
|
102
107
|
userToken: config.token,
|
|
103
108
|
rteRegion: config.region,
|
|
104
|
-
rtcRegion:
|
|
105
|
-
rtmRegion:
|
|
109
|
+
rtcRegion: _type.AgoraRtcRegion.AREA_GLOBAL,
|
|
110
|
+
rtmRegion: _type2.AgoraRtmRegion.AREA_GLOBAL,
|
|
106
111
|
audioConfig: {
|
|
107
112
|
profile: 'default',
|
|
108
113
|
scenario: 'meeting'
|
|
109
114
|
},
|
|
110
115
|
dualCameraVideoStreamConfig: config.dualCameraVideoStreamConfig,
|
|
111
116
|
dualScreenVideoStreamConfig: config.dualScreenVideoStreamConfig,
|
|
112
|
-
parameters: parameters
|
|
117
|
+
parameters: config.parameters
|
|
113
118
|
});
|
|
114
|
-
|
|
119
|
+
const domainHolder = (0, _domainHolder.getSharedDomainHolder)(config.region);
|
|
120
|
+
this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), domainHolder, this._rteEngine.getRequestScheduler());
|
|
115
121
|
this._apiService = new _api.FcrCoreServiceApi(this._restfulClient, config.appId, config.region, !(0, _parameters.isEndpointRegionDisabled)(config.parameters));
|
|
116
122
|
|
|
117
123
|
// cannot be lazy loaded, because all the observers should be added before the engine is started
|
|
@@ -131,6 +137,7 @@ class FcrCoreEngine {
|
|
|
131
137
|
*/
|
|
132
138
|
release() {
|
|
133
139
|
this._rteEngine.release();
|
|
140
|
+
return _type4.FcrReturnCode.SUCCESS;
|
|
134
141
|
}
|
|
135
142
|
|
|
136
143
|
/**
|
|
@@ -139,12 +146,12 @@ class FcrCoreEngine {
|
|
|
139
146
|
async login() {
|
|
140
147
|
await this._lock.dispatch(async () => {
|
|
141
148
|
if (this._isLoggingIn) {
|
|
142
|
-
return;
|
|
149
|
+
return _type4.FcrReturnCode.UNDEFINED;
|
|
143
150
|
}
|
|
144
151
|
try {
|
|
145
152
|
this._isLoggingIn = true;
|
|
146
153
|
this._chatConnection.login();
|
|
147
|
-
await this._rteEngine.login();
|
|
154
|
+
return await this._rteEngine.login();
|
|
148
155
|
} finally {
|
|
149
156
|
this._isLoggingIn = false;
|
|
150
157
|
this._rteEngine.getMonitor().uploadLog({
|
|
@@ -161,7 +168,7 @@ class FcrCoreEngine {
|
|
|
161
168
|
await this._lock.dispatch(async () => {
|
|
162
169
|
this._isLoggingIn = false;
|
|
163
170
|
this._chatConnection.logout();
|
|
164
|
-
await this._rteEngine.logout();
|
|
171
|
+
return await this._rteEngine.logout();
|
|
165
172
|
});
|
|
166
173
|
}
|
|
167
174
|
/**
|
|
@@ -169,7 +176,7 @@ class FcrCoreEngine {
|
|
|
169
176
|
* @param token
|
|
170
177
|
*/
|
|
171
178
|
renewUserToken(token) {
|
|
172
|
-
this._rteEngine.renewUserToken(token);
|
|
179
|
+
return this._rteEngine.renewUserToken(token);
|
|
173
180
|
}
|
|
174
181
|
|
|
175
182
|
/**
|
|
@@ -177,7 +184,7 @@ class FcrCoreEngine {
|
|
|
177
184
|
* @returns The version of the SDK.
|
|
178
185
|
*/
|
|
179
186
|
getVersion() {
|
|
180
|
-
return (0,
|
|
187
|
+
return (0, _packageInfo.getVersion)();
|
|
181
188
|
}
|
|
182
189
|
getDependencyVersions() {
|
|
183
190
|
return {
|
|
@@ -232,33 +239,33 @@ class FcrCoreEngine {
|
|
|
232
239
|
userId
|
|
233
240
|
} = this._rteEngine.getConfig();
|
|
234
241
|
let roomControl = null;
|
|
235
|
-
let [error] = await (0,
|
|
242
|
+
let [error] = await (0, _awaitToJs.default)((0, _asyncRetry.retryAttempt)(async () => {
|
|
236
243
|
const res = await (0, _error.handleRequestError)(() => this._apiService.checkIn({
|
|
237
244
|
userName: options.userName,
|
|
238
245
|
userId,
|
|
239
|
-
userRole:
|
|
246
|
+
userRole: _type4.FcrUserRoleToStringMap[options.userRole],
|
|
240
247
|
userProperties: options.userProperties,
|
|
241
248
|
roomId,
|
|
242
|
-
platform: (0,
|
|
249
|
+
platform: (0, _env.getPlatform)(),
|
|
243
250
|
streams: options.createStreamConfigs?.map(s => ({
|
|
244
251
|
videoSourceUuid: s.videoSourceId,
|
|
245
252
|
audioSourceUuid: s.audioSourceId,
|
|
246
253
|
streamName: s.streamName,
|
|
247
|
-
...(0,
|
|
254
|
+
...(0, _agoraRteSdk.convertStreamTypeToPublishState)(s.streamType),
|
|
248
255
|
videoSourceType: s.videoSourceType,
|
|
249
256
|
audioSourceType: s.audioSourceType,
|
|
250
257
|
audioSourceState: s.audioSourceState,
|
|
251
258
|
videoSourceState: s.videoSourceState
|
|
252
259
|
})),
|
|
253
|
-
version: (0,
|
|
260
|
+
version: (0, _packageInfo.getVersion)(),
|
|
254
261
|
password: options.password,
|
|
255
262
|
avatar: options.avatar
|
|
256
|
-
}),
|
|
263
|
+
}), _errorCode.ErrorModuleCode.FCR_ENGINE);
|
|
257
264
|
const {
|
|
258
265
|
data,
|
|
259
266
|
ts
|
|
260
267
|
} = res;
|
|
261
|
-
if (data.room.roomProperties.roomType ===
|
|
268
|
+
if (data.room.roomProperties.roomType === _type3.FcrRoomType.Waitingroom) {
|
|
262
269
|
roomControl = this.createWaitingRoomControl(data.room.roomInfo.roomUuid);
|
|
263
270
|
} else {
|
|
264
271
|
roomControl = this.createMainRoomControl(roomId);
|
|
@@ -267,7 +274,7 @@ class FcrCoreEngine {
|
|
|
267
274
|
...options,
|
|
268
275
|
snapshot: data,
|
|
269
276
|
timestamp: ts,
|
|
270
|
-
createStreamConfigs: data.room.roomProperties.roomType ===
|
|
277
|
+
createStreamConfigs: data.room.roomProperties.roomType === _type3.FcrRoomType.Waitingroom ? [] : options.createStreamConfigs
|
|
271
278
|
});
|
|
272
279
|
}, [], {
|
|
273
280
|
retriesMax: 10
|
|
@@ -276,7 +283,7 @@ class FcrCoreEngine {
|
|
|
276
283
|
timeFn,
|
|
277
284
|
currentRetry
|
|
278
285
|
}) => {
|
|
279
|
-
if (
|
|
286
|
+
if (error instanceof _error.FcrError && _error.ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM.includes(error.code)) {
|
|
280
287
|
throw error;
|
|
281
288
|
}
|
|
282
289
|
this.logger.error(`retry to join room, ${error.message}, retry ${currentRetry} times`);
|
|
@@ -329,7 +336,7 @@ class FcrCoreEngine {
|
|
|
329
336
|
* @param receiverId
|
|
330
337
|
*/
|
|
331
338
|
async sendPeerMessage(payload, guaranteedDelivery, receiverId) {
|
|
332
|
-
await this._rteEngine.sendPeerMessage(payload, `${_cmd.CMD_PEER_MESSAGE}`, guaranteedDelivery, receiverId);
|
|
339
|
+
return await this._rteEngine.sendPeerMessage(payload, `${_cmd.CMD_PEER_MESSAGE}`, guaranteedDelivery, receiverId);
|
|
333
340
|
}
|
|
334
341
|
|
|
335
342
|
/**
|
|
@@ -345,13 +352,14 @@ class FcrCoreEngine {
|
|
|
345
352
|
rtc,
|
|
346
353
|
rtm
|
|
347
354
|
} = parameters;
|
|
348
|
-
this._rteEngine.setParameters({
|
|
355
|
+
return this._rteEngine.setParameters({
|
|
349
356
|
rtc,
|
|
350
357
|
rtm,
|
|
351
358
|
rte
|
|
352
359
|
});
|
|
353
360
|
} catch (e) {
|
|
354
361
|
this.logger.warn('setParameters failed', e);
|
|
362
|
+
return _type4.FcrReturnCode.UNDEFINED;
|
|
355
363
|
}
|
|
356
364
|
}
|
|
357
365
|
|
|
@@ -383,15 +391,15 @@ class FcrCoreEngine {
|
|
|
383
391
|
});
|
|
384
392
|
}
|
|
385
393
|
_addLogObserver() {
|
|
386
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onConnectionStateUpdated', 'onPeerMessageReceived', 'onUserTokenWillExpire']));
|
|
394
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onConnectionStateUpdated', ['state']], ['onPeerMessageReceived', ['message']], 'onUserTokenWillExpire']));
|
|
387
395
|
}
|
|
388
396
|
_setupCoreIpList(parameters) {
|
|
389
397
|
const coreIpList = (0, _parameters.getCoreIpList)(parameters);
|
|
390
398
|
if (coreIpList) {
|
|
391
399
|
this.logger.info(`setup fixed service domain list: ${JSON.stringify(coreIpList)}`);
|
|
392
400
|
(0, _domainHolder.resetSharedDomainHolder)();
|
|
393
|
-
(0,
|
|
394
|
-
this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), (0,
|
|
401
|
+
(0, _domainHolder.getSharedDomainHolder)(this._config.region).setFixedDomainList(coreIpList);
|
|
402
|
+
this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), (0, _domainHolder.getSharedDomainHolder)(this._config.region), this._rteEngine.getRequestScheduler());
|
|
395
403
|
this._apiService.setRestfulClient(this._restfulClient);
|
|
396
404
|
}
|
|
397
405
|
}
|
|
@@ -406,24 +414,7 @@ class FcrCoreEngine {
|
|
|
406
414
|
_createChatConnection(parameters) {
|
|
407
415
|
const chatIpList = (0, _parameters.getEasemobChatIpList)(parameters);
|
|
408
416
|
const restIpList = (0, _parameters.getEasemobRestIpList)(parameters);
|
|
409
|
-
return new
|
|
410
|
-
}
|
|
411
|
-
_presetParameters(parameters) {
|
|
412
|
-
if (!parameters) {
|
|
413
|
-
parameters = {
|
|
414
|
-
rtc: (0, _parameters.getRtcPresetParameters)()
|
|
415
|
-
};
|
|
416
|
-
} else if (!parameters.rtc) {
|
|
417
|
-
parameters.rtc = (0, _parameters.getRtcPresetParameters)();
|
|
418
|
-
} else {
|
|
419
|
-
parameters.rtc = this._mergeRtcPresetParameters(parameters.rtc);
|
|
420
|
-
}
|
|
421
|
-
return parameters;
|
|
422
|
-
}
|
|
423
|
-
_mergeRtcPresetParameters(parametersList) {
|
|
424
|
-
const rtcPresetParameters = (0, _parameters.getRtcPresetParameters)();
|
|
425
|
-
parametersList.push(...rtcPresetParameters);
|
|
426
|
-
return parametersList;
|
|
417
|
+
return new _connector.FcrChatConnectorImpl(this._config.userId, this._apiService, chatIpList, restIpList);
|
|
427
418
|
}
|
|
428
419
|
}
|
|
429
|
-
exports.
|
|
420
|
+
exports.FcrCoreEngineImpl = FcrCoreEngineImpl;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { FcrDesktopMediaControl, FcrMobileMediaControl, FcrMonitorControl } from '..';
|
|
2
|
+
import { FcrMainRoomControl, FcrWaitingRoomControl, FcrRoomJoinOptions } from '../room-control/type';
|
|
3
|
+
import { FcrRoomRouter, FcrPeerSessionControl, FcrCoreEngineObserver } from '../type';
|
|
4
|
+
import { Unknown } from '../imports';
|
|
5
|
+
export interface FcrCoreEngine {
|
|
6
|
+
release(): void;
|
|
7
|
+
/**
|
|
8
|
+
* Logins to the RTE service.
|
|
9
|
+
*/
|
|
10
|
+
login(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Logouts from the RTE service.
|
|
13
|
+
*/
|
|
14
|
+
logout(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Renews the user token.
|
|
17
|
+
* @param token
|
|
18
|
+
*/
|
|
19
|
+
renewUserToken(token: string): Promise<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Gets the version of the SDK.
|
|
22
|
+
* @returns The version of the SDK.
|
|
23
|
+
*/
|
|
24
|
+
getVersion(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the dependency versions.
|
|
27
|
+
* @returns The dependency versions.
|
|
28
|
+
*/
|
|
29
|
+
getDependencyVersions(): Record<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a room control.
|
|
32
|
+
* @param roomId
|
|
33
|
+
* @returns The room control.
|
|
34
|
+
*/
|
|
35
|
+
createMainRoomControl(roomId: string): FcrMainRoomControl;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a waiting room control.
|
|
38
|
+
* @param roomId
|
|
39
|
+
* @returns The room control.
|
|
40
|
+
*/
|
|
41
|
+
createWaitingRoomControl(roomId: string): FcrWaitingRoomControl;
|
|
42
|
+
/**
|
|
43
|
+
* Creates room router.
|
|
44
|
+
* @param roomId
|
|
45
|
+
* @returns The room router.
|
|
46
|
+
*/
|
|
47
|
+
createRoomRouter(roomId: string): FcrRoomRouter;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a main room control or a waiting room control.
|
|
50
|
+
* @param roomId
|
|
51
|
+
* @returns The room control.
|
|
52
|
+
*/
|
|
53
|
+
createRoomControlAndJoin(roomId: string, options: FcrRoomJoinOptions): Promise<FcrMainRoomControl | FcrWaitingRoomControl>;
|
|
54
|
+
/**
|
|
55
|
+
* Gets the media control.
|
|
56
|
+
* @returns The media control.
|
|
57
|
+
*/
|
|
58
|
+
getDesktopMediaControl(): FcrDesktopMediaControl;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the mobile media control.
|
|
61
|
+
* @returns The mobile media control.
|
|
62
|
+
*/
|
|
63
|
+
getMobileMediaControl(): FcrMobileMediaControl;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the monitor control.
|
|
66
|
+
* @returns The monitor control.
|
|
67
|
+
*/
|
|
68
|
+
getMonitorControl(): FcrMonitorControl;
|
|
69
|
+
/**
|
|
70
|
+
* Gets the peer session control.
|
|
71
|
+
* @returns The peer session control.
|
|
72
|
+
*/
|
|
73
|
+
getPeerSessionControl(): FcrPeerSessionControl;
|
|
74
|
+
/**
|
|
75
|
+
* Sends a peer message.
|
|
76
|
+
* @param payload
|
|
77
|
+
* @param guaranteedDelivery
|
|
78
|
+
* @param receiverId
|
|
79
|
+
*/
|
|
80
|
+
sendPeerMessage(payload: Record<string, Unknown>, guaranteedDelivery: boolean, receiverId: string): Promise<number>;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the parameters.
|
|
83
|
+
* @param parameters
|
|
84
|
+
*/
|
|
85
|
+
setParameters(parameters: Record<string, Unknown>): number;
|
|
86
|
+
/**
|
|
87
|
+
* Adds an observer.
|
|
88
|
+
* @param observer
|
|
89
|
+
*/
|
|
90
|
+
addObserver(observer: FcrCoreEngineObserver): void;
|
|
91
|
+
/**
|
|
92
|
+
* Removes an observer.
|
|
93
|
+
* @param observer
|
|
94
|
+
*/
|
|
95
|
+
removeObserver(observer: FcrCoreEngineObserver): void;
|
|
96
|
+
}
|
package/lib/imports.d.ts
CHANGED
|
@@ -30,12 +30,12 @@ export { validateParams } from 'agora-foundation/lib/decorator/validate';
|
|
|
30
30
|
export { Mutex } from 'agora-foundation/lib/worker/mutex';
|
|
31
31
|
export type { AgoraRtcNetworkStats, AgoraRtcDeviceInfo, AgoraRtcDisplayInfo, AgoraRtcWindowInfo, AgoraRtePerformanceInfo, AgoraRteScenePropertiesDeletedEvent, AgoraRteStreamEncryptionConfig, AgoraRteStreamJoinConfig, AgoraRteDualVideoStreamConfig, AgoraRteMessage, AgoraRteScenePropertiesUpdatedEvent, AgoraRteRenderView, AgoraRteScene, } from 'agora-rte-sdk';
|
|
32
32
|
export type { AgoraRtmClient } from 'agora-rte-sdk/lib/core/rtm/client';
|
|
33
|
-
export type { AgoraRteEngineObserver } from 'agora-rte-sdk/lib/type';
|
|
33
|
+
export type { AgoraRteEngineObserver } from 'agora-rte-sdk/lib/core/engine/type';
|
|
34
34
|
export type { AgoraRteNetworkQualityEvent } from 'agora-rte-sdk/lib/core/scene/type';
|
|
35
35
|
export type { AgoraRteOperatCause } from 'agora-rte-sdk/lib/core/processor/type';
|
|
36
36
|
export type { AgoraRestfulClient } from 'agora-rte-sdk/lib/core/services/client';
|
|
37
37
|
export { AgoraRteError } from 'agora-rte-sdk/lib/core/utilities/error';
|
|
38
|
-
export { AgoraError as FcrError } from 'agora-foundation/lib/utilities/agora-error';
|
|
38
|
+
export { AgoraError as FcrError } from 'agora-foundation/lib/utilities/error/agora-error';
|
|
39
39
|
export type { AgoraRteUserUpdatedReason as FcrUserUpdatedReason, AgoraRteUserPageParams, AgoraRteUserPageResponse, AgoraRteUserPropertiesDeletedEvent, AgoraRteUserPropertiesUpdatedEvent, AgoraRteUserInfo, AgoraRteSceneObserver, AgoraRteSnapshotInfo, AgoraRteEntryRoomResponse, AgoraRteMediaStreamEvent, } from 'agora-rte-sdk/lib/core/scene/type';
|
|
40
40
|
export type AgoraRteMediaStreamCreateConfig = FcrMediaStreamCreateConfigSchema;
|
|
41
41
|
export type AgoraRteStreamBindConfig = FcrStreamBindConfigSchema;
|
|
@@ -43,7 +43,7 @@ export type AgoraRteVideoEncoderConfig = FcrVideoEncoderConfigurationSchema;
|
|
|
43
43
|
export type { AgoraRtcLocalVideoStats, AgoraRtcLocalAudioStats, AgoraRtcRemoteVideoStats, AgoraRtcRemoteAudioStats, AgoraRtcDimensions, } from 'agora-rte-sdk/lib/core/rtc/type';
|
|
44
44
|
export type { AgoraRteAudioRawDataConfig, AgoraRteBeautyOptions, AgoraRteCameraPosition, AgoraRteScreenCaptureParams, AgoraRteVirtualBackgroundOptions, AgoraRteCameraCaptureParams, } from 'agora-rte-sdk/lib/core/media/type';
|
|
45
45
|
export type { AgoraRteMonitor } from 'agora-rte-sdk/lib/core/monitor';
|
|
46
|
-
export type { AgoraRteMediaControl } from 'agora-rte-sdk/lib/core/media';
|
|
46
|
+
export type { AgoraRteMediaControl } from 'agora-rte-sdk/lib/core/media/type';
|
|
47
47
|
export type { AgoraRteUpdateStreamPrivilege, AgoraRteMediaStreamInfo, } from 'agora-rte-sdk/lib/core/scene/type';
|
|
48
48
|
export { AgoraRteConnectionState, AgoraRteEngine, convertStreamTypeToPublishState, AgoraRteLatencyLevel, } from 'agora-rte-sdk';
|
|
49
49
|
export { AgoraRteRoomConnectorType, AgoraRteStreamPrivilegeOperation, AgoraRteStreamPrivilegeVideoSourceType, AgoraRteStreamPrivilegeAudioSourceType, AgoraRteMediaStreamType, } from 'agora-rte-sdk/lib/core/scene/type';
|
|
@@ -56,7 +56,7 @@ export { AgoraRteScreenCaptureType, AgoraRteVideoOrientation, } from 'agora-rte-
|
|
|
56
56
|
export { registerPlugin } from 'agora-rte-sdk/lib/core/engine/plugin';
|
|
57
57
|
export { AgoraRteUserUpdatedReason } from 'agora-rte-sdk/lib/core/scene/type';
|
|
58
58
|
export type { AgoraRteUploadEvent } from 'agora-rte-sdk/lib/core/monitor/type';
|
|
59
|
-
export {
|
|
59
|
+
export { LoggerManager } from 'agora-foundation/lib/utilities/logger';
|
|
60
60
|
export { FcrWhiteboardControlFactoryImpl } from './room-control/whiteboard-control-v2/whiteboard-control/factory';
|
|
61
61
|
export { FcrAnnotationControlFactoryImpl } from './room-control/whiteboard-control-v2/annotation-control/factory';
|
|
62
62
|
export { deCompressGzipToJson } from './room-control/stt-control/de-compress-gzip';
|
|
@@ -66,3 +66,6 @@ export { getVersion } from './utilities/package-info';
|
|
|
66
66
|
export declare const localStorage: Storage;
|
|
67
67
|
export { v4 } from 'uuid';
|
|
68
68
|
export { default as merge } from 'lodash/merge';
|
|
69
|
+
export { DetailErrorCode, ErrorModuleCode, ErrorServiceType, } from 'agora-foundation/lib/utilities/error/error-code';
|
|
70
|
+
export { FcrChatRoomControlImpl } from './plugins/chat/chatroom';
|
|
71
|
+
export type Unknown = unknown;
|
package/lib/imports.js
CHANGED
|
@@ -204,6 +204,12 @@ Object.defineProperty(exports, "AgoraScheduler", {
|
|
|
204
204
|
return _schedule.AgoraScheduler;
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
|
+
Object.defineProperty(exports, "DetailErrorCode", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function () {
|
|
210
|
+
return _errorCode.DetailErrorCode;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
207
213
|
Object.defineProperty(exports, "Duration", {
|
|
208
214
|
enumerable: true,
|
|
209
215
|
get: function () {
|
|
@@ -222,6 +228,18 @@ Object.defineProperty(exports, "EasemobChatSDK", {
|
|
|
222
228
|
return _easemobWebsdk.default;
|
|
223
229
|
}
|
|
224
230
|
});
|
|
231
|
+
Object.defineProperty(exports, "ErrorModuleCode", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function () {
|
|
234
|
+
return _errorCode.ErrorModuleCode;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(exports, "ErrorServiceType", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function () {
|
|
240
|
+
return _errorCode.ErrorServiceType;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
225
243
|
Object.defineProperty(exports, "FcrAnnotationControlFactoryImpl", {
|
|
226
244
|
enumerable: true,
|
|
227
245
|
get: function () {
|
|
@@ -234,10 +252,10 @@ Object.defineProperty(exports, "FcrApplicationPlatform", {
|
|
|
234
252
|
return _env.FcrApplicationPlatform;
|
|
235
253
|
}
|
|
236
254
|
});
|
|
237
|
-
Object.defineProperty(exports, "
|
|
255
|
+
Object.defineProperty(exports, "FcrChatRoomControlImpl", {
|
|
238
256
|
enumerable: true,
|
|
239
257
|
get: function () {
|
|
240
|
-
return
|
|
258
|
+
return _chatroom.FcrChatRoomControlImpl;
|
|
241
259
|
}
|
|
242
260
|
});
|
|
243
261
|
Object.defineProperty(exports, "FcrError", {
|
|
@@ -282,6 +300,12 @@ Object.defineProperty(exports, "FcrWhiteboardPermissionFlag", {
|
|
|
282
300
|
return _forgeWhiteboard.WhiteboardPermissionFlag;
|
|
283
301
|
}
|
|
284
302
|
});
|
|
303
|
+
Object.defineProperty(exports, "LoggerManager", {
|
|
304
|
+
enumerable: true,
|
|
305
|
+
get: function () {
|
|
306
|
+
return _logger2.LoggerManager;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
285
309
|
Object.defineProperty(exports, "Mutex", {
|
|
286
310
|
enumerable: true,
|
|
287
311
|
get: function () {
|
|
@@ -528,7 +552,7 @@ var _schema = require("agora-foundation/lib/utilities/schema");
|
|
|
528
552
|
var _validate = require("agora-foundation/lib/decorator/validate");
|
|
529
553
|
var _mutex = require("agora-foundation/lib/worker/mutex");
|
|
530
554
|
var _error = require("agora-rte-sdk/lib/core/utilities/error");
|
|
531
|
-
var _agoraError = require("agora-foundation/lib/utilities/agora-error");
|
|
555
|
+
var _agoraError = require("agora-foundation/lib/utilities/error/agora-error");
|
|
532
556
|
var _agoraRteSdk = require("agora-rte-sdk");
|
|
533
557
|
var _type = require("agora-rte-sdk/lib/core/scene/type");
|
|
534
558
|
var _type2 = require("agora-rte-sdk/lib/core/rtc/type");
|
|
@@ -538,13 +562,15 @@ var _client = require("agora-rte-sdk/lib/core/services/client");
|
|
|
538
562
|
var _domainHolder = require("agora-rte-sdk/lib/core/services/domain-holder");
|
|
539
563
|
var _type5 = require("agora-rte-sdk/lib/core/media/type");
|
|
540
564
|
var _plugin = require("agora-rte-sdk/lib/core/engine/plugin");
|
|
541
|
-
var
|
|
565
|
+
var _logger2 = require("agora-foundation/lib/utilities/logger");
|
|
542
566
|
var _factory = require("./room-control/whiteboard-control-v2/whiteboard-control/factory");
|
|
543
567
|
var _factory2 = require("./room-control/whiteboard-control-v2/annotation-control/factory");
|
|
544
568
|
var _deCompressGzip = require("./room-control/stt-control/de-compress-gzip");
|
|
545
569
|
var _packageInfo = require("./utilities/package-info");
|
|
546
570
|
var _uuid = require("uuid");
|
|
547
571
|
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
572
|
+
var _errorCode = require("agora-foundation/lib/utilities/error/error-code");
|
|
573
|
+
var _chatroom = require("./plugins/chat/chatroom");
|
|
548
574
|
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); }
|
|
549
575
|
// Other utility exports
|
|
550
576
|
|