@hono/zod-openapi 0.7.2 → 0.8.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.
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/package.json +1 -2
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ type IsForm<T> = T extends string ? T extends `multipart/form-data${infer _Rest}
|
|
|
20
20
|
type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
|
|
21
21
|
type InputTypeBase<R extends RouteConfig, Part extends string, Type extends string> = R['request'] extends RequestTypes ? RequestPart<R, Part> extends AnyZodObject ? {
|
|
22
22
|
in: {
|
|
23
|
-
[K in Type]: z.
|
|
23
|
+
[K in Type]: z.infer<RequestPart<R, Part>>;
|
|
24
24
|
};
|
|
25
25
|
out: {
|
|
26
26
|
[K in Type]: z.output<RequestPart<R, Part>>;
|
|
@@ -28,7 +28,7 @@ type InputTypeBase<R extends RouteConfig, Part extends string, Type extends stri
|
|
|
28
28
|
} : {} : {};
|
|
29
29
|
type InputTypeJson<R extends RouteConfig> = R['request'] extends RequestTypes ? R['request']['body'] extends ZodRequestBody ? R['request']['body']['content'] extends ZodContentObject ? IsJson<keyof R['request']['body']['content']> extends never ? {} : R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema<any> ? {
|
|
30
30
|
in: {
|
|
31
|
-
json: z.
|
|
31
|
+
json: z.infer<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
32
32
|
};
|
|
33
33
|
out: {
|
|
34
34
|
json: z.output<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
@@ -36,7 +36,7 @@ type InputTypeJson<R extends RouteConfig> = R['request'] extends RequestTypes ?
|
|
|
36
36
|
} : {} : {} : {} : {};
|
|
37
37
|
type InputTypeForm<R extends RouteConfig> = R['request'] extends RequestTypes ? R['request']['body'] extends ZodRequestBody ? R['request']['body']['content'] extends ZodContentObject ? IsForm<keyof R['request']['body']['content']> extends never ? {} : R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema<any> ? {
|
|
38
38
|
in: {
|
|
39
|
-
form: z.
|
|
39
|
+
form: z.infer<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
40
40
|
};
|
|
41
41
|
out: {
|
|
42
42
|
form: z.output<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
@@ -53,9 +53,9 @@ type Hook<T, E extends Env, P extends string, O> = (result: {
|
|
|
53
53
|
} | {
|
|
54
54
|
success: false;
|
|
55
55
|
error: ZodError;
|
|
56
|
-
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | void;
|
|
56
|
+
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void;
|
|
57
57
|
type ConvertPathType<T extends string> = T extends `${infer Start}/{${infer Param}}${infer Rest}` ? `${Start}/:${Param}${ConvertPathType<Rest>}` : T;
|
|
58
|
-
type HandlerResponse<O> = TypedResponse<O> | Promise<TypedResponse<O
|
|
58
|
+
type HandlerResponse<O> = TypedResponse<O> | Promise<TypedResponse<O>> | Response | Promise<Response>;
|
|
59
59
|
type OpenAPIHonoOptions<E extends Env> = {
|
|
60
60
|
defaultHook?: Hook<any, E, any, any>;
|
|
61
61
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ type IsForm<T> = T extends string ? T extends `multipart/form-data${infer _Rest}
|
|
|
20
20
|
type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
|
|
21
21
|
type InputTypeBase<R extends RouteConfig, Part extends string, Type extends string> = R['request'] extends RequestTypes ? RequestPart<R, Part> extends AnyZodObject ? {
|
|
22
22
|
in: {
|
|
23
|
-
[K in Type]: z.
|
|
23
|
+
[K in Type]: z.infer<RequestPart<R, Part>>;
|
|
24
24
|
};
|
|
25
25
|
out: {
|
|
26
26
|
[K in Type]: z.output<RequestPart<R, Part>>;
|
|
@@ -28,7 +28,7 @@ type InputTypeBase<R extends RouteConfig, Part extends string, Type extends stri
|
|
|
28
28
|
} : {} : {};
|
|
29
29
|
type InputTypeJson<R extends RouteConfig> = R['request'] extends RequestTypes ? R['request']['body'] extends ZodRequestBody ? R['request']['body']['content'] extends ZodContentObject ? IsJson<keyof R['request']['body']['content']> extends never ? {} : R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema<any> ? {
|
|
30
30
|
in: {
|
|
31
|
-
json: z.
|
|
31
|
+
json: z.infer<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
32
32
|
};
|
|
33
33
|
out: {
|
|
34
34
|
json: z.output<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
@@ -36,7 +36,7 @@ type InputTypeJson<R extends RouteConfig> = R['request'] extends RequestTypes ?
|
|
|
36
36
|
} : {} : {} : {} : {};
|
|
37
37
|
type InputTypeForm<R extends RouteConfig> = R['request'] extends RequestTypes ? R['request']['body'] extends ZodRequestBody ? R['request']['body']['content'] extends ZodContentObject ? IsForm<keyof R['request']['body']['content']> extends never ? {} : R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema<any> ? {
|
|
38
38
|
in: {
|
|
39
|
-
form: z.
|
|
39
|
+
form: z.infer<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
40
40
|
};
|
|
41
41
|
out: {
|
|
42
42
|
form: z.output<R['request']['body']['content'][keyof R['request']['body']['content']]['schema']>;
|
|
@@ -53,9 +53,9 @@ type Hook<T, E extends Env, P extends string, O> = (result: {
|
|
|
53
53
|
} | {
|
|
54
54
|
success: false;
|
|
55
55
|
error: ZodError;
|
|
56
|
-
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | void;
|
|
56
|
+
}, c: Context<E, P>) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void;
|
|
57
57
|
type ConvertPathType<T extends string> = T extends `${infer Start}/{${infer Param}}${infer Rest}` ? `${Start}/:${Param}${ConvertPathType<Rest>}` : T;
|
|
58
|
-
type HandlerResponse<O> = TypedResponse<O> | Promise<TypedResponse<O
|
|
58
|
+
type HandlerResponse<O> = TypedResponse<O> | Promise<TypedResponse<O>> | Response | Promise<Response>;
|
|
59
59
|
type OpenAPIHonoOptions<E extends Env> = {
|
|
60
60
|
defaultHook?: Hook<any, E, any, any>;
|
|
61
61
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hono/zod-openapi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "A wrapper class of Hono which supports OpenAPI.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"zod": "3.*"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@hono/zod-validator": "^0.1.9",
|
|
41
40
|
"hono": "^3.7.2",
|
|
42
41
|
"zod": "^3.22.1"
|
|
43
42
|
},
|