@xylink/xy-rtc-sdk 2.0.6 → 2.1.2-beta.7

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.
@@ -1,10 +1,4 @@
1
- /**
2
- * webrtc action request
3
- *
4
- * @authors Luo-jinghui (luojinghui424@gmail.com)
5
- * @date 2019-10-30 14:14:04
6
- */
7
- import { ILoginExtAccount, ISdkUserInfo, TStateAction, TEventName, IMeetingInfo, TCategory, IToken } from '../type';
1
+ import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams } from '../type';
8
2
  import Logger from '../tools/logger';
9
3
  export interface ICommonParams {
10
4
  securityKey: string;
@@ -16,52 +10,221 @@ declare class Action {
16
10
  private seqId;
17
11
  private statesTime;
18
12
  commonParams: ICommonParams;
13
+ randomDeviceSN: string;
19
14
  constructor();
20
15
  setBaseUrl(baseUrl: string, logUrl: string): void;
21
16
  setLogBaseUrl(logUrl: string): void;
22
- setClientId(clientId: string): void;
17
+ setClientInfo({ clientId, clientSecret }: {
18
+ clientId: string;
19
+ clientSecret: string;
20
+ }): void;
23
21
  setLogger(logger: Logger): void;
24
22
  setMeetingInfo(info: IMeetingInfo): void;
25
23
  setLoginInfo(loginInfo: IToken | null): void;
26
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
+ */
27
37
  upload(data: any): Promise<any>;
28
38
  /**
29
- * 获取小鱼世界账号密码
39
+ * 获取公钥,加密登录需使用此公钥
40
+ *
41
+ * @param { string } account 小鱼账号
42
+ * @returns
43
+ */
44
+ getPublicKey(account: string): Promise<any>;
45
+ /**
46
+ * 不加密登录
30
47
  *
31
48
  * @param sdkUserInfo
32
- * @param params
33
49
  */
34
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>;
35
64
  /**
36
65
  * 获取匿名账号
37
66
  *
38
67
  * @param params
39
68
  */
40
69
  getSdkUserInfo(params: ILoginExtAccount): Promise<any>;
70
+ /**
71
+ * 根据Token获取用户信息
72
+ *
73
+ * @param { string } token
74
+ * @returns
75
+ */
41
76
  getUserInfo(token: string): Promise<any>;
42
- getCallUri(params: any): 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
+ */
43
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
+ */
44
105
  hand(type: string, meetingId: string, di: string, conferenceNo: string): Promise<any>;
45
- fetchErrorCode(): Promise<any>;
46
- getErrorCodeByJson(url: string): Promise<any>;
47
- getConference(userProfileId: number, securityKey: string): Promise<any>;
48
- setStates1(action: TStateAction, eventName: TEventName, params?: {}): Promise<void>;
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
+ */
49
135
  setStates(category: TCategory, eventName: TEventName, params?: {}): Promise<void>;
50
- igonreMeetingMonito(confNumber: string): Promise<any>;
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
+ */
51
151
  getAllocation(userId: number, server: string, isSupportHybridCloud?: boolean): Promise<any>;
152
+ /**
153
+ * 获取会议室水印
154
+ *
155
+ * @param { string } conferenceNumber
156
+ * @returns
157
+ */
52
158
  getWatermarkContent: (conferenceNumber: string) => Promise<any>;
159
+ /**
160
+ * 根据外部企业ID获取内部企业ID
161
+ *
162
+ * @param param0
163
+ * @returns
164
+ */
53
165
  getEnterpriseId: ({ extId, clientId, clientSecret, httpServer }: {
54
166
  extId: string;
55
167
  clientId: string;
56
168
  clientSecret: string;
57
169
  httpServer?: string | undefined;
58
170
  }) => Promise<any>;
171
+ /**
172
+ * WebRTC 内外网探测
173
+ *
174
+ * @param param0
175
+ * @returns
176
+ */
59
177
  locator: ({ extId, clientId, clientSecret, httpServer }: {
60
178
  extId: string;
61
179
  clientId: string;
62
180
  clientSecret: string;
63
181
  httpServer?: string | undefined;
64
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>;
65
228
  }
66
229
  declare const _default: Action;
67
230
  export default _default;
@@ -0,0 +1,115 @@
1
+ import { ICONTENT_CONTRAINTS, IBASE_CONTRAINTS } from '../type';
2
+ /**
3
+ * 初始默认采集分辨率
4
+ */
5
+ export declare const BASE_RESOLUTION_CONTRAINTS: {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ /**
10
+ * 360P
11
+ */
12
+ export declare const RESOLUTION_360_CONTRAINTS: {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ /**
17
+ * people 采集基础配置
18
+ *
19
+ *
20
+ */
21
+ export declare const BASE_CONTRAINTS: IBASE_CONTRAINTS;
22
+ /**
23
+ * content 采集基础配置
24
+ */
25
+ export declare const CONTENT_BASE_CONTRAINTS: ICONTENT_CONTRAINTS;
26
+ /**
27
+ * content 720P 1080P 采集配置信息
28
+ *
29
+ * common: 普通模式
30
+ * advanced: 高级模式, 帧率、宽、高 可进行最大、最小、期望设置
31
+ */
32
+ export declare const CONTENT_CONTRAINTS: {
33
+ '720': {
34
+ common: {
35
+ frameRate?: ConstrainDouble | undefined;
36
+ width: number;
37
+ height: number;
38
+ cursor: string;
39
+ aspectRatio: number;
40
+ resizeMode: "crop-and-scale";
41
+ logicalSurface: true;
42
+ } | {
43
+ frameRate: ConstrainDouble;
44
+ width: number;
45
+ height: number;
46
+ cursor: string;
47
+ aspectRatio: number;
48
+ resizeMode: "crop-and-scale";
49
+ logicalSurface: true;
50
+ };
51
+ advanced: {
52
+ frameRate: {
53
+ ideal: number;
54
+ max: number;
55
+ };
56
+ width: {
57
+ ideal: number;
58
+ max: number;
59
+ };
60
+ height: {
61
+ ideal: number;
62
+ max: number;
63
+ };
64
+ cursor: string;
65
+ aspectRatio: number;
66
+ resizeMode: "crop-and-scale";
67
+ logicalSurface: true;
68
+ };
69
+ };
70
+ '1080': {
71
+ common: {
72
+ frameRate?: ConstrainDouble | undefined;
73
+ width: number;
74
+ height: number;
75
+ cursor: string;
76
+ aspectRatio: number;
77
+ resizeMode: "crop-and-scale";
78
+ logicalSurface: true;
79
+ } | {
80
+ frameRate: ConstrainDouble;
81
+ width: number;
82
+ height: number;
83
+ cursor: string;
84
+ aspectRatio: number;
85
+ resizeMode: "crop-and-scale";
86
+ logicalSurface: true;
87
+ };
88
+ advanced: {
89
+ frameRate: {
90
+ ideal: number;
91
+ max: number;
92
+ };
93
+ width: {
94
+ ideal: number;
95
+ max: number;
96
+ };
97
+ height: {
98
+ ideal: number;
99
+ max: number;
100
+ };
101
+ cursor: string;
102
+ aspectRatio: number;
103
+ resizeMode: "crop-and-scale";
104
+ logicalSurface: true;
105
+ };
106
+ };
107
+ };
108
+ /**
109
+ * people 180P 360P 720P 采集配置信息
110
+ *
111
+ * common: 普通模式
112
+ * advanced: 高级模式, 帧率、宽、高 可进行最大、最小、期望设置
113
+ */
114
+ export declare const PEOPLE_CONTRAINTS: any;
115
+ export declare const RESOLUTION_MAP: Record<string, number>;