@ningboyz/ding 1.0.10 → 1.0.12
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/package.json +41 -41
- package/readme.md +43 -43
- package/es/axios/dingRequest.d.ts +0 -10
- package/es/axios/dingRequest.js +0 -31
- package/es/client/dingClient.d.ts +0 -26
- package/es/client/dingClient.js +0 -33
- package/es/index.d.ts +0 -5
- package/es/index.js +0 -10
- package/es/node_modules/.pnpm/@ningboyz_types@1.2.150/node_modules/@ningboyz/types/src/response/IResponse.js +0 -30
- package/es/types/core/IAxiosConfig.d.ts +0 -8
- package/es/types/core/IAxiosConfig.js +0 -7
- package/es/types/core/IDingConfig.d.ts +0 -10
- package/es/types/core/IDingConfig.js +0 -8
- package/es/types/core/index.d.ts +0 -3
- package/es/types/core/index.js +0 -6
- package/es/types/request/IGetUserInfoByAuthCodeQuerys.d.ts +0 -6
- package/es/types/request/IGetUserInfoByAuthCodeQuerys.js +0 -6
- package/es/types/request/IGetUserInfoByQrCodeQuerys.d.ts +0 -6
- package/es/types/request/IGetUserInfoByQrCodeQuerys.js +0 -6
- package/es/types/request/index.d.ts +0 -3
- package/es/types/request/index.js +0 -6
- package/es/types/response/IDingTalkUserAuthCodeResponse.d.ts +0 -14
- package/es/types/response/IDingTalkUserAuthCodeResponse.js +0 -10
- package/es/types/response/index.d.ts +0 -2
- package/es/types/response/index.js +0 -4
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ningboyz/ding",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"private": false,
|
|
5
|
-
"description": "宁波甬政钉钉库",
|
|
6
|
-
"author": "nbyt-syq",
|
|
7
|
-
"license": "ISC",
|
|
8
|
-
"keywords": [],
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./es/index.d.ts",
|
|
12
|
-
"import": "./es/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./es/*": "./es/*",
|
|
15
|
-
"./package.json": "./package.json"
|
|
16
|
-
},
|
|
17
|
-
"main": "es/index.js",
|
|
18
|
-
"types": "es/index.d.ts",
|
|
19
|
-
"files": [
|
|
20
|
-
"es"
|
|
21
|
-
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "vite build",
|
|
24
|
-
"prettier": "prettier --config ./.prettierrc --write \"./**/*.{ts,tsx}\" "
|
|
25
|
-
},
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public",
|
|
28
|
-
"registry": "https://registry.npmjs.org/"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@ningboyz/types": "
|
|
32
|
-
"axios": "
|
|
33
|
-
"lodash": "4.17.21"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/lodash": "4.17.20",
|
|
37
|
-
"vite": "7.1.3",
|
|
38
|
-
"vite-plugin-dts": "4.5.4",
|
|
39
|
-
"vite-plugin-tsx-resolve-types": "0.0.4"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ningboyz/ding",
|
|
3
|
+
"version": "1.0.12",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "宁波甬政钉钉库",
|
|
6
|
+
"author": "nbyt-syq",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./es/index.d.ts",
|
|
12
|
+
"import": "./es/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./es/*": "./es/*",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"main": "es/index.js",
|
|
18
|
+
"types": "es/index.d.ts",
|
|
19
|
+
"files": [
|
|
20
|
+
"es"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "vite build",
|
|
24
|
+
"prettier": "prettier --config ./.prettierrc --write \"./**/*.{ts,tsx}\" "
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@ningboyz/types": "1.2.192",
|
|
32
|
+
"axios": "1.12.2",
|
|
33
|
+
"lodash": "4.17.21"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/lodash": "4.17.20",
|
|
37
|
+
"vite": "7.1.3",
|
|
38
|
+
"vite-plugin-dts": "4.5.4",
|
|
39
|
+
"vite-plugin-tsx-resolve-types": "0.0.4"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ningboyz/utils",
|
|
3
|
-
"version": "1.2.30",
|
|
4
|
-
"private": false,
|
|
5
|
-
"description": "宁波甬政工具库",
|
|
6
|
-
"author": "nbyt-syq",
|
|
7
|
-
"license": "ISC",
|
|
8
|
-
"keywords": [],
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./es/index.d.ts",
|
|
12
|
-
"import": "./es/index.js",
|
|
13
|
-
"require": "./lib/index.js"
|
|
14
|
-
},
|
|
15
|
-
"./es/*": "./es/*",
|
|
16
|
-
"./lib/*": "./lib/*",
|
|
17
|
-
"./package.json": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
"main": "es/index.js",
|
|
20
|
-
"types": "es/index.d.ts",
|
|
21
|
-
"files": [
|
|
22
|
-
"es",
|
|
23
|
-
"lib"
|
|
24
|
-
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "vite build",
|
|
27
|
-
"prettier": "prettier --config ./.prettierrc --write \"./**/*.{ts,tsx}\" "
|
|
28
|
-
},
|
|
29
|
-
"publishConfig": {
|
|
30
|
-
"access": "public",
|
|
31
|
-
"registry": "https://registry.npmjs.org/"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@ningboyz/types": "1.2.28",
|
|
35
|
-
"lodash": "4.17.21"
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@types/lodash": "4.17.20",
|
|
39
|
-
"vite": "^7.1.3",
|
|
40
|
-
"vite-plugin-dts": "^4.5.4",
|
|
41
|
-
"vite-plugin-tsx-resolve-types": "^0.0.4"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ningboyz/utils",
|
|
3
|
+
"version": "1.2.30",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "宁波甬政工具库",
|
|
6
|
+
"author": "nbyt-syq",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./es/index.d.ts",
|
|
12
|
+
"import": "./es/index.js",
|
|
13
|
+
"require": "./lib/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./es/*": "./es/*",
|
|
16
|
+
"./lib/*": "./lib/*",
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"main": "es/index.js",
|
|
20
|
+
"types": "es/index.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"es",
|
|
23
|
+
"lib"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "vite build",
|
|
27
|
+
"prettier": "prettier --config ./.prettierrc --write \"./**/*.{ts,tsx}\" "
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"registry": "https://registry.npmjs.org/"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@ningboyz/types": "1.2.28",
|
|
35
|
+
"lodash": "4.17.21"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/lodash": "4.17.20",
|
|
39
|
+
"vite": "^7.1.3",
|
|
40
|
+
"vite-plugin-dts": "^4.5.4",
|
|
41
|
+
"vite-plugin-tsx-resolve-types": "^0.0.4"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IAxiosConfig } from '../types/core/IAxiosConfig';
|
|
2
|
-
import { IResponse } from '@ningboyz/types';
|
|
3
|
-
declare class DingRequest {
|
|
4
|
-
private instance;
|
|
5
|
-
private constructor();
|
|
6
|
-
static create(config: IAxiosConfig): DingRequest;
|
|
7
|
-
post<T>(url: string, querys?: object, data?: object, headers?: object): Promise<IResponse<T>>;
|
|
8
|
-
}
|
|
9
|
-
declare const createDingRequest: (config: IAxiosConfig) => DingRequest;
|
|
10
|
-
export { type DingRequest, createDingRequest };
|
package/es/axios/dingRequest.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import m from "axios";
|
|
2
|
-
import { TResponse as u } from "../node_modules/.pnpm/@ningboyz_types@1.2.150/node_modules/@ningboyz/types/src/response/IResponse.js";
|
|
3
|
-
class r {
|
|
4
|
-
instance;
|
|
5
|
-
constructor(t) {
|
|
6
|
-
this.instance = m.create({
|
|
7
|
-
baseURL: t.baseURL,
|
|
8
|
-
timeout: t.timeout
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
static create(t) {
|
|
12
|
-
return new r(t);
|
|
13
|
-
}
|
|
14
|
-
post(t, n, o, c) {
|
|
15
|
-
return new Promise((s) => {
|
|
16
|
-
this.instance.post(t, o, {
|
|
17
|
-
params: n,
|
|
18
|
-
headers: c
|
|
19
|
-
}).then((e) => {
|
|
20
|
-
s(e.data);
|
|
21
|
-
}).catch((e) => {
|
|
22
|
-
const i = u.toError(JSON.stringify(e));
|
|
23
|
-
s(i);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const R = (a) => r.create(a);
|
|
29
|
-
export {
|
|
30
|
-
R as createDingRequest
|
|
31
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IDingConfig } from '../types/core/IDingConfig';
|
|
2
|
-
import { IGetUserInfoByAuthCodeQuerys } from '../types/request/IGetUserInfoByAuthCodeQuerys';
|
|
3
|
-
import { IDingTalkUserAuthCodeResponse } from '../types/response/IDingTalkUserAuthCodeResponse';
|
|
4
|
-
import { IGetUserInfoByQrCodeQuerys } from '../types/request/IGetUserInfoByQrCodeQuerys';
|
|
5
|
-
declare class DingClient {
|
|
6
|
-
private prefixURL;
|
|
7
|
-
private config;
|
|
8
|
-
private dingRequest;
|
|
9
|
-
private constructor();
|
|
10
|
-
static create: (config: IDingConfig) => DingClient;
|
|
11
|
-
private createURL;
|
|
12
|
-
/**
|
|
13
|
-
* 通过临时授权码获取用户信息
|
|
14
|
-
* @param querys
|
|
15
|
-
* @returns
|
|
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[]>>;
|
|
24
|
-
}
|
|
25
|
-
declare const createDingClient: (config: IDingConfig) => DingClient;
|
|
26
|
-
export { type DingClient, createDingClient };
|
package/es/client/dingClient.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createDingRequest as s } from "../axios/dingRequest.js";
|
|
2
|
-
class r {
|
|
3
|
-
prefixURL = "dapi";
|
|
4
|
-
config;
|
|
5
|
-
dingRequest;
|
|
6
|
-
constructor(e) {
|
|
7
|
-
this.config = e, this.dingRequest = s({ baseURL: e.dingTalkURL, timeout: 6e4 });
|
|
8
|
-
}
|
|
9
|
-
static create = (e) => new r(e);
|
|
10
|
-
createURL = (e) => `/${this.prefixURL}${e}`;
|
|
11
|
-
/**
|
|
12
|
-
* 通过临时授权码获取用户信息
|
|
13
|
-
* @param querys
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
getUserInfoByAuthCode(e) {
|
|
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 });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const o = (i) => r.create(i);
|
|
31
|
-
export {
|
|
32
|
-
o as createDingClient
|
|
33
|
-
};
|
package/es/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { DingClient, createDingClient } from './client/dingClient';
|
|
2
|
-
import * as DCore from "./types/core";
|
|
3
|
-
import * as DRequest from "./types/request";
|
|
4
|
-
import * as DResponse from "./types/response";
|
|
5
|
-
export { type DingClient, createDingClient, DCore, DRequest, DResponse };
|
package/es/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createDingClient as i } from "./client/dingClient.js";
|
|
2
|
-
import * as e from "./types/core/index.js";
|
|
3
|
-
import * as o from "./types/request/index.js";
|
|
4
|
-
import * as r from "./types/response/index.js";
|
|
5
|
-
export {
|
|
6
|
-
e as DCore,
|
|
7
|
-
o as DRequest,
|
|
8
|
-
r as DResponse,
|
|
9
|
-
i as createDingClient
|
|
10
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import r from "lodash";
|
|
2
|
-
const T = class T {
|
|
3
|
-
};
|
|
4
|
-
T.toError = (A) => ({
|
|
5
|
-
DATASIZE: 0,
|
|
6
|
-
ERORCODE: -1,
|
|
7
|
-
ERORMEMO: A,
|
|
8
|
-
LISTDATA: [],
|
|
9
|
-
ONSTATUS: !1,
|
|
10
|
-
DATATIME: (/* @__PURE__ */ new Date()).getTime(),
|
|
11
|
-
DATADATE: 0,
|
|
12
|
-
REALPAGE: 0,
|
|
13
|
-
PAGESIZE: 0,
|
|
14
|
-
TOTALCNT: 0
|
|
15
|
-
}), T.toTrue = (A, E) => ({
|
|
16
|
-
DATASIZE: r.isArray(A) ? A.length : 0,
|
|
17
|
-
ERORCODE: 0,
|
|
18
|
-
ERORMEMO: E,
|
|
19
|
-
LISTDATA: A,
|
|
20
|
-
ONSTATUS: !0,
|
|
21
|
-
DATATIME: (/* @__PURE__ */ new Date()).getTime(),
|
|
22
|
-
DATADATE: 0,
|
|
23
|
-
REALPAGE: 0,
|
|
24
|
-
PAGESIZE: 0,
|
|
25
|
-
TOTALCNT: 0
|
|
26
|
-
});
|
|
27
|
-
let t = T;
|
|
28
|
-
export {
|
|
29
|
-
t as TResponse
|
|
30
|
-
};
|
package/es/types/core/index.d.ts
DELETED
package/es/types/core/index.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IGetUserInfoByAuthCodeQuerys, TGetUserInfoByAuthCodeQuerys } from './IGetUserInfoByAuthCodeQuerys';
|
|
2
|
-
import { IGetUserInfoByQrCodeQuerys, TGetUserInfoByQrCodeQuerys } from './IGetUserInfoByQrCodeQuerys';
|
|
3
|
-
export { type IGetUserInfoByAuthCodeQuerys, type IGetUserInfoByQrCodeQuerys, TGetUserInfoByAuthCodeQuerys, TGetUserInfoByQrCodeQuerys };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface IDingTalkUserAuthCodeResponse {
|
|
2
|
-
accountId: string;
|
|
3
|
-
userName: string;
|
|
4
|
-
employeeCode: string;
|
|
5
|
-
avatar: string;
|
|
6
|
-
encryptData: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class TDingTalkUserAuthCodeResponse implements IDingTalkUserAuthCodeResponse {
|
|
9
|
-
accountId: string;
|
|
10
|
-
userName: string;
|
|
11
|
-
employeeCode: string;
|
|
12
|
-
avatar: string;
|
|
13
|
-
encryptData: string;
|
|
14
|
-
}
|