@hono/zod-openapi 1.1.2 → 1.1.3
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/CHANGELOG.md +6 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hono/zod-openapi
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1469](https://github.com/honojs/middleware/pull/1469) [`db68e22a9edee796c8692ef84cdc21be79566718`](https://github.com/honojs/middleware/commit/db68e22a9edee796c8692ef84cdc21be79566718) Thanks [@BarryThePenguin](https://github.com/BarryThePenguin)! - Remove `SimplifyDeepArray` usage, see https://github.com/honojs/hono/pull/4406
|
|
8
|
+
|
|
3
9
|
## 1.1.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
|
3
3
|
import { MiddlewareHandler, TypedResponse, Env, ValidationTargets, Context, Input, Handler, Schema, Hono, ToSchema } from 'hono';
|
|
4
4
|
import { MergePath, MergeSchemaPath } from 'hono/types';
|
|
5
5
|
import { InfoStatusCode, SuccessStatusCode, RedirectStatusCode, ClientErrorStatusCode, ServerErrorStatusCode, StatusCode } from 'hono/utils/http-status';
|
|
6
|
-
import {
|
|
6
|
+
import { JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
|
|
7
7
|
import { OpenAPIObject } from 'openapi3-ts/oas30';
|
|
8
8
|
import { OpenAPIObject as OpenAPIObject$1 } from 'openapi3-ts/oas31';
|
|
9
9
|
import { ZodType, z, ZodError } from 'zod';
|
|
@@ -23,7 +23,7 @@ type RequestTypes = {
|
|
|
23
23
|
};
|
|
24
24
|
type IsJson<T> = T extends string ? T extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? 'json' : never : never : never;
|
|
25
25
|
type IsForm<T> = T extends string ? T extends `multipart/form-data${infer _Rest}` | `application/x-www-form-urlencoded${infer _Rest}` ? 'form' : never : never;
|
|
26
|
-
type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<
|
|
26
|
+
type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<JSONParsed<Content>, ExtractStatusCode<Status>, 'json'> : never : ContentType extends `text/plain${infer _Rest}` ? TypedResponse<Content, ExtractStatusCode<Status>, 'text'> : Response : never;
|
|
27
27
|
type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
|
|
28
28
|
type HasUndefined<T> = undefined extends T ? true : false;
|
|
29
29
|
type InputTypeBase<R extends RouteConfig, Part extends string, Type extends keyof ValidationTargets> = R['request'] extends RequestTypes ? RequestPart<R, Part> extends ZodType ? {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
|
3
3
|
import { MiddlewareHandler, TypedResponse, Env, ValidationTargets, Context, Input, Handler, Schema, Hono, ToSchema } from 'hono';
|
|
4
4
|
import { MergePath, MergeSchemaPath } from 'hono/types';
|
|
5
5
|
import { InfoStatusCode, SuccessStatusCode, RedirectStatusCode, ClientErrorStatusCode, ServerErrorStatusCode, StatusCode } from 'hono/utils/http-status';
|
|
6
|
-
import {
|
|
6
|
+
import { JSONParsed, RemoveBlankRecord } from 'hono/utils/types';
|
|
7
7
|
import { OpenAPIObject } from 'openapi3-ts/oas30';
|
|
8
8
|
import { OpenAPIObject as OpenAPIObject$1 } from 'openapi3-ts/oas31';
|
|
9
9
|
import { ZodType, z, ZodError } from 'zod';
|
|
@@ -23,7 +23,7 @@ type RequestTypes = {
|
|
|
23
23
|
};
|
|
24
24
|
type IsJson<T> = T extends string ? T extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? 'json' : never : never : never;
|
|
25
25
|
type IsForm<T> = T extends string ? T extends `multipart/form-data${infer _Rest}` | `application/x-www-form-urlencoded${infer _Rest}` ? 'form' : never : never;
|
|
26
|
-
type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<
|
|
26
|
+
type ReturnJsonOrTextOrResponse<ContentType, Content, Status extends keyof StatusCodeRangeDefinitions | StatusCode> = ContentType extends string ? ContentType extends `application/${infer Start}json${infer _End}` ? Start extends '' | `${string}+` | `vnd.${string}+` ? TypedResponse<JSONParsed<Content>, ExtractStatusCode<Status>, 'json'> : never : ContentType extends `text/plain${infer _Rest}` ? TypedResponse<Content, ExtractStatusCode<Status>, 'text'> : Response : never;
|
|
27
27
|
type RequestPart<R extends RouteConfig, Part extends string> = Part extends keyof R['request'] ? R['request'][Part] : {};
|
|
28
28
|
type HasUndefined<T> = undefined extends T ? true : false;
|
|
29
29
|
type InputTypeBase<R extends RouteConfig, Part extends string, Type extends keyof ValidationTargets> = R['request'] extends RequestTypes ? RequestPart<R, Part> extends ZodType ? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hono/zod-openapi",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A wrapper class of Hono which supports OpenAPI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
50
|
-
"hono": "^4.8
|
|
50
|
+
"hono": "^4.9.8",
|
|
51
51
|
"publint": "^0.3.9",
|
|
52
52
|
"tsup": "^8.5.0",
|
|
53
53
|
"typescript": "^5.8.2",
|