@lsby/net-core 0.0.21 → 0.0.23
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/dist/cjs/index.d.cts +4 -4
- package/dist/cjs/interface/interface-type.d.cts +21 -6
- package/dist/cjs/interface/interface.d.cts +15 -6
- package/dist/cjs/interface/plug.d.cts +6 -3
- package/dist/cjs/plugin/chinese-path.d.cts +0 -1
- package/dist/cjs/plugin/custom-data.d.cts +0 -1
- package/dist/cjs/plugin/json.d.cts +6 -3
- package/dist/cjs/plugin/urlencoded.d.cts +0 -1
- package/dist/cjs/result/result.d.cts +1 -2
- package/dist/cjs/server/server.d.cts +2 -3
- package/dist/cjs/test/test.d.cts +2 -5
- package/dist/esm/{chunk-ZBNSNYDR.js → chunk-B62YPABM.js} +1 -1
- package/dist/esm/{chunk-MHWX74JN.js → chunk-HARBKRRI.js} +1 -1
- package/dist/esm/{chunk-CYHD3PZ5.js → chunk-S3ITAYKY.js} +1 -1
- package/dist/esm/global/global.js +2 -2
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +10 -11
- package/dist/esm/interface/interface-type.d.ts +21 -6
- package/dist/esm/interface/interface.d.ts +15 -6
- package/dist/esm/interface/plug.d.ts +6 -3
- package/dist/esm/plugin/chinese-path.d.ts +0 -1
- package/dist/esm/plugin/custom-data.d.ts +0 -1
- package/dist/esm/plugin/json.d.ts +6 -3
- package/dist/esm/plugin/json.js +3 -3
- package/dist/esm/plugin/urlencoded.d.ts +0 -1
- package/dist/esm/result/result.d.ts +1 -2
- package/dist/esm/result/result.js +3 -3
- package/dist/esm/server/server.d.ts +2 -3
- package/dist/esm/server/server.js +3 -3
- package/dist/esm/test/test.d.ts +2 -5
- package/package.json +1 -1
- package/dist/cjs/interface/types.cjs +0 -18
- package/dist/cjs/interface/types.d.cts +0 -7
- package/dist/cjs/interface-Bgtd1OOZ.d.cts +0 -41
- package/dist/cjs/types/type-hold.cjs +0 -30
- package/dist/cjs/types/type-hold.d.cts +0 -3
- package/dist/esm/chunk-NGPELO7K.js +0 -0
- package/dist/esm/interface/types.d.ts +0 -7
- package/dist/esm/interface/types.js +0 -1
- package/dist/esm/interface-TECERLTl.d.ts +0 -41
- package/dist/esm/types/type-hold.d.ts +0 -3
- package/dist/esm/types/type-hold.js +0 -5
- package/dist/esm/{chunk-TXWZ6QOA.js → chunk-ZSY7VBEW.js} +3 -3
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { 任意接口, 接口 } from './interface/interface.cjs';
|
|
2
|
+
export { 任意接口类型, 接口类型, 获得接口插件们 } from './interface/interface-type.cjs';
|
|
3
|
+
export { 任意插件, 取插件内部类型, 合并插件结果, 插件, 插件项类型 } from './interface/plug.cjs';
|
|
3
4
|
export { 中文路径支持插件 } from './plugin/chinese-path.cjs';
|
|
4
5
|
export { 自定义数据插件 } from './plugin/custom-data.cjs';
|
|
5
|
-
export { JSON
|
|
6
|
+
export { JSON解析插件, 从接口类型获得JSON参数, 任意JSON解析插件, 合并JSON插件结果 } from './plugin/json.cjs';
|
|
6
7
|
export { 表单解析插件 } from './plugin/urlencoded.cjs';
|
|
7
8
|
export { 正确JSON结果, 正确结果, 正确自定义结果, 结果, 错误JSON结果, 错误结果 } from './result/result.cjs';
|
|
8
9
|
export { 服务器 } from './server/server.cjs';
|
|
9
10
|
export { 测试 } from './test/test.cjs';
|
|
10
11
|
import 'zod';
|
|
11
|
-
import './types/type-hold.cjs';
|
|
12
12
|
import 'express';
|
|
13
13
|
import 'node:http';
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import 'zod';
|
|
2
|
-
import '
|
|
3
|
-
export { a as 接口类型 } from '../interface-Bgtd1OOZ.cjs';
|
|
4
|
-
import '../result/result.cjs';
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 插件项类型 as _____ } from './plug.cjs';
|
|
5
3
|
import 'express';
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
declare class 接口类型<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<_____>, 正确结果类型 extends z.ZodTypeAny, 错误结果类型 extends z.ZodTypeAny> {
|
|
6
|
+
private 路径;
|
|
7
|
+
private 方法;
|
|
8
|
+
private 插件们;
|
|
9
|
+
private 正确结果;
|
|
10
|
+
private 错误结果;
|
|
11
|
+
protected readonly 类型保持符号?: [路径, 方法, 插件们, 正确结果类型, 错误结果类型];
|
|
12
|
+
constructor(路径: 路径, 方法: 方法, 插件们: [...插件们], 正确结果: 正确结果类型, 错误结果: 错误结果类型);
|
|
13
|
+
获得路径(): 路径;
|
|
14
|
+
获得方法(): 方法;
|
|
15
|
+
获得插件们(): [...插件们];
|
|
16
|
+
获得正确结果类型(): 正确结果类型;
|
|
17
|
+
获得错误结果类型(): 错误结果类型;
|
|
18
|
+
}
|
|
19
|
+
type 任意接口类型 = 接口类型<any, any, any, any, any>;
|
|
20
|
+
type 获得接口插件们<接口类型描述> = 接口类型描述 extends 接口类型<any, any, infer 插件, any, any> ? 插件 : never;
|
|
21
|
+
|
|
22
|
+
export { type 任意接口类型, 接口类型, type 获得接口插件们 };
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import 'zod';
|
|
2
|
-
import '../result/result.cjs';
|
|
3
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 正确结果 as ____$1, 错误结果 as ____$2 } from '../result/result.cjs';
|
|
3
|
+
import { 接口类型 as ____ } from './interface-type.cjs';
|
|
4
|
+
import { 插件项类型 as _____, 合并插件结果 as ______ } from './plug.cjs';
|
|
4
5
|
import 'express';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
declare class 接口<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<_____>, 正确返回类型 extends z.ZodTypeAny, 错误返回类型 extends z.ZodTypeAny> {
|
|
8
|
+
private 接口类型;
|
|
9
|
+
private 实现;
|
|
10
|
+
constructor(接口类型: ____<路径, 方法, 插件们, 正确返回类型, 错误返回类型>, 实现: (插件结果: ______<插件们>) => Promise<____$1<z.infer<正确返回类型>> | ____$2<z.infer<错误返回类型>>>);
|
|
11
|
+
获得类型(): typeof this.接口类型;
|
|
12
|
+
获得实现(): typeof this.实现;
|
|
13
|
+
}
|
|
14
|
+
type 任意接口 = 接口<any, any, any, any, any>;
|
|
15
|
+
|
|
16
|
+
export { type 任意接口, 接口 };
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { 类型保持符号 as ______ } from '../types/type-hold.cjs';
|
|
4
3
|
|
|
5
4
|
declare class 插件<Obj extends z.AnyZodObject> {
|
|
6
5
|
private 类型;
|
|
7
6
|
private 实现;
|
|
8
|
-
|
|
7
|
+
protected readonly 类型保持符号?: Obj;
|
|
9
8
|
constructor(类型: Obj, 实现: (req: Request, res: Response) => Promise<z.infer<Obj>>);
|
|
10
9
|
获得类型(): typeof this.类型;
|
|
11
10
|
获得实现(): typeof this.实现;
|
|
12
11
|
}
|
|
12
|
+
type 任意插件 = 插件<any>;
|
|
13
|
+
type 插件项类型 = 插件<z.AnyZodObject>;
|
|
14
|
+
type 取插件内部类型<A> = A extends 插件<infer x> ? x : never;
|
|
15
|
+
type 合并插件结果<Arr extends Array<插件项类型>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<插件项类型> ? z.infer<取插件内部类型<插件>> & 合并插件结果<xs> : {} : {} : {};
|
|
13
16
|
|
|
14
|
-
export {
|
|
17
|
+
export { type 任意插件, type 取插件内部类型, type 合并插件结果, 插件, type 插件项类型 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import '../
|
|
3
|
+
import { 获得接口插件们 as _______$1 } from '../interface/interface-type.cjs';
|
|
4
|
+
import { 插件 as __, 插件项类型 as _____, 取插件内部类型 as _______, 合并插件结果 as ______ } from '../interface/plug.cjs';
|
|
5
5
|
|
|
6
6
|
declare class JSON解析插件<Result extends z.ZodObject<{
|
|
7
7
|
body: z.AnyZodObject;
|
|
@@ -9,5 +9,8 @@ declare class JSON解析插件<Result extends z.ZodObject<{
|
|
|
9
9
|
private log;
|
|
10
10
|
constructor(t: Result, opt: Parameters<typeof express.json>[0]);
|
|
11
11
|
}
|
|
12
|
+
type 任意JSON解析插件 = JSON解析插件<any>;
|
|
13
|
+
type 合并JSON插件结果<Arr extends Array<_____>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<_____> ? 插件 extends 任意JSON解析插件 ? z.infer<_______<插件>>['body'] & ______<xs> : {} : {} : {} : {};
|
|
14
|
+
type 从接口类型获得JSON参数<接口类型描述> = 合并JSON插件结果<_______$1<接口类型描述>>;
|
|
12
15
|
|
|
13
|
-
export { JSON
|
|
16
|
+
export { JSON解析插件, type 从接口类型获得JSON参数, type 任意JSON解析插件, type 合并JSON插件结果 };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
import { 类型保持符号 as ______ } from '../types/type-hold.cjs';
|
|
3
2
|
|
|
4
3
|
declare abstract class 结果<T> {
|
|
5
|
-
|
|
4
|
+
protected readonly 类型保持符号?: T;
|
|
6
5
|
abstract run(req: Request, res: Response): Promise<void>;
|
|
7
6
|
}
|
|
8
7
|
declare abstract class 正确结果<T> extends 结果<T> {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as http from 'node:http';
|
|
2
|
-
import {
|
|
2
|
+
import { 任意接口 as ____ } from '../interface/interface.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../result/result.cjs';
|
|
5
5
|
import 'express';
|
|
6
|
-
import '../
|
|
7
|
-
import '../plugin/json.cjs';
|
|
6
|
+
import '../interface/interface-type.cjs';
|
|
8
7
|
import '../interface/plug.cjs';
|
|
9
8
|
|
|
10
9
|
declare class 服务器 {
|
package/dist/cjs/test/test.d.cts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 任意接口类型 as ______ } from '../interface/interface-type.cjs';
|
|
2
2
|
import 'zod';
|
|
3
|
-
import '../result/result.cjs';
|
|
4
|
-
import 'express';
|
|
5
|
-
import '../types/type-hold.cjs';
|
|
6
|
-
import '../plugin/json.cjs';
|
|
7
3
|
import '../interface/plug.cjs';
|
|
4
|
+
import 'express';
|
|
8
5
|
|
|
9
6
|
declare class 测试 {
|
|
10
7
|
private 接口类型;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { 任意接口, 接口 } from './interface/interface.js';
|
|
2
|
+
export { 任意接口类型, 接口类型, 获得接口插件们 } from './interface/interface-type.js';
|
|
3
|
+
export { 任意插件, 取插件内部类型, 合并插件结果, 插件, 插件项类型 } from './interface/plug.js';
|
|
3
4
|
export { 中文路径支持插件 } from './plugin/chinese-path.js';
|
|
4
5
|
export { 自定义数据插件 } from './plugin/custom-data.js';
|
|
5
|
-
export { JSON
|
|
6
|
+
export { JSON解析插件, 从接口类型获得JSON参数, 任意JSON解析插件, 合并JSON插件结果 } from './plugin/json.js';
|
|
6
7
|
export { 表单解析插件 } from './plugin/urlencoded.js';
|
|
7
8
|
export { 正确JSON结果, 正确结果, 正确自定义结果, 结果, 错误JSON结果, 错误结果 } from './result/result.js';
|
|
8
9
|
export { 服务器 } from './server/server.js';
|
|
9
10
|
export { 测试 } from './test/test.js';
|
|
10
11
|
import 'zod';
|
|
11
|
-
import './types/type-hold.js';
|
|
12
12
|
import 'express';
|
|
13
13
|
import 'node:http';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
JSON解析插件
|
|
3
|
-
} from "./chunk-ZBNSNYDR.js";
|
|
4
1
|
import {
|
|
5
2
|
表单解析插件
|
|
6
3
|
} from "./chunk-5UUMGDDD.js";
|
|
7
|
-
import {
|
|
8
|
-
服务器
|
|
9
|
-
} from "./chunk-CYHD3PZ5.js";
|
|
10
4
|
import {
|
|
11
5
|
正确JSON结果,
|
|
12
6
|
正确结果,
|
|
@@ -14,26 +8,31 @@ import {
|
|
|
14
8
|
结果,
|
|
15
9
|
错误JSON结果,
|
|
16
10
|
错误结果
|
|
17
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HARBKRRI.js";
|
|
18
12
|
import {
|
|
19
13
|
测试
|
|
20
14
|
} from "./chunk-I4WZG5LK.js";
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
import {
|
|
16
|
+
服务器
|
|
17
|
+
} from "./chunk-S3ITAYKY.js";
|
|
24
18
|
import {
|
|
25
19
|
接口类型
|
|
26
20
|
} from "./chunk-SF5Z34AP.js";
|
|
27
21
|
import {
|
|
28
22
|
接口
|
|
29
23
|
} from "./chunk-KRIDSMPV.js";
|
|
30
|
-
import "./chunk-NGPELO7K.js";
|
|
31
24
|
import {
|
|
32
25
|
中文路径支持插件
|
|
33
26
|
} from "./chunk-XG4VZZOX.js";
|
|
34
27
|
import {
|
|
35
28
|
自定义数据插件
|
|
36
29
|
} from "./chunk-P6PGPAMW.js";
|
|
30
|
+
import {
|
|
31
|
+
JSON解析插件
|
|
32
|
+
} from "./chunk-B62YPABM.js";
|
|
33
|
+
import "./chunk-ZSY7VBEW.js";
|
|
34
|
+
import "./chunk-LVYVPQ5V.js";
|
|
35
|
+
import "./chunk-BZOQHDXK.js";
|
|
37
36
|
import {
|
|
38
37
|
插件
|
|
39
38
|
} from "./chunk-KSZE2DTR.js";
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import 'zod';
|
|
2
|
-
import '
|
|
3
|
-
export { a as 接口类型 } from '../interface-TECERLTl.js';
|
|
4
|
-
import '../result/result.js';
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 插件项类型 as _____ } from './plug.js';
|
|
5
3
|
import 'express';
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
declare class 接口类型<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<_____>, 正确结果类型 extends z.ZodTypeAny, 错误结果类型 extends z.ZodTypeAny> {
|
|
6
|
+
private 路径;
|
|
7
|
+
private 方法;
|
|
8
|
+
private 插件们;
|
|
9
|
+
private 正确结果;
|
|
10
|
+
private 错误结果;
|
|
11
|
+
protected readonly 类型保持符号?: [路径, 方法, 插件们, 正确结果类型, 错误结果类型];
|
|
12
|
+
constructor(路径: 路径, 方法: 方法, 插件们: [...插件们], 正确结果: 正确结果类型, 错误结果: 错误结果类型);
|
|
13
|
+
获得路径(): 路径;
|
|
14
|
+
获得方法(): 方法;
|
|
15
|
+
获得插件们(): [...插件们];
|
|
16
|
+
获得正确结果类型(): 正确结果类型;
|
|
17
|
+
获得错误结果类型(): 错误结果类型;
|
|
18
|
+
}
|
|
19
|
+
type 任意接口类型 = 接口类型<any, any, any, any, any>;
|
|
20
|
+
type 获得接口插件们<接口类型描述> = 接口类型描述 extends 接口类型<any, any, infer 插件, any, any> ? 插件 : never;
|
|
21
|
+
|
|
22
|
+
export { type 任意接口类型, 接口类型, type 获得接口插件们 };
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import 'zod';
|
|
2
|
-
import '../result/result.js';
|
|
3
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 正确结果 as ____$1, 错误结果 as ____$2 } from '../result/result.js';
|
|
3
|
+
import { 接口类型 as ____ } from './interface-type.js';
|
|
4
|
+
import { 插件项类型 as _____, 合并插件结果 as ______ } from './plug.js';
|
|
4
5
|
import 'express';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
declare class 接口<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<_____>, 正确返回类型 extends z.ZodTypeAny, 错误返回类型 extends z.ZodTypeAny> {
|
|
8
|
+
private 接口类型;
|
|
9
|
+
private 实现;
|
|
10
|
+
constructor(接口类型: ____<路径, 方法, 插件们, 正确返回类型, 错误返回类型>, 实现: (插件结果: ______<插件们>) => Promise<____$1<z.infer<正确返回类型>> | ____$2<z.infer<错误返回类型>>>);
|
|
11
|
+
获得类型(): typeof this.接口类型;
|
|
12
|
+
获得实现(): typeof this.实现;
|
|
13
|
+
}
|
|
14
|
+
type 任意接口 = 接口<any, any, any, any, any>;
|
|
15
|
+
|
|
16
|
+
export { type 任意接口, 接口 };
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { 类型保持符号 as ______ } from '../types/type-hold.js';
|
|
4
3
|
|
|
5
4
|
declare class 插件<Obj extends z.AnyZodObject> {
|
|
6
5
|
private 类型;
|
|
7
6
|
private 实现;
|
|
8
|
-
|
|
7
|
+
protected readonly 类型保持符号?: Obj;
|
|
9
8
|
constructor(类型: Obj, 实现: (req: Request, res: Response) => Promise<z.infer<Obj>>);
|
|
10
9
|
获得类型(): typeof this.类型;
|
|
11
10
|
获得实现(): typeof this.实现;
|
|
12
11
|
}
|
|
12
|
+
type 任意插件 = 插件<any>;
|
|
13
|
+
type 插件项类型 = 插件<z.AnyZodObject>;
|
|
14
|
+
type 取插件内部类型<A> = A extends 插件<infer x> ? x : never;
|
|
15
|
+
type 合并插件结果<Arr extends Array<插件项类型>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<插件项类型> ? z.infer<取插件内部类型<插件>> & 合并插件结果<xs> : {} : {} : {};
|
|
13
16
|
|
|
14
|
-
export {
|
|
17
|
+
export { type 任意插件, type 取插件内部类型, type 合并插件结果, 插件, type 插件项类型 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import '../
|
|
3
|
+
import { 获得接口插件们 as _______$1 } from '../interface/interface-type.js';
|
|
4
|
+
import { 插件 as __, 插件项类型 as _____, 取插件内部类型 as _______, 合并插件结果 as ______ } from '../interface/plug.js';
|
|
5
5
|
|
|
6
6
|
declare class JSON解析插件<Result extends z.ZodObject<{
|
|
7
7
|
body: z.AnyZodObject;
|
|
@@ -9,5 +9,8 @@ declare class JSON解析插件<Result extends z.ZodObject<{
|
|
|
9
9
|
private log;
|
|
10
10
|
constructor(t: Result, opt: Parameters<typeof express.json>[0]);
|
|
11
11
|
}
|
|
12
|
+
type 任意JSON解析插件 = JSON解析插件<any>;
|
|
13
|
+
type 合并JSON插件结果<Arr extends Array<_____>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<_____> ? 插件 extends 任意JSON解析插件 ? z.infer<_______<插件>>['body'] & ______<xs> : {} : {} : {} : {};
|
|
14
|
+
type 从接口类型获得JSON参数<接口类型描述> = 合并JSON插件结果<_______$1<接口类型描述>>;
|
|
12
15
|
|
|
13
|
-
export { JSON
|
|
16
|
+
export { JSON解析插件, type 从接口类型获得JSON参数, type 任意JSON解析插件, type 合并JSON插件结果 };
|
package/dist/esm/plugin/json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JSON解析插件
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-BZOQHDXK.js";
|
|
3
|
+
} from "../chunk-B62YPABM.js";
|
|
4
|
+
import "../chunk-ZSY7VBEW.js";
|
|
6
5
|
import "../chunk-LVYVPQ5V.js";
|
|
6
|
+
import "../chunk-BZOQHDXK.js";
|
|
7
7
|
import "../chunk-KSZE2DTR.js";
|
|
8
8
|
export {
|
|
9
9
|
JSON\u89E3\u6790\u63D2\u4EF6
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
import { 类型保持符号 as ______ } from '../types/type-hold.js';
|
|
3
2
|
|
|
4
3
|
declare abstract class 结果<T> {
|
|
5
|
-
|
|
4
|
+
protected readonly 类型保持符号?: T;
|
|
6
5
|
abstract run(req: Request, res: Response): Promise<void>;
|
|
7
6
|
}
|
|
8
7
|
declare abstract class 正确结果<T> extends 结果<T> {
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
结果,
|
|
6
6
|
错误JSON结果,
|
|
7
7
|
错误结果
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-BZOQHDXK.js";
|
|
8
|
+
} from "../chunk-HARBKRRI.js";
|
|
9
|
+
import "../chunk-ZSY7VBEW.js";
|
|
11
10
|
import "../chunk-LVYVPQ5V.js";
|
|
11
|
+
import "../chunk-BZOQHDXK.js";
|
|
12
12
|
export {
|
|
13
13
|
\u6B63\u786EJSON\u7ED3\u679C,
|
|
14
14
|
\u6B63\u786E\u7ED3\u679C,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as http from 'node:http';
|
|
2
|
-
import {
|
|
2
|
+
import { 任意接口 as ____ } from '../interface/interface.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import '../result/result.js';
|
|
5
5
|
import 'express';
|
|
6
|
-
import '../
|
|
7
|
-
import '../plugin/json.js';
|
|
6
|
+
import '../interface/interface-type.js';
|
|
8
7
|
import '../interface/plug.js';
|
|
9
8
|
|
|
10
9
|
declare class 服务器 {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
服务器
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-BZOQHDXK.js";
|
|
3
|
+
} from "../chunk-S3ITAYKY.js";
|
|
4
|
+
import "../chunk-ZSY7VBEW.js";
|
|
6
5
|
import "../chunk-LVYVPQ5V.js";
|
|
6
|
+
import "../chunk-BZOQHDXK.js";
|
|
7
7
|
export {
|
|
8
8
|
\u670D\u52A1\u5668
|
|
9
9
|
};
|
package/dist/esm/test/test.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 任意接口类型 as ______ } from '../interface/interface-type.js';
|
|
2
2
|
import 'zod';
|
|
3
|
-
import '../result/result.js';
|
|
4
|
-
import 'express';
|
|
5
|
-
import '../types/type-hold.js';
|
|
6
|
-
import '../plugin/json.js';
|
|
7
3
|
import '../interface/plug.js';
|
|
4
|
+
import 'express';
|
|
8
5
|
|
|
9
6
|
declare class 测试 {
|
|
10
7
|
private 接口类型;
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/interface/types.ts
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import 'zod';
|
|
2
|
-
export { 从 as 从接口类型获得JSON参数, d as 任意JSON解析插件, 任 as 任意接口, b as 任意接口类型, c as 任意插件, 取 as 取插件内部类型, e as 合并JSON插件结果, 合 as 合并插件结果, 插 as 插件项类型, 获 as 获得接口插件们 } from '../interface-Bgtd1OOZ.cjs';
|
|
3
|
-
import '../plugin/json.cjs';
|
|
4
|
-
import './plug.cjs';
|
|
5
|
-
import '../result/result.cjs';
|
|
6
|
-
import 'express';
|
|
7
|
-
import '../types/type-hold.cjs';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { 正确结果 as ____, 错误结果 as ____$1 } from './result/result.cjs';
|
|
3
|
-
import { 类型保持符号 as ______ } from './types/type-hold.cjs';
|
|
4
|
-
import { JSON解析插件 as JSON____ } from './plugin/json.cjs';
|
|
5
|
-
import { 插件 as __ } from './interface/plug.cjs';
|
|
6
|
-
|
|
7
|
-
type 任意接口 = 接口<any, any, any, any, any>;
|
|
8
|
-
type 任意接口类型 = 接口类型<any, any, any, any, any>;
|
|
9
|
-
type 插件项类型 = __<z.AnyZodObject>;
|
|
10
|
-
type 取插件内部类型<A> = A extends __<infer x> ? x : never;
|
|
11
|
-
type 任意插件 = __<any>;
|
|
12
|
-
type 任意JSON解析插件 = JSON____<any>;
|
|
13
|
-
type 合并插件结果<Arr extends Array<插件项类型>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<插件项类型> ? z.infer<取插件内部类型<插件>> & 合并插件结果<xs> : {} : {} : {};
|
|
14
|
-
type 合并JSON插件结果<Arr extends Array<插件项类型>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<插件项类型> ? 插件 extends 任意JSON解析插件 ? z.infer<取插件内部类型<插件>>['body'] & 合并插件结果<xs> : {} : {} : {} : {};
|
|
15
|
-
type 获得接口插件们<接口类型描述> = 接口类型描述 extends 接口类型<any, any, infer 插件, any, any> ? 插件 : never;
|
|
16
|
-
type 从接口类型获得JSON参数<接口类型描述> = 合并JSON插件结果<获得接口插件们<接口类型描述>>;
|
|
17
|
-
|
|
18
|
-
declare class 接口类型<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<插件项类型>, 正确结果类型 extends z.ZodTypeAny, 错误结果类型 extends z.ZodTypeAny> {
|
|
19
|
-
private 路径;
|
|
20
|
-
private 方法;
|
|
21
|
-
private 插件们;
|
|
22
|
-
private 正确结果;
|
|
23
|
-
private 错误结果;
|
|
24
|
-
[______]: [路径, 方法, 插件们, 正确结果类型, 错误结果类型];
|
|
25
|
-
constructor(路径: 路径, 方法: 方法, 插件们: [...插件们], 正确结果: 正确结果类型, 错误结果: 错误结果类型);
|
|
26
|
-
获得路径(): 路径;
|
|
27
|
-
获得方法(): 方法;
|
|
28
|
-
获得插件们(): [...插件们];
|
|
29
|
-
获得正确结果类型(): 正确结果类型;
|
|
30
|
-
获得错误结果类型(): 错误结果类型;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare class 接口<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<插件项类型>, 正确返回类型 extends z.ZodTypeAny, 错误返回类型 extends z.ZodTypeAny> {
|
|
34
|
-
private 接口类型;
|
|
35
|
-
private 实现;
|
|
36
|
-
constructor(接口类型: 接口类型<路径, 方法, 插件们, 正确返回类型, 错误返回类型>, 实现: (插件结果: 合并插件结果<插件们>) => Promise<____<z.infer<正确返回类型>> | ____$1<z.infer<错误返回类型>>>);
|
|
37
|
-
获得类型(): typeof this.接口类型;
|
|
38
|
-
获得实现(): typeof this.实现;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { 接口类型 as a, type 任意接口类型 as b, type 任意插件 as c, type 任意JSON解析插件 as d, type 合并JSON插件结果 as e, type 从接口类型获得JSON参数 as 从, type 任意接口 as 任, type 取插件内部类型 as 取, type 合并插件结果 as 合, 接口 as 接, type 插件项类型 as 插, type 获得接口插件们 as 获 };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/types/type-hold.ts
|
|
21
|
-
var type_hold_exports = {};
|
|
22
|
-
__export(type_hold_exports, {
|
|
23
|
-
\u7C7B\u578B\u4FDD\u6301\u7B26\u53F7: () => \u7C7B\u578B\u4FDD\u6301\u7B26\u53F7
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(type_hold_exports);
|
|
26
|
-
var \u7C7B\u578B\u4FDD\u6301\u7B26\u53F7 = Symbol();
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
\u7C7B\u578B\u4FDD\u6301\u7B26\u53F7
|
|
30
|
-
});
|
|
File without changes
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import 'zod';
|
|
2
|
-
export { 从 as 从接口类型获得JSON参数, d as 任意JSON解析插件, 任 as 任意接口, b as 任意接口类型, c as 任意插件, 取 as 取插件内部类型, e as 合并JSON插件结果, 合 as 合并插件结果, 插 as 插件项类型, 获 as 获得接口插件们 } from '../interface-TECERLTl.js';
|
|
3
|
-
import '../plugin/json.js';
|
|
4
|
-
import './plug.js';
|
|
5
|
-
import '../result/result.js';
|
|
6
|
-
import 'express';
|
|
7
|
-
import '../types/type-hold.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../chunk-NGPELO7K.js";
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { 正确结果 as ____, 错误结果 as ____$1 } from './result/result.js';
|
|
3
|
-
import { 类型保持符号 as ______ } from './types/type-hold.js';
|
|
4
|
-
import { JSON解析插件 as JSON____ } from './plugin/json.js';
|
|
5
|
-
import { 插件 as __ } from './interface/plug.js';
|
|
6
|
-
|
|
7
|
-
type 任意接口 = 接口<any, any, any, any, any>;
|
|
8
|
-
type 任意接口类型 = 接口类型<any, any, any, any, any>;
|
|
9
|
-
type 插件项类型 = __<z.AnyZodObject>;
|
|
10
|
-
type 取插件内部类型<A> = A extends __<infer x> ? x : never;
|
|
11
|
-
type 任意插件 = __<any>;
|
|
12
|
-
type 任意JSON解析插件 = JSON____<any>;
|
|
13
|
-
type 合并插件结果<Arr extends Array<插件项类型>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<插件项类型> ? z.infer<取插件内部类型<插件>> & 合并插件结果<xs> : {} : {} : {};
|
|
14
|
-
type 合并JSON插件结果<Arr extends Array<插件项类型>> = Arr extends [] ? {} : Arr extends [infer x, ...infer xs] ? x extends infer 插件 ? xs extends Array<插件项类型> ? 插件 extends 任意JSON解析插件 ? z.infer<取插件内部类型<插件>>['body'] & 合并插件结果<xs> : {} : {} : {} : {};
|
|
15
|
-
type 获得接口插件们<接口类型描述> = 接口类型描述 extends 接口类型<any, any, infer 插件, any, any> ? 插件 : never;
|
|
16
|
-
type 从接口类型获得JSON参数<接口类型描述> = 合并JSON插件结果<获得接口插件们<接口类型描述>>;
|
|
17
|
-
|
|
18
|
-
declare class 接口类型<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<插件项类型>, 正确结果类型 extends z.ZodTypeAny, 错误结果类型 extends z.ZodTypeAny> {
|
|
19
|
-
private 路径;
|
|
20
|
-
private 方法;
|
|
21
|
-
private 插件们;
|
|
22
|
-
private 正确结果;
|
|
23
|
-
private 错误结果;
|
|
24
|
-
[______]: [路径, 方法, 插件们, 正确结果类型, 错误结果类型];
|
|
25
|
-
constructor(路径: 路径, 方法: 方法, 插件们: [...插件们], 正确结果: 正确结果类型, 错误结果: 错误结果类型);
|
|
26
|
-
获得路径(): 路径;
|
|
27
|
-
获得方法(): 方法;
|
|
28
|
-
获得插件们(): [...插件们];
|
|
29
|
-
获得正确结果类型(): 正确结果类型;
|
|
30
|
-
获得错误结果类型(): 错误结果类型;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare class 接口<路径 extends string, 方法 extends 'get' | 'post', 插件们 extends Array<插件项类型>, 正确返回类型 extends z.ZodTypeAny, 错误返回类型 extends z.ZodTypeAny> {
|
|
34
|
-
private 接口类型;
|
|
35
|
-
private 实现;
|
|
36
|
-
constructor(接口类型: 接口类型<路径, 方法, 插件们, 正确返回类型, 错误返回类型>, 实现: (插件结果: 合并插件结果<插件们>) => Promise<____<z.infer<正确返回类型>> | ____$1<z.infer<错误返回类型>>>);
|
|
37
|
-
获得类型(): typeof this.接口类型;
|
|
38
|
-
获得实现(): typeof this.实现;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { 接口类型 as a, type 任意接口类型 as b, type 任意插件 as c, type 任意JSON解析插件 as d, type 合并JSON插件结果 as e, type 从接口类型获得JSON参数 as 从, type 任意接口 as 任, type 取插件内部类型 as 取, type 合并插件结果 as 合, 接口 as 接, type 插件项类型 as 插, type 获得接口插件们 as 获 };
|