Skip to content

Commit d9e814a

Browse files
committed
chore: resolve version conflict
1 parent 738f13c commit d9e814a

34 files changed

+201
-327
lines changed

examples/zod/kubb.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export default defineConfig(async () => {
3737
output: {
3838
path: './zod',
3939
},
40-
typed: true,
4140
transformers: {
4241
name: (name, type) => (type === 'file' ? `${name}.gen` : name),
4342
schema: ({ parentName, name }, defaultSchemas) => {

examples/zod/src/gen/zod/addPetRequestSchema.gen.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* Do not edit manually.
44
*/
55

6-
import type { AddPetRequestType } from '../ts/AddPetRequestType.ts'
7-
import type { ToZod } from '@kubb/plugin-zod/utils'
86
import { z } from '../../zod.ts'
97
import { categorySchema } from './categorySchema.gen.ts'
108
import { tagSchema } from './tagSchema.gen.ts'
@@ -16,6 +14,6 @@ export const addPetRequestSchema = z.object({
1614
photoUrls: z.array(z.string()),
1715
tags: z.optional(z.array(z.lazy(() => tagSchema))),
1816
status: z.optional(z.enum(['available', 'pending', 'sold']).describe('pet status in the store')),
19-
}) as unknown as ToZod<AddPetRequestType>
17+
})
2018

21-
export type AddPetRequestSchema = AddPetRequestType
19+
export type AddPetRequestSchema = z.infer<typeof addPetRequestSchema>

examples/zod/src/gen/zod/addPetSchema.gen.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,34 @@
33
* Do not edit manually.
44
*/
55

6-
import type { AddPet200Type, AddPet405Type, AddPetMutationRequestType, AddPetMutationResponseType } from '../ts/AddPetType.ts'
7-
import type { ToZod } from '@kubb/plugin-zod/utils'
86
import { z } from '../../zod.ts'
97
import { addPetRequestSchema } from './addPetRequestSchema.gen.ts'
108
import { petSchema } from './petSchema.gen.ts'
119

1210
/**
1311
* @description Successful operation
1412
*/
15-
export const addPet200Schema = z.lazy(() => petSchema) as unknown as ToZod<AddPet200Type>
13+
export const addPet200Schema = z.lazy(() => petSchema)
1614

17-
export type AddPet200Schema = AddPet200Type
15+
export type AddPet200Schema = z.infer<typeof addPet200Schema>
1816

1917
/**
2018
* @description Pet not found
2119
*/
2220
export const addPet405Schema = z.object({
2321
code: z.optional(z.number().int()),
2422
message: z.optional(z.string()),
25-
}) as unknown as ToZod<AddPet405Type>
23+
})
2624

27-
export type AddPet405Schema = AddPet405Type
25+
export type AddPet405Schema = z.infer<typeof addPet405Schema>
2826

2927
/**
3028
* @description Create a new pet in the store
3129
*/
32-
export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema) as unknown as ToZod<AddPetMutationRequestType>
30+
export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema)
3331

34-
export type AddPetMutationRequestSchema = AddPetMutationRequestType
32+
export type AddPetMutationRequestSchema = z.infer<typeof addPetMutationRequestSchema>
3533

36-
export const addPetMutationResponseSchema = z.lazy(() => addPet200Schema) as unknown as ToZod<AddPetMutationResponseType>
34+
export const addPetMutationResponseSchema = z.lazy(() => addPet200Schema)
3735

38-
export type AddPetMutationResponseSchema = AddPetMutationResponseType
36+
export type AddPetMutationResponseSchema = z.infer<typeof addPetMutationResponseSchema>

examples/zod/src/gen/zod/addressSchema.gen.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
* Do not edit manually.
44
*/
55

6-
import type { AddressType } from '../ts/AddressType.ts'
7-
import type { ToZod } from '@kubb/plugin-zod/utils'
86
import { z } from '../../zod.ts'
97

108
export const addressSchema = z.object({
119
street: z.optional(z.string()),
1210
city: z.optional(z.string()),
1311
state: z.optional(z.string()),
1412
zip: z.optional(z.string()),
15-
}) as unknown as ToZod<AddressType>
13+
})
1614

17-
export type AddressSchema = AddressType
15+
export type AddressSchema = z.infer<typeof addressSchema>

examples/zod/src/gen/zod/apiResponseSchema.gen.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
* Do not edit manually.
44
*/
55

6-
import type { ApiResponseType } from '../ts/ApiResponseType.ts'
7-
import type { ToZod } from '@kubb/plugin-zod/utils'
86
import { z } from '../../zod.ts'
97

108
export const apiResponseSchema = z.object({
119
code: z.optional(z.number().int()),
1210
type: z.optional(z.string()),
1311
message: z.optional(z.string()),
14-
}) as unknown as ToZod<ApiResponseType>
12+
})
1513

