@xylink/xy-rtc-sdk 2.1.2 → 3.8.0-beta.2

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.
Files changed (51) hide show
  1. package/README.MD +37 -37
  2. package/lib/{src/action → action}/index.d.ts +254 -236
  3. package/lib/{src/enum → enum}/contraints.d.ts +121 -116
  4. package/lib/{src/enum → enum}/errorCode.d.ts +880 -880
  5. package/lib/{src/enum → enum}/index.d.ts +137 -133
  6. package/lib/{src/index.d.ts → index.d.ts} +34 -34
  7. package/lib/{src/main → main}/client.d.ts +953 -808
  8. package/lib/{src/main → main}/deviceManager.d.ts +164 -164
  9. package/lib/{src/main → main}/helper.d.ts +51 -51
  10. package/lib/{src/main → main}/iauth.d.ts +33 -33
  11. package/lib/{src/main → main}/layoutManager.d.ts +214 -214
  12. package/lib/main/meeting.d.ts +80 -0
  13. package/lib/{src/main → main}/peer.d.ts +311 -311
  14. package/lib/{src/main → main}/qualityManager.d.ts +39 -39
  15. package/lib/{src/main → main}/stream.d.ts +263 -243
  16. package/lib/{src/main → main}/videoManager.d.ts +65 -65
  17. package/lib/{src/tools → tools}/audioLevel.d.ts +23 -23
  18. package/lib/{src/tools → tools}/browser.d.ts +55 -55
  19. package/lib/{src/tools → tools}/config.d.ts +14 -12
  20. package/lib/{src/tools → tools}/db.d.ts +85 -85
  21. package/lib/{src/tools → tools}/detect.d.ts +44 -45
  22. package/lib/{src/tools → tools}/emmitter.d.ts +15 -15
  23. package/lib/{src/tools → tools}/enum.d.ts +6 -6
  24. package/lib/{src/tools → tools}/httpClient.d.ts +64 -64
  25. package/lib/{src/tools → tools}/i18n.d.ts +8 -8
  26. package/lib/{src/tools → tools}/index.d.ts +8 -8
  27. package/lib/{src/tools → tools}/logger.d.ts +151 -151
  28. package/lib/{src/tools → tools}/socket.d.ts +53 -53
  29. package/lib/{src/tools → tools}/store.d.ts +15 -15
  30. package/lib/{src/tools → tools}/template.d.ts +14 -14
  31. package/lib/{src/tools → tools}/utils.d.ts +74 -67
  32. package/lib/{src/tools → tools}/verify.d.ts +7 -7
  33. package/lib/type/action.d.ts +6 -0
  34. package/lib/{src/type → type}/base.d.ts +71 -71
  35. package/lib/{src/type → type}/client.d.ts +1174 -1106
  36. package/lib/{src/type → type}/device.d.ts +77 -77
  37. package/lib/{src/type → type}/index.d.ts +13 -11
  38. package/lib/type/meeting.d.ts +41 -0
  39. package/lib/{src/type → type}/quality.d.ts +77 -77
  40. package/lib/{src/type → type}/stream.d.ts +426 -426
  41. package/lib/xyrtc.cjs.js +1 -0
  42. package/lib/xyrtc.umd.js +1 -0
  43. package/package.json +119 -130
  44. package/scripts/build_lib.js +16 -0
  45. package/scripts/utils.js +27 -0
  46. package/scripts/webpack.common.js +139 -0
  47. package/scripts/webpack.dev.js +27 -0
  48. package/scripts/webpack.sdk.js +68 -0
  49. package/tsconfig.lib.json +37 -0
  50. package/lib/index.es.js +0 -3
  51. package/lib/index.js +0 -3
