@kaito-http/core 2.7.0 → 2.7.1
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.
|
@@ -12,6 +12,6 @@ export type Route<Context, Result, Path extends string, Method extends KaitoMeth
|
|
|
12
12
|
query?: Query;
|
|
13
13
|
path: Path;
|
|
14
14
|
method: Method;
|
|
15
|
-
run(args: RouteArgument<Path, Context, z.infer<z.ZodObject<Query>>, BodyOutput>): Promise<Result
|
|
15
|
+
run(args: RouteArgument<Path, Context, z.infer<z.ZodObject<Query>>, BodyOutput>): Promise<Result>;
|
|
16
16
|
};
|
|
17
17
|
export type AnyRoute<Context = any> = Route<Context, any, any, any, AnyQueryDefinition, any, any, any>;
|
|
@@ -28,7 +28,7 @@ export declare class Router<Context, R extends Routes> {
|
|
|
28
28
|
* @param route The route specification to add to this router
|
|
29
29
|
* @returns A new router with this route added
|
|
30
30
|
*/
|
|
31
|
-
add: <Result, Path extends string, Method extends KaitoMethod, Query extends AnyQueryDefinition = {}, BodyOutput = never, BodyDef extends z.ZodTypeDef = z.ZodTypeDef, BodyInput = BodyOutput>(method: Method, path: Path, route: ((args: import("./route").RouteArgument<Path, Context, z.objectUtil.addQuestionMarks<{ [k_1 in keyof Query]: Query[k_1]["_output"]; }> extends infer T extends object ? { [k in keyof T]: z.objectUtil.addQuestionMarks<{ [k_1 in keyof Query]: Query[k_1]["_output"]; }>[k]; } : never, BodyOutput>) =>
|
|
31
|
+
add: <Result, Path extends string, Method extends KaitoMethod, Query extends AnyQueryDefinition = {}, BodyOutput = never, BodyDef extends z.ZodTypeDef = z.ZodTypeDef, BodyInput = BodyOutput>(method: Method, path: Path, route: ((args: import("./route").RouteArgument<Path, Context, z.objectUtil.addQuestionMarks<{ [k_1 in keyof Query]: Query[k_1]["_output"]; }> extends infer T extends object ? { [k in keyof T]: z.objectUtil.addQuestionMarks<{ [k_1 in keyof Query]: Query[k_1]["_output"]; }>[k]; } : never, BodyOutput>) => Promise<Result>) | (Method extends "GET" ? Omit<Route<Context, Result, Path, Method, Query, BodyOutput, BodyDef, BodyInput>, "path" | "body" | "method"> : Omit<Route<Context, Result, Path, Method, Query, BodyOutput, BodyDef, BodyInput>, "path" | "method">)) => Router<Context, [...R, Route<Context, Result, Path, Method, Query, BodyOutput, BodyDef, BodyInput>]>;
|
|
32
32
|
merge: <PathPrefix extends `/${string}`, OtherRoutes extends Routes>(pathPrefix: PathPrefix, other: Router<Context, OtherRoutes>) => Router<Context, [...R, ...PrefixRoutesPath<PathPrefix, OtherRoutes>]>;
|
|
33
33
|
toFindMyWay: (server: ServerConfig<Context, any>) => fmw.Instance<fmw.HTTPVersion.V1>;
|
|
34
34
|
}
|