fcr-ui-widget-sdk 3.8.0 → 3.8.1
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/sdk.d.ts +4 -1
- package/lib/sdk.js +16 -1
- package/lib/type.d.ts +43 -1
- package/package.json +4 -4
package/lib/sdk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FcrRoomInfo, FcrRoomSchedule, FcrRoomState, FcrUserInfo } from 'fcr-core/lib/type';
|
|
1
|
+
import type { FcrIPConnectorSessionParams, FcrPhoneConnectorSessionParams, FcrRoomInfo, FcrRoomSchedule, FcrRoomState, FcrUserInfo } from 'fcr-core/lib/type';
|
|
2
2
|
import { FcrUIWidgetObserver, FcrUIWidgetSDK } from './type';
|
|
3
3
|
export declare class FcrUIWidgetSDKImpl implements FcrUIWidgetSDK {
|
|
4
4
|
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
@@ -15,6 +15,9 @@ export declare class FcrUIWidgetSDKImpl implements FcrUIWidgetSDK {
|
|
|
15
15
|
getLocalUser(): Promise<FcrUserInfo>;
|
|
16
16
|
getUserList(): Promise<FcrUserInfo[]>;
|
|
17
17
|
getAllUserCount(): Promise<number>;
|
|
18
|
+
startSessionByPhone(params: FcrPhoneConnectorSessionParams): Promise<string>;
|
|
19
|
+
startSessionByIP(params: FcrIPConnectorSessionParams): Promise<string>;
|
|
20
|
+
stopSession(sessionId: string): Promise<void>;
|
|
18
21
|
addObserver(observer: FcrUIWidgetObserver): void;
|
|
19
22
|
removeObserver(observer: FcrUIWidgetObserver): void;
|
|
20
23
|
private _handlePostMessage;
|
package/lib/sdk.js
CHANGED
|
@@ -160,6 +160,21 @@ var FcrUIWidgetSDKImpl = exports.FcrUIWidgetSDKImpl = /*#__PURE__*/function () {
|
|
|
160
160
|
getAllUserCount() {
|
|
161
161
|
return this._sendRequest('getAllUserCount');
|
|
162
162
|
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "startSessionByPhone",
|
|
165
|
+
value: function startSessionByPhone(params) {
|
|
166
|
+
return this._sendRequest('startSessionByPhone', [params]);
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
key: "startSessionByIP",
|
|
170
|
+
value: function startSessionByIP(params) {
|
|
171
|
+
return this._sendRequest('startSessionByIP', [params]);
|
|
172
|
+
}
|
|
173
|
+
}, {
|
|
174
|
+
key: "stopSession",
|
|
175
|
+
value: function stopSession(sessionId) {
|
|
176
|
+
return this._sendRequest('stopSession', [sessionId]);
|
|
177
|
+
}
|
|
163
178
|
}, {
|
|
164
179
|
key: "addObserver",
|
|
165
180
|
value: function
|
|
@@ -205,7 +220,7 @@ var FcrUIWidgetSDKImpl = exports.FcrUIWidgetSDKImpl = /*#__PURE__*/function () {
|
|
|
205
220
|
}]);
|
|
206
221
|
}();
|
|
207
222
|
_FcrUIWidgetSDKImpl = FcrUIWidgetSDKImpl;
|
|
208
|
-
var _applyDecs$e = _applyDecs(_FcrUIWidgetSDKImpl, [[_bound.bound, 2, "getRoomInfo"], [_bound.bound, 2, "getRoomSchedule"], [_bound.bound, 2, "getRoomState"], [_bound.bound, 2, "getLocalUser"], [_bound.bound, 2, "getUserList"], [_bound.bound, 2, "getAllUserCount"], [_bound.bound, 2, "addObserver"], [_bound.bound, 2, "removeObserver"], [_bound.bound, 2, "_handlePostMessage"]], []).e;
|
|
223
|
+
var _applyDecs$e = _applyDecs(_FcrUIWidgetSDKImpl, [[_bound.bound, 2, "getRoomInfo"], [_bound.bound, 2, "getRoomSchedule"], [_bound.bound, 2, "getRoomState"], [_bound.bound, 2, "getLocalUser"], [_bound.bound, 2, "getUserList"], [_bound.bound, 2, "getAllUserCount"], [_bound.bound, 2, "startSessionByPhone"], [_bound.bound, 2, "startSessionByIP"], [_bound.bound, 2, "stopSession"], [_bound.bound, 2, "addObserver"], [_bound.bound, 2, "removeObserver"], [_bound.bound, 2, "_handlePostMessage"]], []).e;
|
|
209
224
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
210
225
|
_initProto = _applyDecs$e2[0];
|
|
211
226
|
_applyDecs$e;
|
package/lib/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FcrRoomInfo, FcrRoomSchedule, FcrRoomState, FcrUserInfo } from 'fcr-core/lib/type';
|
|
1
|
+
import type { FcrIPConnectorSession, FcrIPConnectorSessionParams, FcrPhoneConnectorSession, FcrPhoneConnectorSessionParams, FcrRoomConnectorSessionReason, FcrRoomConnectorSessionState, FcrRoomInfo, FcrRoomSchedule, FcrRoomState, FcrUserInfo } from 'fcr-core/lib/type';
|
|
2
2
|
import type { FcrUserJoinedEvent, FcrUserLeftEvent, FcrUserPageParams, FcrUserPageResponse, FcrUserUpdatedEvent } from 'fcr-core/lib/room-control/user-control/type';
|
|
3
3
|
type MethodNames<T> = {
|
|
4
4
|
[K in keyof T]: T[K] extends Function ? K : never;
|
|
@@ -34,6 +34,20 @@ export interface FcrUIWidgetSDK {
|
|
|
34
34
|
* 获取房间内用户总数
|
|
35
35
|
*/
|
|
36
36
|
getAllUserCount(): Promise<number>;
|
|
37
|
+
/**
|
|
38
|
+
* 开始电话会话
|
|
39
|
+
* @param params 会话参数
|
|
40
|
+
*/
|
|
41
|
+
startSessionByPhone(params: FcrPhoneConnectorSessionParams): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* 开始IP会话
|
|
44
|
+
*/
|
|
45
|
+
startSessionByIP(params: FcrIPConnectorSessionParams): Promise<string>;
|
|
46
|
+
/**
|
|
47
|
+
* 停止会话
|
|
48
|
+
* @param sessionId 会话ID
|
|
49
|
+
*/
|
|
50
|
+
stopSession(sessionId: string): Promise<void>;
|
|
37
51
|
/**
|
|
38
52
|
* 添加观察者,用来接收 Widget 事件回调
|
|
39
53
|
* @param observer 实现 FcrUIWidgetObserver 的对象
|
|
@@ -72,6 +86,20 @@ export interface FcrUIWidgetObserver {
|
|
|
72
86
|
* @param count 当前的用户数量
|
|
73
87
|
*/
|
|
74
88
|
onAllUserCountUpdated?(roomId: string, count: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* 电话会话状态更新回调
|
|
91
|
+
* @param session 会话信息
|
|
92
|
+
* @param state 状态
|
|
93
|
+
* @param reason 原因
|
|
94
|
+
*/
|
|
95
|
+
onPhoneConnectorSessionStateUpdated?(session: FcrPhoneConnectorSession, state: FcrRoomConnectorSessionState, reason: FcrRoomConnectorSessionReason): void;
|
|
96
|
+
/**
|
|
97
|
+
* IP会话状态更新回调
|
|
98
|
+
* @param session 会话信息
|
|
99
|
+
* @param state 状态
|
|
100
|
+
* @param reason 原因
|
|
101
|
+
*/
|
|
102
|
+
onIPConnectorSessionStateUpdated?(session: FcrIPConnectorSession, state: FcrRoomConnectorSessionState, reason: FcrRoomConnectorSessionReason): void;
|
|
75
103
|
}
|
|
76
104
|
export interface FcrUIBaseWidget {
|
|
77
105
|
/**
|
|
@@ -98,6 +126,20 @@ export interface FcrUIBaseWidget {
|
|
|
98
126
|
* 获取房间内用户总数
|
|
99
127
|
*/
|
|
100
128
|
getAllUserCount(): number;
|
|
129
|
+
/**
|
|
130
|
+
* 开始电话会话
|
|
131
|
+
* @param params 会话参数
|
|
132
|
+
*/
|
|
133
|
+
startSessionByPhone(params: FcrPhoneConnectorSessionParams): Promise<string>;
|
|
134
|
+
/**
|
|
135
|
+
* 开始IP会话
|
|
136
|
+
*/
|
|
137
|
+
startSessionByIP(params: FcrIPConnectorSessionParams): Promise<string>;
|
|
138
|
+
/**
|
|
139
|
+
* 停止会话
|
|
140
|
+
* @param sessionId 会话ID
|
|
141
|
+
*/
|
|
142
|
+
stopSession(sessionId: string): Promise<void>;
|
|
101
143
|
/**
|
|
102
144
|
* Fetches the list of users.
|
|
103
145
|
* @param params
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fcr-ui-widget-sdk",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"repository": "ssh://git@git.agoralab.co/aduc/fcr-ui-scene-desktop.git",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"test": "agora-tc-test-karma-browser"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"fcr-core": "3.8.
|
|
19
|
-
"agora-foundation": "3.8.
|
|
18
|
+
"fcr-core": "3.8.1",
|
|
19
|
+
"agora-foundation": "3.8.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@babel/core": "^7.23.5",
|
|
23
23
|
"@babel/preset-env": "^7.23.5",
|
|
24
24
|
"@babel/preset-react": "^7.24.1",
|
|
25
25
|
"@babel/preset-typescript": "^7.23.3",
|
|
26
|
-
"agora-toolchain": "3.8.
|
|
26
|
+
"agora-toolchain": "3.8.1",
|
|
27
27
|
"tslib": "^2.6.2"
|
|
28
28
|
}
|
|
29
29
|
}
|