@xylink/xy-rtc-sdk 2.0.8 → 2.0.10-beta.0

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.
@@ -4,7 +4,7 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-23 12:04:44
6
6
  */
7
- import { IClientConfig, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, IServers, ILoginExtAccount, ISdkUserInfo, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternels, IVideoAudioType, ISahreContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, IContentMode } from '../type';
7
+ import { IClientConfig, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, IServers, ILoginExtAccount, ISdkUserInfo, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternels, IVideoAudioType, ISahreContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, IContentMode, ILoginWidthAuthCode, IStatus } from '../type';
8
8
  import Emmitter from '../tools/emmitter';
9
9
  import Socket from '../tools/socket';
10
10
  import Stream from './stream';
@@ -277,7 +277,7 @@ export default class Client extends Emmitter {
277
277
  * @param { string } password 小鱼用户账号密码
278
278
  * @returns { Promise<Object> } { access_token }
279
279
  */
280
- loginXYlinkAccount(userName: string, password: string): Promise<Object>;
280
+ loginXYlinkAccount(userName: string, password: string): Promise<IStatus>;
281
281
  /**
282
282
  * 获取第三方user info & 获取token方法
283
283
  *
@@ -294,9 +294,22 @@ export default class Client extends Emmitter {
294
294
  *
295
295
  * @public
296
296
  * @param { ILoginExtAccount } params 参数
297
- * @return { Promise<Object> } 登录结果
297
+ * @return { Promise<IStatus> } 登录结果
298
298
  */
299
- loginExternalAccount(params: ILoginExtAccount): Promise<Object>;
299
+ loginExternalAccount(params: ILoginExtAccount): Promise<IStatus>;
300
+ /**
301
+ * 授权码登录
302
+ *
303
+ * @param { ILoginWidthAuthCode } params 参数
304
+ * @param {string} params.extID 企业id
305
+ * @param {string} params.extUserId 用户id
306
+ * @param {string} params.oauthCode 授权码
307
+ * @param {string} params.channelId 渠道id
308
+ * @param {string?} params.displayName 用户名称
309
+ * @param {boolean?} params.isTempUser 是否临时账户
310
+ * @return {*}
311
+ */
312
+ loginWithAuthCode(params: ILoginWidthAuthCode): Promise<IStatus>;
300
313
  /**
301
314
  * 获取随机云会议室 - 目前用于教育
302
315
  *
@@ -4,7 +4,7 @@
4
4
  * @authors Luo-jinghui (luojinghui424@gmail.com)
5
5
  * @date 2019-10-24 14:06:05
6
6
  */
7
- export declare const version = "2.0.8 - build on 2022-09-01 19:14";
7
+ export declare const version = "2.0.10-beta.0 - build on 2023-11-21 09:52";
8
8
  export declare const proxy: {
9
9
  wssHost: string;
10
10
  restHost: string;
@@ -27,6 +27,7 @@ declare class HttpClient {
27
27
  logger: Logger | null;
28
28
  private baseUrl;
29
29
  private clientId;
30
+ private clientSecret;
30
31
  private retryCount;
31
32
  constructor(commonOption: IAxiosRequestConfig);
32
33
  refreshToken({ baseURL, refresh_token }: {
@@ -35,17 +36,20 @@ declare class HttpClient {
35
36
  }): Promise<any>;
36
37
  setLogger(logger: Logger): void;
37
38
  setBaseUrl(url: string): void;
38
- setClientId(clientId: string): void;
39
+ setClientInfo({ clientId, clientSecret }: {
40
+ clientId: string;
41
+ clientSecret: string;
42
+ }): void;
39
43
  setHttpConfig(config: IAxiosRequestConfig): void;
40
44
  setHeader(params: ISignParams): any;
41
45
  setLoginInfo(loginInfo: IToken | null): void;
42
46
  getLoginInfo(): any;
43
- assignOptions: (option?: AxiosRequestConfig) => AxiosRequestConfig & {
47
+ assignOptions: (option?: AxiosRequestConfig | undefined) => AxiosRequestConfig & {
44
48
  params: any;
45
49
  };
46
- get: (url: string, option?: IAxiosRequestConfig) => any;
47
- put: (url: string, data?: any, option?: AxiosRequestConfig) => any;
48
- post: (url: string, data?: any, option?: AxiosRequestConfig) => any;
49
- delete: (url: string, option?: AxiosRequestConfig) => any;
50
+ get: (url: string, option?: IAxiosRequestConfig | undefined) => any;
51
+ put: (url: string, data?: any, option?: AxiosRequestConfig | undefined) => any;
52
+ post: (url: string, data?: any, option?: AxiosRequestConfig | undefined) => any;
53
+ delete: (url: string, option?: AxiosRequestConfig | undefined) => any;
50
54
  }
51
55
  export default HttpClient;
@@ -52,3 +52,11 @@ export declare const getStatus: (code: string, detail?: any, msg?: string) => {
52
52
  detail: any;
53
53
  };
54
54
  export declare const getErrorMsg: (err: Error) => string;
55
+ export declare const TYPEOF: {
56
+ isNumber(num: any): boolean;
57
+ isObject(obj: any): boolean;
58
+ isArray(arr: any): boolean;
59
+ isString(str: any): boolean;
60
+ isBoolean(str: any): boolean;
61
+ isUndefined(str: any): boolean;
62
+ };
@@ -1,4 +1,5 @@
1
1
  import VideoManager from '../main/videoManager';
2
+ import { IToken } from './base';
2
3
  /**
3
4
  * 向Client推送流类型
4
5
  *
@@ -170,7 +171,8 @@ export declare type IQualityType = 0 | 1 | 2;
170
171
  /**
171
172
  * client配置参数
172
173
  *
173
- * @property { string } clientId 必填 | "" | 网关校验id(clientId),需要从对接人处获取
174
+ * @property { string } clientId 必填 网关校验id(clientId),需要从对接人处获取
175
+ * @property { string } clientSecret 必填 网关密钥(网关密钥),需要从对接人处获取
174
176
  * @property { string } wssServer 非必填 websocket服务地址,默认不需要配置
175
177
  * @property { string } httpServer 非必填 resetApi服务地址,默认不需要配置
176
178
  * @property { string } logServer 非必填 logServer服务地址,默认不需要配置
@@ -191,7 +193,8 @@ export declare type IQualityType = 0 | 1 | 2;
191
193
  *
192
194
  */
193
195
  export interface IClientConfig {
194
- clientId?: string;
196
+ clientId: string;
197
+ clientSecret: string;
195
198
  wssServer?: string;
196
199
  httpServer?: string;
197
200
  logServer?: string;
@@ -210,6 +213,7 @@ export interface IClientConfig {
210
213
  __monitorMode?: string;
211
214
  isThird?: boolean;
212
215
  isSupportHybridCloud?: boolean;
216
+ checkSSL?: boolean;
213
217
  }
214
218
  export interface ILayoutParams {
215
219
  rosters: IRoster[];
@@ -435,6 +439,24 @@ export interface ISdkUserInfo {
435
439
  password: string;
436
440
  extId?: string;
437
441
  }
442
+ /**
443
+ * 授权码登录
444
+ *
445
+ * @property { string } extId 企业id
446
+ * @property { string } extUserId 用户id
447
+ * @property { string } displayName 用户名
448
+ * @property { string } oauthCode 授权码
449
+ * @property { boolean } isTempUser 是否是临时账号
450
+ * @property { string } channelId 渠道id
451
+ */
452
+ export interface ILoginWidthAuthCode {
453
+ extId: string;
454
+ extUserId: string;
455
+ oauthCode: string;
456
+ channelId: string;
457
+ displayName?: string;
458
+ isTempUser?: boolean;
459
+ }
438
460
  export interface IServers {
439
461
  wssServer: string;
440
462
  httpServer: string;
@@ -448,16 +470,9 @@ export interface IHttpConfig {
448
470
  *
449
471
  * 此信息是由业务层提供网关配置
450
472
  */
451
- export interface IConfig {
473
+ export interface IConfig extends IToken {
452
474
  client_id: string;
453
- access_token: string;
454
- signSecret?: string;
455
- refresh_token?: string;
456
- domain?: string;
457
- expires_in?: number;
458
- openid?: string;
459
- scope?: string;
460
- token_type?: string;
475
+ client_secret: string;
461
476
  }
462
477
  /**
463
478
  * 会议室配置信息
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylink/xy-rtc-sdk",
3
- "version": "2.0.8",
3
+ "version": "2.0.10-beta.0",
4
4
  "description": "XYRTC SDK(小鱼易连web音视频 sdk)",
5
5
  "keywords": [
6
6
  "webrtc",