package/README.MD CHANGED
@@ -1,38 +1,38 @@
1
- # XYLINK WEBRTC SDK
2
-
3
- ## 介绍
4
-
5
- XY RTC Web SDK 是小鱼易连音视频通讯解决方案的Web端SDK,它是通过 HTML 网页加载的 JavaScript 库,采用 WebRTC 技术,开发者可以使用 XY RTC Web SDK 提供的 API 建立连接,控制实时多人音视频通话。
6
-
7
- 目前 XY RTC Web SDK 主要支持 Chrome v72+ 和 Edge v80+ 浏览器。
8
- ## 安装
9
- ``` bash
10
- # 通过 Yarn 安装
11
- $ yarn add @xylink/xy-rtc-sdk
12
-
13
- # 通过 Npm 安装
14
- $ npm install @xylink/xy-rtc-sdk --save
15
- ```
16
- ## 示例
17
-
18
- > **注意**:请务必使用 HTTPS 协议或者 localhost 开发、测试,否则无法正常使用 XY RTC SDK 进行加入会议操作;
19
-
20
-
21
- ```bash
22
- import xyRTC from "@xylink/xy-rtc-sdk";
23
-
24
- const client = xyRTC.createClient();
25
- ```
26
-
27
-
28
- 具体可参考[详细API文档](https://openapi.xylink.com/common/meeting/api/description?platform=web)完成音视频通话。
29
- ## 开源示例项目
30
- 我们在 GitHub 上提供了开源的示例项目供你参考。
31
-
32
- - Vue 版本:https://github.com/xylink-com/xylink-rtc-vue-demo
33
- - React 版本:https://github.com/xylink-com/xylink-rtc-demo
34
-
35
-
36
- 如果你是第一次集成 XY RTC SDK 产品,你可以使用我们基于 SDK 实现的产品进行体验:[小鱼 Web 会议](https://cdn.xylink.com/webrtc/web/index.html#/)。 我们会将 SDK 的最新功能在小鱼 Web 会议上进行集成展示出来,方便作为你的一种参考方式。
37
- ## 版本更新内容
1
+ # XYLINK WEBRTC SDK
2
+
3
+ ## 介绍
4
+
5
+ XY RTC Web SDK 是小鱼易连音视频通讯解决方案的Web端SDK,它是通过 HTML 网页加载的 JavaScript 库,采用 WebRTC 技术,开发者可以使用 XY RTC Web SDK 提供的 API 建立连接,控制实时多人音视频通话。
6
+
7
+ 目前 XY RTC Web SDK 主要支持 Chrome v72+ 和 Edge v80+ 浏览器。
8
+ ## 安装
9
+ ``` bash
10
+ # 通过 Yarn 安装
11
+ $ yarn add @xylink/xy-rtc-sdk
12
+
13
+ # 通过 Npm 安装
14
+ $ npm install @xylink/xy-rtc-sdk --save
15
+ ```
16
+ ## 示例
17
+
18
+ > **注意**:请务必使用 HTTPS 协议或者 localhost 开发、测试,否则无法正常使用 XY RTC SDK 进行加入会议操作;
19
+
20
+
21
+ ```bash
22
+ import xyRTC from "@xylink/xy-rtc-sdk";
23
+
24
+ const client = xyRTC.createClient();
25
+ ```
26
+
27
+
28
+ 具体可参考[详细API文档](https://openapi.xylink.com/common/meeting/api/description?platform=web)完成音视频通话。
29
+ ## 开源示例项目
30
+ 我们在 GitHub 上提供了开源的示例项目供你参考。
31
+
32
+ - Vue 版本:https://github.com/xylink-com/xylink-rtc-vue-demo
33
+ - React 版本:https://github.com/xylink-com/xylink-rtc-demo
34
+
35
+
36
+ 如果你是第一次集成 XY RTC SDK 产品,你可以使用我们基于 SDK 实现的产品进行体验:[小鱼 Web 会议](https://cdn.xylink.com/webrtc/web/index.html#/)。 我们会将 SDK 的最新功能在小鱼 Web 会议上进行集成展示出来,方便作为你的一种参考方式。
37
+ ## 版本更新内容
38
38
  具体可查看[发版说明文档](https://openapi.xylink.com/common/meeting/doc/version?platform=web)。
@@ -1,236 +1,254 @@
1
- import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams } from '../type';
2
- import Logger from '../tools/logger';
3
- export interface ICommonParams {
4
- securityKey: string;
5
- }
6
- declare class Action {
7
- private http;
8
- private logHttp;
9
- private meetingInfo;
10
- private seqId;
11
- private statesTime;
12
- commonParams: ICommonParams;
13
- randomDeviceSN: string;
14
- constructor();
15
- setBaseUrl(baseUrl: string, logUrl: string): void;
16
- setLogBaseUrl(logUrl: string): void;
17
- setClientInfo({ clientId, clientSecret }: {
18
- clientId: string;
19
- clientSecret: string;
20
- }): void;
21
- setLogger(logger: Logger): void;
22
- setMeetingInfo(info: IMeetingInfo): void;
23
- setLoginInfo(loginInfo: IToken | null): void;
24
- getLoginInfo(): IToken;
25
- /**
26
- * 设置默认参数,如securityKey
27
- *
28
- * @param data
29
- */
30
- setCommonParams: (data: any) => void;
31
- /**
32
- * 日志上传
33
- *
34
- * @param data
35
- * @returns
36
- */
37
- upload(data: any): Promise<any>;
38
- /**
39
- * 获取公钥,加密登录需使用此公钥
40
- *
41
- * @param { string } account 小鱼账号
42
- * @returns
43
- */
44
- getPublicKey(account: string): Promise<any>;
45
- /**
46
- * 不加密登录
47
- *
48
- * @param sdkUserInfo
49
- */
50
- login(sdkUserInfo: ISdkUserInfo): Promise<any>;
51
- /**
52
- * 加密登录
53
- *
54
- * @param { ISdkUserInfo } sdkUserInfo 小鱼账号
55
- */
56
- encryptLogin(sdkUserInfo: ISdkUserInfo): Promise<any>;
57
- /**
58
- * 定制(RSA直接加密)登录接口(适配SHA512加密老用户)
59
- *
60
- * @param data
61
- * @returns
62
- */
63
- customLogin: (data: any) => Promise<any>;
64
- /**
65
- * 获取匿名账号
66
- *
67
- * @param params
68
- */
69
- getSdkUserInfo(params: ILoginExtAccount): Promise<any>;
70
- /**
71
- * 根据Token获取用户信息
72
- *
73
- * @param { string } token
74
- * @returns
75
- */
76
- getUserInfo(token: string): Promise<any>;
77
- /**
78
- * 获取云会议室信息
79
- *
80
- * @param params
81
- * @returns
82
- */
83
- getCallUri(params: {
84
- number: string;
85
- deviceType: number;
86
- country: string;
87
- }): Promise<any>;
88
- /**
89
- * 校验会议室密码
90
- *
91
- * @param { string } confNumber 会议号
92
- * @param { string } password 密码
93
- * @returns
94
- */
95
- verifyPassword(confNumber: string, password: string): Promise<any>;
96
- /**
97
- * 举手发言
98
- *
99
- * @param { string } type
100
- * @param { string } meetingId
101
- * @param { string } di
102
- * @param { string } conferenceNo 会议号
103
- * @returns
104
- */
105
- hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
106
- /**
107
- * 获取i18n/errorcode等链接
108
- *
109
- * @returns
110
- */
111
- getDefaultServerConfig(): Promise<any>;
112
- /**
113
- * 获取json文件内容
114
- *
115
- * @param { string } url
116
- * @returns
117
- */
118
- getCodeByJson(url: string): Promise<any>;
119
- /**
120
- * 获取随机云会议室号(目前仅用户巡课)
121
- *
122
- * @param { number } userProfileId 用户ID
123
- * @param { string } securityKey
124
- * @param { IGetConferenceParams } params
125
- * @returns
126
- */
127
- getConference(userProfileId: number, securityKey: string, params: IGetConferenceParams): Promise<any>;
128
- /**
129
- * 会议信息埋点
130
- *
131
- * @param { TCategory } category
132
- * @param { TEventName } eventName
133
- * @param { Object } params
134
- */
135
- setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
136
- /**
137
- * 监课模式不需要入会密码
138
- *
139
- * @param { string } confNumber
140
- * @returns
141
- */
142
- ignoreMeetingMonitor(confNumber: string): Promise<any>;
143
- /**
144
- * 信令多活:获取信令服务信息
145
- *
146
- * @param { number } userId 用户ID
147
- * @param { string } server 服务端地址
148
- * @param { boolean } isSupportHybridCloud 是否支持混合云
149
- * @returns
150
- */
151
- getAllocation(userId: number, server: string, isSupportHybridCloud?: boolean): Promise<any>;
152
- /**
153
- * 获取会议室水印
154
- *
155
- * @param { string } conferenceNumber
156
- * @returns
157
- */
158
- getWatermarkContent: (conferenceNumber: string) => Promise<any>;
159
- /**
160
- * 根据外部企业ID获取内部企业ID
161
- *
162
- * @param param0
163
- * @returns
164
- */
165
- getEnterpriseId: ({ extId, clientId, clientSecret, httpServer }: {
166
- extId: string;
167
- clientId: string;
168
- clientSecret: string;
169
- httpServer?: string | undefined;
170
- }) => Promise<any>;
171
- /**
172
- * WebRTC 内外网探测
173
- *
174
- * @param param0
175
- * @returns
176
- */
177
- locator: ({ extId, clientId, clientSecret, httpServer }: {
178
- extId: string;
179
- clientId: string;
180
- clientSecret: string;
181
- httpServer?: string | undefined;
182
- }) => Promise<any>;
183
- /**
184
- * 监会操作
185
- *
186
- * @param params meetingId: 会议号;action: 操作类型;operations: 操作信息
187
- * @returns [hasError, dada]
188
- */
189
- monitorOperation(params: {
190
- meetingId: string;
191
- action: string;
192
- operations: Array<{
193
- callUri: string;
194
- params: string;
195
- }>;
196
- }): Promise<[boolean, any]>;
197
- /**
198
- * 监会 updateWebViewProp 操作
199
- *
200
- * @param meetingId 会议号
201
- * @param operations 操作信息
202
- */
203
- updateWebViewProp(meetingId: string, operations?: Array<{
204
- callUri: string;
205
- params: string;
206
- }>): Promise<[boolean, any]>;
207
- /**
208
- * 检查会议室录制权限
209
- *
210
- * @param { string } confNumber 云会议室号
211
- * @param { string } meetingId 会议室ID
212
- * @returns
213
- */
214
- checkPermissionWithMeetingNumber(confNumber: string, meetingId: string): Promise<any>;
215
- /**
216
- * 录制存储空间检查
217
- *
218
- * @param { string } recordingUrl
219
- * @returns
220
- */
221
- checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<any>;
222
- /**
223
- * 获取企业管理平台带宽配置
224
- *
225
- * @returns
226
- */
227
- getWebRxBandwidth(userId: number): Promise<any>;
228
- /**
229
- * 刷新Token
230
- *
231
- * @returns
232
- */
233
- refreshToken(refresh_token: string): Promise<any>;
234
- }
235
- declare const _default: Action;
236
- export default _default;
1
+ import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams, IMeetingInviteParams } from '../type';
2
+ import Logger from '../tools/logger';
3
+ export interface ICommonParams {
4
+ securityKey: string;
5
+ }
6
+ declare class Action {
7
+ private http;
8
+ private logHttp;
9
+ private meetingInfo;
10
+ private seqId;
11
+ private statesTime;
12
+ commonParams: ICommonParams;
13
+ randomDeviceSN: string;
14
+ private httpDefaultBaseUrl;
15
+ private logHttpDefaultBaseUrl;
16
+ constructor();
17
+ setBaseUrl(baseUrl?: string, logUrl?: string): void;
18
+ setLogBaseUrl(logUrl?: string): void;
19
+ setClientInfo({ clientId, clientSecret }: {
20
+ clientId: string;
21
+ clientSecret: string;
22
+ }): void;
23
+ setLogger(logger: Logger): void;
24
+ setMeetingInfo(info: IMeetingInfo): void;
25
+ setLoginInfo(loginInfo: IToken | null): void;
26
+ getLoginInfo(): IToken;
27
+ /**
28
+ * 设置默认参数,如securityKey
29
+ *
30
+ * @param data
31
+ */
32
+ setCommonParams: (data: any) => void;
33
+ /**
34
+ * 日志上传
35
+ *
36
+ * @param data
37
+ * @returns
38
+ */
39
+ upload(data: any): Promise<any>;
40
+ /**
41
+ * 获取公钥,加密登录需使用此公钥
42
+ *
43
+ * @param { string } account 小鱼账号
44
+ * @returns
45
+ */
46
+ getPublicKey(account: string): Promise<any>;
47
+ /**
48
+ * 不加密登录
49
+ *
50
+ * @param sdkUserInfo
51
+ */
52
+ login(sdkUserInfo: ISdkUserInfo): Promise<any>;
53
+ /**
54
+ * 加密登录
55
+ *
56
+ * @param { ISdkUserInfo } sdkUserInfo 小鱼账号
57
+ */
58
+ encryptLogin(sdkUserInfo: ISdkUserInfo): Promise<any>;
59
+ /**
60
+ * 定制(RSA直接加密)登录接口(适配SHA512加密老用户)
61
+ *
62
+ * @param data
63
+ * @returns
64
+ */
65
+ customLogin: (data: any) => Promise<any>;
66
+ /**
67
+ * 获取匿名账号
68
+ *
69
+ * @param params
70
+ */
71
+ getSdkUserInfo(params: ILoginExtAccount): Promise<any>;
72
+ /**
73
+ * 根据Token获取用户信息
74
+ *
75
+ * @param { string } token
76
+ * @returns
77
+ */
78
+ getUserInfo(token: string): Promise<any>;
79
+ /**
80
+ * 获取云会议室信息
81
+ *
82
+ * @param params
83
+ * @returns
84
+ */
85
+ getCallUri(params: {
86
+ number: string;
87
+ deviceType: number;
88
+ country: string;
89
+ }): Promise<any>;
90
+ /**
91
+ * 校验会议室密码
92
+ *
93
+ * @param { string } confNumber 会议号
94
+ * @param { string } password 密码
95
+ * @returns
96
+ */
97
+ verifyPassword(confNumber: string, password: string): Promise<any>;
98
+ /**
99
+ * 举手发言
100
+ *
101
+ * @param { string } type
102
+ * @param { string } meetingId
103
+ * @param { string } di
104
+ * @param { string } conferenceNo 会议号
105
+ * @returns
106
+ */
107
+ hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
108
+ /**
109
+ * 获取i18n/errorcode等链接
110
+ *
111
+ * @returns
112
+ */
113
+ getDefaultServerConfig(): Promise<any>;
114
+ /**
115
+ * 批量获取serverConfig
116
+ *
117
+ * @param {string[]} includeConfigNameList 需要的配置key值
118
+ * @returns
119
+ */
120
+ getServerConfig(includeConfigNameList?: string[]): Promise<any>;
121
+ /**
122
+ * 获取json文件内容
123
+ *
124
+ * @param { string } url
125
+ * @returns
126
+ */
127
+ getCodeByJson(url: string): Promise<any>;
128
+ /**
129
+ * 获取随机云会议室号(目前仅用户巡课)
130
+ *
131
+ * @param { number } userProfileId 用户ID
132
+ * @param { string } securityKey
133
+ * @param { IGetConferenceParams } params
134
+ * @returns
135
+ */
136
+ getConference(userProfileId: number, securityKey: string, params: IGetConferenceParams): Promise<any>;
137
+ /**
138
+ * 功能操作上报记录
139
+ *
140
+ * @private
141
+ * @param { TCategory } category - 事件类别
142
+ * @param { TEventName } eventName - 事件名称
143
+ * @param { Objet } params - 事件详细数据
144
+ */
145
+ setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
146
+ /**
147
+ * 监课模式不需要入会密码
148
+ *
149
+ * @param { string } confNumber
150
+ * @returns
151
+ */
152
+ ignoreMeetingMonitor(confNumber: string): Promise<any>;
153
+ /**
154
+ * 信令多活:获取信令服务信息
155
+ *
156
+ * @param { number } userId 用户ID
157
+ * @param { string } server 服务端地址
158
+ * @param { boolean } isSupportHybridCloud 是否支持混合云
159
+ * @returns
160
+ */
161
+ getAllocation(userId: number, server: string, isSupportHybridCloud?: boolean): Promise<any>;
162
+ /**
163
+ * 获取会议室水印
164
+ *
165
+ * @param { string } conferenceNumber
166
+ * @returns
167
+ */
168
+ getWatermarkContent: (conferenceNumber: string) => Promise<any>;
169
+ /**
170
+ * 根据外部企业ID获取内部企业ID
171
+ *
172
+ * @param param0
173
+ * @returns
174
+ */
175
+ getEnterpriseId: ({ extId, clientId, clientSecret, httpServer }: {
176
+ extId: string;
177
+ clientId: string;
178
+ clientSecret: string;
179
+ httpServer?: string | undefined;
180
+ }) => Promise<any>;
181
+ /**
182
+ * WebRTC 内外网探测
183
+ *
184
+ * @param param0
185
+ * @returns
186
+ */
187
+ locator: ({ extId, clientId, clientSecret, httpServer }: {
188
+ extId: string;
189
+ clientId: string;
190
+ clientSecret: string;
191
+ httpServer?: string | undefined;
192
+ }) => Promise<any>;
193
+ /**
194
+ * 监会操作
195
+ *
196
+ * @param params meetingId: 会议号;action: 操作类型;operations: 操作信息
197
+ * @returns [hasError, dada]
198
+ */
199
+ monitorOperation(params: {
200
+ meetingId: string;
201
+ action: string;
202
+ operations: Array<{
203
+ callUri: string;
204
+ params: string;
205
+ }>;
206
+ }): Promise<[boolean, any]>;
207
+ /**
208
+ * 监会 updateWebViewProp 操作
209
+ *
210
+ * @param meetingId 会议号
211
+ * @param operations 操作信息
212
+ */
213
+ updateWebViewProp(meetingId: string, operations?: Array<{
214
+ callUri: string;
215
+ params: string;
216
+ }>): Promise<[boolean, any]>;
217
+ /**
218
+ * 检查会议室录制权限
219
+ *
220
+ * @param { string } confNumber 云会议室号
221
+ * @param { string } meetingId 会议室ID
222
+ * @returns
223
+ */
224
+ checkPermissionWithMeetingNumber(confNumber: string, meetingId: string): Promise<any>;
225
+ /**
226
+ * 录制存储空间检查
227
+ *
228
+ * @param { string } recordingUrl
229
+ * @returns
230
+ */
231
+ checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<any>;
232
+ /**
233
+ * 获取企业管理平台带宽配置
234
+ *
235
+ * @returns
236
+ */
237
+ getWebRxBandwidth(userId: number): Promise<any>;
238
+ /**
239
+ * 刷新Token
240
+ *
241
+ * @returns
242
+ */
243
+ refreshToken(refresh_token: string): Promise<any>;
244
+ /**
245
+ * 获取会议邀请链接信息
246
+ */
247
+ getMeetingInviteInfo(params: IMeetingInviteParams): Promise<any>;
248
+ /**
249
+ * 获取个人云会议室信息,包含入会密码和个人云会议室号
250
+ */
251
+ getCloudMeetingRooms(userId: number): Promise<any>;
252
+ }
253
+ declare const _default: Action;
254
+ export default _default;