@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.
@@ -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 };
@@ -1,24 +1,33 @@
1
1
  import { createDingRequest as s } from "../axios/dingRequest.js";
2
- class t {
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 t(e);
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 i = this.createURL("/user/get_userinfo_by_authcode");
18
- return this.dingRequest.post(i, e, void 0, { appid: this.config.scanAppId });
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 c = (r) => t.create(r);
30
+ const o = (i) => r.create(i);
22
31
  export {
23
- c as createDingClient
32
+ o as createDingClient
24
33
  };
@@ -0,0 +1,6 @@
1
+ export interface IGetUserInfoByQrCodeQuerys {
2
+ authcode: string;
3
+ }
4
+ export declare class TGetUserInfoByQrCodeQuerys implements IGetUserInfoByQrCodeQuerys {
5
+ authcode: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ class o {
2
+ authcode = "";
3
+ }
4
+ export {
5
+ o as TGetUserInfoByQrCodeQuerys
6
+ };
@@ -1,2 +1,3 @@
1
1
  import { IGetUserInfoByAuthCodeQuerys, TGetUserInfoByAuthCodeQuerys } from './IGetUserInfoByAuthCodeQuerys';
2
- export { type IGetUserInfoByAuthCodeQuerys, TGetUserInfoByAuthCodeQuerys };
2
+ import { IGetUserInfoByQrCodeQuerys, TGetUserInfoByQrCodeQuerys } from './IGetUserInfoByQrCodeQuerys';
3
+ export { type IGetUserInfoByAuthCodeQuerys, type IGetUserInfoByQrCodeQuerys, TGetUserInfoByAuthCodeQuerys, TGetUserInfoByQrCodeQuerys };
@@ -1,4 +1,6 @@
1
- import { TGetUserInfoByAuthCodeQuerys as r } from "./IGetUserInfoByAuthCodeQuerys.js";
1
+ import { TGetUserInfoByAuthCodeQuerys as o } from "./IGetUserInfoByAuthCodeQuerys.js";
2
+ import { TGetUserInfoByQrCodeQuerys as f } from "./IGetUserInfoByQrCodeQuerys.js";
2
3
  export {
3
- r as TGetUserInfoByAuthCodeQuerys
4
+ o as TGetUserInfoByAuthCodeQuerys,
5
+ f as TGetUserInfoByQrCodeQuerys
4
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ningboyz/ding",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "private": false,
5
5
  "description": "宁波甬政钉钉库",
6
6
  "author": "nbyt-syq",