16-
export type ApiResponseSchema = ApiResponseType
14+
export type ApiResponseSchema = z.infer<typeof apiResponseSchema>

examples/zod/src/gen/zod/categorySchema.gen.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
* Do not edit manually.
44
*/
55

6-
import type { CategoryType } from '../ts/CategoryType.ts'
7-
import type { ToZod } from '@kubb/plugin-zod/utils'
86
import { z } from '../../zod.ts'
97

108
export const categorySchema = z.object({
119
id: z.optional(z.number().int()),
1210
name: z.optional(z.string()),
1311
parent: z.optional(z.lazy(() => categorySchema)),
14-
}) as unknown as ToZod<CategoryType>
12+
})
1513

16-
export type CategorySchema = CategoryType
14+
export type CategorySchema = z.infer<typeof categorySchema>

examples/zod/src/gen/zod/createPetsSchema.gen.ts

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,50 @@
33
* Do not edit manually.
44
*/
55

6-
import type {
7-
CreatePetsPathParamsType,
8-
CreatePetsQueryParamsType,
9-
CreatePetsHeaderParamsType,
10-
CreatePets201Type,
11-
CreatePetsErrorType,
12-
CreatePetsMutationRequestType,
13-
CreatePetsMutationResponseType,
14-
} from '../ts/CreatePetsType.ts'
15-
import type { ToZod } from '@kubb/plugin-zod/utils'
166
import { z } from '../../zod.ts'
177
import { petNotFoundSchema } from './petNotFoundSchema.gen.ts'
188

199
export const createPetsPathParamsSchema = z.object({
2010
uuid: z.string().describe('UUID'),
21-
}) as unknown as ToZod<CreatePetsPathParamsType>
11+
})
2212

23-
export type CreatePetsPathParamsSchema = CreatePetsPathParamsType
13+
export type CreatePetsPathParamsSchema = z.infer<typeof createPetsPathParamsSchema>
2414

2515
export const createPetsQueryParamsSchema = z
2616
.object({
2717
offset: z.optional(z.coerce.number().int().describe('Offset')),
2818
})
29-
.optional() as unknown as ToZod<CreatePetsQueryParamsType>
19+
.optional()
3020

31-
export type CreatePetsQueryParamsSchema = CreatePetsQueryParamsType
21+
export type CreatePetsQueryParamsSchema = z.infer<typeof createPetsQueryParamsSchema>
3222

3323
export const createPetsHeaderParamsSchema = z.object({
3424
'X-EXAMPLE': z.enum(['ONE', 'TWO', 'THREE']).describe('Header parameters'),
35-
}) as unknown as ToZod<CreatePetsHeaderParamsType>
25+
})
3626

37-
export type CreatePetsHeaderParamsSchema = CreatePetsHeaderParamsType
27+
export type CreatePetsHeaderParamsSchema = z.infer<typeof createPetsHeaderParamsSchema>
3828

3929
/**
4030
* @description Null response
4131
*/
42-
export const createPets201Schema = z.any() as unknown as ToZod<CreatePets201Type>
32+
export const createPets201Schema = z.any()
4333

44-
export type CreatePets201Schema = CreatePets201Type
34+
export type CreatePets201Schema = z.infer<typeof createPets201Schema>
4535

4636
/**
4737
* @description unexpected error
4838
*/
49-
export const createPetsErrorSchema = z.lazy(() => petNotFoundSchema).describe('Pet not found') as unknown as ToZod<CreatePetsErrorType>
39+
export const createPetsErrorSchema = z.lazy(() => petNotFoundSchema).describe('Pet not found')
5040

51-
export type CreatePetsErrorSchema = CreatePetsErrorType
41+
export type CreatePetsErrorSchema = z.infer<typeof createPetsErrorSchema>
5242

5343
export const createPetsMutationRequestSchema = z.object({
5444
name: z.string(),
5545
tag: z.string(),
56-
}) as unknown as ToZod<CreatePetsMutationRequestType>
46+
})
5747

58-
export type CreatePetsMutationRequestSchema = CreatePetsMutationRequestType
48+
export type CreatePetsMutationRequestSchema = z.infer<typeof createPetsMutationRequestSchema>
5949

60-
export const createPetsMutationResponseSchema = z.lazy(() => createPets201Schema) as unknown as ToZod<CreatePetsMutationResponseType>
50+
export const createPetsMutationResponseSchema = z.lazy(() => createPets201Schema)
6151

62-
export type CreatePetsMutationResponseSchema = CreatePetsMutationResponseType
52+
export type CreatePetsMutationResponseSchema = z.infer<typeof createPetsMutationResponseSchema>

examples/zod/src/gen/zod/createUserSchema.gen.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,23 @@
33
* Do not edit manually.
44
*/
55

