@xylink/xy-rtc-sdk 3.9.0 → 3.9.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/action/index.d.ts +12 -2
- package/lib/enum/contraints.d.ts +0 -9
- package/lib/enum/index.d.ts +20 -7
- package/lib/index.d.ts +2 -0
- package/lib/main/client.d.ts +89 -27
- package/lib/main/iauth.d.ts +62 -13
- package/lib/main/{layoutManager.d.ts → layout/index.d.ts} +184 -87
- package/lib/main/layout/template.d.ts +64 -0
- package/lib/main/meeting.d.ts +4 -3
- package/lib/tools/browser.d.ts +58 -49
- package/lib/tools/config.d.ts +5 -1
- package/lib/tools/httpClient.d.ts +13 -21
- package/lib/tools/template/index.d.ts +324 -0
- package/lib/tools/template/mobile.d.ts +9 -0
- package/lib/type/action.d.ts +4 -0
- package/lib/type/client.d.ts +65 -142
- package/lib/type/iauth.d.ts +112 -0
- package/lib/type/index.d.ts +1 -0
- package/lib/type/layout.d.ts +164 -13
- package/lib/type/stream.d.ts +1 -1
- package/lib/xyrtc.cjs.js +1 -1
- package/lib/xyrtc.umd.js +1 -1
- package/package.json +2 -1
- package/lib/tools/template.d.ts +0 -21
package/lib/action/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams, IMeetingInviteParams, IMediaConfigParam } from '../type';
|
|
1
|
+
import { ILoginExtAccount, ISdkUserInfo, TEventName, IMeetingInfo, TCategory, IToken, IGetConferenceParams, IMeetingInviteParams, IMediaConfigParam, LoginType, LoginParams } from '../type';
|
|
2
2
|
import Logger from '../tools/logger';
|
|
3
3
|
export interface ICommonParams {
|
|
4
4
|
securityKey: string;
|
|
5
5
|
}
|
|
6
6
|
declare class Action {
|
|
7
|
+
private logger;
|
|
7
8
|
private commonParams;
|
|
8
9
|
private randomDeviceSN;
|
|
9
10
|
private http;
|
|
@@ -92,11 +93,12 @@ declare class Action {
|
|
|
92
93
|
/**
|
|
93
94
|
* 获取i18n/errorcode等链接
|
|
94
95
|
*
|
|
96
|
+
* @deprecated
|
|
95
97
|
* @returns
|
|
96
98
|
*/
|
|
97
99
|
getDefaultServerConfig(): Promise<any>;
|
|
98
100
|
/**
|
|
99
|
-
* 批量获取serverConfig
|
|
101
|
+
* 批量获取serverConfig, 获取错误码/i18n等json链接
|
|
100
102
|
*
|
|
101
103
|
* @param {string[]} includeConfigNameList 需要的配置key值
|
|
102
104
|
* @returns
|
|
@@ -282,6 +284,14 @@ declare class Action {
|
|
|
282
284
|
oauthCode: string;
|
|
283
285
|
isTempUser: boolean;
|
|
284
286
|
}): Promise<any>;
|
|
287
|
+
/**
|
|
288
|
+
* 三方用户统一认证登录
|
|
289
|
+
*
|
|
290
|
+
* @param { LoginType } loginType 登录方式
|
|
291
|
+
* @param { LoginParams } data body信息
|
|
292
|
+
* @returns
|
|
293
|
+
*/
|
|
294
|
+
loginWithUnified(loginType: LoginType, data: LoginParams): Promise<any>;
|
|
285
295
|
/**
|
|
286
296
|
* 设置默认参数,如securityKey
|
|
287
297
|
*
|
package/lib/enum/contraints.d.ts
CHANGED
|
@@ -48,12 +48,3 @@ export declare const RESOLUTION_MAP: Record<string, number>;
|
|
|
48
48
|
* 枚举分辨率对应的最小带宽值
|
|
49
49
|
*/
|
|
50
50
|
export declare const MIN_BANDWIDTH_MAP: Record<string, number>;
|
|
51
|
-
/**
|
|
52
|
-
* 枚举会控平台
|
|
53
|
-
*/
|
|
54
|
-
export declare const MEETING_CONTROL_PLATFORM: {
|
|
55
|
-
PC: string;
|
|
56
|
-
MOBILE: string;
|
|
57
|
-
SIDE: string;
|
|
58
|
-
PROFESSIONAL: string;
|
|
59
|
-
};
|
package/lib/enum/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-30 14:12:52
|
|
6
6
|
*/
|
|
7
|
-
import { IDefault, IOPERATE_MAP,
|
|
7
|
+
import { IDefault, IOPERATE_MAP, IRoster, IFeatureConfig, StreamStatus, StreamType, ILoggerConfig, FacingMode, TemplateMode, ContentTemplateMode } from '../type';
|
|
8
8
|
export * from './contraints';
|
|
9
9
|
export declare const LOG_CACHE_COUNT = 10;
|
|
10
10
|
export declare const DB_TABLE_COUNT = 10;
|
|
@@ -61,6 +61,10 @@ export declare const RESOLUTION_TYPE: number[];
|
|
|
61
61
|
* 每页最大显示终端数
|
|
62
62
|
*/
|
|
63
63
|
export declare const MAX_PAGE_SIZE = 9;
|
|
64
|
+
/**
|
|
65
|
+
* 移动端 对称布局 最大请流数量
|
|
66
|
+
*/
|
|
67
|
+
export declare const MAX_MOBILE_PAGE_SIZE = 6;
|
|
64
68
|
/**
|
|
65
69
|
* 网络信息
|
|
66
70
|
*/
|
|
@@ -87,21 +91,21 @@ export declare const DEFAULT_ROSTER: IRoster;
|
|
|
87
91
|
*/
|
|
88
92
|
export declare const DEFAULT: IDefault;
|
|
89
93
|
/**
|
|
90
|
-
*
|
|
94
|
+
* 非content 默认模版类型数组
|
|
91
95
|
*/
|
|
92
|
-
export declare const
|
|
96
|
+
export declare const TEMPLATE_MODE_LIST: TemplateMode[];
|
|
93
97
|
/**
|
|
94
|
-
* content
|
|
98
|
+
* content 模板类型数组
|
|
95
99
|
*/
|
|
96
|
-
export declare const
|
|
100
|
+
export declare const CONTENT_TEMPLATE_MODE_LIST: ContentTemplateMode[];
|
|
97
101
|
/**
|
|
98
102
|
* 非content 默认模板类型
|
|
99
103
|
*/
|
|
100
|
-
export declare const TEMPLATE_DEFAULT_MODE =
|
|
104
|
+
export declare const TEMPLATE_DEFAULT_MODE = TemplateMode.SPEAKER;
|
|
101
105
|
/**
|
|
102
106
|
* content 模板类型
|
|
103
107
|
*/
|
|
104
|
-
export declare const CONTENT_DEFAULT_TEMPLATE_MODE =
|
|
108
|
+
export declare const CONTENT_DEFAULT_TEMPLATE_MODE = ContentTemplateMode.MULTI_PIC_CONTENT_HIGH_PRIORITY;
|
|
105
109
|
/**
|
|
106
110
|
* 用户类型
|
|
107
111
|
*/
|
|
@@ -186,3 +190,12 @@ export declare const ENTERPRISE_CONFIG: {
|
|
|
186
190
|
configName: string;
|
|
187
191
|
};
|
|
188
192
|
};
|
|
193
|
+
/**
|
|
194
|
+
* 枚举会控平台
|
|
195
|
+
*/
|
|
196
|
+
export declare const MEETING_CONTROL_PLATFORM: {
|
|
197
|
+
PC: string;
|
|
198
|
+
MOBILE: string;
|
|
199
|
+
SIDE: string;
|
|
200
|
+
PROFESSIONAL: string;
|
|
201
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import Logger from './tools/logger';
|
|
|
12
12
|
import Client from './main/client';
|
|
13
13
|
import Stream from './main/stream';
|
|
14
14
|
import { getVideoInfoByRotation, getSendSupportedCodec, getLayoutRotateInfo, getLayoutItemState, detectLocator } from './main/helper';
|
|
15
|
+
import BrowserDetector from './tools/browser';
|
|
15
16
|
/**
|
|
16
17
|
* XYLink WebRTC SDK 操作入口
|
|
17
18
|
*/
|
|
@@ -35,3 +36,4 @@ export default xyRTC;
|
|
|
35
36
|
export { Client, Stream, Logger, DeviceManager, getLayoutItemState, getVideoInfoByRotation as getVideoInfoByRotaion, getLayoutRotateInfo, getSendSupportedCodec, detectLocator };
|
|
36
37
|
export * from './type';
|
|
37
38
|
export { ERROR_CODE } from './enum/errorCode';
|
|
39
|
+
export { BrowserDetector };
|
package/lib/main/client.d.ts
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-23 12:04:44
|
|
6
6
|
*/
|
|
7
|
-
import { IClientConfig, ICall, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternals, IVideoAudioType, ShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, ContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage, IFeatureConfig, IConfMgmtUrl, IVideoControlResult, ICustomMessageConfig, OperateType, PushType, FacingMode, IFacingMode, ILoginWidthAuthCode } from '../type';
|
|
7
|
+
import { IClientConfig, ICall, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternals, IVideoAudioType, ShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, ContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage, IFeatureConfig, IConfMgmtUrl, IVideoControlResult, ICustomMessageConfig, OperateType, PushType, FacingMode, IFacingMode, ILoginWidthAuthCode, LoginXYAccountParams, LoginExtTokenParams, IReturnResult, InviteInfo, LayoutOrientationType } from '../type';
|
|
8
8
|
import Emitter from '../tools/emitter';
|
|
9
9
|
import Socket from '../tools/socket';
|
|
10
10
|
import Stream from './stream';
|
|
11
11
|
import Logger from '../tools/logger';
|
|
12
12
|
import IAuth from './iauth';
|
|
13
13
|
import DeviceManager from './deviceManager';
|
|
14
|
-
import LayoutManager from './
|
|
14
|
+
import LayoutManager from './layout';
|
|
15
15
|
export default class Client extends Emitter {
|
|
16
16
|
logger: Logger;
|
|
17
17
|
iauth: IAuth;
|
|
@@ -148,6 +148,13 @@ export default class Client extends Emitter {
|
|
|
148
148
|
* @returns { IMediaConfig }
|
|
149
149
|
*/
|
|
150
150
|
getEnterpriseMediaConfig(): import("../type").IMediaConfig;
|
|
151
|
+
/**
|
|
152
|
+
* 切换布局方向
|
|
153
|
+
*
|
|
154
|
+
* @param { LayoutOrientationType } orientation - 布局方向: MOBILE_HORIZONTAL(横屏);MOBILE_VERTICAL(竖屏)
|
|
155
|
+
* @returns { Promise<IReturnResult> }
|
|
156
|
+
*/
|
|
157
|
+
setLayoutOrientation(orientation: LayoutOrientationType): Promise<IReturnResult>;
|
|
151
158
|
/**
|
|
152
159
|
* 设置本地是否在等候室
|
|
153
160
|
*
|
|
@@ -157,34 +164,60 @@ export default class Client extends Emitter {
|
|
|
157
164
|
/**
|
|
158
165
|
* 小鱼账号初始登录,获取token方法
|
|
159
166
|
*
|
|
167
|
+
* @deprecated 已废弃 但不影响老客户调用,建议使用新登录方式:loginXYAccount
|
|
160
168
|
* @public
|
|
161
169
|
* @param { string } userName 小鱼用户账号
|
|
162
170
|
* @param { string } password 小鱼用户账号密码
|
|
163
|
-
* @returns { Promise<
|
|
171
|
+
* @returns { Promise<IReturnResult> } 登录结果
|
|
164
172
|
*/
|
|
165
|
-
loginXYlinkAccount(userName: string, password: string): Promise<
|
|
173
|
+
loginXYlinkAccount(userName: string, password: string): Promise<IReturnResult>;
|
|
166
174
|
/**
|
|
167
|
-
*
|
|
175
|
+
* 第三方账号登录
|
|
168
176
|
*
|
|
169
177
|
* @public
|
|
170
178
|
* @param { ILoginExtAccount } params 参数
|
|
171
|
-
* @
|
|
179
|
+
* @param { string } params.displayName 用户名称
|
|
180
|
+
* @param { string } params.extId 企业ID
|
|
181
|
+
* @param { string } params.extUserId 三方用户ID
|
|
182
|
+
* @param { string } params.authCode 授权码 v3.8.2新增
|
|
183
|
+
* @param { string } params.tempUser 是否是临时账号 v3.8.2新增
|
|
184
|
+
* @return { Promise<IReturnResult> } 登录结果
|
|
185
|
+
*/
|
|
186
|
+
loginExternalAccount(params: ILoginExtAccount): Promise<IReturnResult>;
|
|
187
|
+
/**
|
|
188
|
+
* 三方账号统一认证登录 - 小鱼账号登录
|
|
189
|
+
*
|
|
190
|
+
* @param { LoginXYAccountParams } params 参数
|
|
191
|
+
* @param { string } params.account 用户账号
|
|
192
|
+
* @param { string } params.password 用户密码
|
|
193
|
+
* @param { string } params.countryCode 国家码:默认+86
|
|
194
|
+
* @param { string } params.extId 企业ID
|
|
195
|
+
* @return { Promise<IReturnResult> } 登录结果
|
|
196
|
+
*/
|
|
197
|
+
loginXYAccount(params: LoginXYAccountParams): Promise<IReturnResult>;
|
|
198
|
+
/**
|
|
199
|
+
* 三方账号统一认证登录 - token登录
|
|
200
|
+
*
|
|
201
|
+
* @param { LoginExtTokenParams } params 参数
|
|
202
|
+
* @param { string } params.authCode 登录码
|
|
203
|
+
* @param { string? } params.extId 企业ID
|
|
204
|
+
* @return { Promise<IReturnResult> } 登录结果
|
|
172
205
|
*/
|
|
173
|
-
|
|
206
|
+
loginExtToken(params: LoginExtTokenParams): Promise<IReturnResult>;
|
|
174
207
|
/**
|
|
175
|
-
*
|
|
208
|
+
* 建行授权码登录
|
|
176
209
|
*
|
|
177
210
|
* @public
|
|
178
211
|
* @param { ILoginWidthAuthCode } params 参数
|
|
179
|
-
* @param {string}
|
|
180
|
-
* @param {string}
|
|
181
|
-
* @param {string}
|
|
182
|
-
* @param {string}
|
|
183
|
-
* @param {boolean} params.isTempUser 是否临时账户
|
|
184
|
-
* @param {string} params.channelId 渠道id
|
|
185
|
-
* @return { Promise<
|
|
212
|
+
* @param { string } params.extId 企业id
|
|
213
|
+
* @param { string } params.extUserId 用户id
|
|
214
|
+
* @param { string } params.displayName 用户名称
|
|
215
|
+
* @param { string } params.oauthCode 授权码
|
|
216
|
+
* @param { boolean } params.isTempUser 是否临时账户
|
|
217
|
+
* @param { string } params.channelId 渠道id
|
|
218
|
+
* @return { Promise<IReturnResult> } 登录结果
|
|
186
219
|
*/
|
|
187
|
-
loginWithAuthCode(params: ILoginWidthAuthCode): Promise<
|
|
220
|
+
loginWithAuthCode(params: ILoginWidthAuthCode): Promise<IReturnResult>;
|
|
188
221
|
/**
|
|
189
222
|
* 退会时 重置初始化参数
|
|
190
223
|
*
|
|
@@ -210,7 +243,7 @@ export default class Client extends Emitter {
|
|
|
210
243
|
* @property { boolean } config.enableWatermarkContent 是否启用获取content水印内容, 默认启用, 设置为true
|
|
211
244
|
* @returns { IResult }
|
|
212
245
|
*/
|
|
213
|
-
setFeatureConfig(config: IFeatureConfig):
|
|
246
|
+
setFeatureConfig(config: IFeatureConfig): IReturnResult | undefined;
|
|
214
247
|
/**
|
|
215
248
|
* 获取会控地址
|
|
216
249
|
*/
|
|
@@ -299,6 +332,13 @@ export default class Client extends Emitter {
|
|
|
299
332
|
* @returns { Promise<IMode> } 切换后的布局模式
|
|
300
333
|
*/
|
|
301
334
|
switchLayout(templateMode?: IMode): Promise<IMode>;
|
|
335
|
+
/**
|
|
336
|
+
* 切换主画面
|
|
337
|
+
*
|
|
338
|
+
* @param { string } id 指定切换到主画面的LayoutId
|
|
339
|
+
* @returns { Promise<string> } LayoutId
|
|
340
|
+
*/
|
|
341
|
+
setFocusView(id: string): Promise<string>;
|
|
302
342
|
/**
|
|
303
343
|
* AUTO布局 分页
|
|
304
344
|
*
|
|
@@ -336,6 +376,12 @@ export default class Client extends Emitter {
|
|
|
336
376
|
* @param { Object } data 远端数据
|
|
337
377
|
*/
|
|
338
378
|
private onEPMessage;
|
|
379
|
+
/**
|
|
380
|
+
* 处理联席主持人消息
|
|
381
|
+
*
|
|
382
|
+
* @param data
|
|
383
|
+
*/
|
|
384
|
+
private onNotification;
|
|
339
385
|
/**
|
|
340
386
|
* 通知会控打开/关闭摄像头结果
|
|
341
387
|
*
|
|
@@ -343,26 +389,26 @@ export default class Client extends Emitter {
|
|
|
343
389
|
* @param { IVideoControlResult } data - 数据详情
|
|
344
390
|
* @returns { Promise<IReturnResult | null> }
|
|
345
391
|
*/
|
|
346
|
-
sendVideoControlResult(type: 'muteVideo' | 'unMuteVideo', data: IVideoControlResult): Promise<
|
|
392
|
+
sendVideoControlResult(type: 'muteVideo' | 'unMuteVideo', data: IVideoControlResult): Promise<IReturnResult>;
|
|
347
393
|
/**
|
|
348
|
-
*
|
|
394
|
+
* 处理远端录制状态上报
|
|
349
395
|
*
|
|
350
396
|
* @private
|
|
351
|
-
* @param {
|
|
397
|
+
* @param { IRecordStatusNotification } data
|
|
352
398
|
*/
|
|
353
399
|
private onRecordStatusNotfiMessage;
|
|
354
400
|
/**
|
|
355
|
-
*
|
|
401
|
+
* 处理本地录制结果上报Message
|
|
356
402
|
*
|
|
357
403
|
* @private
|
|
358
|
-
* @param {
|
|
404
|
+
* @param { IRecordingStateChanged } data
|
|
359
405
|
*/
|
|
360
406
|
private onRecordingStateChangedMessage;
|
|
361
407
|
/**
|
|
362
408
|
* 处理Content状态控制消息
|
|
363
409
|
*
|
|
364
410
|
* @private
|
|
365
|
-
* @param { Object } data
|
|
411
|
+
* @param { Object } data
|
|
366
412
|
*/
|
|
367
413
|
private onDualStreamMessage;
|
|
368
414
|
/**
|
|
@@ -512,11 +558,21 @@ export default class Client extends Emitter {
|
|
|
512
558
|
* @returns
|
|
513
559
|
*/
|
|
514
560
|
private getCodeByJson;
|
|
561
|
+
/**
|
|
562
|
+
* 添加音视频开启/关闭 同步任务
|
|
563
|
+
*
|
|
564
|
+
* @private
|
|
565
|
+
* @param { OperateType } type 操作类型
|
|
566
|
+
* @param { boolean } isSendWs 是否向信令发送对应消息,默认:发送(true); 信令下发的音频mute/unmute,不再向信令发送此消息
|
|
567
|
+
* @returns Promise
|
|
568
|
+
*/
|
|
569
|
+
private addOperateVideoAudioTask;
|
|
515
570
|
/**
|
|
516
571
|
* 音视频开启/关闭操作
|
|
517
572
|
*
|
|
518
573
|
* @private
|
|
519
574
|
* @param { OperateType } type 操作类型
|
|
575
|
+
* @param { boolean } isSendWs 是否向信令发送对应消息,默认:发送(true); 信令下发的音频mute/unmute,不再向信令发送此消息
|
|
520
576
|
* @returns Promise<IVideoAudioType> 类型
|
|
521
577
|
*/
|
|
522
578
|
private operateVideoAudio;
|
|
@@ -655,7 +711,7 @@ export default class Client extends Emitter {
|
|
|
655
711
|
* @param { string } config.data - 消息内容,JSON字符串;因业务数据可能会传输图片,需要对二进制数据进行base64编码,消息长度限制最大:1030KB
|
|
656
712
|
* @return { { code: string, message: string, data: null | object } } 返回结果
|
|
657
713
|
*/
|
|
658
|
-
sendCustomMessage(config: ICustomMessageConfig):
|
|
714
|
+
sendCustomMessage(config: ICustomMessageConfig): IReturnResult;
|
|
659
715
|
/**
|
|
660
716
|
* 处理媒体消息
|
|
661
717
|
*
|
|
@@ -983,7 +1039,7 @@ export default class Client extends Emitter {
|
|
|
983
1039
|
* @param { number } mediagroupId 分组id,也称sessionId或者mediaGroupId,代表只向此分组通道发送音频数据
|
|
984
1040
|
* @returns { boolean }
|
|
985
1041
|
*/
|
|
986
|
-
bindTrackGroup(trackType: 'audio' | 'video', mediagroupId: number): true |
|
|
1042
|
+
bindTrackGroup(trackType: 'audio' | 'video', mediagroupId: number): true | IReturnResult;
|
|
987
1043
|
/**
|
|
988
1044
|
* 启用多分组通道,接收多分组通道数据
|
|
989
1045
|
*
|
|
@@ -991,7 +1047,7 @@ export default class Client extends Emitter {
|
|
|
991
1047
|
* @param { Key[] } mediagrpIds 多分组sessionId,可以配置多个或一个值
|
|
992
1048
|
* @returns { boolean }
|
|
993
1049
|
*/
|
|
994
|
-
startMonitorGroup(mediagrpIds: Key[]): true |
|
|
1050
|
+
startMonitorGroup(mediagrpIds: Key[]): true | IReturnResult;
|
|
995
1051
|
/**
|
|
996
1052
|
* 停止多分组通道,销毁资源
|
|
997
1053
|
*
|
|
@@ -999,7 +1055,13 @@ export default class Client extends Emitter {
|
|
|
999
1055
|
* @param { Key[] } mediagrpIds 多分组sessionId,可以配置多个或一个值
|
|
1000
1056
|
* @returns { boolean }
|
|
1001
1057
|
*/
|
|
1002
|
-
stopMonitorGroup(mediagrpIds: Key[]): true |
|
|
1058
|
+
stopMonitorGroup(mediagrpIds: Key[]): true | IReturnResult;
|
|
1059
|
+
/**
|
|
1060
|
+
* 获取会议分享详情信息
|
|
1061
|
+
*
|
|
1062
|
+
* @returns {Promise<InviteInfo>}
|
|
1063
|
+
*/
|
|
1064
|
+
getMeetingInviteInfo(): Promise<InviteInfo>;
|
|
1003
1065
|
/**
|
|
1004
1066
|
* 设置多分组通道,通用方法
|
|
1005
1067
|
*
|
package/lib/main/iauth.d.ts
CHANGED
|
@@ -2,29 +2,27 @@
|
|
|
2
2
|
* 登录模块
|
|
3
3
|
*
|
|
4
4
|
*/
|
|
5
|
-
import { ILoginExtAccount, ISdkUserInfo, ILoginInfo, ILoginWidthAuthCode } from '../type';
|
|
5
|
+
import { ILoginExtAccount, ISdkUserInfo, ILoginInfo, ILoginWidthAuthCode, LoginXYAccountParams, LoginExtTokenParams, ExtInfo } from '../type';
|
|
6
6
|
import Logger from '../tools/logger';
|
|
7
7
|
declare class IAuth {
|
|
8
8
|
private logger;
|
|
9
9
|
private loginInfo;
|
|
10
|
-
|
|
10
|
+
private extInfo;
|
|
11
|
+
constructor(logger: Logger, extInfo?: ExtInfo);
|
|
11
12
|
getLoginInfo(): ILoginInfo;
|
|
12
13
|
setLoginInfo(loginInfo: ILoginInfo): void;
|
|
14
|
+
setExtInfo(info: ExtInfo): void;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* 第三方账号登录 - 旧方法
|
|
15
17
|
*
|
|
16
18
|
* @public
|
|
17
19
|
* @param { ILoginExtAccount } params 参数
|
|
18
|
-
* @
|
|
20
|
+
* @param { string } params.displayName 用户名称
|
|
21
|
+
* @param { string } params.extId 企业id
|
|
22
|
+
* @param { string? } params.extUserId 三方用户ID
|
|
23
|
+
* @return
|
|
19
24
|
*/
|
|
20
|
-
loginExternalAccount(params: ILoginExtAccount): Promise<
|
|
21
|
-
/**
|
|
22
|
-
* 登录
|
|
23
|
-
*
|
|
24
|
-
* @param { ISdkUserInfo } sdkUserInfo
|
|
25
|
-
* @param { ILoginExtAccount } params
|
|
26
|
-
*/
|
|
27
|
-
login(sdkUserInfo: ISdkUserInfo, params?: ILoginExtAccount): Promise<import("../type").IReturnResult>;
|
|
25
|
+
loginExternalAccount(params: ILoginExtAccount): Promise<import("../type").IReturnResult>;
|
|
28
26
|
/**
|
|
29
27
|
* 授权码登录
|
|
30
28
|
*
|
|
@@ -35,8 +33,59 @@ declare class IAuth {
|
|
|
35
33
|
* @param {string} params.oauthCode 授权码
|
|
36
34
|
* @param {boolean} params.isTempUser 是否临时账户
|
|
37
35
|
* @param {string} params.channelId 渠道id
|
|
38
|
-
* @return
|
|
36
|
+
* @return
|
|
39
37
|
*/
|
|
40
38
|
loginWithAuthCode(params: ILoginWidthAuthCode): Promise<import("../type").IReturnResult>;
|
|
39
|
+
/**
|
|
40
|
+
* 登录
|
|
41
|
+
*
|
|
42
|
+
* @param { ISdkUserInfo } sdkUserInfo
|
|
43
|
+
* @param { ILoginExtAccount } params
|
|
44
|
+
* @return
|
|
45
|
+
*/
|
|
46
|
+
login(sdkUserInfo: ISdkUserInfo, params?: ILoginExtAccount): Promise<import("../type").IReturnResult>;
|
|
47
|
+
/**
|
|
48
|
+
* 三方用户统一认证-小鱼账号登录
|
|
49
|
+
*
|
|
50
|
+
* @param { LoginXYAccountParams } params 参数
|
|
51
|
+
* @return
|
|
52
|
+
*/
|
|
53
|
+
loginXYAccount(params: LoginXYAccountParams): Promise<import("../type").IReturnResult>;
|
|
54
|
+
/**
|
|
55
|
+
* 三方用户统一认证-三方id登录
|
|
56
|
+
*
|
|
57
|
+
* @param { ILoginExtAccount } params 参数
|
|
58
|
+
* @return
|
|
59
|
+
*/
|
|
60
|
+
loginExtUserId(params: ILoginExtAccount): Promise<import("../type").IReturnResult>;
|
|
61
|
+
/**
|
|
62
|
+
* 三方用户统一认证-token登录
|
|
63
|
+
*
|
|
64
|
+
* @param { LoginExtTokenParams } params 参数
|
|
65
|
+
* @return
|
|
66
|
+
*/
|
|
67
|
+
loginExtToken(params: LoginExtTokenParams): Promise<import("../type").IReturnResult>;
|
|
68
|
+
/**
|
|
69
|
+
* 统一处理登录后的信息
|
|
70
|
+
*
|
|
71
|
+
* @param { any } result 接口返回值
|
|
72
|
+
* @param { ILoginExtAccount } params
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
private handleLoginResult;
|
|
76
|
+
/**
|
|
77
|
+
* 校验必填参数
|
|
78
|
+
*
|
|
79
|
+
* @param { Record<string, any> | any } requiredField 校验参数
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
private verifyRequiredField;
|
|
83
|
+
/**
|
|
84
|
+
* 校验三方用户ID
|
|
85
|
+
*
|
|
86
|
+
* @param { string } extUserId 三方用户ID
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
private verifyExtUserId;
|
|
41
90
|
}
|
|
42
91
|
export default IAuth;
|