@ningboyz/ding 1.0.8 → 1.0.10
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/es/client/dingClient.d.ts +8 -1
- package/es/client/dingClient.js +16 -7
- package/es/types/request/IGetUserInfoByQrCodeQuerys.d.ts +6 -0
- package/es/types/request/IGetUserInfoByQrCodeQuerys.js +6 -0
- package/es/types/request/index.d.ts +2 -1
- package/es/types/request/index.js +4 -2
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IDingConfig } from '../types/core/IDingConfig';
|
|
2
2
|
import { IGetUserInfoByAuthCodeQuerys } from '../types/request/IGetUserInfoByAuthCodeQuerys';
|
|
3
3
|
import { IDingTalkUserAuthCodeResponse } from '../types/response/IDingTalkUserAuthCodeResponse';
|
|
4
|
+
import { IGetUserInfoByQrCodeQuerys } from '../types/request/IGetUserInfoByQrCodeQuerys';
|
|
4
5
|
declare class DingClient {
|
|
5
6
|
private prefixURL;
|
|
6
7
|
private config;
|
|
@@ -9,11 +10,17 @@ declare class DingClient {
|
|
|
9
10
|
static create: (config: IDingConfig) => DingClient;
|
|
10
11
|
private createURL;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
+
* 通过临时授权码获取用户信息
|
|
13
14
|
* @param querys
|
|
14
15
|
* @returns
|
|
15
16
|
*/
|
|
16
17
|
getUserInfoByAuthCode(querys: IGetUserInfoByAuthCodeQuerys): Promise<import('@ningboyz/types').IResponse<IDingTalkUserAuthCodeResponse[]>>;
|
|
18
|
+
/**
|
|
19
|
+
* 扫码通过临时授权码获取用户信息
|
|
20
|
+
* @param querys
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
getUserInfoByQrCode(querys: IGetUserInfoByQrCodeQuerys): Promise<import('@ningboyz/types').IResponse<IDingTalkUserAuthCodeResponse[]>>;
|
|
17
24
|
}
|
|
18
25
|
declare const createDingClient: (config: IDingConfig) => DingClient;
|
|
19
26
|
export { type DingClient, createDingClient };
|
package/es/client/dingClient.js
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
import { createDingRequest as s } from "../axios/dingRequest.js";
|
|
2
|
-
class
|
|
2
|
+
class r {
|
|
3
3
|
prefixURL = "dapi";
|
|
4
4
|
config;
|
|
5
5
|
dingRequest;
|
|
6
6
|
constructor(e) {
|
|
7
7
|
this.config = e, this.dingRequest = s({ baseURL: e.dingTalkURL, timeout: 6e4 });
|
|
8
8
|
}
|
|
9
|
-
static create = (e) => new
|
|
9
|
+
static create = (e) => new r(e);
|
|
10
10
|
createURL = (e) => `/${this.prefixURL}${e}`;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* 通过临时授权码获取用户信息
|
|
13
13
|
* @param querys
|
|
14
14
|
* @returns
|
|
15
15
|
*/
|
|
16
16
|
getUserInfoByAuthCode(e) {
|
|
17
|
-
const
|
|
18
|
-
return this.dingRequest.post(
|
|
17
|
+
const t = this.createURL("/user/get_userinfo_by_authcode");
|
|
18
|
+
return this.dingRequest.post(t, e, void 0, { appid: this.config.appId });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 扫码通过临时授权码获取用户信息
|
|
22
|
+
* @param querys
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
getUserInfoByQrCode(e) {
|
|
26
|
+
const t = this.createURL("/user/get_userinfo_by_qrcode");
|
|
27
|
+
return this.dingRequest.post(t, e, void 0, { appid: this.config.scanAppId });
|
|
19
28
|
}
|
|
20
29
|
}
|
|
21
|
-
const
|
|
30
|
+
const o = (i) => r.create(i);
|
|
22
31
|
export {
|
|
23
|
-
|
|
32
|
+
o as createDingClient
|
|
24
33
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { IGetUserInfoByAuthCodeQuerys, TGetUserInfoByAuthCodeQuerys } from './IGetUserInfoByAuthCodeQuerys';
|
|
2
|
-
|
|
2
|
+
import { IGetUserInfoByQrCodeQuerys, TGetUserInfoByQrCodeQuerys } from './IGetUserInfoByQrCodeQuerys';
|
|
3
|
+
export { type IGetUserInfoByAuthCodeQuerys, type IGetUserInfoByQrCodeQuerys, TGetUserInfoByAuthCodeQuerys, TGetUserInfoByQrCodeQuerys };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { TGetUserInfoByAuthCodeQuerys as
|
|
1
|
+
import { TGetUserInfoByAuthCodeQuerys as o } from "./IGetUserInfoByAuthCodeQuerys.js";
|
|
2
|
+
import { TGetUserInfoByQrCodeQuerys as f } from "./IGetUserInfoByQrCodeQuerys.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
o as TGetUserInfoByAuthCodeQuerys,
|
|
5
|
+
f as TGetUserInfoByQrCodeQuerys
|
|
4
6
|
};
|