6-
import type { CreateUserErrorType, CreateUserMutationRequestType, CreateUserMutationResponseType } from '../ts/CreateUserType.ts'
7-
import type { ToZod } from '@kubb/plugin-zod/utils'
86
import { z } from '../../zod.ts'
97
import { userSchema } from './userSchema.gen.ts'
108

119
/**
1210
* @description successful operation
1311
*/
14-
export const createUserErrorSchema = z.lazy(() => userSchema) as unknown as ToZod<CreateUserErrorType>
12+
export const createUserErrorSchema = z.lazy(() => userSchema)
1513

16-
export type CreateUserErrorSchema = CreateUserErrorType
14+
export type CreateUserErrorSchema = z.infer<typeof createUserErrorSchema>
1715

1816
/**
1917
* @description Created user object
2018
*/
21-
export const createUserMutationRequestSchema = z.lazy(() => userSchema) as unknown as ToZod<CreateUserMutationRequestType>
19+
export const createUserMutationRequestSchema = z.lazy(() => userSchema)
2220

23-
export type CreateUserMutationRequestSchema = CreateUserMutationRequestType
21+
export type CreateUserMutationRequestSchema = z.infer<typeof createUserMutationRequestSchema>
2422

25-
export const createUserMutationResponseSchema = z.any() as unknown as ToZod<CreateUserMutationResponseType>
23+
export const createUserMutationResponseSchema = z.any()
2624

27-
export type CreateUserMutationResponseSchema = CreateUserMutationResponseType
25+
export type CreateUserMutationResponseSchema = z.infer<typeof createUserMutationResponseSchema>

examples/zod/src/gen/zod/createUsersWithListInputSchema.gen.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,27 @@
33
* Do not edit manually.
44
*/
55

6-
import type {
7-
CreateUsersWithListInput200Type,
8-
CreateUsersWithListInputErrorType,
9-
CreateUsersWithListInputMutationRequestType,
10-
CreateUsersWithListInputMutationResponseType,
11-
} from '../ts/CreateUsersWithListInputType.ts'
12-
import type { ToZod } from '@kubb/plugin-zod/utils'
136
import { z } from '../../zod.ts'
147
import { userSchema } from './userSchema.gen.ts'
158

169
/**
1710
* @description Successful operation
1811
*/
19-
export const createUsersWithListInput200Schema = z.lazy(() => userSchema) as unknown as ToZod<CreateUsersWithListInput200Type>
12+
export const createUsersWithListInput200Schema = z.lazy(() => userSchema)
2013

21-
export type CreateUsersWithListInput200Schema = CreateUsersWithListInput200Type
14+
export type CreateUsersWithListInput200Schema = z.infer<typeof createUsersWithListInput200Schema>
2215

2316
/**
2417
* @description successful operation
2518
*/
26-
export const createUsersWithListInputErrorSchema = z.any() as unknown as ToZod<CreateUsersWithListInputErrorType>
19+
export const createUsersWithListInputErrorSchema = z.any()
2720

28-
export type CreateUsersWithListInputErrorSchema = CreateUsersWithListInputErrorType
21+
export type CreateUsersWithListInputErrorSchema = z.infer<typeof createUsersWithListInputErrorSchema>
2922

30-
export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema)) as unknown as ToZod<CreateUsersWithListInputMutationRequestType>
23+
export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema))
3124

32-
export type CreateUsersWithListInputMutationRequestSchema = CreateUsersWithListInputMutationRequestType
25+
export type CreateUsersWithListInputMutationRequestSchema = z.infer<typeof createUsersWithListInputMutationRequestSchema>
3326

34-
export const createUsersWithListInputMutationResponseSchema = z.lazy(
35-
() => createUsersWithListInput200Schema,
36-
) as unknown as ToZod<CreateUsersWithListInputMutationResponseType>
27+
export const createUsersWithListInputMutationResponseSchema = z.lazy(() => createUsersWithListInput200Schema)
3728

38-
export type CreateUsersWithListInputMutationResponseSchema = CreateUsersWithListInputMutationResponseType
29+
export type CreateUsersWithListInputMutationResponseSchema = z.infer<typeof createUsersWithListInputMutationResponseSchema>

examples/zod/src/gen/zod/customerSchema.gen.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
* Do not edit manually.
44
*/
55

6-
import type { CustomerType } from '../ts/CustomerType.ts'
7-
import type { ToZod } from '@kubb/plugin-zod/utils'
86
import { z } from '../../zod.ts'
97
import { addressSchema } from './addressSchema.gen.ts'
108

119
export const customerSchema = z.object({
1210
id: z.optional(z.number().int()),
1311
username: z.optional(z.string()),
1412
address: z.optional(z.array(z.lazy(() => addressSchema))),
15-
}) as unknown as ToZod<CustomerType>
13+
})
1614

17-
export type CustomerSchema = CustomerType
15+
export type CustomerSchema = z.infer<typeof customerSchema>

0 commit comments

Comments
 (0)