@ningboyz/ding 1.0.7 → 1.0.9
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 +1 -1
- package/es/axios/dingRequest.d.ts +0 -10
- package/es/axios/dingRequest.js +0 -31
- package/es/client/dingClient.d.ts +0 -19
- package/es/client/dingClient.js +0 -24
- package/es/index.d.ts +0 -6
- package/es/index.js +0 -12
- 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/index.d.ts +0 -2
- package/es/types/request/index.js +0 -4
- 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,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,19 +0,0 @@
|
|
|
1
|
-
import { IDingConfig } from '../types/core/IDingConfig';
|
|
2
|
-
import { IGetUserInfoByAuthCodeQuerys } from '../types/request/IGetUserInfoByAuthCodeQuerys';
|
|
3
|
-
import { IDingTalkUserAuthCodeResponse } from '../types/response/IDingTalkUserAuthCodeResponse';
|
|
4
|
-
declare class DingClient {
|
|
5
|
-
private prefixURL;
|
|
6
|
-
private config;
|
|
7
|
-
private dingRequest;
|
|
8
|
-
private constructor();
|
|
9
|
-
static create: (config: IDingConfig) => DingClient;
|
|
10
|
-
private createURL;
|
|
11
|
-
/**
|
|
12
|
-
* 扫码通过临时授权码获取用户信息
|
|
13
|
-
* @param querys
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
getUserInfoByAuthCode(querys: IGetUserInfoByAuthCodeQuerys): Promise<import('@ningboyz/types').IResponse<IDingTalkUserAuthCodeResponse[]>>;
|
|
17
|
-
}
|
|
18
|
-
declare const createDingClient: (config: IDingConfig) => DingClient;
|
|
19
|
-
export { type DingClient, createDingClient };
|
package/es/client/dingClient.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createDingRequest as s } from "../axios/dingRequest.js";
|
|
2
|
-
class t {
|
|
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 t(e);
|
|
10
|
-
createURL = (e) => `/${this.prefixURL}${e}`;
|
|
11
|
-
/**
|
|
12
|
-
* 扫码通过临时授权码获取用户信息
|
|
13
|
-
* @param querys
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
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 });
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const c = (r) => t.create(r);
|
|
22
|
-
export {
|
|
23
|
-
c as createDingClient
|
|
24
|
-
};
|
package/es/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DingRequest, createDingRequest } from './axios/dingRequest';
|
|
2
|
-
import { DingClient, createDingClient } from './client/dingClient';
|
|
3
|
-
import * as DCore from "./types/core";
|
|
4
|
-
import * as DRequest from "./types/request";
|
|
5
|
-
import * as DResponse from "./types/response";
|
|
6
|
-
export { type DingRequest, type DingClient, createDingClient, createDingRequest, DCore, DRequest, DResponse };
|
package/es/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createDingRequest as i } from "./axios/dingRequest.js";
|
|
2
|
-
import { createDingClient as a } from "./client/dingClient.js";
|
|
3
|
-
import * as e from "./types/core/index.js";
|
|
4
|
-
import * as r from "./types/request/index.js";
|
|
5
|
-
import * as o from "./types/response/index.js";
|
|
6
|
-
export {
|
|
7
|
-
e as DCore,
|
|
8
|
-
r as DRequest,
|
|
9
|
-
o as DResponse,
|
|
10
|
-
a as createDingClient,
|
|
11
|
-
i as createDingRequest
|
|
12
|
-
};
|
|
@@ -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,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
|
-
}
|