@kevisual/router 0.0.26 → 0.0.27
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/router-browser.d.ts +6 -7
- package/dist/router-browser.js +1381 -113
- package/dist/router-sign.d.ts +16 -0
- package/dist/router-sign.js +28698 -0
- package/dist/router-simple-lib.d.ts +3 -0
- package/dist/router-simple-lib.js +35 -0
- package/dist/router-simple.js +153 -147
- package/dist/router.d.ts +38 -7
- package/dist/router.js +1556 -222
- package/package.json +26 -27
- package/src/app.ts +1 -1
- package/src/connect.ts +67 -0
- package/src/index.ts +3 -3
- package/src/io.ts +6 -0
- package/src/route.ts +10 -5
- package/src/server/ws-server.ts +4 -3
- package/src/sign.ts +1 -1
- package/src/test/ws.ts +25 -0
- package/src/utils/parse.ts +4 -3
- package/src/validator/index.ts +1 -5
- package/src/validator/rule.ts +3 -2
- package/auto.ts +0 -20
- package/dist/auto.d.ts +0 -472
- package/dist/auto.js +0 -4789
- package/src/auto/call-sock.ts +0 -164
- package/src/auto/listen/cleanup.ts +0 -102
- package/src/auto/listen/run-check.ts +0 -51
- package/src/auto/listen/server-time.ts +0 -33
- package/src/auto/listen-sock.ts +0 -274
- package/src/auto/load-ts.ts +0 -38
- package/src/auto/runtime.ts +0 -19
- package/src/auto/utils/glob.ts +0 -83
package/dist/router-browser.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'zod';
|
|
2
|
+
export { Schema } from 'zod';
|
|
2
3
|
import * as querystring from 'querystring';
|
|
3
4
|
import { IncomingMessage } from 'node:http';
|
|
4
5
|
import { RouteOpts as RouteOpts$1, QueryRouterServer as QueryRouterServer$1, RouteMiddleware as RouteMiddleware$1, Run as Run$1 } from '@kevisual/router';
|
|
@@ -37,9 +38,7 @@ type RuleAny = {
|
|
|
37
38
|
type: 'any';
|
|
38
39
|
} & BaseRule;
|
|
39
40
|
type Rule = RuleString | RuleNumber | RuleBoolean | RuleArray | RuleObject | RuleAny;
|
|
40
|
-
declare const createSchema: (rule: Rule) =>
|
|
41
|
-
|
|
42
|
-
type Schema = z.ZodType<any, any, any>;
|
|
41
|
+
declare const createSchema: (rule: Rule) => Schema;
|
|
43
42
|
|
|
44
43
|
type RouterContextT = {
|
|
45
44
|
code?: number;
|
|
@@ -141,7 +140,7 @@ type RouteOpts = {
|
|
|
141
140
|
[key: string]: Rule;
|
|
142
141
|
};
|
|
143
142
|
schema?: {
|
|
144
|
-
[key: string]: any
|
|
143
|
+
[key: string]: Schema<any>;
|
|
145
144
|
};
|
|
146
145
|
isVerify?: boolean;
|
|
147
146
|
verify?: (ctx?: RouteContext, dev?: boolean) => boolean;
|
|
@@ -182,7 +181,7 @@ declare class Route<U = {
|
|
|
182
181
|
type?: string;
|
|
183
182
|
private _validator?;
|
|
184
183
|
schema?: {
|
|
185
|
-
[key: string]: any
|
|
184
|
+
[key: string]: Schema<any>;
|
|
186
185
|
};
|
|
187
186
|
data?: any;
|
|
188
187
|
/**
|
|
@@ -514,4 +513,4 @@ declare class QueryUtil<T extends RouteObject = RouteObject> {
|
|
|
514
513
|
declare const App: typeof QueryRouterServer;
|
|
515
514
|
|
|
516
515
|
export { App, CustomError, QueryRouter, QueryRouterServer, QueryUtil, Route, createSchema, define, parseBody, parseSearch, parseSearchValue, util };
|
|
517
|
-
export type { RouteArray, RouteContext, RouteObject, RouteOpts, Rule, Run
|
|
516
|
+
export type { RouteArray, RouteContext, RouteObject, RouteOpts, Rule, Run };
|