@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ningboyz/ding",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "description": "宁波甬政钉钉库",
6
6
  "author": "nbyt-syq",
@@ -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 };
@@ -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 };
@@ -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
- };
@@ -1,8 +0,0 @@
1
- export interface IAxiosConfig {
2
- baseURL: string;
3
- timeout: number;
4
- }
5
- export declare class TAxiosConfig implements IAxiosConfig {
6
- baseURL: string;
7
- timeout: number;
8
- }
@@ -1,7 +0,0 @@
1
- class o {
2
- baseURL = "";
3
- timeout = 6e4;
4
- }
5
- export {
6
- o as TAxiosConfig
7
- };
@@ -1,10 +0,0 @@
1
- export interface IDingConfig {
2
- appId: string;
3
- scanAppId: string;
4
- dingTalkURL: string;
5
- }
6
- export declare class TDingConfig implements IDingConfig {
7
- appId: string;
8
- scanAppId: string;
9
- dingTalkURL: string;
10
- }
@@ -1,8 +0,0 @@
1
- class a {
2
- appId = "";
3
- scanAppId = "";
4
- dingTalkURL = "";
5
- }
6
- export {
7
- a as TDingConfig
8
- };
@@ -1,3 +0,0 @@
1
- import { IAxiosConfig, TAxiosConfig } from './IAxiosConfig';
2
- import { IDingConfig, TDingConfig } from './IDingConfig';
3
- export { type IAxiosConfig, type IDingConfig, TAxiosConfig, TDingConfig };
@@ -1,6 +0,0 @@
1
- import { TAxiosConfig as i } from "./IAxiosConfig.js";
2
- import { TDingConfig as g } from "./IDingConfig.js";
3
- export {
4
- i as TAxiosConfig,
5
- g as TDingConfig
6
- };
@@ -1,6 +0,0 @@
1
- export interface IGetUserInfoByAuthCodeQuerys {
2
- authcode: string;
3
- }
4
- export declare class TGetUserInfoByAuthCodeQuerys implements IGetUserInfoByAuthCodeQuerys {
5
- authcode: string;
6
- }
@@ -1,6 +0,0 @@
1
- class o {
2
- authcode = "";
3
- }
4
- export {
5
- o as TGetUserInfoByAuthCodeQuerys
6
- };
@@ -1,2 +0,0 @@
1
- import { IGetUserInfoByAuthCodeQuerys, TGetUserInfoByAuthCodeQuerys } from './IGetUserInfoByAuthCodeQuerys';
2
- export { type IGetUserInfoByAuthCodeQuerys, TGetUserInfoByAuthCodeQuerys };
@@ -1,4 +0,0 @@
1
- import { TGetUserInfoByAuthCodeQuerys as r } from "./IGetUserInfoByAuthCodeQuerys.js";
2
- export {
3
- r as TGetUserInfoByAuthCodeQuerys
4
- };
@@ -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
- }
@@ -1,10 +0,0 @@
1
- class a {
2
- accountId = "";
3
- userName = "";
4
- employeeCode = "";
5
- avatar = "";
6
- encryptData = "";
7
- }
8
- export {
9
- a as TDingTalkUserAuthCodeResponse
10
- };
@@ -1,2 +0,0 @@
1
- import { IDingTalkUserAuthCodeResponse, TDingTalkUserAuthCodeResponse } from './IDingTalkUserAuthCodeResponse';
2
- export { type IDingTalkUserAuthCodeResponse, TDingTalkUserAuthCodeResponse };
@@ -1,4 +0,0 @@
1
- import { TDingTalkUserAuthCodeResponse as r } from "./IDingTalkUserAuthCodeResponse.js";
2
- export {
3
- r as TDingTalkUserAuthCodeResponse
4
- };