hono-takibi 0.8.5 → 0.8.6
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/cli/takibi.js +1 -1
- package/dist/generator/zod/helper/property-schema.js +1 -1
- package/dist/generator/zod/index.d.ts +1 -1
- package/dist/generator/zod/index.js +1 -1
- package/dist/generator/zod/z/array.js +1 -1
- package/dist/generator/zod/z/object.js +1 -1
- package/dist/generator/zod-openapi-hono/openapi/components/index.js +1 -1
- package/dist/generator/zod-openapi-hono/openapi/index.d.ts +1 -1
- package/dist/generator/zod-openapi-hono/openapi/index.js +1 -1
- package/dist/generator/zod-openapi-hono/openapi/route/params/params-object.js +1 -1
- package/dist/helper/allof.js +1 -1
- package/dist/helper/anyof.js +1 -1
- package/dist/helper/oneof.js +1 -1
- package/dist/vite-plugin/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/takibi.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { fmt } from '../format/index.js';
|
|
3
3
|
import { mkdir, writeFile } from '../fsp/index.js';
|
|
4
|
-
import
|
|
4
|
+
import zodOpenAPIHono from '../generator/zod-openapi-hono/openapi/index.js';
|
|
5
5
|
import { parseOpenAPI } from '../openapi/index.js';
|
|
6
6
|
import { asyncAndThen, ok } from '../result/index.js';
|
|
7
7
|
import { templateCode } from './template-code.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { wrap } from '../../../helper/wrap.js';
|
|
2
2
|
import { zodToOpenAPI } from '../../../helper/zod-to-openapi.js';
|
|
3
3
|
import { refSchema } from '../../../utils/index.js';
|
|
4
|
-
import
|
|
4
|
+
import zod from '../index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Generates a Zod-compatible schema string for a given property.
|
|
7
7
|
*
|
|
@@ -51,4 +51,4 @@ import type { Schema } from '../../openapi/index.js';
|
|
|
51
51
|
* - Optimizes out redundant `.min()` when `.gt()` is used
|
|
52
52
|
* - Logs unhandled cases to `console.warn`
|
|
53
53
|
*/
|
|
54
|
-
export
|
|
54
|
+
export default function zod(schema: Schema): string;
|
|
@@ -59,7 +59,7 @@ import { _enum, array, boolean, date, integer, number, object, string } from './
|
|
|
59
59
|
* - Optimizes out redundant `.min()` when `.gt()` is used
|
|
60
60
|
* - Logs unhandled cases to `console.warn`
|
|
61
61
|
*/
|
|
62
|
-
export function zod(schema) {
|
|
62
|
+
export default function zod(schema) {
|
|
63
63
|
if (schema === undefined)
|
|
64
64
|
throw new Error('hono-takibi: only #/components/schemas/* is supported');
|
|
65
65
|
/* $ref */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { wrap } from '../../../helper/wrap.js';
|
|
2
|
-
import
|
|
2
|
+
import zod from '../index.js';
|
|
3
3
|
export function array(schema) {
|
|
4
4
|
const array = `z.array(${schema.items ? zod(schema.items) : 'z.any()'})`;
|
|
5
5
|
if (typeof schema.minItems === 'number' && typeof schema.maxItems === 'number') {
|
|
@@ -4,7 +4,7 @@ import { not } from '../../../helper/not.js';
|
|
|
4
4
|
import { oneOf } from '../../../helper/oneof.js';
|
|
5
5
|
import { wrap } from '../../../helper/wrap.js';
|
|
6
6
|
import { propertiesSchema } from '../helper/properties-schema.js';
|
|
7
|
-
import
|
|
7
|
+
import zod from '../index.js';
|
|
8
8
|
/**
|
|
9
9
|
* Generates a Zod object schema from an OpenAPI schema definition.
|
|
10
10
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveSchemasDependencies } from '../../../../helper/resolve-schemas-dependencies.js';
|
|
2
2
|
import { zodToOpenAPI } from '../../../../helper/zod-to-openapi.js';
|
|
3
3
|
import { zodToOpenAPISchema } from '../../../../helper/zod-to-openapi-schema.js';
|
|
4
|
-
import
|
|
4
|
+
import zod from '../../../zod/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Converts OpenAPI component schemas to Zod-based TypeScript definitions.
|
|
7
7
|
*
|
|
@@ -7,4 +7,4 @@ import type { OpenAPI } from '../../../openapi/index.js';
|
|
|
7
7
|
* @param exportType - Whether to export inferred TypeScript types
|
|
8
8
|
* @returns The generated TypeScript code string
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export default function zodOpenAPIHono(openapi: OpenAPI, exportSchema: boolean, exportType: boolean): string;
|
|
@@ -8,7 +8,7 @@ import { routeCode } from './route/index.js';
|
|
|
8
8
|
* @param exportType - Whether to export inferred TypeScript types
|
|
9
9
|
* @returns The generated TypeScript code string
|
|
10
10
|
*/
|
|
11
|
-
export function zodOpenAPIHono(openapi, exportSchema, exportType) {
|
|
11
|
+
export default function zodOpenAPIHono(openapi, exportSchema, exportType) {
|
|
12
12
|
const components = openapi.components
|
|
13
13
|
? componentsCode(openapi.components, exportSchema, exportType)
|
|
14
14
|
: '';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { zodToOpenAPI } from '../../../../../helper/zod-to-openapi.js';
|
|
2
2
|
import { getToSafeIdentifier } from '../../../../../utils/index.js';
|
|
3
|
-
import
|
|
3
|
+
import zod from '../../../../zod/index.js';
|
|
4
4
|
import { queryParameter } from './index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Converts OpenAPI component schemas into TypeScript code using Zod.
|
package/dist/helper/allof.js
CHANGED
package/dist/helper/anyof.js
CHANGED
package/dist/helper/oneof.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fsp from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fmt } from '../format/index.js';
|
|
4
|
-
import
|
|
4
|
+
import zodOpenAPIHono from '../generator/zod-openapi-hono/openapi/index.js';
|
|
5
5
|
import { parseOpenAPI } from '../openapi/index.js';
|
|
6
6
|
export default async function HonoTakibiVite({ input, output, exportType = true, exportSchema = true, }) {
|
|
7
7
|
const run = async () => {
|