From e32b6bda3d676b099dd28c6ab380cf22abb44895 Mon Sep 17 00:00:00 2001 From: Stijn Van Hulle Date: Sat, 13 Apr 2024 13:33:13 +0200 Subject: [PATCH] fix: exclude min/max (#929) * fix: exclude min/max * fix: nullable enums are not generated as nullable * chore: cleanup * chore: update examples * chore * chore: typecheck fix --- .changeset/short-hats-beg.md | 7 + .changeset/thin-clocks-burn.md | 6 + docs/package.json | 4 +- e2e/package.json | 4 +- .../src/gen/zod/addPetRequestSchema.ts | 4 +- .../advanced/src/gen/zod/customerSchema.ts | 2 +- .../src/gen/zod/petController/addPetSchema.ts | 4 +- .../petController/findPetsByStatusSchema.ts | 4 +- .../zod/petController/findPetsByTagsSchema.ts | 4 +- .../gen/zod/petController/getPetByIdSchema.ts | 2 +- .../gen/zod/petController/updatePetSchema.ts | 2 +- .../gen/zod/petController/uploadFileSchema.ts | 4 +- examples/advanced/src/gen/zod/petSchema.ts | 4 +- .../zod/petsController/createPetsSchema.ts | 2 +- .../advanced/src/gen/zod/userArraySchema.ts | 2 +- .../zod/userController/createUserSchema.ts | 4 +- .../createUsersWithListInputSchema.ts | 6 +- .../zod/userController/getUserByNameSchema.ts | 4 +- .../zod/userController/updateUserSchema.ts | 2 +- examples/client/package.json | 2 +- examples/faker/package.json | 2 +- examples/python/package.json | 6 +- examples/react-query-v5/package.json | 6 +- .../react-query-v5/src/gen/hooks/index.ts | 40 +- .../src/gen/hooks/useAddPetHook.ts | 86 +- .../src/gen/hooks/useCreateUserHook.ts | 86 +- .../hooks/useCreateUsersWithListInputHook.ts | 86 +- .../src/gen/hooks/useDeleteOrderHook.ts | 85 +- .../src/gen/hooks/useDeletePetHook.ts | 88 +- .../src/gen/hooks/useDeleteUserHook.ts | 85 +- .../src/gen/hooks/useFindPetsByStatusHook.ts | 175 ++-- .../src/gen/hooks/useFindPetsByTagsHook.ts | 266 +++--- .../src/gen/hooks/useGetInventoryHook.ts | 164 ++-- .../src/gen/hooks/useGetOrderByIdHook.ts | 168 ++-- .../src/gen/hooks/useGetPetByIdHook.ts | 166 ++-- .../src/gen/hooks/useGetUserByNameHook.ts | 172 ++-- .../src/gen/hooks/useLoginUserHook.ts | 170 ++-- .../src/gen/hooks/useLogoutUserHook.ts | 164 ++-- .../src/gen/hooks/usePlaceOrderHook.ts | 86 +- .../src/gen/hooks/usePlaceOrderPatchHook.ts | 86 +- .../src/gen/hooks/useUpdatePetHook.ts | 86 +- .../src/gen/hooks/useUpdatePetWithFormHook.ts | 191 ++--- .../src/gen/hooks/useUpdateUserHook.ts | 87 +- .../src/gen/hooks/useUploadFileHook.ts | 90 +- examples/react-query-v5/src/gen/index.ts | 4 +- .../react-query-v5/src/gen/invalidations.ts | 77 +- .../react-query-v5/src/gen/models/AddPet.ts | 54 +- .../src/gen/models/AddPetRequest.ts | 62 +- .../react-query-v5/src/gen/models/Address.ts | 34 +- .../src/gen/models/ApiResponse.ts | 26 +- .../react-query-v5/src/gen/models/Category.ts | 18 +- .../src/gen/models/CreateUser.ts | 24 +- .../gen/models/CreateUsersWithListInput.ts | 30 +- .../react-query-v5/src/gen/models/Customer.ts | 30 +- .../src/gen/models/DeleteOrder.ts | 36 +- .../src/gen/models/DeletePet.ts | 44 +- .../src/gen/models/DeleteUser.ts | 36 +- .../src/gen/models/FindPetsByStatus.ts | 56 +- .../src/gen/models/FindPetsByTags.ts | 64 +- .../src/gen/models/GetInventory.ts | 20 +- .../src/gen/models/GetOrderById.ts | 50 +- .../src/gen/models/GetPetById.ts | 50 +- .../src/gen/models/GetUserByName.ts | 50 +- .../src/gen/models/LoginUser.ts | 50 +- .../src/gen/models/LogoutUser.ts | 12 +- .../react-query-v5/src/gen/models/Order.ts | 82 +- examples/react-query-v5/src/gen/models/Pet.ts | 62 +- .../src/gen/models/PetNotFound.ts | 18 +- .../src/gen/models/PlaceOrder.ts | 32 +- .../src/gen/models/PlaceOrderPatch.ts | 32 +- examples/react-query-v5/src/gen/models/Tag.ts | 18 +- .../src/gen/models/UpdatePet.ts | 48 +- .../src/gen/models/UpdatePetWithForm.ts | 56 +- .../src/gen/models/UpdateUser.ts | 40 +- .../src/gen/models/UploadFile.ts | 56 +- .../react-query-v5/src/gen/models/User.ts | 68 +- .../src/gen/models/UserArray.ts | 4 +- .../react-query-v5/src/gen/models/index.ts | 62 +- examples/react-query/package.json | 4 +- examples/simple-single/src/gen/zod.ts | 76 +- examples/simple-single/src/gen2/index.ts | 198 ++--- examples/solid-query/package.json | 2 +- examples/svelte-query/package.json | 2 +- examples/typescript/package.json | 2 +- examples/vue-query-v5/src/gen/hooks/index.ts | 38 +- .../vue-query-v5/src/gen/hooks/useAddPet.ts | 72 +- .../src/gen/hooks/useCreateUser.ts | 72 +- .../gen/hooks/useCreateUsersWithListInput.ts | 72 +- .../src/gen/hooks/useDeleteOrder.ts | 77 +- .../src/gen/hooks/useDeletePet.ts | 82 +- .../src/gen/hooks/useDeleteUser.ts | 77 +- .../src/gen/hooks/useFindPetsByStatus.ts | 114 ++- .../src/gen/hooks/useFindPetsByTags.ts | 113 ++- .../src/gen/hooks/useGetInventory.ts | 100 ++- .../src/gen/hooks/useGetOrderById.ts | 108 ++- .../src/gen/hooks/useGetPetById.ts | 107 ++- .../src/gen/hooks/useGetUserByName.ts | 108 ++- .../src/gen/hooks/useLoginUser.ts | 109 ++- .../src/gen/hooks/useLogoutUser.ts | 100 ++- .../src/gen/hooks/usePlaceOrder.ts | 72 +- .../src/gen/hooks/useUpdatePet.ts | 72 +- .../src/gen/hooks/useUpdatePetWithForm.ts | 87 +- .../src/gen/hooks/useUpdateUser.ts | 79 +- .../src/gen/hooks/useUploadFile.ts | 84 +- examples/vue-query-v5/src/gen/index.ts | 4 +- .../vue-query-v5/src/gen/models/AddPet.ts | 36 +- .../vue-query-v5/src/gen/models/Address.ts | 52 +- .../src/gen/models/ApiResponse.ts | 26 +- .../vue-query-v5/src/gen/models/Category.ts | 18 +- .../vue-query-v5/src/gen/models/CreateUser.ts | 24 +- .../gen/models/CreateUsersWithListInput.ts | 30 +- .../vue-query-v5/src/gen/models/Customer.ts | 30 +- .../src/gen/models/DeleteOrder.ts | 36 +- .../vue-query-v5/src/gen/models/DeletePet.ts | 44 +- .../vue-query-v5/src/gen/models/DeleteUser.ts | 36 +- .../src/gen/models/FindPetsByStatus.ts | 56 +- .../src/gen/models/FindPetsByTags.ts | 44 +- .../src/gen/models/GetInventory.ts | 20 +- .../src/gen/models/GetOrderById.ts | 50 +- .../vue-query-v5/src/gen/models/GetPetById.ts | 50 +- .../src/gen/models/GetUserByName.ts | 50 +- .../vue-query-v5/src/gen/models/LoginUser.ts | 50 +- .../vue-query-v5/src/gen/models/LogoutUser.ts | 12 +- examples/vue-query-v5/src/gen/models/Order.ts | 62 +- examples/vue-query-v5/src/gen/models/Pet.ts | 62 +- .../vue-query-v5/src/gen/models/PlaceOrder.ts | 32 +- examples/vue-query-v5/src/gen/models/Tag.ts | 18 +- .../vue-query-v5/src/gen/models/UpdatePet.ts | 48 +- .../src/gen/models/UpdatePetWithForm.ts | 56 +- .../vue-query-v5/src/gen/models/UpdateUser.ts | 40 +- .../vue-query-v5/src/gen/models/UploadFile.ts | 56 +- examples/vue-query-v5/src/gen/models/User.ts | 68 +- .../vue-query-v5/src/gen/models/UserArray.ts | 4 +- examples/vue-query-v5/src/gen/models/index.ts | 56 +- examples/zod/package.json | 2 +- .../zod/src/gen/zod/addPetRequestSchema.ts | 4 +- examples/zod/src/gen/zod/addPetSchema.ts | 6 +- examples/zod/src/gen/zod/createPetsSchema.ts | 2 +- examples/zod/src/gen/zod/createUserSchema.ts | 4 +- .../gen/zod/createUsersWithListInputSchema.ts | 6 +- examples/zod/src/gen/zod/customerSchema.ts | 6 +- .../zod/src/gen/zod/findPetsByStatusSchema.ts | 4 +- .../zod/src/gen/zod/findPetsByTagsSchema.ts | 4 +- .../zod/src/gen/zod/getOrderByIdSchema.ts | 4 +- examples/zod/src/gen/zod/getPetByIdSchema.ts | 4 +- .../zod/src/gen/zod/getUserByNameSchema.ts | 4 +- examples/zod/src/gen/zod/petSchema.ts | 4 +- .../zod/src/gen/zod/placeOrderPatchSchema.ts | 6 +- examples/zod/src/gen/zod/placeOrderSchema.ts | 6 +- examples/zod/src/gen/zod/updatePetSchema.ts | 6 +- examples/zod/src/gen/zod/updateUserSchema.ts | 2 +- examples/zod/src/gen/zod/uploadFileSchema.ts | 4 +- examples/zod/src/gen/zod/userArraySchema.ts | 2 +- examples/zodios/package.json | 2 +- .../zodios/src/gen/zod/addPetRequestSchema.ts | 4 +- examples/zodios/src/gen/zod/addPetSchema.ts | 6 +- .../zodios/src/gen/zod/createUserSchema.ts | 4 +- .../gen/zod/createUsersWithListInputSchema.ts | 6 +- examples/zodios/src/gen/zod/customerSchema.ts | 6 +- .../src/gen/zod/findPetsByStatusSchema.ts | 4 +- .../src/gen/zod/findPetsByTagsSchema.ts | 4 +- .../zodios/src/gen/zod/getOrderByIdSchema.ts | 4 +- .../zodios/src/gen/zod/getPetByIdSchema.ts | 4 +- .../zodios/src/gen/zod/getUserByNameSchema.ts | 4 +- examples/zodios/src/gen/zod/petSchema.ts | 4 +- .../src/gen/zod/placeOrderPatchSchema.ts | 6 +- .../zodios/src/gen/zod/placeOrderSchema.ts | 6 +- .../zodios/src/gen/zod/updatePetSchema.ts | 6 +- .../zodios/src/gen/zod/updateUserSchema.ts | 2 +- .../zodios/src/gen/zod/uploadFileSchema.ts | 4 +- .../zodios/src/gen/zod/userArraySchema.ts | 2 +- package.json | 10 +- packages/cli/package.json | 4 +- packages/config/ts-config/package.json | 2 +- packages/config/tsup-config/package.json | 4 +- packages/core/package.json | 6 +- packages/kubb/package.json | 4 +- packages/parser/package.json | 4 +- packages/react/package.json | 4 +- packages/swagger-client/mocks/petStore.yaml | 2 +- packages/swagger-client/package.json | 4 +- packages/swagger-faker/mocks/petStore.yaml | 2 +- packages/swagger-faker/package.json | 4 +- .../src/OperationGenerator.test.tsx | 4 + .../src/SchemaGenerator.test.tsx | 2 + .../__snapshots__/fakerParser.test.ts.snap | 2 + .../src/components/OperationSchema.test.tsx | 1 + .../src/components/OperationSchema.tsx | 1 + .../src/components/Schema.test.tsx | 1 + packages/swagger-faker/src/plugin.ts | 2 + packages/swagger-faker/src/types.ts | 1 + packages/swagger-msw/mocks/petStore.yaml | 2 +- packages/swagger-msw/package.json | 4 +- packages/swagger-swr/mocks/petStore.yaml | 2 +- packages/swagger-swr/package.json | 4 +- packages/swagger-tanstack-query/package.json | 4 +- packages/swagger-ts/mocks/petStore.yaml | 2 +- packages/swagger-ts/mocks/petStoreRef.yaml | 2 +- packages/swagger-ts/package.json | 2 +- .../src/OperationGenerator.test.tsx | 4 + .../swagger-ts/src/SchemaGenerator.test.tsx | 36 + .../src/__snapshots__/typeParser.test.ts.snap | 10 + .../src/components/OperationSchema.test.tsx | 1 + .../src/components/OperationSchema.tsx | 3 +- packages/swagger-ts/src/plugin.ts | 2 + packages/swagger-ts/src/types.ts | 1 + packages/swagger-zod/mocks/enums.yaml | 33 +- packages/swagger-zod/mocks/enums3_1.yaml | 25 + packages/swagger-zod/mocks/petStore.yaml | 4 +- packages/swagger-zod/mocks/petStoreRef.yaml | 2 +- packages/swagger-zod/package.json | 4 +- .../swagger-zod/src/SchemaGenerator.test.tsx | 47 ++ .../OperationGenerator.test.tsx.snap | 14 +- .../SchemaGenerator.test.tsx.snap | 16 +- .../src/__snapshots__/zodParser.test.ts.snap | 20 +- .../src/components/OperationSchema.tsx | 1 + .../components/__snapshots__/Schema/pets.ts | 2 +- .../__snapshots__/Schema/showPetById.ts | 6 +- packages/swagger-zod/src/plugin.ts | 1 + packages/swagger-zod/src/zodParser.tsx | 29 +- packages/swagger-zodios/mocks/petStore.yaml | 2 +- .../swagger-zodios/mocks/petStoreRef.yaml | 2 +- packages/swagger-zodios/package.json | 4 +- packages/swagger/mocks/petStore.yaml | 2 +- packages/swagger/mocks/schemas.ts | 37 + packages/swagger/package.json | 10 +- packages/swagger/src/OasManager.test.ts | 2 +- packages/swagger/src/OperationGenerator.ts | 8 +- packages/swagger/src/SchemaGenerator.ts | 78 +- packages/swagger/src/types.ts | 11 +- packages/types/package.json | 2 +- packages/unplugin/package.json | 10 +- pnpm-lock.yaml | 771 ++++++++---------- 233 files changed, 4375 insertions(+), 4385 deletions(-) create mode 100644 .changeset/short-hats-beg.md create mode 100644 .changeset/thin-clocks-burn.md create mode 100644 packages/swagger-zod/mocks/enums3_1.yaml diff --git a/.changeset/short-hats-beg.md b/.changeset/short-hats-beg.md new file mode 100644 index 000000000..12edd97e7 --- /dev/null +++ b/.changeset/short-hats-beg.md @@ -0,0 +1,7 @@ +--- +"@kubb/swagger-zod": patch +"@kubb/swagger-ts": patch +"@kubb/swagger": patch +--- + +Nullable enums are not generated as nullable diff --git a/.changeset/thin-clocks-burn.md b/.changeset/thin-clocks-burn.md new file mode 100644 index 000000000..f2eee199a --- /dev/null +++ b/.changeset/thin-clocks-burn.md @@ -0,0 +1,6 @@ +--- +"@kubb/swagger-zod": patch +"@kubb/swagger": patch +--- + +exclude min/max out of Array schema diff --git a/docs/package.json b/docs/package.json index 38bdf46c3..0bb7246de 100644 --- a/docs/package.json +++ b/docs/package.json @@ -22,11 +22,11 @@ "@vercel/analytics": "^1.2.2", "@vercel/speed-insights": "^1.0.10", "sitemap": "^7.1.1", - "vitepress": "^1.0.2", + "vitepress": "^1.1.0", "vue": "^3.4.21" }, "devDependencies": { - "@types/node": "^20.12.5" + "@types/node": "^20.12.7" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/e2e/package.json b/e2e/package.json index 52fbeb546..0cd07aafc 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -32,8 +32,8 @@ "@kubb/swagger-ts": "workspace:*", "@kubb/swagger-zod": "workspace:*", "@kubb/swagger-zodios": "workspace:*", - "@tanstack/react-query": "^5.29.0", - "@tanstack/solid-query": "^5.29.0", + "@tanstack/react-query": "^5.29.2", + "@tanstack/solid-query": "^5.29.3", "@tanstack/svelte-query": "^5.29.0", "@tanstack/vue-query": "^5.29.0", "@zodios/core": "^10.9.6", diff --git a/examples/advanced/src/gen/zod/addPetRequestSchema.ts b/examples/advanced/src/gen/zod/addPetRequestSchema.ts index f2cf8aa92..071fb5e8a 100644 --- a/examples/advanced/src/gen/zod/addPetRequestSchema.ts +++ b/examples/advanced/src/gen/zod/addPetRequestSchema.ts @@ -6,8 +6,8 @@ import { tagTagSchema } from './tag/tagSchema' export const addPetRequestSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagTagSchema)).optional(), + tags: z.array(z.lazy(() => tagTagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) as z.ZodType diff --git a/examples/advanced/src/gen/zod/customerSchema.ts b/examples/advanced/src/gen/zod/customerSchema.ts index 2e1012fb4..1bb930836 100644 --- a/examples/advanced/src/gen/zod/customerSchema.ts +++ b/examples/advanced/src/gen/zod/customerSchema.ts @@ -5,5 +5,5 @@ import { addressSchema } from './addressSchema' export const customerSchema = z.object({ id: z.number().optional(), username: z.string().optional(), - address: z.array(z.lazy(() => addressSchema)).optional(), + address: z.array(z.lazy(() => addressSchema).schema).optional(), }) as z.ZodType diff --git a/examples/advanced/src/gen/zod/petController/addPetSchema.ts b/examples/advanced/src/gen/zod/petController/addPetSchema.ts index b739092c9..4219a8365 100644 --- a/examples/advanced/src/gen/zod/petController/addPetSchema.ts +++ b/examples/advanced/src/gen/zod/petController/addPetSchema.ts @@ -5,7 +5,7 @@ import { petSchema } from '../petSchema' /** * @description Successful operation */ -export const addPet200Schema = z.lazy(() => petSchema) +export const addPet200Schema = z.lazy(() => petSchema).schema /** * @description Pet not found @@ -15,7 +15,7 @@ export const addPet405Schema = z.object({ code: z.number().optional(), message: /** * @description Create a new pet in the store */ -export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema) +export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema).schema /** * @description Successful operation diff --git a/examples/advanced/src/gen/zod/petController/findPetsByStatusSchema.ts b/examples/advanced/src/gen/zod/petController/findPetsByStatusSchema.ts index 77169b445..8f5e135f7 100644 --- a/examples/advanced/src/gen/zod/petController/findPetsByStatusSchema.ts +++ b/examples/advanced/src/gen/zod/petController/findPetsByStatusSchema.ts @@ -9,7 +9,7 @@ export const findPetsByStatusQueryParamsSchema = z * @description successful operation */ export const findPetsByStatus200Schema = z - .array(z.lazy(() => petSchema)) + .array(z.lazy(() => petSchema).schema) .min(1) .max(3) @@ -22,6 +22,6 @@ export const findPetsByStatus400Schema = z.any() * @description successful operation */ export const findPetsByStatusQueryResponseSchema = z - .array(z.lazy(() => petSchema)) + .array(z.lazy(() => petSchema).schema) .min(1) .max(3) diff --git a/examples/advanced/src/gen/zod/petController/findPetsByTagsSchema.ts b/examples/advanced/src/gen/zod/petController/findPetsByTagsSchema.ts index fa41ea778..992b7cec3 100644 --- a/examples/advanced/src/gen/zod/petController/findPetsByTagsSchema.ts +++ b/examples/advanced/src/gen/zod/petController/findPetsByTagsSchema.ts @@ -14,7 +14,7 @@ export const findPetsByTagsHeaderParamsSchema = z.object({ 'X-EXAMPLE': z.enum([ /** * @description successful operation */ -export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema)) +export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema).schema) /** * @description Invalid tag value @@ -24,4 +24,4 @@ export const findPetsByTags400Schema = z.any() /** * @description successful operation */ -export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema)) +export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema).schema) diff --git a/examples/advanced/src/gen/zod/petController/getPetByIdSchema.ts b/examples/advanced/src/gen/zod/petController/getPetByIdSchema.ts index e47cf0ed4..542db9e81 100644 --- a/examples/advanced/src/gen/zod/petController/getPetByIdSchema.ts +++ b/examples/advanced/src/gen/zod/petController/getPetByIdSchema.ts @@ -6,7 +6,7 @@ export const getPetByIdPathParamsSchema = z.object({ petId: z.number().describe( /** * @description successful operation */ -export const getPetById200Schema = z.lazy(() => petSchema) +export const getPetById200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied diff --git a/examples/advanced/src/gen/zod/petController/updatePetSchema.ts b/examples/advanced/src/gen/zod/petController/updatePetSchema.ts index 6f95d6e44..e082eef4d 100644 --- a/examples/advanced/src/gen/zod/petController/updatePetSchema.ts +++ b/examples/advanced/src/gen/zod/petController/updatePetSchema.ts @@ -4,7 +4,7 @@ import { petSchema } from '../petSchema' /** * @description Successful operation */ -export const updatePet200Schema = z.lazy(() => petSchema) +export const updatePet200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied diff --git a/examples/advanced/src/gen/zod/petController/uploadFileSchema.ts b/examples/advanced/src/gen/zod/petController/uploadFileSchema.ts index 46d23622f..aedcf37d2 100644 --- a/examples/advanced/src/gen/zod/petController/uploadFileSchema.ts +++ b/examples/advanced/src/gen/zod/petController/uploadFileSchema.ts @@ -8,11 +8,11 @@ export const uploadFileQueryParamsSchema = z.object({ additionalMetadata: z.stri /** * @description successful operation */ -export const uploadFile200Schema = z.lazy(() => apiResponseSchema) +export const uploadFile200Schema = z.lazy(() => apiResponseSchema).schema export const uploadFileMutationRequestSchema = z.string() /** * @description successful operation */ -export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema) +export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema).schema diff --git a/examples/advanced/src/gen/zod/petSchema.ts b/examples/advanced/src/gen/zod/petSchema.ts index 2c2afc149..d13ce8ba3 100644 --- a/examples/advanced/src/gen/zod/petSchema.ts +++ b/examples/advanced/src/gen/zod/petSchema.ts @@ -6,8 +6,8 @@ import { tagTagSchema } from './tag/tagSchema' export const petSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagTagSchema)).optional(), + tags: z.array(z.lazy(() => tagTagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) as z.ZodType diff --git a/examples/advanced/src/gen/zod/petsController/createPetsSchema.ts b/examples/advanced/src/gen/zod/petsController/createPetsSchema.ts index d41e38e28..23d7c7b61 100644 --- a/examples/advanced/src/gen/zod/petsController/createPetsSchema.ts +++ b/examples/advanced/src/gen/zod/petsController/createPetsSchema.ts @@ -15,7 +15,7 @@ export const createPets201Schema = z.any() /** * @description unexpected error */ -export const createPetsErrorSchema = z.lazy(() => petNotFoundSchema).describe('Pet not found') +export const createPetsErrorSchema = z.lazy(() => petNotFoundSchema).schema.describe('Pet not found') export const createPetsMutationRequestSchema = z.object({ name: z.string(), tag: z.string() }) diff --git a/examples/advanced/src/gen/zod/userArraySchema.ts b/examples/advanced/src/gen/zod/userArraySchema.ts index bd95bdc5c..ae4b19b98 100644 --- a/examples/advanced/src/gen/zod/userArraySchema.ts +++ b/examples/advanced/src/gen/zod/userArraySchema.ts @@ -2,4 +2,4 @@ import { z } from 'zod' import type { UserArray } from '../models/ts/UserArray' import { userSchema } from './userSchema' -export const userArraySchema = z.array(z.lazy(() => userSchema)) as z.ZodType +export const userArraySchema = z.array(z.lazy(() => userSchema).schema) as z.ZodType diff --git a/examples/advanced/src/gen/zod/userController/createUserSchema.ts b/examples/advanced/src/gen/zod/userController/createUserSchema.ts index b19980c1f..cdc25c844 100644 --- a/examples/advanced/src/gen/zod/userController/createUserSchema.ts +++ b/examples/advanced/src/gen/zod/userController/createUserSchema.ts @@ -4,11 +4,11 @@ import { userSchema } from '../userSchema' /** * @description successful operation */ -export const createUserErrorSchema = z.lazy(() => userSchema) +export const createUserErrorSchema = z.lazy(() => userSchema).schema /** * @description Created user object */ -export const createUserMutationRequestSchema = z.lazy(() => userSchema) +export const createUserMutationRequestSchema = z.lazy(() => userSchema).schema export const createUserMutationResponseSchema = z.any() diff --git a/examples/advanced/src/gen/zod/userController/createUsersWithListInputSchema.ts b/examples/advanced/src/gen/zod/userController/createUsersWithListInputSchema.ts index 9008aeed7..3187d9305 100644 --- a/examples/advanced/src/gen/zod/userController/createUsersWithListInputSchema.ts +++ b/examples/advanced/src/gen/zod/userController/createUsersWithListInputSchema.ts @@ -4,16 +4,16 @@ import { userSchema } from '../userSchema' /** * @description Successful operation */ -export const createUsersWithListInput200Schema = z.lazy(() => userSchema) +export const createUsersWithListInput200Schema = z.lazy(() => userSchema).schema /** * @description successful operation */ export const createUsersWithListInputErrorSchema = z.any() -export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema)) +export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema).schema) /** * @description Successful operation */ -export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema) +export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema).schema diff --git a/examples/advanced/src/gen/zod/userController/getUserByNameSchema.ts b/examples/advanced/src/gen/zod/userController/getUserByNameSchema.ts index e33c53474..e77b8e1e8 100644 --- a/examples/advanced/src/gen/zod/userController/getUserByNameSchema.ts +++ b/examples/advanced/src/gen/zod/userController/getUserByNameSchema.ts @@ -6,7 +6,7 @@ export const getUserByNamePathParamsSchema = z.object({ username: z.string().des /** * @description successful operation */ -export const getUserByName200Schema = z.lazy(() => userSchema) +export const getUserByName200Schema = z.lazy(() => userSchema).schema /** * @description Invalid username supplied @@ -21,4 +21,4 @@ export const getUserByName404Schema = z.any() /** * @description successful operation */ -export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema) +export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema).schema diff --git a/examples/advanced/src/gen/zod/userController/updateUserSchema.ts b/examples/advanced/src/gen/zod/userController/updateUserSchema.ts index 85f8507ce..c5d1d8c4a 100644 --- a/examples/advanced/src/gen/zod/userController/updateUserSchema.ts +++ b/examples/advanced/src/gen/zod/userController/updateUserSchema.ts @@ -11,6 +11,6 @@ export const updateUserErrorSchema = z.any() /** * @description Update an existent user in the store */ -export const updateUserMutationRequestSchema = z.lazy(() => userSchema) +export const updateUserMutationRequestSchema = z.lazy(() => userSchema).schema export const updateUserMutationResponseSchema = z.any() diff --git a/examples/client/package.json b/examples/client/package.json index 71a443a34..c2bbad325 100644 --- a/examples/client/package.json +++ b/examples/client/package.json @@ -32,7 +32,7 @@ "@kubb/ts-config": "workspace:*", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/faker/package.json b/examples/faker/package.json index 4231dd19b..883772c2c 100644 --- a/examples/faker/package.json +++ b/examples/faker/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@kubb/ts-config": "workspace:*", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/python/package.json b/examples/python/package.json index 6134753d3..eb4ee36b4 100644 --- a/examples/python/package.json +++ b/examples/python/package.json @@ -32,10 +32,10 @@ }, "devDependencies": { "@kubb/ts-config": "workspace:*", - "@types/react": "^18.2.74", - "@types/react-dom": "^18.2.24", + "@types/react": "^18.2.77", + "@types/react-dom": "^18.2.25", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/react-query-v5/package.json b/examples/react-query-v5/package.json index f6395ac25..297703b0d 100644 --- a/examples/react-query-v5/package.json +++ b/examples/react-query-v5/package.json @@ -29,15 +29,15 @@ "@kubb/swagger-client": "workspace:*", "@kubb/swagger-tanstack-query": "workspace:*", "@kubb/swagger-ts": "workspace:*", - "@tanstack/react-query": "^5.29.0", + "@tanstack/react-query": "^5.29.2", "@tanstack/react-query-devtools": "5.0.0", "axios": "^1.6.8", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@types/react": "^18.2.74", - "@types/react-dom": "^18.2.24", + "@types/react": "^18.2.77", + "@types/react-dom": "^18.2.25", "@vitejs/plugin-react": "^4.2.1", "msw": "^1.3.3", "tsup": "^8.0.2", diff --git a/examples/react-query-v5/src/gen/hooks/index.ts b/examples/react-query-v5/src/gen/hooks/index.ts index 3cd1ec1db..ad8585388 100644 --- a/examples/react-query-v5/src/gen/hooks/index.ts +++ b/examples/react-query-v5/src/gen/hooks/index.ts @@ -1,20 +1,20 @@ -export * from './useAddPetHook' -export * from './useCreateUserHook' -export * from './useCreateUsersWithListInputHook' -export * from './useDeleteOrderHook' -export * from './useDeletePetHook' -export * from './useDeleteUserHook' -export * from './useFindPetsByStatusHook' -export * from './useFindPetsByTagsHook' -export * from './useGetInventoryHook' -export * from './useGetOrderByIdHook' -export * from './useGetPetByIdHook' -export * from './useGetUserByNameHook' -export * from './useLoginUserHook' -export * from './useLogoutUserHook' -export * from './usePlaceOrderHook' -export * from './usePlaceOrderPatchHook' -export * from './useUpdatePetHook' -export * from './useUpdatePetWithFormHook' -export * from './useUpdateUserHook' -export * from './useUploadFileHook' +export * from "./useAddPetHook"; +export * from "./useCreateUserHook"; +export * from "./useCreateUsersWithListInputHook"; +export * from "./useDeleteOrderHook"; +export * from "./useDeletePetHook"; +export * from "./useDeleteUserHook"; +export * from "./useFindPetsByStatusHook"; +export * from "./useFindPetsByTagsHook"; +export * from "./useGetInventoryHook"; +export * from "./useGetOrderByIdHook"; +export * from "./useGetPetByIdHook"; +export * from "./useGetUserByNameHook"; +export * from "./useLoginUserHook"; +export * from "./useLogoutUserHook"; +export * from "./usePlaceOrderHook"; +export * from "./usePlaceOrderPatchHook"; +export * from "./useUpdatePetHook"; +export * from "./useUpdatePetWithFormHook"; +export * from "./useUpdateUserHook"; +export * from "./useUploadFileHook"; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useAddPetHook.ts b/examples/react-query-v5/src/gen/hooks/useAddPetHook.ts index 7164710d1..21feb08d7 100644 --- a/examples/react-query-v5/src/gen/hooks/useAddPetHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useAddPetHook.ts @@ -1,50 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { AddPet405, AddPetMutationRequest, AddPetMutationResponse } from '../models/AddPet' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from "../models/AddPet"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type AddPetClient = typeof client + type AddPetClient = typeof client; type AddPet = { - data: AddPetMutationResponse - error: AddPet405 - request: AddPetMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: AddPetMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: AddPetMutationResponse; + error: AddPet405; + request: AddPetMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: AddPetMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Add a new pet to the store * @summary Add a new pet to the store * @link /pet */ -export function useAddPetHook( - options: { - mutation?: UseMutationOptions - client?: AddPet['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useAddPetHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/pet', - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useAddPetHook(options: { + mutation?: UseMutationOptions; + client?: AddPet["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useAddPetHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/pet`, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useCreateUserHook.ts b/examples/react-query-v5/src/gen/hooks/useCreateUserHook.ts index bfd58fda3..1e072b95f 100644 --- a/examples/react-query-v5/src/gen/hooks/useCreateUserHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useCreateUserHook.ts @@ -1,50 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../models/CreateUser' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { CreateUserMutationRequest, CreateUserMutationResponse } from "../models/CreateUser"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type CreateUserClient = typeof client + type CreateUserClient = typeof client; type CreateUser = { - data: CreateUserMutationResponse - error: never - request: CreateUserMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: CreateUserMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: CreateUserMutationResponse; + error: never; + request: CreateUserMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: CreateUserMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description This can only be done by the logged in user. * @summary Create user * @link /user */ -export function useCreateUserHook( - options: { - mutation?: UseMutationOptions - client?: CreateUser['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useCreateUserHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/user', - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useCreateUserHook(options: { + mutation?: UseMutationOptions; + client?: CreateUser["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useCreateUserHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/user`, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useCreateUsersWithListInputHook.ts b/examples/react-query-v5/src/gen/hooks/useCreateUsersWithListInputHook.ts index 5719ec915..dd62eb44e 100644 --- a/examples/react-query-v5/src/gen/hooks/useCreateUsersWithListInputHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useCreateUsersWithListInputHook.ts @@ -1,50 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputMutationResponse } from '../models/CreateUsersWithListInput' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputMutationResponse } from "../models/CreateUsersWithListInput"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type CreateUsersWithListInputClient = typeof client + type CreateUsersWithListInputClient = typeof client; type CreateUsersWithListInput = { - data: CreateUsersWithListInputMutationResponse - error: never - request: CreateUsersWithListInputMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: CreateUsersWithListInputMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: CreateUsersWithListInputMutationResponse; + error: never; + request: CreateUsersWithListInputMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: CreateUsersWithListInputMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Creates list of users with given input array * @summary Creates list of users with given input array * @link /user/createWithList */ -export function useCreateUsersWithListInputHook( - options: { - mutation?: UseMutationOptions - client?: CreateUsersWithListInput['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useCreateUsersWithListInputHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/user/createWithList', - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useCreateUsersWithListInputHook(options: { + mutation?: UseMutationOptions; + client?: CreateUsersWithListInput["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useCreateUsersWithListInputHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/user/createWithList`, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useDeleteOrderHook.ts b/examples/react-query-v5/src/gen/hooks/useDeleteOrderHook.ts index 29d3e5ae6..f3a400a5c 100644 --- a/examples/react-query-v5/src/gen/hooks/useDeleteOrderHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useDeleteOrderHook.ts @@ -1,50 +1,49 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { DeleteOrder400, DeleteOrder404, DeleteOrderMutationResponse, DeleteOrderPathParams } from '../models/DeleteOrder' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { DeleteOrderMutationResponse, DeleteOrderPathParams, DeleteOrder400, DeleteOrder404 } from "../models/DeleteOrder"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type DeleteOrderClient = typeof client + type DeleteOrderClient = typeof client; type DeleteOrder = { - data: DeleteOrderMutationResponse - error: DeleteOrder400 | DeleteOrder404 - request: never - pathParams: DeleteOrderPathParams - queryParams: never - headerParams: never - response: DeleteOrderMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: DeleteOrderMutationResponse; + error: DeleteOrder400 | DeleteOrder404; + request: never; + pathParams: DeleteOrderPathParams; + queryParams: never; + headerParams: never; + response: DeleteOrderMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID * @link /store/order/:orderId */ -export function useDeleteOrderHook( - orderId: DeleteOrderPathParams['orderId'], - options: { - mutation?: UseMutationOptions - client?: DeleteOrder['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useDeleteOrderHook') - return useMutation({ - mutationFn: async () => { - const res = await client({ - method: 'delete', - url: `/store/order/${orderId}`, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useDeleteOrderHook(orderId: DeleteOrderPathParams["orderId"], options: { + mutation?: UseMutationOptions; + client?: DeleteOrder["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useDeleteOrderHook"); + return useMutation({ + mutationFn: async () => { + const res = await client({ + method: "delete", + url: `/store/order/${orderId}`, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useDeletePetHook.ts b/examples/react-query-v5/src/gen/hooks/useDeletePetHook.ts index ab5890e8f..1bab86b38 100644 --- a/examples/react-query-v5/src/gen/hooks/useDeletePetHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useDeletePetHook.ts @@ -1,52 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { DeletePet400, DeletePetHeaderParams, DeletePetMutationResponse, DeletePetPathParams } from '../models/DeletePet' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderParams, DeletePet400 } from "../models/DeletePet"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type DeletePetClient = typeof client + type DeletePetClient = typeof client; type DeletePet = { - data: DeletePetMutationResponse - error: DeletePet400 - request: never - pathParams: DeletePetPathParams - queryParams: never - headerParams: DeletePetHeaderParams - response: DeletePetMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: DeletePetMutationResponse; + error: DeletePet400; + request: never; + pathParams: DeletePetPathParams; + queryParams: never; + headerParams: DeletePetHeaderParams; + response: DeletePetMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description delete a pet * @summary Deletes a pet * @link /pet/:petId */ -export function useDeletePetHook( - petId: DeletePetPathParams['petId'], - headers?: DeletePet['headerParams'], - options: { - mutation?: UseMutationOptions - client?: DeletePet['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useDeletePetHook') - return useMutation({ - mutationFn: async () => { - const res = await client({ - method: 'delete', - url: `/pet/${petId}`, - headers: { ...headers, ...clientOptions.headers }, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useDeletePetHook(petId: DeletePetPathParams["petId"], headers?: DeletePet["headerParams"], options: { + mutation?: UseMutationOptions; + client?: DeletePet["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useDeletePetHook"); + return useMutation({ + mutationFn: async () => { + const res = await client({ + method: "delete", + url: `/pet/${petId}`, + headers: { ...headers, ...clientOptions.headers }, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useDeleteUserHook.ts b/examples/react-query-v5/src/gen/hooks/useDeleteUserHook.ts index f6a92f4fb..77e43d513 100644 --- a/examples/react-query-v5/src/gen/hooks/useDeleteUserHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useDeleteUserHook.ts @@ -1,50 +1,49 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { DeleteUser400, DeleteUser404, DeleteUserMutationResponse, DeleteUserPathParams } from '../models/DeleteUser' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { DeleteUserMutationResponse, DeleteUserPathParams, DeleteUser400, DeleteUser404 } from "../models/DeleteUser"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type DeleteUserClient = typeof client + type DeleteUserClient = typeof client; type DeleteUser = { - data: DeleteUserMutationResponse - error: DeleteUser400 | DeleteUser404 - request: never - pathParams: DeleteUserPathParams - queryParams: never - headerParams: never - response: DeleteUserMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: DeleteUserMutationResponse; + error: DeleteUser400 | DeleteUser404; + request: never; + pathParams: DeleteUserPathParams; + queryParams: never; + headerParams: never; + response: DeleteUserMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description This can only be done by the logged in user. * @summary Delete user * @link /user/:username */ -export function useDeleteUserHook( - username: DeleteUserPathParams['username'], - options: { - mutation?: UseMutationOptions - client?: DeleteUser['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useDeleteUserHook') - return useMutation({ - mutationFn: async () => { - const res = await client({ - method: 'delete', - url: `/user/${username}`, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useDeleteUserHook(username: DeleteUserPathParams["username"], options: { + mutation?: UseMutationOptions; + client?: DeleteUser["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useDeleteUserHook"); + return useMutation({ + mutationFn: async () => { + const res = await client({ + method: "delete", + url: `/user/${username}`, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useFindPetsByStatusHook.ts b/examples/react-query-v5/src/gen/hooks/useFindPetsByStatusHook.ts index e6ec86077..f7c10e351 100644 --- a/examples/react-query-v5/src/gen/hooks/useFindPetsByStatusHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useFindPetsByStatusHook.ts @@ -1,110 +1,99 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { FindPetsByStatus400, FindPetsByStatusQueryParams, FindPetsByStatusQueryResponse } from '../models/FindPetsByStatus' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { FindPetsByStatusQueryResponse, FindPetsByStatusQueryParams, FindPetsByStatus400 } from "../models/FindPetsByStatus"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type FindPetsByStatusClient = typeof client + type FindPetsByStatusClient = typeof client; type FindPetsByStatus = { - data: FindPetsByStatusQueryResponse - error: FindPetsByStatus400 - request: never - pathParams: never - queryParams: FindPetsByStatusQueryParams - headerParams: never - response: FindPetsByStatusQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const findPetsByStatusQueryKey = (params?: FindPetsByStatus['queryParams']) => ['v5', { url: '/pet/findByStatus' }, ...(params ? [params] : [])] as const -export type FindPetsByStatusQueryKey = ReturnType -export function findPetsByStatusQueryOptions(params?: FindPetsByStatus['queryParams'], options: FindPetsByStatus['client']['parameters'] = {}) { - const queryKey = findPetsByStatusQueryKey(params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/pet/findByStatus', - params, - ...options, - }) - return res.data - }, - }) + data: FindPetsByStatusQueryResponse; + error: FindPetsByStatus400; + request: never; + pathParams: never; + queryParams: FindPetsByStatusQueryParams; + headerParams: never; + response: FindPetsByStatusQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const findPetsByStatusQueryKey = (params?: FindPetsByStatus["queryParams"]) => ["v5", { url: "/pet/findByStatus" }, ...(params ? [params] : [])] as const; +export type FindPetsByStatusQueryKey = ReturnType; +export function findPetsByStatusQueryOptions(params?: FindPetsByStatus["queryParams"], options: FindPetsByStatus["client"]["parameters"] = {}) { + const queryKey = findPetsByStatusQueryKey(params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/pet/findByStatus`, + params, + ...options + }); + return res.data; + }, + }); } /** * @description Multiple status values can be provided with comma separated strings * @summary Finds Pets by status * @link /pet/findByStatus */ -export function useFindPetsByStatusHook< - TData = FindPetsByStatus['response'], - TQueryData = FindPetsByStatus['response'], - TQueryKey extends QueryKey = FindPetsByStatusQueryKey, ->( - params?: FindPetsByStatus['queryParams'], - options: { - query?: Partial> - client?: FindPetsByStatus['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useFindPetsByStatusHook(params?: FindPetsByStatus["queryParams"], options: { + query?: Partial>; + client?: FindPetsByStatus["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? findPetsByStatusQueryKey(params) - const query = useQuery({ - ...(findPetsByStatusQueryOptions(params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? findPetsByStatusQueryKey(params); + const query = useQuery({ + ...findPetsByStatusQueryOptions(params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const findPetsByStatusSuspenseQueryKey = (params?: FindPetsByStatus['queryParams']) => - ['v5', { url: '/pet/findByStatus' }, ...(params ? [params] : [])] as const -export type FindPetsByStatusSuspenseQueryKey = ReturnType -export function findPetsByStatusSuspenseQueryOptions(params?: FindPetsByStatus['queryParams'], options: FindPetsByStatus['client']['parameters'] = {}) { - const queryKey = findPetsByStatusSuspenseQueryKey(params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/pet/findByStatus', - params, - ...options, - }) - return res.data - }, - }) +export const findPetsByStatusSuspenseQueryKey = (params?: FindPetsByStatus["queryParams"]) => ["v5", { url: "/pet/findByStatus" }, ...(params ? [params] : [])] as const; +export type FindPetsByStatusSuspenseQueryKey = ReturnType; +export function findPetsByStatusSuspenseQueryOptions(params?: FindPetsByStatus["queryParams"], options: FindPetsByStatus["client"]["parameters"] = {}) { + const queryKey = findPetsByStatusSuspenseQueryKey(params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/pet/findByStatus`, + params, + ...options + }); + return res.data; + }, + }); } /** * @description Multiple status values can be provided with comma separated strings * @summary Finds Pets by status * @link /pet/findByStatus */ -export function useFindPetsByStatusHookSuspense( - params?: FindPetsByStatus['queryParams'], - options: { - query?: Partial> - client?: FindPetsByStatus['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useFindPetsByStatusHookSuspense(params?: FindPetsByStatus["queryParams"], options: { + query?: Partial>; + client?: FindPetsByStatus["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? findPetsByStatusSuspenseQueryKey(params) - const query = useSuspenseQuery({ - ...(findPetsByStatusSuspenseQueryOptions(params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? findPetsByStatusSuspenseQueryKey(params); + const query = useSuspenseQuery({ + ...findPetsByStatusSuspenseQueryOptions(params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useFindPetsByTagsHook.ts b/examples/react-query-v5/src/gen/hooks/useFindPetsByTagsHook.ts index e5ab1043c..f1014975c 100644 --- a/examples/react-query-v5/src/gen/hooks/useFindPetsByTagsHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useFindPetsByTagsHook.ts @@ -1,172 +1,146 @@ -import client from '@kubb/swagger-client/client' -import { infiniteQueryOptions, queryOptions, useInfiniteQuery, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { - InfiniteData, - InfiniteQueryObserverOptions, - QueryKey, - QueryObserverOptions, - UseInfiniteQueryResult, - UseQueryResult, - UseSuspenseQueryOptions, - UseSuspenseQueryResult, -} from '@tanstack/react-query' -import type { FindPetsByTags400, FindPetsByTagsQueryParams, FindPetsByTagsQueryResponse } from '../models/FindPetsByTags' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useInfiniteQuery, infiniteQueryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { FindPetsByTagsQueryResponse, FindPetsByTagsQueryParams, FindPetsByTags400 } from "../models/FindPetsByTags"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, InfiniteQueryObserverOptions, UseInfiniteQueryResult, InfiniteData, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type FindPetsByTagsClient = typeof client + type FindPetsByTagsClient = typeof client; type FindPetsByTags = { - data: FindPetsByTagsQueryResponse - error: FindPetsByTags400 - request: never - pathParams: never - queryParams: FindPetsByTagsQueryParams - headerParams: never - response: Awaited> - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const findPetsByTagsQueryKey = (params?: FindPetsByTags['queryParams']) => ['/pet/findByTags', ...(params ? [params] : [])] as const -export type FindPetsByTagsQueryKey = ReturnType -export function findPetsByTagsQueryOptions(params?: FindPetsByTags['queryParams'], options: FindPetsByTags['client']['parameters'] = {}) { - const queryKey = findPetsByTagsQueryKey(params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/pet/findByTags', - params, - ...options, - }) - return res - }, - }) + data: FindPetsByTagsQueryResponse; + error: FindPetsByTags400; + request: never; + pathParams: never; + queryParams: FindPetsByTagsQueryParams; + headerParams: never; + response: Awaited>; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const findPetsByTagsQueryKey = (params?: FindPetsByTags["queryParams"]) => ["/pet/findByTags", ...(params ? [params] : [])] as const; +export type FindPetsByTagsQueryKey = ReturnType; +export function findPetsByTagsQueryOptions(params?: FindPetsByTags["queryParams"], options: FindPetsByTags["client"]["parameters"] = {}) { + const queryKey = findPetsByTagsQueryKey(params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/pet/findByTags`, + params, + ...options + }); + return res; + }, + }); } /** * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @link /pet/findByTags */ -export function useFindPetsByTagsHook< - TData = FindPetsByTags['response'], - TQueryData = FindPetsByTags['response'], - TQueryKey extends QueryKey = FindPetsByTagsQueryKey, ->( - params?: FindPetsByTags['queryParams'], - options: { - query?: Partial> - client?: FindPetsByTags['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useFindPetsByTagsHook(params?: FindPetsByTags["queryParams"], options: { + query?: Partial>; + client?: FindPetsByTags["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params) - const query = useQuery({ - ...(findPetsByTagsQueryOptions(params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params); + const query = useQuery({ + ...findPetsByTagsQueryOptions(params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const findPetsByTagsInfiniteQueryKey = (params?: FindPetsByTags['queryParams']) => ['/pet/findByTags', ...(params ? [params] : [])] as const -export type FindPetsByTagsInfiniteQueryKey = ReturnType -export function findPetsByTagsInfiniteQueryOptions(params?: FindPetsByTags['queryParams'], options: FindPetsByTags['client']['parameters'] = {}) { - const queryKey = findPetsByTagsInfiniteQueryKey(params) - return infiniteQueryOptions({ - queryKey, - queryFn: async ({ pageParam }) => { - const res = await client({ - method: 'get', - url: '/pet/findByTags', - ...options, - params: { - ...params, - ['pageSize']: pageParam, - ...(options.params || {}), +export const findPetsByTagsInfiniteQueryKey = (params?: FindPetsByTags["queryParams"]) => ["/pet/findByTags", ...(params ? [params] : [])] as const; +export type FindPetsByTagsInfiniteQueryKey = ReturnType; +export function findPetsByTagsInfiniteQueryOptions(params?: FindPetsByTags["queryParams"], options: FindPetsByTags["client"]["parameters"] = {}) { + const queryKey = findPetsByTagsInfiniteQueryKey(params); + return infiniteQueryOptions({ + queryKey, + queryFn: async ({ pageParam }) => { + const res = await client({ + method: "get", + url: `/pet/findByTags`, + ...options, + params: { + ...params, + ["pageSize"]: pageParam, + ...(options.params || {}), + } + }); + return res; }, - }) - return res - }, - initialPageParam: 0, - getNextPageParam: (lastPage, allPages, lastPageParam) => (Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1), - getPreviousPageParam: (firstPage, allPages, firstPageParam) => (firstPageParam <= 1 ? undefined : firstPageParam - 1), - }) + initialPageParam: 0, + getNextPageParam: (lastPage, allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1, + getPreviousPageParam: (firstPage, allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1 + }); } /** * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @link /pet/findByTags */ -export function useFindPetsByTagsHookInfinite< - TData = InfiniteData, - TQueryData = FindPetsByTags['response'], - TQueryKey extends QueryKey = FindPetsByTagsInfiniteQueryKey, ->( - params?: FindPetsByTags['queryParams'], - options: { - query?: Partial> - client?: FindPetsByTags['client']['parameters'] - } = {}, -): UseInfiniteQueryResult & { - queryKey: TQueryKey +export function useFindPetsByTagsHookInfinite, TQueryData = FindPetsByTags["response"], TQueryKey extends QueryKey = FindPetsByTagsInfiniteQueryKey>(params?: FindPetsByTags["queryParams"], options: { + query?: Partial>; + client?: FindPetsByTags["client"]["parameters"]; +} = {}): UseInfiniteQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? findPetsByTagsInfiniteQueryKey(params) - const query = useInfiniteQuery({ - ...(findPetsByTagsInfiniteQueryOptions(params, clientOptions) as unknown as InfiniteQueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseInfiniteQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? findPetsByTagsInfiniteQueryKey(params); + const query = useInfiniteQuery({ + ...findPetsByTagsInfiniteQueryOptions(params, clientOptions) as unknown as InfiniteQueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseInfiniteQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const findPetsByTagsSuspenseQueryKey = (params?: FindPetsByTags['queryParams']) => ['/pet/findByTags', ...(params ? [params] : [])] as const -export type FindPetsByTagsSuspenseQueryKey = ReturnType -export function findPetsByTagsSuspenseQueryOptions(params?: FindPetsByTags['queryParams'], options: FindPetsByTags['client']['parameters'] = {}) { - const queryKey = findPetsByTagsSuspenseQueryKey(params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/pet/findByTags', - params, - ...options, - }) - return res - }, - }) +export const findPetsByTagsSuspenseQueryKey = (params?: FindPetsByTags["queryParams"]) => ["/pet/findByTags", ...(params ? [params] : [])] as const; +export type FindPetsByTagsSuspenseQueryKey = ReturnType; +export function findPetsByTagsSuspenseQueryOptions(params?: FindPetsByTags["queryParams"], options: FindPetsByTags["client"]["parameters"] = {}) { + const queryKey = findPetsByTagsSuspenseQueryKey(params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/pet/findByTags`, + params, + ...options + }); + return res; + }, + }); } /** * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @link /pet/findByTags */ -export function useFindPetsByTagsHookSuspense( - params?: FindPetsByTags['queryParams'], - options: { - query?: Partial> - client?: FindPetsByTags['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useFindPetsByTagsHookSuspense(params?: FindPetsByTags["queryParams"], options: { + query?: Partial>; + client?: FindPetsByTags["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? findPetsByTagsSuspenseQueryKey(params) - const query = useSuspenseQuery({ - ...(findPetsByTagsSuspenseQueryOptions(params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? findPetsByTagsSuspenseQueryKey(params); + const query = useSuspenseQuery({ + ...findPetsByTagsSuspenseQueryOptions(params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useGetInventoryHook.ts b/examples/react-query-v5/src/gen/hooks/useGetInventoryHook.ts index f1a8f9833..c8756d9e7 100644 --- a/examples/react-query-v5/src/gen/hooks/useGetInventoryHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useGetInventoryHook.ts @@ -1,101 +1,97 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { GetInventoryQueryResponse } from '../models/GetInventory' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { GetInventoryQueryResponse } from "../models/GetInventory"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type GetInventoryClient = typeof client + type GetInventoryClient = typeof client; type GetInventory = { - data: GetInventoryQueryResponse - error: never - request: never - pathParams: never - queryParams: never - headerParams: never - response: GetInventoryQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getInventoryQueryKey = () => ['v5', { url: '/store/inventory' }] as const -export type GetInventoryQueryKey = ReturnType -export function getInventoryQueryOptions(options: GetInventory['client']['parameters'] = {}) { - const queryKey = getInventoryQueryKey() - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/store/inventory', - ...options, - }) - return res.data - }, - }) + data: GetInventoryQueryResponse; + error: never; + request: never; + pathParams: never; + queryParams: never; + headerParams: never; + response: GetInventoryQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getInventoryQueryKey = () => ["v5", { url: "/store/inventory" }] as const; +export type GetInventoryQueryKey = ReturnType; +export function getInventoryQueryOptions(options: GetInventory["client"]["parameters"] = {}) { + const queryKey = getInventoryQueryKey(); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/store/inventory`, + ...options + }); + return res.data; + }, + }); } /** * @description Returns a map of status codes to quantities * @summary Returns pet inventories by status * @link /store/inventory */ -export function useGetInventoryHook( - options: { - query?: Partial> - client?: GetInventory['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useGetInventoryHook(options: { + query?: Partial>; + client?: GetInventory["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getInventoryQueryKey() - const query = useQuery({ - ...(getInventoryQueryOptions(clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getInventoryQueryKey(); + const query = useQuery({ + ...getInventoryQueryOptions(clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const getInventorySuspenseQueryKey = () => ['v5', { url: '/store/inventory' }] as const -export type GetInventorySuspenseQueryKey = ReturnType -export function getInventorySuspenseQueryOptions(options: GetInventory['client']['parameters'] = {}) { - const queryKey = getInventorySuspenseQueryKey() - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/store/inventory', - ...options, - }) - return res.data - }, - }) +export const getInventorySuspenseQueryKey = () => ["v5", { url: "/store/inventory" }] as const; +export type GetInventorySuspenseQueryKey = ReturnType; +export function getInventorySuspenseQueryOptions(options: GetInventory["client"]["parameters"] = {}) { + const queryKey = getInventorySuspenseQueryKey(); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/store/inventory`, + ...options + }); + return res.data; + }, + }); } /** * @description Returns a map of status codes to quantities * @summary Returns pet inventories by status * @link /store/inventory */ -export function useGetInventoryHookSuspense( - options: { - query?: Partial> - client?: GetInventory['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useGetInventoryHookSuspense(options: { + query?: Partial>; + client?: GetInventory["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getInventorySuspenseQueryKey() - const query = useSuspenseQuery({ - ...(getInventorySuspenseQueryOptions(clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getInventorySuspenseQueryKey(); + const query = useSuspenseQuery({ + ...getInventorySuspenseQueryOptions(clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useGetOrderByIdHook.ts b/examples/react-query-v5/src/gen/hooks/useGetOrderByIdHook.ts index 6b138a91f..1e5bc115b 100644 --- a/examples/react-query-v5/src/gen/hooks/useGetOrderByIdHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useGetOrderByIdHook.ts @@ -1,105 +1,97 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { GetOrderById400, GetOrderById404, GetOrderByIdPathParams, GetOrderByIdQueryResponse } from '../models/GetOrderById' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { GetOrderByIdQueryResponse, GetOrderByIdPathParams, GetOrderById400, GetOrderById404 } from "../models/GetOrderById"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type GetOrderByIdClient = typeof client + type GetOrderByIdClient = typeof client; type GetOrderById = { - data: GetOrderByIdQueryResponse - error: GetOrderById400 | GetOrderById404 - request: never - pathParams: GetOrderByIdPathParams - queryParams: never - headerParams: never - response: GetOrderByIdQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getOrderByIdQueryKey = (orderId: GetOrderByIdPathParams['orderId']) => - ['v5', { url: '/store/order/:orderId', params: { orderId: orderId } }] as const -export type GetOrderByIdQueryKey = ReturnType -export function getOrderByIdQueryOptions(orderId: GetOrderByIdPathParams['orderId'], options: GetOrderById['client']['parameters'] = {}) { - const queryKey = getOrderByIdQueryKey(orderId) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: `/store/order/${orderId}`, - ...options, - }) - return res.data - }, - }) + data: GetOrderByIdQueryResponse; + error: GetOrderById400 | GetOrderById404; + request: never; + pathParams: GetOrderByIdPathParams; + queryParams: never; + headerParams: never; + response: GetOrderByIdQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getOrderByIdQueryKey = (orderId: GetOrderByIdPathParams["orderId"]) => ["v5", { url: "/store/order/:orderId", params: { orderId: orderId } }] as const; +export type GetOrderByIdQueryKey = ReturnType; +export function getOrderByIdQueryOptions(orderId: GetOrderByIdPathParams["orderId"], options: GetOrderById["client"]["parameters"] = {}) { + const queryKey = getOrderByIdQueryKey(orderId); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/store/order/${orderId}`, + ...options + }); + return res.data; + }, + }); } /** * @description For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. * @summary Find purchase order by ID * @link /store/order/:orderId */ -export function useGetOrderByIdHook( - orderId: GetOrderByIdPathParams['orderId'], - options: { - query?: Partial> - client?: GetOrderById['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useGetOrderByIdHook(orderId: GetOrderByIdPathParams["orderId"], options: { + query?: Partial>; + client?: GetOrderById["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getOrderByIdQueryKey(orderId) - const query = useQuery({ - ...(getOrderByIdQueryOptions(orderId, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getOrderByIdQueryKey(orderId); + const query = useQuery({ + ...getOrderByIdQueryOptions(orderId, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const getOrderByIdSuspenseQueryKey = (orderId: GetOrderByIdPathParams['orderId']) => - ['v5', { url: '/store/order/:orderId', params: { orderId: orderId } }] as const -export type GetOrderByIdSuspenseQueryKey = ReturnType -export function getOrderByIdSuspenseQueryOptions(orderId: GetOrderByIdPathParams['orderId'], options: GetOrderById['client']['parameters'] = {}) { - const queryKey = getOrderByIdSuspenseQueryKey(orderId) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: `/store/order/${orderId}`, - ...options, - }) - return res.data - }, - }) +export const getOrderByIdSuspenseQueryKey = (orderId: GetOrderByIdPathParams["orderId"]) => ["v5", { url: "/store/order/:orderId", params: { orderId: orderId } }] as const; +export type GetOrderByIdSuspenseQueryKey = ReturnType; +export function getOrderByIdSuspenseQueryOptions(orderId: GetOrderByIdPathParams["orderId"], options: GetOrderById["client"]["parameters"] = {}) { + const queryKey = getOrderByIdSuspenseQueryKey(orderId); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/store/order/${orderId}`, + ...options + }); + return res.data; + }, + }); } /** * @description For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. * @summary Find purchase order by ID * @link /store/order/:orderId */ -export function useGetOrderByIdHookSuspense( - orderId: GetOrderByIdPathParams['orderId'], - options: { - query?: Partial> - client?: GetOrderById['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useGetOrderByIdHookSuspense(orderId: GetOrderByIdPathParams["orderId"], options: { + query?: Partial>; + client?: GetOrderById["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getOrderByIdSuspenseQueryKey(orderId) - const query = useSuspenseQuery({ - ...(getOrderByIdSuspenseQueryOptions(orderId, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getOrderByIdSuspenseQueryKey(orderId); + const query = useSuspenseQuery({ + ...getOrderByIdSuspenseQueryOptions(orderId, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useGetPetByIdHook.ts b/examples/react-query-v5/src/gen/hooks/useGetPetByIdHook.ts index fcd1822f0..daf9aea6e 100644 --- a/examples/react-query-v5/src/gen/hooks/useGetPetByIdHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useGetPetByIdHook.ts @@ -1,103 +1,97 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { GetPetById400, GetPetById404, GetPetByIdPathParams, GetPetByIdQueryResponse } from '../models/GetPetById' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { GetPetByIdQueryResponse, GetPetByIdPathParams, GetPetById400, GetPetById404 } from "../models/GetPetById"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type GetPetByIdClient = typeof client + type GetPetByIdClient = typeof client; type GetPetById = { - data: GetPetByIdQueryResponse - error: GetPetById400 | GetPetById404 - request: never - pathParams: GetPetByIdPathParams - queryParams: never - headerParams: never - response: GetPetByIdQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getPetByIdQueryKey = (petId: GetPetByIdPathParams['petId']) => ['v5', { url: '/pet/:petId', params: { petId: petId } }] as const -export type GetPetByIdQueryKey = ReturnType -export function getPetByIdQueryOptions(petId: GetPetByIdPathParams['petId'], options: GetPetById['client']['parameters'] = {}) { - const queryKey = getPetByIdQueryKey(petId) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: `/pet/${petId}`, - ...options, - }) - return res.data - }, - }) + data: GetPetByIdQueryResponse; + error: GetPetById400 | GetPetById404; + request: never; + pathParams: GetPetByIdPathParams; + queryParams: never; + headerParams: never; + response: GetPetByIdQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getPetByIdQueryKey = (petId: GetPetByIdPathParams["petId"]) => ["v5", { url: "/pet/:petId", params: { petId: petId } }] as const; +export type GetPetByIdQueryKey = ReturnType; +export function getPetByIdQueryOptions(petId: GetPetByIdPathParams["petId"], options: GetPetById["client"]["parameters"] = {}) { + const queryKey = getPetByIdQueryKey(petId); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/pet/${petId}`, + ...options + }); + return res.data; + }, + }); } /** * @description Returns a single pet * @summary Find pet by ID * @link /pet/:petId */ -export function useGetPetByIdHook( - petId: GetPetByIdPathParams['petId'], - options: { - query?: Partial> - client?: GetPetById['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useGetPetByIdHook(petId: GetPetByIdPathParams["petId"], options: { + query?: Partial>; + client?: GetPetById["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getPetByIdQueryKey(petId) - const query = useQuery({ - ...(getPetByIdQueryOptions(petId, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getPetByIdQueryKey(petId); + const query = useQuery({ + ...getPetByIdQueryOptions(petId, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const getPetByIdSuspenseQueryKey = (petId: GetPetByIdPathParams['petId']) => ['v5', { url: '/pet/:petId', params: { petId: petId } }] as const -export type GetPetByIdSuspenseQueryKey = ReturnType -export function getPetByIdSuspenseQueryOptions(petId: GetPetByIdPathParams['petId'], options: GetPetById['client']['parameters'] = {}) { - const queryKey = getPetByIdSuspenseQueryKey(petId) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: `/pet/${petId}`, - ...options, - }) - return res.data - }, - }) +export const getPetByIdSuspenseQueryKey = (petId: GetPetByIdPathParams["petId"]) => ["v5", { url: "/pet/:petId", params: { petId: petId } }] as const; +export type GetPetByIdSuspenseQueryKey = ReturnType; +export function getPetByIdSuspenseQueryOptions(petId: GetPetByIdPathParams["petId"], options: GetPetById["client"]["parameters"] = {}) { + const queryKey = getPetByIdSuspenseQueryKey(petId); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/pet/${petId}`, + ...options + }); + return res.data; + }, + }); } /** * @description Returns a single pet * @summary Find pet by ID * @link /pet/:petId */ -export function useGetPetByIdHookSuspense( - petId: GetPetByIdPathParams['petId'], - options: { - query?: Partial> - client?: GetPetById['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useGetPetByIdHookSuspense(petId: GetPetByIdPathParams["petId"], options: { + query?: Partial>; + client?: GetPetById["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getPetByIdSuspenseQueryKey(petId) - const query = useSuspenseQuery({ - ...(getPetByIdSuspenseQueryOptions(petId, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getPetByIdSuspenseQueryKey(petId); + const query = useSuspenseQuery({ + ...getPetByIdSuspenseQueryOptions(petId, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useGetUserByNameHook.ts b/examples/react-query-v5/src/gen/hooks/useGetUserByNameHook.ts index cd44fdf16..f49556b11 100644 --- a/examples/react-query-v5/src/gen/hooks/useGetUserByNameHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useGetUserByNameHook.ts @@ -1,107 +1,95 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { GetUserByName400, GetUserByName404, GetUserByNamePathParams, GetUserByNameQueryResponse } from '../models/GetUserByName' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { GetUserByNameQueryResponse, GetUserByNamePathParams, GetUserByName400, GetUserByName404 } from "../models/GetUserByName"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type GetUserByNameClient = typeof client + type GetUserByNameClient = typeof client; type GetUserByName = { - data: GetUserByNameQueryResponse - error: GetUserByName400 | GetUserByName404 - request: never - pathParams: GetUserByNamePathParams - queryParams: never - headerParams: never - response: GetUserByNameQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getUserByNameQueryKey = (username: GetUserByNamePathParams['username']) => - ['v5', { url: '/user/:username', params: { username: username } }] as const -export type GetUserByNameQueryKey = ReturnType -export function getUserByNameQueryOptions(username: GetUserByNamePathParams['username'], options: GetUserByName['client']['parameters'] = {}) { - const queryKey = getUserByNameQueryKey(username) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: `/user/${username}`, - ...options, - }) - return res.data - }, - }) + data: GetUserByNameQueryResponse; + error: GetUserByName400 | GetUserByName404; + request: never; + pathParams: GetUserByNamePathParams; + queryParams: never; + headerParams: never; + response: GetUserByNameQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getUserByNameQueryKey = (username: GetUserByNamePathParams["username"]) => ["v5", { url: "/user/:username", params: { username: username } }] as const; +export type GetUserByNameQueryKey = ReturnType; +export function getUserByNameQueryOptions(username: GetUserByNamePathParams["username"], options: GetUserByName["client"]["parameters"] = {}) { + const queryKey = getUserByNameQueryKey(username); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/user/${username}`, + ...options + }); + return res.data; + }, + }); } /** * @summary Get user by user name * @link /user/:username */ -export function useGetUserByNameHook< - TData = GetUserByName['response'], - TQueryData = GetUserByName['response'], - TQueryKey extends QueryKey = GetUserByNameQueryKey, ->( - username: GetUserByNamePathParams['username'], - options: { - query?: Partial> - client?: GetUserByName['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useGetUserByNameHook(username: GetUserByNamePathParams["username"], options: { + query?: Partial>; + client?: GetUserByName["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getUserByNameQueryKey(username) - const query = useQuery({ - ...(getUserByNameQueryOptions(username, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getUserByNameQueryKey(username); + const query = useQuery({ + ...getUserByNameQueryOptions(username, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const getUserByNameSuspenseQueryKey = (username: GetUserByNamePathParams['username']) => - ['v5', { url: '/user/:username', params: { username: username } }] as const -export type GetUserByNameSuspenseQueryKey = ReturnType -export function getUserByNameSuspenseQueryOptions(username: GetUserByNamePathParams['username'], options: GetUserByName['client']['parameters'] = {}) { - const queryKey = getUserByNameSuspenseQueryKey(username) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: `/user/${username}`, - ...options, - }) - return res.data - }, - }) +export const getUserByNameSuspenseQueryKey = (username: GetUserByNamePathParams["username"]) => ["v5", { url: "/user/:username", params: { username: username } }] as const; +export type GetUserByNameSuspenseQueryKey = ReturnType; +export function getUserByNameSuspenseQueryOptions(username: GetUserByNamePathParams["username"], options: GetUserByName["client"]["parameters"] = {}) { + const queryKey = getUserByNameSuspenseQueryKey(username); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/user/${username}`, + ...options + }); + return res.data; + }, + }); } /** * @summary Get user by user name * @link /user/:username */ -export function useGetUserByNameHookSuspense( - username: GetUserByNamePathParams['username'], - options: { - query?: Partial> - client?: GetUserByName['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useGetUserByNameHookSuspense(username: GetUserByNamePathParams["username"], options: { + query?: Partial>; + client?: GetUserByName["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getUserByNameSuspenseQueryKey(username) - const query = useSuspenseQuery({ - ...(getUserByNameSuspenseQueryOptions(username, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getUserByNameSuspenseQueryKey(username); + const query = useSuspenseQuery({ + ...getUserByNameSuspenseQueryOptions(username, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useLoginUserHook.ts b/examples/react-query-v5/src/gen/hooks/useLoginUserHook.ts index 6b80522d2..0ffee680e 100644 --- a/examples/react-query-v5/src/gen/hooks/useLoginUserHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useLoginUserHook.ts @@ -1,103 +1,97 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { LoginUser400, LoginUserQueryParams, LoginUserQueryResponse } from '../models/LoginUser' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { LoginUserQueryResponse, LoginUserQueryParams, LoginUser400 } from "../models/LoginUser"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type LoginUserClient = typeof client + type LoginUserClient = typeof client; type LoginUser = { - data: LoginUserQueryResponse - error: LoginUser400 - request: never - pathParams: never - queryParams: LoginUserQueryParams - headerParams: never - response: LoginUserQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const loginUserQueryKey = (params?: LoginUser['queryParams']) => ['v5', { url: '/user/login' }, ...(params ? [params] : [])] as const -export type LoginUserQueryKey = ReturnType -export function loginUserQueryOptions(params?: LoginUser['queryParams'], options: LoginUser['client']['parameters'] = {}) { - const queryKey = loginUserQueryKey(params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/user/login', - params, - ...options, - }) - return res.data - }, - }) + data: LoginUserQueryResponse; + error: LoginUser400; + request: never; + pathParams: never; + queryParams: LoginUserQueryParams; + headerParams: never; + response: LoginUserQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const loginUserQueryKey = (params?: LoginUser["queryParams"]) => ["v5", { url: "/user/login" }, ...(params ? [params] : [])] as const; +export type LoginUserQueryKey = ReturnType; +export function loginUserQueryOptions(params?: LoginUser["queryParams"], options: LoginUser["client"]["parameters"] = {}) { + const queryKey = loginUserQueryKey(params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/user/login`, + params, + ...options + }); + return res.data; + }, + }); } /** * @summary Logs user into the system * @link /user/login */ -export function useLoginUserHook( - params?: LoginUser['queryParams'], - options: { - query?: Partial> - client?: LoginUser['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useLoginUserHook(params?: LoginUser["queryParams"], options: { + query?: Partial>; + client?: LoginUser["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? loginUserQueryKey(params) - const query = useQuery({ - ...(loginUserQueryOptions(params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? loginUserQueryKey(params); + const query = useQuery({ + ...loginUserQueryOptions(params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const loginUserSuspenseQueryKey = (params?: LoginUser['queryParams']) => ['v5', { url: '/user/login' }, ...(params ? [params] : [])] as const -export type LoginUserSuspenseQueryKey = ReturnType -export function loginUserSuspenseQueryOptions(params?: LoginUser['queryParams'], options: LoginUser['client']['parameters'] = {}) { - const queryKey = loginUserSuspenseQueryKey(params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/user/login', - params, - ...options, - }) - return res.data - }, - }) +export const loginUserSuspenseQueryKey = (params?: LoginUser["queryParams"]) => ["v5", { url: "/user/login" }, ...(params ? [params] : [])] as const; +export type LoginUserSuspenseQueryKey = ReturnType; +export function loginUserSuspenseQueryOptions(params?: LoginUser["queryParams"], options: LoginUser["client"]["parameters"] = {}) { + const queryKey = loginUserSuspenseQueryKey(params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/user/login`, + params, + ...options + }); + return res.data; + }, + }); } /** * @summary Logs user into the system * @link /user/login */ -export function useLoginUserHookSuspense( - params?: LoginUser['queryParams'], - options: { - query?: Partial> - client?: LoginUser['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useLoginUserHookSuspense(params?: LoginUser["queryParams"], options: { + query?: Partial>; + client?: LoginUser["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? loginUserSuspenseQueryKey(params) - const query = useSuspenseQuery({ - ...(loginUserSuspenseQueryOptions(params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? loginUserSuspenseQueryKey(params); + const query = useSuspenseQuery({ + ...loginUserSuspenseQueryOptions(params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useLogoutUserHook.ts b/examples/react-query-v5/src/gen/hooks/useLogoutUserHook.ts index e5d7d7841..b7eaa5186 100644 --- a/examples/react-query-v5/src/gen/hooks/useLogoutUserHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useLogoutUserHook.ts @@ -1,99 +1,95 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { LogoutUserQueryResponse } from '../models/LogoutUser' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { LogoutUserQueryResponse } from "../models/LogoutUser"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type LogoutUserClient = typeof client + type LogoutUserClient = typeof client; type LogoutUser = { - data: LogoutUserQueryResponse - error: never - request: never - pathParams: never - queryParams: never - headerParams: never - response: LogoutUserQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const logoutUserQueryKey = () => ['v5', { url: '/user/logout' }] as const -export type LogoutUserQueryKey = ReturnType -export function logoutUserQueryOptions(options: LogoutUser['client']['parameters'] = {}) { - const queryKey = logoutUserQueryKey() - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/user/logout', - ...options, - }) - return res.data - }, - }) + data: LogoutUserQueryResponse; + error: never; + request: never; + pathParams: never; + queryParams: never; + headerParams: never; + response: LogoutUserQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const logoutUserQueryKey = () => ["v5", { url: "/user/logout" }] as const; +export type LogoutUserQueryKey = ReturnType; +export function logoutUserQueryOptions(options: LogoutUser["client"]["parameters"] = {}) { + const queryKey = logoutUserQueryKey(); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/user/logout`, + ...options + }); + return res.data; + }, + }); } /** * @summary Logs out current logged in user session * @link /user/logout */ -export function useLogoutUserHook( - options: { - query?: Partial> - client?: LogoutUser['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useLogoutUserHook(options: { + query?: Partial>; + client?: LogoutUser["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? logoutUserQueryKey() - const query = useQuery({ - ...(logoutUserQueryOptions(clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? logoutUserQueryKey(); + const query = useQuery({ + ...logoutUserQueryOptions(clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const logoutUserSuspenseQueryKey = () => ['v5', { url: '/user/logout' }] as const -export type LogoutUserSuspenseQueryKey = ReturnType -export function logoutUserSuspenseQueryOptions(options: LogoutUser['client']['parameters'] = {}) { - const queryKey = logoutUserSuspenseQueryKey() - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/user/logout', - ...options, - }) - return res.data - }, - }) +export const logoutUserSuspenseQueryKey = () => ["v5", { url: "/user/logout" }] as const; +export type LogoutUserSuspenseQueryKey = ReturnType; +export function logoutUserSuspenseQueryOptions(options: LogoutUser["client"]["parameters"] = {}) { + const queryKey = logoutUserSuspenseQueryKey(); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/user/logout`, + ...options + }); + return res.data; + }, + }); } /** * @summary Logs out current logged in user session * @link /user/logout */ -export function useLogoutUserHookSuspense( - options: { - query?: Partial> - client?: LogoutUser['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useLogoutUserHookSuspense(options: { + query?: Partial>; + client?: LogoutUser["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? logoutUserSuspenseQueryKey() - const query = useSuspenseQuery({ - ...(logoutUserSuspenseQueryOptions(clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? logoutUserSuspenseQueryKey(); + const query = useSuspenseQuery({ + ...logoutUserSuspenseQueryOptions(clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/usePlaceOrderHook.ts b/examples/react-query-v5/src/gen/hooks/usePlaceOrderHook.ts index d0860e613..72264f567 100644 --- a/examples/react-query-v5/src/gen/hooks/usePlaceOrderHook.ts +++ b/examples/react-query-v5/src/gen/hooks/usePlaceOrderHook.ts @@ -1,50 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { PlaceOrder405, PlaceOrderMutationRequest, PlaceOrderMutationResponse } from '../models/PlaceOrder' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { PlaceOrderMutationRequest, PlaceOrderMutationResponse, PlaceOrder405 } from "../models/PlaceOrder"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type PlaceOrderClient = typeof client + type PlaceOrderClient = typeof client; type PlaceOrder = { - data: PlaceOrderMutationResponse - error: PlaceOrder405 - request: PlaceOrderMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: PlaceOrderMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: PlaceOrderMutationResponse; + error: PlaceOrder405; + request: PlaceOrderMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: PlaceOrderMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Place a new order in the store * @summary Place an order for a pet * @link /store/order */ -export function usePlaceOrderHook( - options: { - mutation?: UseMutationOptions - client?: PlaceOrder['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('usePlaceOrderHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/store/order', - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function usePlaceOrderHook(options: { + mutation?: UseMutationOptions; + client?: PlaceOrder["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("usePlaceOrderHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/store/order`, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/usePlaceOrderPatchHook.ts b/examples/react-query-v5/src/gen/hooks/usePlaceOrderPatchHook.ts index e4b99aee1..b9435de7c 100644 --- a/examples/react-query-v5/src/gen/hooks/usePlaceOrderPatchHook.ts +++ b/examples/react-query-v5/src/gen/hooks/usePlaceOrderPatchHook.ts @@ -1,50 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { PlaceOrderPatch405, PlaceOrderPatchMutationRequest, PlaceOrderPatchMutationResponse } from '../models/PlaceOrderPatch' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { PlaceOrderPatchMutationRequest, PlaceOrderPatchMutationResponse, PlaceOrderPatch405 } from "../models/PlaceOrderPatch"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type PlaceOrderPatchClient = typeof client + type PlaceOrderPatchClient = typeof client; type PlaceOrderPatch = { - data: PlaceOrderPatchMutationResponse - error: PlaceOrderPatch405 - request: PlaceOrderPatchMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: PlaceOrderPatchMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: PlaceOrderPatchMutationResponse; + error: PlaceOrderPatch405; + request: PlaceOrderPatchMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: PlaceOrderPatchMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Place a new order in the store with patch * @summary Place an order for a pet with patch * @link /store/order */ -export function usePlaceOrderPatchHook( - options: { - mutation?: UseMutationOptions - client?: PlaceOrderPatch['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('usePlaceOrderPatchHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'patch', - url: '/store/order', - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function usePlaceOrderPatchHook(options: { + mutation?: UseMutationOptions; + client?: PlaceOrderPatch["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("usePlaceOrderPatchHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "patch", + url: `/store/order`, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useUpdatePetHook.ts b/examples/react-query-v5/src/gen/hooks/useUpdatePetHook.ts index 7803c3462..9875427c2 100644 --- a/examples/react-query-v5/src/gen/hooks/useUpdatePetHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useUpdatePetHook.ts @@ -1,50 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { UpdatePet400, UpdatePet404, UpdatePet405, UpdatePetMutationRequest, UpdatePetMutationResponse } from '../models/UpdatePet' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { UpdatePetMutationRequest, UpdatePetMutationResponse, UpdatePet400, UpdatePet404, UpdatePet405 } from "../models/UpdatePet"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type UpdatePetClient = typeof client + type UpdatePetClient = typeof client; type UpdatePet = { - data: UpdatePetMutationResponse - error: UpdatePet400 | UpdatePet404 | UpdatePet405 - request: UpdatePetMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: UpdatePetMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: UpdatePetMutationResponse; + error: UpdatePet400 | UpdatePet404 | UpdatePet405; + request: UpdatePetMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: UpdatePetMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Update an existing pet by Id * @summary Update an existing pet * @link /pet */ -export function useUpdatePetHook( - options: { - mutation?: UseMutationOptions - client?: UpdatePet['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useUpdatePetHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'put', - url: '/pet', - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useUpdatePetHook(options: { + mutation?: UseMutationOptions; + client?: UpdatePet["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useUpdatePetHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "put", + url: `/pet`, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useUpdatePetWithFormHook.ts b/examples/react-query-v5/src/gen/hooks/useUpdatePetWithFormHook.ts index 4a390cd19..e337d668d 100644 --- a/examples/react-query-v5/src/gen/hooks/useUpdatePetWithFormHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useUpdatePetWithFormHook.ts @@ -1,124 +1,97 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery, useSuspenseQuery } from '@tanstack/react-query' -import type { QueryKey, QueryObserverOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query' -import type { - UpdatePetWithForm405, - UpdatePetWithFormMutationResponse, - UpdatePetWithFormPathParams, - UpdatePetWithFormQueryParams, -} from '../models/UpdatePetWithForm' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import type { UpdatePetWithFormMutationResponse, UpdatePetWithFormPathParams, UpdatePetWithFormQueryParams, UpdatePetWithForm405 } from "../models/UpdatePetWithForm"; +import type { QueryObserverOptions, UseQueryResult, QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; -type UpdatePetWithFormClient = typeof client + type UpdatePetWithFormClient = typeof client; type UpdatePetWithForm = { - data: UpdatePetWithFormMutationResponse - error: UpdatePetWithForm405 - request: never - pathParams: UpdatePetWithFormPathParams - queryParams: UpdatePetWithFormQueryParams - headerParams: never - response: UpdatePetWithFormMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const updatePetWithFormQueryKey = (petId: UpdatePetWithFormPathParams['petId'], params?: UpdatePetWithForm['queryParams']) => - [{ url: '/pet/:petId', params: { petId: petId } }, ...(params ? [params] : [])] as const -export type UpdatePetWithFormQueryKey = ReturnType -export function updatePetWithFormQueryOptions( - petId: UpdatePetWithFormPathParams['petId'], - params?: UpdatePetWithForm['queryParams'], - options: UpdatePetWithForm['client']['parameters'] = {}, -) { - const queryKey = updatePetWithFormQueryKey(petId, params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'post', - url: `/pet/${petId}`, - params, - ...options, - }) - return res.data - }, - }) + data: UpdatePetWithFormMutationResponse; + error: UpdatePetWithForm405; + request: never; + pathParams: UpdatePetWithFormPathParams; + queryParams: UpdatePetWithFormQueryParams; + headerParams: never; + response: UpdatePetWithFormMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const updatePetWithFormQueryKey = (petId: UpdatePetWithFormPathParams["petId"], params?: UpdatePetWithForm["queryParams"]) => [{ url: "/pet/:petId", params: { petId: petId } }, ...(params ? [params] : [])] as const; +export type UpdatePetWithFormQueryKey = ReturnType; +export function updatePetWithFormQueryOptions(petId: UpdatePetWithFormPathParams["petId"], params?: UpdatePetWithForm["queryParams"], options: UpdatePetWithForm["client"]["parameters"] = {}) { + const queryKey = updatePetWithFormQueryKey(petId, params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "post", + url: `/pet/${petId}`, + params, + ...options + }); + return res.data; + }, + }); } /** * @summary Updates a pet in the store with form data * @link /pet/:petId */ -export function useUpdatePetWithFormHook< - TData = UpdatePetWithForm['response'], - TQueryData = UpdatePetWithForm['response'], - TQueryKey extends QueryKey = UpdatePetWithFormQueryKey, ->( - petId: UpdatePetWithFormPathParams['petId'], - params?: UpdatePetWithForm['queryParams'], - options: { - query?: Partial> - client?: UpdatePetWithForm['client']['parameters'] - } = {}, -): UseQueryResult & { - queryKey: TQueryKey +export function useUpdatePetWithFormHook(petId: UpdatePetWithFormPathParams["petId"], params?: UpdatePetWithForm["queryParams"], options: { + query?: Partial>; + client?: UpdatePetWithForm["client"]["parameters"]; +} = {}): UseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? updatePetWithFormQueryKey(petId, params) - const query = useQuery({ - ...(updatePetWithFormQueryOptions(petId, params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? updatePetWithFormQueryKey(petId, params); + const query = useQuery({ + ...updatePetWithFormQueryOptions(petId, params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; } -export const updatePetWithFormSuspenseQueryKey = (petId: UpdatePetWithFormPathParams['petId'], params?: UpdatePetWithForm['queryParams']) => - [{ url: '/pet/:petId', params: { petId: petId } }, ...(params ? [params] : [])] as const -export type UpdatePetWithFormSuspenseQueryKey = ReturnType -export function updatePetWithFormSuspenseQueryOptions( - petId: UpdatePetWithFormPathParams['petId'], - params?: UpdatePetWithForm['queryParams'], - options: UpdatePetWithForm['client']['parameters'] = {}, -) { - const queryKey = updatePetWithFormSuspenseQueryKey(petId, params) - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'post', - url: `/pet/${petId}`, - params, - ...options, - }) - return res.data - }, - }) +export const updatePetWithFormSuspenseQueryKey = (petId: UpdatePetWithFormPathParams["petId"], params?: UpdatePetWithForm["queryParams"]) => [{ url: "/pet/:petId", params: { petId: petId } }, ...(params ? [params] : [])] as const; +export type UpdatePetWithFormSuspenseQueryKey = ReturnType; +export function updatePetWithFormSuspenseQueryOptions(petId: UpdatePetWithFormPathParams["petId"], params?: UpdatePetWithForm["queryParams"], options: UpdatePetWithForm["client"]["parameters"] = {}) { + const queryKey = updatePetWithFormSuspenseQueryKey(petId, params); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "post", + url: `/pet/${petId}`, + params, + ...options + }); + return res.data; + }, + }); } /** * @summary Updates a pet in the store with form data * @link /pet/:petId */ -export function useUpdatePetWithFormHookSuspense( - petId: UpdatePetWithFormPathParams['petId'], - params?: UpdatePetWithForm['queryParams'], - options: { - query?: Partial> - client?: UpdatePetWithForm['client']['parameters'] - } = {}, -): UseSuspenseQueryResult & { - queryKey: TQueryKey +export function useUpdatePetWithFormHookSuspense(petId: UpdatePetWithFormPathParams["petId"], params?: UpdatePetWithForm["queryParams"], options: { + query?: Partial>; + client?: UpdatePetWithForm["client"]["parameters"]; +} = {}): UseSuspenseQueryResult & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? updatePetWithFormSuspenseQueryKey(petId, params) - const query = useSuspenseQuery({ - ...(updatePetWithFormSuspenseQueryOptions(petId, params, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseSuspenseQueryResult & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? updatePetWithFormSuspenseQueryKey(petId, params); + const query = useSuspenseQuery({ + ...updatePetWithFormSuspenseQueryOptions(petId, params, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseSuspenseQueryResult & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useUpdateUserHook.ts b/examples/react-query-v5/src/gen/hooks/useUpdateUserHook.ts index dc3a620b1..91c01efce 100644 --- a/examples/react-query-v5/src/gen/hooks/useUpdateUserHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useUpdateUserHook.ts @@ -1,51 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../models/UpdateUser' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from "../models/UpdateUser"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type UpdateUserClient = typeof client + type UpdateUserClient = typeof client; type UpdateUser = { - data: UpdateUserMutationResponse - error: never - request: UpdateUserMutationRequest - pathParams: UpdateUserPathParams - queryParams: never - headerParams: never - response: UpdateUserMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: UpdateUserMutationResponse; + error: never; + request: UpdateUserMutationRequest; + pathParams: UpdateUserPathParams; + queryParams: never; + headerParams: never; + response: UpdateUserMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description This can only be done by the logged in user. * @summary Update user * @link /user/:username */ -export function useUpdateUserHook( - username: UpdateUserPathParams['username'], - options: { - mutation?: UseMutationOptions - client?: UpdateUser['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useUpdateUserHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'put', - url: `/user/${username}`, - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useUpdateUserHook(username: UpdateUserPathParams["username"], options: { + mutation?: UseMutationOptions; + client?: UpdateUser["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useUpdateUserHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "put", + url: `/user/${username}`, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/hooks/useUploadFileHook.ts b/examples/react-query-v5/src/gen/hooks/useUploadFileHook.ts index 1605fd593..c3bee7c2d 100644 --- a/examples/react-query-v5/src/gen/hooks/useUploadFileHook.ts +++ b/examples/react-query-v5/src/gen/hooks/useUploadFileHook.ts @@ -1,52 +1,50 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/react-query' -import type { UseMutationOptions } from '@tanstack/react-query' -import { useInvalidationForMutation } from '../../useInvalidationForMutation' -import type { UploadFileMutationRequest, UploadFileMutationResponse, UploadFilePathParams, UploadFileQueryParams } from '../models/UploadFile' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/react-query"; +import { useInvalidationForMutation } from "../../useInvalidationForMutation"; +import type { UploadFileMutationRequest, UploadFileMutationResponse, UploadFilePathParams, UploadFileQueryParams } from "../models/UploadFile"; +import type { UseMutationOptions } from "@tanstack/react-query"; -type UploadFileClient = typeof client + type UploadFileClient = typeof client; type UploadFile = { - data: UploadFileMutationResponse - error: never - request: UploadFileMutationRequest - pathParams: UploadFilePathParams - queryParams: UploadFileQueryParams - headerParams: never - response: UploadFileMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: UploadFileMutationResponse; + error: never; + request: UploadFileMutationRequest; + pathParams: UploadFilePathParams; + queryParams: UploadFileQueryParams; + headerParams: never; + response: UploadFileMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @summary uploads an image * @link /pet/:petId/uploadImage */ -export function useUploadFileHook( - petId: UploadFilePathParams['petId'], - params?: UploadFile['queryParams'], - options: { - mutation?: UseMutationOptions - client?: UploadFile['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - const invalidationOnSuccess = useInvalidationForMutation('useUploadFileHook') - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: `/pet/${petId}/uploadImage`, - params, - data, - ...clientOptions, - }) - return res.data - }, - onSuccess: (...args) => { - if (invalidationOnSuccess) invalidationOnSuccess(...args) - if (mutationOptions?.onSuccess) mutationOptions.onSuccess(...args) - }, - ...mutationOptions, - }) -} +export function useUploadFileHook(petId: UploadFilePathParams["petId"], params?: UploadFile["queryParams"], options: { + mutation?: UseMutationOptions; + client?: UploadFile["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + const invalidationOnSuccess = useInvalidationForMutation("useUploadFileHook"); + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/pet/${petId}/uploadImage`, + params, + data, + ...clientOptions + }); + return res.data; + }, + onSuccess: (...args) => { + if (invalidationOnSuccess) + invalidationOnSuccess(...args); + if (mutationOptions?.onSuccess) + mutationOptions.onSuccess(...args); + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/index.ts b/examples/react-query-v5/src/gen/index.ts index 6e6f12d44..91cd800f9 100644 --- a/examples/react-query-v5/src/gen/index.ts +++ b/examples/react-query-v5/src/gen/index.ts @@ -1,2 +1,2 @@ -export * from './models/index' -export * from './hooks/index' +export * from "./models/index"; +export * from "./hooks/index"; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/invalidations.ts b/examples/react-query-v5/src/gen/invalidations.ts index 5da5cafd2..cc7fdcf0c 100644 --- a/examples/react-query-v5/src/gen/invalidations.ts +++ b/examples/react-query-v5/src/gen/invalidations.ts @@ -1,54 +1,25 @@ -import type { UseMutationOptions } from '@tanstack/react-query' -import type { - AddPetMutationRequest, - AddPetMutationResponse, - CreateUserMutationRequest, - CreateUserMutationResponse, - CreateUsersWithListInputMutationRequest, - CreateUsersWithListInputMutationResponse, - DeleteOrderMutationResponse, - DeletePetMutationResponse, - DeleteUserMutationResponse, - FindPetsByStatusQueryResponse, - FindPetsByTagsQueryResponse, - GetInventoryQueryResponse, - GetOrderByIdQueryResponse, - GetPetByIdQueryResponse, - GetUserByNameQueryResponse, - LoginUserQueryResponse, - LogoutUserQueryResponse, - PlaceOrderMutationRequest, - PlaceOrderMutationResponse, - PlaceOrderPatchMutationRequest, - PlaceOrderPatchMutationResponse, - UpdatePetMutationRequest, - UpdatePetMutationResponse, - UpdatePetWithFormMutationResponse, - UpdateUserMutationRequest, - UpdateUserMutationResponse, - UploadFileMutationRequest, - UploadFileMutationResponse, -} from './index' +import type { UpdatePetMutationResponse, UpdatePetMutationRequest, AddPetMutationResponse, AddPetMutationRequest, FindPetsByStatusQueryResponse, FindPetsByTagsQueryResponse, GetPetByIdQueryResponse, UpdatePetWithFormMutationResponse, DeletePetMutationResponse, UploadFileMutationResponse, UploadFileMutationRequest, GetInventoryQueryResponse, PlaceOrderMutationResponse, PlaceOrderMutationRequest, PlaceOrderPatchMutationResponse, PlaceOrderPatchMutationRequest, GetOrderByIdQueryResponse, DeleteOrderMutationResponse, CreateUserMutationResponse, CreateUserMutationRequest, CreateUsersWithListInputMutationResponse, CreateUsersWithListInputMutationRequest, LoginUserQueryResponse, LogoutUserQueryResponse, GetUserByNameQueryResponse, UpdateUserMutationResponse, UpdateUserMutationRequest, DeleteUserMutationResponse } from "./index"; +import type { UseMutationOptions } from "@tanstack/react-query"; -export type Invalidations = { - useUpdatePetHook: UseMutationOptions['onSuccess'] - useAddPetHook: UseMutationOptions['onSuccess'] - useFindPetsByStatusHook: UseMutationOptions['onSuccess'] - useFindPetsByTagsHook: UseMutationOptions['onSuccess'] - useGetPetByIdHook: UseMutationOptions['onSuccess'] - useUpdatePetWithFormHook: UseMutationOptions['onSuccess'] - useDeletePetHook: UseMutationOptions['onSuccess'] - useUploadFileHook: UseMutationOptions['onSuccess'] - useGetInventoryHook: UseMutationOptions['onSuccess'] - usePlaceOrderHook: UseMutationOptions['onSuccess'] - usePlaceOrderPatchHook: UseMutationOptions['onSuccess'] - useGetOrderByIdHook: UseMutationOptions['onSuccess'] - useDeleteOrderHook: UseMutationOptions['onSuccess'] - useCreateUserHook: UseMutationOptions['onSuccess'] - useCreateUsersWithListInputHook: UseMutationOptions['onSuccess'] - useLoginUserHook: UseMutationOptions['onSuccess'] - useLogoutUserHook: UseMutationOptions['onSuccess'] - useGetUserByNameHook: UseMutationOptions['onSuccess'] - useUpdateUserHook: UseMutationOptions['onSuccess'] - useDeleteUserHook: UseMutationOptions['onSuccess'] -} + export type Invalidations = { + "useUpdatePetHook": UseMutationOptions["onSuccess"]; + "useAddPetHook": UseMutationOptions["onSuccess"]; + "useFindPetsByStatusHook": UseMutationOptions["onSuccess"]; + "useFindPetsByTagsHook": UseMutationOptions["onSuccess"]; + "useGetPetByIdHook": UseMutationOptions["onSuccess"]; + "useUpdatePetWithFormHook": UseMutationOptions["onSuccess"]; + "useDeletePetHook": UseMutationOptions["onSuccess"]; + "useUploadFileHook": UseMutationOptions["onSuccess"]; + "useGetInventoryHook": UseMutationOptions["onSuccess"]; + "usePlaceOrderHook": UseMutationOptions["onSuccess"]; + "usePlaceOrderPatchHook": UseMutationOptions["onSuccess"]; + "useGetOrderByIdHook": UseMutationOptions["onSuccess"]; + "useDeleteOrderHook": UseMutationOptions["onSuccess"]; + "useCreateUserHook": UseMutationOptions["onSuccess"]; + "useCreateUsersWithListInputHook": UseMutationOptions["onSuccess"]; + "useLoginUserHook": UseMutationOptions["onSuccess"]; + "useLogoutUserHook": UseMutationOptions["onSuccess"]; + "useGetUserByNameHook": UseMutationOptions["onSuccess"]; + "useUpdateUserHook": UseMutationOptions["onSuccess"]; + "useDeleteUserHook": UseMutationOptions["onSuccess"]; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/AddPet.ts b/examples/react-query-v5/src/gen/models/AddPet.ts index dfc60e285..20b112cd8 100644 --- a/examples/react-query-v5/src/gen/models/AddPet.ts +++ b/examples/react-query-v5/src/gen/models/AddPet.ts @@ -1,37 +1,37 @@ -import type { AddPetRequest } from './AddPetRequest' -import type { Pet } from './Pet' +import { AddPetRequest } from "./AddPetRequest"; +import type { Pet } from "./Pet"; -/** + /** * @description Successful operation - */ -export type AddPet200 = Pet +*/ +export type AddPet200 = Pet; -/** + /** * @description Pet not found - */ +*/ export type AddPet405 = { - /** - * @type integer | undefined int32 - */ - code?: number - /** - * @type string | undefined - */ - message?: string -} + /** + * @type integer | undefined int32 + */ + code?: number; + /** + * @type string | undefined + */ + message?: string; +}; -/** + /** * @description Create a new pet in the store - */ -export type AddPetMutationRequest = AddPetRequest +*/ +export type AddPetMutationRequest = AddPetRequest; -/** + /** * @description Successful operation - */ -export type AddPetMutationResponse = Pet +*/ +export type AddPetMutationResponse = Pet; -export type AddPetMutation = { - Response: AddPetMutationResponse - Request: AddPetMutationRequest - Errors: AddPet405 -} + export type AddPetMutation = { + Response: AddPetMutationResponse; + Request: AddPetMutationRequest; + Errors: AddPet405; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/AddPetRequest.ts b/examples/react-query-v5/src/gen/models/AddPetRequest.ts index 9c76717ea..c1a6f0b70 100644 --- a/examples/react-query-v5/src/gen/models/AddPetRequest.ts +++ b/examples/react-query-v5/src/gen/models/AddPetRequest.ts @@ -1,33 +1,33 @@ -import type { Category } from './Category' -import type { Tag } from './Tag' +import type { Category } from "./Category"; +import type { Tag } from "./Tag"; -export const addPetRequestStatus = { - available: 'available', - pending: 'pending', - sold: 'sold', -} as const -export type AddPetRequestStatus = (typeof addPetRequestStatus)[keyof typeof addPetRequestStatus] + export const addPetRequestStatus = { + "available": "available", + "pending": "pending", + "sold": "sold" +} as const; +export type AddPetRequestStatus = (typeof addPetRequestStatus)[keyof typeof addPetRequestStatus]; export type AddPetRequest = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string - */ - name: string - category?: Category - /** - * @type array - */ - photoUrls: string[] - /** - * @type array | undefined - */ - tags?: Tag[] - /** - * @description pet status in the store - * @type string | undefined - */ - status?: AddPetRequestStatus -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string + */ + name: string; + category?: Category; + /** + * @type array + */ + photoUrls: string[]; + /** + * @type array | undefined + */ + tags?: Tag[]; + /** + * @description pet status in the store + * @type string | undefined + */ + status?: AddPetRequestStatus; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/Address.ts b/examples/react-query-v5/src/gen/models/Address.ts index eb578826d..4b61854c4 100644 --- a/examples/react-query-v5/src/gen/models/Address.ts +++ b/examples/react-query-v5/src/gen/models/Address.ts @@ -1,18 +1,18 @@ export type Address = { - /** - * @type string | undefined - */ - street?: string - /** - * @type string | undefined - */ - city?: string - /** - * @type string | undefined - */ - state?: string - /** - * @type string | undefined - */ - zip?: string -} + /** + * @type string | undefined + */ + street?: string; + /** + * @type string | undefined + */ + city?: string; + /** + * @type string | undefined + */ + state?: string; + /** + * @type string | undefined + */ + zip?: string; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/ApiResponse.ts b/examples/react-query-v5/src/gen/models/ApiResponse.ts index 499e9e9ca..c006d2618 100644 --- a/examples/react-query-v5/src/gen/models/ApiResponse.ts +++ b/examples/react-query-v5/src/gen/models/ApiResponse.ts @@ -1,14 +1,14 @@ export type ApiResponse = { - /** - * @type integer | undefined int32 - */ - code?: number - /** - * @type string | undefined - */ - type?: string - /** - * @type string | undefined - */ - message?: string -} + /** + * @type integer | undefined int32 + */ + code?: number; + /** + * @type string | undefined + */ + type?: string; + /** + * @type string | undefined + */ + message?: string; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/Category.ts b/examples/react-query-v5/src/gen/models/Category.ts index 24b90a71a..bcf608c7d 100644 --- a/examples/react-query-v5/src/gen/models/Category.ts +++ b/examples/react-query-v5/src/gen/models/Category.ts @@ -1,10 +1,10 @@ export type Category = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - name?: string -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + name?: string; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/CreateUser.ts b/examples/react-query-v5/src/gen/models/CreateUser.ts index ada359de3..048dec373 100644 --- a/examples/react-query-v5/src/gen/models/CreateUser.ts +++ b/examples/react-query-v5/src/gen/models/CreateUser.ts @@ -1,18 +1,18 @@ -import type { User } from './User' +import type { User } from "./User"; -/** + /** * @description successful operation - */ -export type CreateUserError = User +*/ +export type CreateUserError = User; -/** + /** * @description Created user object - */ -export type CreateUserMutationRequest = User +*/ +export type CreateUserMutationRequest = User; -export type CreateUserMutationResponse = any + export type CreateUserMutationResponse = any; -export type CreateUserMutation = { - Response: CreateUserMutationResponse - Request: CreateUserMutationRequest -} + export type CreateUserMutation = { + Response: CreateUserMutationResponse; + Request: CreateUserMutationRequest; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/CreateUsersWithListInput.ts b/examples/react-query-v5/src/gen/models/CreateUsersWithListInput.ts index eb718eb51..daeaa03e6 100644 --- a/examples/react-query-v5/src/gen/models/CreateUsersWithListInput.ts +++ b/examples/react-query-v5/src/gen/models/CreateUsersWithListInput.ts @@ -1,23 +1,23 @@ -import type { User } from './User' +import type { User } from "./User"; -/** + /** * @description Successful operation - */ -export type CreateUsersWithListInput200 = User +*/ +export type CreateUsersWithListInput200 = User; -/** + /** * @description successful operation - */ -export type CreateUsersWithListInputError = any +*/ +export type CreateUsersWithListInputError = any; -export type CreateUsersWithListInputMutationRequest = User[] + export type CreateUsersWithListInputMutationRequest = User[]; -/** + /** * @description Successful operation - */ -export type CreateUsersWithListInputMutationResponse = User +*/ +export type CreateUsersWithListInputMutationResponse = User; -export type CreateUsersWithListInputMutation = { - Response: CreateUsersWithListInputMutationResponse - Request: CreateUsersWithListInputMutationRequest -} + export type CreateUsersWithListInputMutation = { + Response: CreateUsersWithListInputMutationResponse; + Request: CreateUsersWithListInputMutationRequest; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/Customer.ts b/examples/react-query-v5/src/gen/models/Customer.ts index 5a6d435a3..38705efe9 100644 --- a/examples/react-query-v5/src/gen/models/Customer.ts +++ b/examples/react-query-v5/src/gen/models/Customer.ts @@ -1,16 +1,16 @@ -import type { Address } from './Address' +import { Address } from "./Address"; -export type Customer = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - username?: string - /** - * @type array | undefined - */ - address?: Address[] -} + export type Customer = { + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + username?: string; + /** + * @type array | undefined + */ + address?: Address[]; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/DeleteOrder.ts b/examples/react-query-v5/src/gen/models/DeleteOrder.ts index d160f7c4e..ba913be7d 100644 --- a/examples/react-query-v5/src/gen/models/DeleteOrder.ts +++ b/examples/react-query-v5/src/gen/models/DeleteOrder.ts @@ -1,25 +1,25 @@ export type DeleteOrderPathParams = { - /** - * @description ID of the order that needs to be deleted - * @type integer int64 - */ - orderId: number -} + /** + * @description ID of the order that needs to be deleted + * @type integer int64 + */ + orderId: number; +}; -/** + /** * @description Invalid ID supplied - */ -export type DeleteOrder400 = any +*/ +export type DeleteOrder400 = any; -/** + /** * @description Order not found - */ -export type DeleteOrder404 = any +*/ +export type DeleteOrder404 = any; -export type DeleteOrderMutationResponse = any + export type DeleteOrderMutationResponse = any; -export type DeleteOrderMutation = { - Response: DeleteOrderMutationResponse - PathParams: DeleteOrderPathParams - Errors: DeleteOrder400 | DeleteOrder404 -} + export type DeleteOrderMutation = { + Response: DeleteOrderMutationResponse; + PathParams: DeleteOrderPathParams; + Errors: DeleteOrder400 | DeleteOrder404; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/DeletePet.ts b/examples/react-query-v5/src/gen/models/DeletePet.ts index 6bb98c261..185a5ef2c 100644 --- a/examples/react-query-v5/src/gen/models/DeletePet.ts +++ b/examples/react-query-v5/src/gen/models/DeletePet.ts @@ -1,28 +1,28 @@ export type DeletePetPathParams = { - /** - * @description Pet id to delete - * @type integer int64 - */ - petId: number -} + /** + * @description Pet id to delete + * @type integer int64 + */ + petId: number; +}; -export type DeletePetHeaderParams = { - /** - * @type string | undefined - */ - api_key?: string -} + export type DeletePetHeaderParams = { + /** + * @type string | undefined + */ + api_key?: string; +}; -/** + /** * @description Invalid pet value - */ -export type DeletePet400 = any +*/ +export type DeletePet400 = any; -export type DeletePetMutationResponse = any + export type DeletePetMutationResponse = any; -export type DeletePetMutation = { - Response: DeletePetMutationResponse - PathParams: DeletePetPathParams - HeaderParams: DeletePetHeaderParams - Errors: DeletePet400 -} + export type DeletePetMutation = { + Response: DeletePetMutationResponse; + PathParams: DeletePetPathParams; + HeaderParams: DeletePetHeaderParams; + Errors: DeletePet400; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/DeleteUser.ts b/examples/react-query-v5/src/gen/models/DeleteUser.ts index 63010e04f..16327e3b1 100644 --- a/examples/react-query-v5/src/gen/models/DeleteUser.ts +++ b/examples/react-query-v5/src/gen/models/DeleteUser.ts @@ -1,25 +1,25 @@ export type DeleteUserPathParams = { - /** - * @description The name that needs to be deleted - * @type string - */ - username: string -} + /** + * @description The name that needs to be deleted + * @type string + */ + username: string; +}; -/** + /** * @description Invalid username supplied - */ -export type DeleteUser400 = any +*/ +export type DeleteUser400 = any; -/** + /** * @description User not found - */ -export type DeleteUser404 = any +*/ +export type DeleteUser404 = any; -export type DeleteUserMutationResponse = any + export type DeleteUserMutationResponse = any; -export type DeleteUserMutation = { - Response: DeleteUserMutationResponse - PathParams: DeleteUserPathParams - Errors: DeleteUser400 | DeleteUser404 -} + export type DeleteUserMutation = { + Response: DeleteUserMutationResponse; + PathParams: DeleteUserPathParams; + Errors: DeleteUser400 | DeleteUser404; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts b/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts index 504347081..0e9680607 100644 --- a/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts +++ b/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts @@ -1,37 +1,37 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -export const findPetsByStatusQueryParamsStatus = { - available: 'available', - pending: 'pending', - sold: 'sold', -} as const -export type FindPetsByStatusQueryParamsStatus = (typeof findPetsByStatusQueryParamsStatus)[keyof typeof findPetsByStatusQueryParamsStatus] + export const findPetsByStatusQueryParamsStatus = { + "available": "available", + "pending": "pending", + "sold": "sold" +} as const; +export type FindPetsByStatusQueryParamsStatus = (typeof findPetsByStatusQueryParamsStatus)[keyof typeof findPetsByStatusQueryParamsStatus]; export type FindPetsByStatusQueryParams = { - /** - * @description Status values that need to be considered for filter - * @default "available" - * @type string | undefined - */ - status?: FindPetsByStatusQueryParamsStatus -} + /** + * @description Status values that need to be considered for filter + * @default "available" + * @type string | undefined + */ + status?: FindPetsByStatusQueryParamsStatus; +}; -/** + /** * @description successful operation - */ -export type FindPetsByStatus200 = Pet[] +*/ +export type FindPetsByStatus200 = Pet[]; -/** + /** * @description Invalid status value - */ -export type FindPetsByStatus400 = any +*/ +export type FindPetsByStatus400 = any; -/** + /** * @description successful operation - */ -export type FindPetsByStatusQueryResponse = Pet[] +*/ +export type FindPetsByStatusQueryResponse = Pet[]; -export type FindPetsByStatusQuery = { - Response: FindPetsByStatusQueryResponse - QueryParams: FindPetsByStatusQueryParams - Errors: FindPetsByStatus400 -} + export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse; + QueryParams: FindPetsByStatusQueryParams; + Errors: FindPetsByStatus400; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/FindPetsByTags.ts b/examples/react-query-v5/src/gen/models/FindPetsByTags.ts index 1869b345a..6f8c1b7e6 100644 --- a/examples/react-query-v5/src/gen/models/FindPetsByTags.ts +++ b/examples/react-query-v5/src/gen/models/FindPetsByTags.ts @@ -1,40 +1,40 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -export type FindPetsByTagsQueryParams = { - /** - * @description Tags to filter by - * @type array | undefined - */ - tags?: string[] - /** - * @description to request with required page number or pagination - * @type string | undefined - */ - page?: string - /** - * @description to request with required page size - * @type string | undefined - */ - pageSize?: string -} + export type FindPetsByTagsQueryParams = { + /** + * @description Tags to filter by + * @type array | undefined + */ + tags?: string[]; + /** + * @description to request with required page number or pagination + * @type string | undefined + */ + page?: string; + /** + * @description to request with required page size + * @type string | undefined + */ + pageSize?: string; +}; -/** + /** * @description successful operation - */ -export type FindPetsByTags200 = Pet[] +*/ +export type FindPetsByTags200 = Pet[]; -/** + /** * @description Invalid tag value - */ -export type FindPetsByTags400 = any +*/ +export type FindPetsByTags400 = any; -/** + /** * @description successful operation - */ -export type FindPetsByTagsQueryResponse = Pet[] +*/ +export type FindPetsByTagsQueryResponse = Pet[]; -export type FindPetsByTagsQuery = { - Response: FindPetsByTagsQueryResponse - QueryParams: FindPetsByTagsQueryParams - Errors: FindPetsByTags400 -} + export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse; + QueryParams: FindPetsByTagsQueryParams; + Errors: FindPetsByTags400; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/GetInventory.ts b/examples/react-query-v5/src/gen/models/GetInventory.ts index ec0602416..23861c1bf 100644 --- a/examples/react-query-v5/src/gen/models/GetInventory.ts +++ b/examples/react-query-v5/src/gen/models/GetInventory.ts @@ -1,17 +1,17 @@ /** * @description successful operation - */ +*/ export type GetInventory200 = { - [key: string]: number -} + [key: string]: number; +}; -/** + /** * @description successful operation - */ +*/ export type GetInventoryQueryResponse = { - [key: string]: number -} + [key: string]: number; +}; -export type GetInventoryQuery = { - Response: GetInventoryQueryResponse -} + export type GetInventoryQuery = { + Response: GetInventoryQueryResponse; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/GetOrderById.ts b/examples/react-query-v5/src/gen/models/GetOrderById.ts index 0d25b0ee9..33831c3ae 100644 --- a/examples/react-query-v5/src/gen/models/GetOrderById.ts +++ b/examples/react-query-v5/src/gen/models/GetOrderById.ts @@ -1,35 +1,35 @@ -import type { Order } from './Order' +import type { Order } from "./Order"; -export type GetOrderByIdPathParams = { - /** - * @description ID of order that needs to be fetched - * @type integer int64 - */ - orderId: number -} + export type GetOrderByIdPathParams = { + /** + * @description ID of order that needs to be fetched + * @type integer int64 + */ + orderId: number; +}; -/** + /** * @description successful operation - */ -export type GetOrderById200 = Order +*/ +export type GetOrderById200 = Order; -/** + /** * @description Invalid ID supplied - */ -export type GetOrderById400 = any +*/ +export type GetOrderById400 = any; -/** + /** * @description Order not found - */ -export type GetOrderById404 = any +*/ +export type GetOrderById404 = any; -/** + /** * @description successful operation - */ -export type GetOrderByIdQueryResponse = Order +*/ +export type GetOrderByIdQueryResponse = Order; -export type GetOrderByIdQuery = { - Response: GetOrderByIdQueryResponse - PathParams: GetOrderByIdPathParams - Errors: GetOrderById400 | GetOrderById404 -} + export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse; + PathParams: GetOrderByIdPathParams; + Errors: GetOrderById400 | GetOrderById404; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/GetPetById.ts b/examples/react-query-v5/src/gen/models/GetPetById.ts index 437d1a7ef..2b23c27d2 100644 --- a/examples/react-query-v5/src/gen/models/GetPetById.ts +++ b/examples/react-query-v5/src/gen/models/GetPetById.ts @@ -1,35 +1,35 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -export type GetPetByIdPathParams = { - /** - * @description ID of pet to return - * @type integer int64 - */ - petId: number -} + export type GetPetByIdPathParams = { + /** + * @description ID of pet to return + * @type integer int64 + */ + petId: number; +}; -/** + /** * @description successful operation - */ -export type GetPetById200 = Pet +*/ +export type GetPetById200 = Pet; -/** + /** * @description Invalid ID supplied - */ -export type GetPetById400 = any +*/ +export type GetPetById400 = any; -/** + /** * @description Pet not found - */ -export type GetPetById404 = any +*/ +export type GetPetById404 = any; -/** + /** * @description successful operation - */ -export type GetPetByIdQueryResponse = Pet +*/ +export type GetPetByIdQueryResponse = Pet; -export type GetPetByIdQuery = { - Response: GetPetByIdQueryResponse - PathParams: GetPetByIdPathParams - Errors: GetPetById400 | GetPetById404 -} + export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse; + PathParams: GetPetByIdPathParams; + Errors: GetPetById400 | GetPetById404; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/GetUserByName.ts b/examples/react-query-v5/src/gen/models/GetUserByName.ts index c2c975229..3a27c559c 100644 --- a/examples/react-query-v5/src/gen/models/GetUserByName.ts +++ b/examples/react-query-v5/src/gen/models/GetUserByName.ts @@ -1,35 +1,35 @@ -import type { User } from './User' +import type { User } from "./User"; -export type GetUserByNamePathParams = { - /** - * @description The name that needs to be fetched. Use user1 for testing. - * @type string - */ - username: string -} + export type GetUserByNamePathParams = { + /** + * @description The name that needs to be fetched. Use user1 for testing. + * @type string + */ + username: string; +}; -/** + /** * @description successful operation - */ -export type GetUserByName200 = User +*/ +export type GetUserByName200 = User; -/** + /** * @description Invalid username supplied - */ -export type GetUserByName400 = any +*/ +export type GetUserByName400 = any; -/** + /** * @description User not found - */ -export type GetUserByName404 = any +*/ +export type GetUserByName404 = any; -/** + /** * @description successful operation - */ -export type GetUserByNameQueryResponse = User +*/ +export type GetUserByNameQueryResponse = User; -export type GetUserByNameQuery = { - Response: GetUserByNameQueryResponse - PathParams: GetUserByNamePathParams - Errors: GetUserByName400 | GetUserByName404 -} + export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse; + PathParams: GetUserByNamePathParams; + Errors: GetUserByName400 | GetUserByName404; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/LoginUser.ts b/examples/react-query-v5/src/gen/models/LoginUser.ts index 64e5db7b6..6658166a8 100644 --- a/examples/react-query-v5/src/gen/models/LoginUser.ts +++ b/examples/react-query-v5/src/gen/models/LoginUser.ts @@ -1,33 +1,33 @@ export type LoginUserQueryParams = { - /** - * @description The user name for login - * @type string | undefined - */ - username?: string - /** - * @description The password for login in clear text - * @type string | undefined - */ - password?: string -} + /** + * @description The user name for login + * @type string | undefined + */ + username?: string; + /** + * @description The password for login in clear text + * @type string | undefined + */ + password?: string; +}; -/** + /** * @description successful operation - */ -export type LoginUser200 = string +*/ +export type LoginUser200 = string; -/** + /** * @description Invalid username/password supplied - */ -export type LoginUser400 = any +*/ +export type LoginUser400 = any; -/** + /** * @description successful operation - */ -export type LoginUserQueryResponse = string +*/ +export type LoginUserQueryResponse = string; -export type LoginUserQuery = { - Response: LoginUserQueryResponse - QueryParams: LoginUserQueryParams - Errors: LoginUser400 -} + export type LoginUserQuery = { + Response: LoginUserQueryResponse; + QueryParams: LoginUserQueryParams; + Errors: LoginUser400; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/LogoutUser.ts b/examples/react-query-v5/src/gen/models/LogoutUser.ts index 521837490..a685be5fa 100644 --- a/examples/react-query-v5/src/gen/models/LogoutUser.ts +++ b/examples/react-query-v5/src/gen/models/LogoutUser.ts @@ -1,10 +1,10 @@ /** * @description successful operation - */ -export type LogoutUserError = any +*/ +export type LogoutUserError = any; -export type LogoutUserQueryResponse = any + export type LogoutUserQueryResponse = any; -export type LogoutUserQuery = { - Response: LogoutUserQueryResponse -} + export type LogoutUserQuery = { + Response: LogoutUserQueryResponse; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/Order.ts b/examples/react-query-v5/src/gen/models/Order.ts index 878fe6ba2..6f600c3f9 100644 --- a/examples/react-query-v5/src/gen/models/Order.ts +++ b/examples/react-query-v5/src/gen/models/Order.ts @@ -1,44 +1,44 @@ export const orderStatus = { - placed: 'placed', - approved: 'approved', - delivered: 'delivered', -} as const -export type OrderStatus = (typeof orderStatus)[keyof typeof orderStatus] + "placed": "placed", + "approved": "approved", + "delivered": "delivered" +} as const; +export type OrderStatus = (typeof orderStatus)[keyof typeof orderStatus]; export const orderHttpStatus = { - '200': 200, - '400': 400, - '500': 500, -} as const -export type OrderHttpStatus = (typeof orderHttpStatus)[keyof typeof orderHttpStatus] + "200": 200, + "400": 400, + "500": 500 +} as const; +export type OrderHttpStatus = (typeof orderHttpStatus)[keyof typeof orderHttpStatus]; export type Order = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type integer | undefined int64 - */ - petId?: number - /** - * @type integer | undefined int32 - */ - quantity?: number - /** - * @type string | undefined date-time - */ - shipDate?: string - /** - * @description Order Status - * @type string | undefined - */ - status?: OrderStatus - /** - * @description HTTP Status - * @type number | undefined - */ - http_status?: OrderHttpStatus - /** - * @type boolean | undefined - */ - complete?: boolean -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type integer | undefined int64 + */ + petId?: number; + /** + * @type integer | undefined int32 + */ + quantity?: number; + /** + * @type string | undefined date-time + */ + shipDate?: string; + /** + * @description Order Status + * @type string | undefined + */ + status?: OrderStatus; + /** + * @description HTTP Status + * @type number | undefined + */ + http_status?: OrderHttpStatus; + /** + * @type boolean | undefined + */ + complete?: boolean; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/Pet.ts b/examples/react-query-v5/src/gen/models/Pet.ts index 4eaf45ee1..5f7ecd2a0 100644 --- a/examples/react-query-v5/src/gen/models/Pet.ts +++ b/examples/react-query-v5/src/gen/models/Pet.ts @@ -1,33 +1,33 @@ -import type { Category } from './Category' -import type { Tag } from './Tag' +import { Category } from "./Category"; +import { Tag } from "./Tag"; -export const petStatus = { - available: 'available', - pending: 'pending', - sold: 'sold', -} as const -export type PetStatus = (typeof petStatus)[keyof typeof petStatus] + export const petStatus = { + "available": "available", + "pending": "pending", + "sold": "sold" +} as const; +export type PetStatus = (typeof petStatus)[keyof typeof petStatus]; export type Pet = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string - */ - name: string - category?: Category - /** - * @type array - */ - photoUrls: string[] - /** - * @type array | undefined - */ - tags?: Tag[] - /** - * @description pet status in the store - * @type string | undefined - */ - status?: PetStatus -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string + */ + name: string; + category?: Category; + /** + * @type array + */ + photoUrls: string[]; + /** + * @type array | undefined + */ + tags?: Tag[]; + /** + * @description pet status in the store + * @type string | undefined + */ + status?: PetStatus; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/PetNotFound.ts b/examples/react-query-v5/src/gen/models/PetNotFound.ts index 676a15893..47159c4a4 100644 --- a/examples/react-query-v5/src/gen/models/PetNotFound.ts +++ b/examples/react-query-v5/src/gen/models/PetNotFound.ts @@ -1,10 +1,10 @@ export type PetNotFound = { - /** - * @type integer | undefined int32 - */ - code?: number - /** - * @type string | undefined - */ - message?: string -} + /** + * @type integer | undefined int32 + */ + code?: number; + /** + * @type string | undefined + */ + message?: string; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/PlaceOrder.ts b/examples/react-query-v5/src/gen/models/PlaceOrder.ts index 20aa2ff08..fd29e6525 100644 --- a/examples/react-query-v5/src/gen/models/PlaceOrder.ts +++ b/examples/react-query-v5/src/gen/models/PlaceOrder.ts @@ -1,24 +1,24 @@ -import type { Order } from './Order' +import type { Order } from "./Order"; -/** + /** * @description successful operation - */ -export type PlaceOrder200 = Order +*/ +export type PlaceOrder200 = Order; -/** + /** * @description Invalid input - */ -export type PlaceOrder405 = any +*/ +export type PlaceOrder405 = any; -export type PlaceOrderMutationRequest = Order + export type PlaceOrderMutationRequest = Order; -/** + /** * @description successful operation - */ -export type PlaceOrderMutationResponse = Order +*/ +export type PlaceOrderMutationResponse = Order; -export type PlaceOrderMutation = { - Response: PlaceOrderMutationResponse - Request: PlaceOrderMutationRequest - Errors: PlaceOrder405 -} + export type PlaceOrderMutation = { + Response: PlaceOrderMutationResponse; + Request: PlaceOrderMutationRequest; + Errors: PlaceOrder405; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/PlaceOrderPatch.ts b/examples/react-query-v5/src/gen/models/PlaceOrderPatch.ts index bca3cfaad..b5f2613b8 100644 --- a/examples/react-query-v5/src/gen/models/PlaceOrderPatch.ts +++ b/examples/react-query-v5/src/gen/models/PlaceOrderPatch.ts @@ -1,24 +1,24 @@ -import type { Order } from './Order' +import type { Order } from "./Order"; -/** + /** * @description successful operation - */ -export type PlaceOrderPatch200 = Order +*/ +export type PlaceOrderPatch200 = Order; -/** + /** * @description Invalid input - */ -export type PlaceOrderPatch405 = any +*/ +export type PlaceOrderPatch405 = any; -export type PlaceOrderPatchMutationRequest = Order + export type PlaceOrderPatchMutationRequest = Order; -/** + /** * @description successful operation - */ -export type PlaceOrderPatchMutationResponse = Order +*/ +export type PlaceOrderPatchMutationResponse = Order; -export type PlaceOrderPatchMutation = { - Response: PlaceOrderPatchMutationResponse - Request: PlaceOrderPatchMutationRequest - Errors: PlaceOrderPatch405 -} + export type PlaceOrderPatchMutation = { + Response: PlaceOrderPatchMutationResponse; + Request: PlaceOrderPatchMutationRequest; + Errors: PlaceOrderPatch405; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/Tag.ts b/examples/react-query-v5/src/gen/models/Tag.ts index 5145ac12c..49a0b6cbf 100644 --- a/examples/react-query-v5/src/gen/models/Tag.ts +++ b/examples/react-query-v5/src/gen/models/Tag.ts @@ -1,10 +1,10 @@ export type Tag = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - name?: string -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + name?: string; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/UpdatePet.ts b/examples/react-query-v5/src/gen/models/UpdatePet.ts index c8d59265f..d55cd8eeb 100644 --- a/examples/react-query-v5/src/gen/models/UpdatePet.ts +++ b/examples/react-query-v5/src/gen/models/UpdatePet.ts @@ -1,37 +1,37 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -/** + /** * @description Successful operation - */ -export type UpdatePet200 = Pet +*/ +export type UpdatePet200 = Pet; -/** + /** * @description Invalid ID supplied - */ -export type UpdatePet400 = any +*/ +export type UpdatePet400 = any; -/** + /** * @description Pet not found - */ -export type UpdatePet404 = any +*/ +export type UpdatePet404 = any; -/** + /** * @description Validation exception - */ -export type UpdatePet405 = any +*/ +export type UpdatePet405 = any; -/** + /** * @description Update an existent pet in the store - */ -export type UpdatePetMutationRequest = Pet +*/ +export type UpdatePetMutationRequest = Pet; -/** + /** * @description Successful operation - */ -export type UpdatePetMutationResponse = Pet +*/ +export type UpdatePetMutationResponse = Pet; -export type UpdatePetMutation = { - Response: UpdatePetMutationResponse - Request: UpdatePetMutationRequest - Errors: UpdatePet400 | UpdatePet404 | UpdatePet405 -} + export type UpdatePetMutation = { + Response: UpdatePetMutationResponse; + Request: UpdatePetMutationRequest; + Errors: UpdatePet400 | UpdatePet404 | UpdatePet405; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/UpdatePetWithForm.ts b/examples/react-query-v5/src/gen/models/UpdatePetWithForm.ts index ada2c08ca..ef1b8fc2e 100644 --- a/examples/react-query-v5/src/gen/models/UpdatePetWithForm.ts +++ b/examples/react-query-v5/src/gen/models/UpdatePetWithForm.ts @@ -1,34 +1,34 @@ export type UpdatePetWithFormPathParams = { - /** - * @description ID of pet that needs to be updated - * @type integer int64 - */ - petId: number -} + /** + * @description ID of pet that needs to be updated + * @type integer int64 + */ + petId: number; +}; -export type UpdatePetWithFormQueryParams = { - /** - * @description Name of pet that needs to be updated - * @type string | undefined - */ - name?: string - /** - * @description Status of pet that needs to be updated - * @type string | undefined - */ - status?: string -} + export type UpdatePetWithFormQueryParams = { + /** + * @description Name of pet that needs to be updated + * @type string | undefined + */ + name?: string; + /** + * @description Status of pet that needs to be updated + * @type string | undefined + */ + status?: string; +}; -/** + /** * @description Invalid input - */ -export type UpdatePetWithForm405 = any +*/ +export type UpdatePetWithForm405 = any; -export type UpdatePetWithFormMutationResponse = any + export type UpdatePetWithFormMutationResponse = any; -export type UpdatePetWithFormMutation = { - Response: UpdatePetWithFormMutationResponse - PathParams: UpdatePetWithFormPathParams - QueryParams: UpdatePetWithFormQueryParams - Errors: UpdatePetWithForm405 -} + export type UpdatePetWithFormMutation = { + Response: UpdatePetWithFormMutationResponse; + PathParams: UpdatePetWithFormPathParams; + QueryParams: UpdatePetWithFormQueryParams; + Errors: UpdatePetWithForm405; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/UpdateUser.ts b/examples/react-query-v5/src/gen/models/UpdateUser.ts index d636efeb0..9a44548d7 100644 --- a/examples/react-query-v5/src/gen/models/UpdateUser.ts +++ b/examples/react-query-v5/src/gen/models/UpdateUser.ts @@ -1,27 +1,27 @@ -import type { User } from './User' +import { User } from "./User"; -export type UpdateUserPathParams = { - /** - * @description name that need to be deleted - * @type string - */ - username: string -} + export type UpdateUserPathParams = { + /** + * @description name that need to be deleted + * @type string + */ + username: string; +}; -/** + /** * @description successful operation - */ -export type UpdateUserError = any +*/ +export type UpdateUserError = any; -/** + /** * @description Update an existent user in the store - */ -export type UpdateUserMutationRequest = User +*/ +export type UpdateUserMutationRequest = User; -export type UpdateUserMutationResponse = any + export type UpdateUserMutationResponse = any; -export type UpdateUserMutation = { - Response: UpdateUserMutationResponse - Request: UpdateUserMutationRequest - PathParams: UpdateUserPathParams -} + export type UpdateUserMutation = { + Response: UpdateUserMutationResponse; + Request: UpdateUserMutationRequest; + PathParams: UpdateUserPathParams; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/UploadFile.ts b/examples/react-query-v5/src/gen/models/UploadFile.ts index 0c0956bea..99d23f9ba 100644 --- a/examples/react-query-v5/src/gen/models/UploadFile.ts +++ b/examples/react-query-v5/src/gen/models/UploadFile.ts @@ -1,36 +1,36 @@ -import type { ApiResponse } from './ApiResponse' +import type { ApiResponse } from "./ApiResponse"; -export type UploadFilePathParams = { - /** - * @description ID of pet to update - * @type integer int64 - */ - petId: number -} + export type UploadFilePathParams = { + /** + * @description ID of pet to update + * @type integer int64 + */ + petId: number; +}; -export type UploadFileQueryParams = { - /** - * @description Additional Metadata - * @type string | undefined - */ - additionalMetadata?: string -} + export type UploadFileQueryParams = { + /** + * @description Additional Metadata + * @type string | undefined + */ + additionalMetadata?: string; +}; -/** + /** * @description successful operation - */ -export type UploadFile200 = ApiResponse +*/ +export type UploadFile200 = ApiResponse; -export type UploadFileMutationRequest = string + export type UploadFileMutationRequest = string; -/** + /** * @description successful operation - */ -export type UploadFileMutationResponse = ApiResponse +*/ +export type UploadFileMutationResponse = ApiResponse; -export type UploadFileMutation = { - Response: UploadFileMutationResponse - Request: UploadFileMutationRequest - PathParams: UploadFilePathParams - QueryParams: UploadFileQueryParams -} + export type UploadFileMutation = { + Response: UploadFileMutationResponse; + Request: UploadFileMutationRequest; + PathParams: UploadFilePathParams; + QueryParams: UploadFileQueryParams; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/User.ts b/examples/react-query-v5/src/gen/models/User.ts index fd722d07d..6d8cc00d6 100644 --- a/examples/react-query-v5/src/gen/models/User.ts +++ b/examples/react-query-v5/src/gen/models/User.ts @@ -1,35 +1,35 @@ export type User = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - username?: string - /** - * @type string | undefined - */ - firstName?: string - /** - * @type string | undefined - */ - lastName?: string - /** - * @type string | undefined - */ - email?: string - /** - * @type string | undefined - */ - password?: string - /** - * @type string | undefined - */ - phone?: string - /** - * @description User Status - * @type integer | undefined int32 - */ - userStatus?: number -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + username?: string; + /** + * @type string | undefined + */ + firstName?: string; + /** + * @type string | undefined + */ + lastName?: string; + /** + * @type string | undefined + */ + email?: string; + /** + * @type string | undefined + */ + password?: string; + /** + * @type string | undefined + */ + phone?: string; + /** + * @description User Status + * @type integer | undefined int32 + */ + userStatus?: number; +}; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/UserArray.ts b/examples/react-query-v5/src/gen/models/UserArray.ts index effb23af2..21e14e46a 100644 --- a/examples/react-query-v5/src/gen/models/UserArray.ts +++ b/examples/react-query-v5/src/gen/models/UserArray.ts @@ -1,3 +1,3 @@ -import type { User } from './User' +import { User } from "./User"; -export type UserArray = User[] + export type UserArray = User[]; \ No newline at end of file diff --git a/examples/react-query-v5/src/gen/models/index.ts b/examples/react-query-v5/src/gen/models/index.ts index dbeb82e28..6f9cc329b 100644 --- a/examples/react-query-v5/src/gen/models/index.ts +++ b/examples/react-query-v5/src/gen/models/index.ts @@ -1,31 +1,31 @@ -export * from './AddPet' -export * from './AddPetRequest' -export * from './Address' -export * from './ApiResponse' -export * from './Category' -export * from './CreateUser' -export * from './CreateUsersWithListInput' -export * from './Customer' -export * from './DeleteOrder' -export * from './DeletePet' -export * from './DeleteUser' -export * from './FindPetsByStatus' -export * from './FindPetsByTags' -export * from './GetInventory' -export * from './GetOrderById' -export * from './GetPetById' -export * from './GetUserByName' -export * from './LoginUser' -export * from './LogoutUser' -export * from './Order' -export * from './Pet' -export * from './PetNotFound' -export * from './PlaceOrder' -export * from './PlaceOrderPatch' -export * from './Tag' -export * from './UpdatePet' -export * from './UpdatePetWithForm' -export * from './UpdateUser' -export * from './UploadFile' -export * from './User' -export * from './UserArray' +export * from "./AddPet"; +export * from "./AddPetRequest"; +export * from "./Address"; +export * from "./ApiResponse"; +export * from "./Category"; +export * from "./CreateUser"; +export * from "./CreateUsersWithListInput"; +export * from "./Customer"; +export * from "./DeleteOrder"; +export * from "./DeletePet"; +export * from "./DeleteUser"; +export * from "./FindPetsByStatus"; +export * from "./FindPetsByTags"; +export * from "./GetInventory"; +export * from "./GetOrderById"; +export * from "./GetPetById"; +export * from "./GetUserByName"; +export * from "./LoginUser"; +export * from "./LogoutUser"; +export * from "./Order"; +export * from "./Pet"; +export * from "./PetNotFound"; +export * from "./PlaceOrder"; +export * from "./PlaceOrderPatch"; +export * from "./Tag"; +export * from "./UpdatePet"; +export * from "./UpdatePetWithForm"; +export * from "./UpdateUser"; +export * from "./UploadFile"; +export * from "./User"; +export * from "./UserArray"; \ No newline at end of file diff --git a/examples/react-query/package.json b/examples/react-query/package.json index 96640474b..ea609aed5 100644 --- a/examples/react-query/package.json +++ b/examples/react-query/package.json @@ -35,8 +35,8 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@types/react": "^18.2.74", - "@types/react-dom": "^18.2.24", + "@types/react": "^18.2.77", + "@types/react-dom": "^18.2.25", "@vitejs/plugin-react": "^4.2.1", "msw": "^1.3.3", "tsup": "^8.0.2", diff --git a/examples/simple-single/src/gen/zod.ts b/examples/simple-single/src/gen/zod.ts index f80ef2065..4b9a33718 100644 --- a/examples/simple-single/src/gen/zod.ts +++ b/examples/simple-single/src/gen/zod.ts @@ -13,7 +13,11 @@ export const orderSchema = z.object({ complete: z.boolean().optional(), }) -export const customerSchema = z.object({ id: z.number().optional(), username: z.string().optional(), address: z.array(z.lazy(() => addressSchema)).optional() }) +export const customerSchema = z.object({ + id: z.number().optional(), + username: z.string().optional(), + address: z.array(z.lazy(() => addressSchema).schema).optional(), +}) export const addressSchema = z.object({ street: z.string().optional(), city: z.string().optional(), state: z.string().optional(), zip: z.string().optional() }) @@ -35,18 +39,18 @@ export const tagSchema = z.object({ id: z.number().optional(), name: z.string(). export const petSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagSchema)).optional(), + tags: z.array(z.lazy(() => tagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) export const addPetRequestSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagSchema)).optional(), + tags: z.array(z.lazy(() => tagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) @@ -54,12 +58,12 @@ export const apiResponseSchema = z.object({ code: z.number().optional(), type: z export const petNotFoundSchema = z.object({ code: z.number().optional(), message: z.string().optional() }) -export const userArraySchema = z.array(z.lazy(() => userSchema)) +export const userArraySchema = z.array(z.lazy(() => userSchema).schema) /** * @description Successful operation */ -export const updatePet200Schema = z.lazy(() => petSchema) +export const updatePet200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied @@ -79,17 +83,17 @@ export const updatePet405Schema = z.any() /** * @description Update an existent pet in the store */ -export const updatePetMutationRequestSchema = z.lazy(() => petSchema) +export const updatePetMutationRequestSchema = z.lazy(() => petSchema).schema /** * @description Successful operation */ -export const updatePetMutationResponseSchema = z.lazy(() => petSchema) +export const updatePetMutationResponseSchema = z.lazy(() => petSchema).schema /** * @description Successful operation */ -export const addPet200Schema = z.lazy(() => petSchema) +export const addPet200Schema = z.lazy(() => petSchema).schema /** * @description Pet not found @@ -99,12 +103,12 @@ export const addPet405Schema = z.object({ code: z.number().optional(), message: /** * @description Create a new pet in the store */ -export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema) +export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema).schema /** * @description Successful operation */ -export const addPetMutationResponseSchema = z.lazy(() => petSchema) +export const addPetMutationResponseSchema = z.lazy(() => petSchema).schema export const findPetsByStatusQueryParamsSchema = z .object({ status: z.enum(['available', 'pending', 'sold']).default('available').describe('Status values that need to be considered for filter').optional() }) @@ -113,7 +117,7 @@ export const findPetsByStatusQueryParamsSchema = z /** * @description successful operation */ -export const findPetsByStatus200Schema = z.array(z.lazy(() => petSchema)) +export const findPetsByStatus200Schema = z.array(z.lazy(() => petSchema).schema) /** * @description Invalid status value @@ -123,7 +127,7 @@ export const findPetsByStatus400Schema = z.any() /** * @description successful operation */ -export const findPetsByStatusQueryResponseSchema = z.array(z.lazy(() => petSchema)) +export const findPetsByStatusQueryResponseSchema = z.array(z.lazy(() => petSchema).schema) export const findPetsByTagsQueryParamsSchema = z .object({ @@ -136,7 +140,7 @@ export const findPetsByTagsQueryParamsSchema = z /** * @description successful operation */ -export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema)) +export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema).schema) /** * @description Invalid tag value @@ -146,14 +150,14 @@ export const findPetsByTags400Schema = z.any() /** * @description successful operation */ -export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema)) +export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema).schema) export const getPetByIdPathParamsSchema = z.object({ petId: z.number().describe('ID of pet to return') }) /** * @description successful operation */ -export const getPetById200Schema = z.lazy(() => petSchema) +export const getPetById200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied @@ -168,7 +172,7 @@ export const getPetById404Schema = z.any() /** * @description successful operation */ -export const getPetByIdQueryResponseSchema = z.lazy(() => petSchema) +export const getPetByIdQueryResponseSchema = z.lazy(() => petSchema).schema export const updatePetWithFormPathParamsSchema = z.object({ petId: z.number().describe('ID of pet that needs to be updated') }) @@ -204,14 +208,14 @@ export const uploadFileQueryParamsSchema = z.object({ additionalMetadata: z.stri /** * @description successful operation */ -export const uploadFile200Schema = z.lazy(() => apiResponseSchema) +export const uploadFile200Schema = z.lazy(() => apiResponseSchema).schema export const uploadFileMutationRequestSchema = z.string() /** * @description successful operation */ -export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema) +export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema).schema /** * @description successful operation @@ -226,43 +230,43 @@ export const getInventoryQueryResponseSchema = z.object({}).catchall(z.number()) /** * @description successful operation */ -export const placeOrder200Schema = z.lazy(() => orderSchema) +export const placeOrder200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid input */ export const placeOrder405Schema = z.any() -export const placeOrderMutationRequestSchema = z.lazy(() => orderSchema) +export const placeOrderMutationRequestSchema = z.lazy(() => orderSchema).schema /** * @description successful operation */ -export const placeOrderMutationResponseSchema = z.lazy(() => orderSchema) +export const placeOrderMutationResponseSchema = z.lazy(() => orderSchema).schema /** * @description successful operation */ -export const placeOrderPatch200Schema = z.lazy(() => orderSchema) +export const placeOrderPatch200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid input */ export const placeOrderPatch405Schema = z.any() -export const placeOrderPatchMutationRequestSchema = z.lazy(() => orderSchema) +export const placeOrderPatchMutationRequestSchema = z.lazy(() => orderSchema).schema /** * @description successful operation */ -export const placeOrderPatchMutationResponseSchema = z.lazy(() => orderSchema) +export const placeOrderPatchMutationResponseSchema = z.lazy(() => orderSchema).schema export const getOrderByIdPathParamsSchema = z.object({ orderId: z.number().describe('ID of order that needs to be fetched') }) /** * @description successful operation */ -export const getOrderById200Schema = z.lazy(() => orderSchema) +export const getOrderById200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid ID supplied @@ -277,7 +281,7 @@ export const getOrderById404Schema = z.any() /** * @description successful operation */ -export const getOrderByIdQueryResponseSchema = z.lazy(() => orderSchema) +export const getOrderByIdQueryResponseSchema = z.lazy(() => orderSchema).schema export const deleteOrderPathParamsSchema = z.object({ orderId: z.number().describe('ID of the order that needs to be deleted') }) @@ -296,31 +300,31 @@ export const deleteOrderMutationResponseSchema = z.any() /** * @description successful operation */ -export const createUserErrorSchema = z.lazy(() => userSchema) +export const createUserErrorSchema = z.lazy(() => userSchema).schema /** * @description Created user object */ -export const createUserMutationRequestSchema = z.lazy(() => userSchema) +export const createUserMutationRequestSchema = z.lazy(() => userSchema).schema export const createUserMutationResponseSchema = z.any() /** * @description Successful operation */ -export const createUsersWithListInput200Schema = z.lazy(() => userSchema) +export const createUsersWithListInput200Schema = z.lazy(() => userSchema).schema /** * @description successful operation */ export const createUsersWithListInputErrorSchema = z.any() -export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema)) +export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema).schema) /** * @description Successful operation */ -export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema) +export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema).schema export const loginUserQueryParamsSchema = z .object({ @@ -356,7 +360,7 @@ export const getUserByNamePathParamsSchema = z.object({ username: z.string().des /** * @description successful operation */ -export const getUserByName200Schema = z.lazy(() => userSchema) +export const getUserByName200Schema = z.lazy(() => userSchema).schema /** * @description Invalid username supplied @@ -371,7 +375,7 @@ export const getUserByName404Schema = z.any() /** * @description successful operation */ -export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema) +export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema).schema export const updateUserPathParamsSchema = z.object({ username: z.string().describe('name that need to be deleted') }) @@ -383,7 +387,7 @@ export const updateUserErrorSchema = z.any() /** * @description Update an existent user in the store */ -export const updateUserMutationRequestSchema = z.lazy(() => userSchema) +export const updateUserMutationRequestSchema = z.lazy(() => userSchema).schema export const updateUserMutationResponseSchema = z.any() diff --git a/examples/simple-single/src/gen2/index.ts b/examples/simple-single/src/gen2/index.ts index 41c858b4d..79db5d14e 100644 --- a/examples/simple-single/src/gen2/index.ts +++ b/examples/simple-single/src/gen2/index.ts @@ -3,7 +3,7 @@ import { z } from 'zod' export const appSchema = z.object({ id: z.string().optional(), name: z.string().optional(), - organization: z.lazy(() => organizationSchema).optional(), + organization: z.lazy(() => organizationSchema).schema.optional(), status: z.string().optional(), }) @@ -26,7 +26,7 @@ export const createLeaseRequestSchema = z.object({ description: z.string().optio export const createMachineRequestSchema = z.object({ config: z .lazy(() => flyMachineConfigSchema) - .describe('An object defining the Machine configuration') + .schema.describe('An object defining the Machine configuration') .optional(), lease_ttl: z.number().optional(), lsvd: z.boolean().optional(), @@ -42,7 +42,7 @@ export const createMachineRequestSchema = z.object({ export const createOidcTokenRequestSchema = z.object({ aud: z.string().optional() }) export const createVolumeRequestSchema = z.object({ - compute: z.lazy(() => flyMachineGuestSchema).optional(), + compute: z.lazy(() => flyMachineGuestSchema).schema.optional(), compute_image: z.string().optional(), encrypted: z.boolean().optional(), fstype: z.string().optional(), @@ -59,12 +59,12 @@ export const createVolumeRequestSchema = z.object({ export const errorResponseSchema = z.object({ details: z.object({}).describe('Deprecated').optional(), error: z.string().optional(), - status: z.lazy(() => mainStatusCodeSchema).optional(), + status: z.lazy(() => mainStatusCodeSchema).schema.optional(), }) export const extendVolumeRequestSchema = z.object({ size_gb: z.number().optional() }) -export const extendVolumeResponseSchema = z.object({ needs_restart: z.boolean().optional(), volume: z.lazy(() => volumeSchema).optional() }) +export const extendVolumeResponseSchema = z.object({ needs_restart: z.boolean().optional(), volume: z.lazy(() => volumeSchema).schema.optional() }) export const imageRefSchema = z.object({ digest: z.string().optional(), @@ -89,17 +89,17 @@ export const listAppSchema = z.object({ network: z.object({}).optional(), }) -export const listAppsResponseSchema = z.object({ apps: z.array(z.lazy(() => listAppSchema)).optional(), total_apps: z.number().optional() }) +export const listAppsResponseSchema = z.object({ apps: z.array(z.lazy(() => listAppSchema).schema).optional(), total_apps: z.number().optional() }) export const listenSocketSchema = z.object({ address: z.string().optional(), proto: z.string().optional() }) export const machineSchema = z.object({ - checks: z.array(z.lazy(() => checkStatusSchema)).optional(), - config: z.lazy(() => flyMachineConfigSchema).optional(), + checks: z.array(z.lazy(() => checkStatusSchema).schema).optional(), + config: z.lazy(() => flyMachineConfigSchema).schema.optional(), created_at: z.string().optional(), - events: z.array(z.lazy(() => machineEventSchema)).optional(), + events: z.array(z.lazy(() => machineEventSchema).schema).optional(), id: z.string().optional(), - image_ref: z.lazy(() => imageRefSchema).optional(), + image_ref: z.lazy(() => imageRefSchema).schema.optional(), instance_id: z.string().describe('InstanceID is unique for each version of the machine').optional(), name: z.string().optional(), nonce: z.string().describe('Nonce is only every returned on machine creation if a lease_duration was provided.').optional(), @@ -124,7 +124,7 @@ export const machineExecRequestSchema = z.object({ timeout: z.number().optional(), }) -export const machineVersionSchema = z.object({ user_config: z.lazy(() => flyMachineConfigSchema).optional(), version: z.string().optional() }) +export const machineVersionSchema = z.object({ user_config: z.lazy(() => flyMachineConfigSchema).schema.optional(), version: z.string().optional() }) export const organizationSchema = z.object({ name: z.string().optional(), slug: z.string().optional() }) @@ -132,7 +132,7 @@ export const processStatSchema = z.object({ command: z.string().optional(), cpu: z.number().optional(), directory: z.string().optional(), - listen_sockets: z.array(z.lazy(() => listenSocketSchema)).optional(), + listen_sockets: z.array(z.lazy(() => listenSocketSchema).schema).optional(), pid: z.number().optional(), rss: z.number().optional(), rtime: z.number().optional(), @@ -145,12 +145,12 @@ export const signalRequestSchema = z.object({ .optional(), }) -export const stopRequestSchema = z.object({ signal: z.string().optional(), timeout: z.lazy(() => flyDurationSchema).optional() }) +export const stopRequestSchema = z.object({ signal: z.string().optional(), timeout: z.lazy(() => flyDurationSchema).schema.optional() }) export const updateMachineRequestSchema = z.object({ config: z .lazy(() => flyMachineConfigSchema) - .describe('An object defining the Machine configuration') + .schema.describe('An object defining the Machine configuration') .optional(), current_version: z.string().optional(), lease_ttl: z.number().optional(), @@ -195,9 +195,9 @@ export const volumeSnapshotSchema = z.object({ }) export const flyDnsConfigSchema = z.object({ - dns_forward_rules: z.array(z.lazy(() => flyDnsForwardRuleSchema)).optional(), + dns_forward_rules: z.array(z.lazy(() => flyDnsForwardRuleSchema).schema).optional(), nameservers: z.array(z.string()).optional(), - options: z.array(z.lazy(() => flyDnsOptionSchema)).optional(), + options: z.array(z.lazy(() => flyDnsOptionSchema).schema).optional(), searches: z.array(z.string()).optional(), skip_registration: z.boolean().optional(), }) @@ -233,7 +233,7 @@ export const flyFileSchema = z export const flyHttpOptionsSchema = z.object({ compress: z.boolean().optional(), h2_backend: z.boolean().optional(), - response: z.lazy(() => flyHttpResponseOptionsSchema).optional(), + response: z.lazy(() => flyHttpResponseOptionsSchema).schema.optional(), }) export const flyHttpResponseOptionsSchema = z.object({ headers: z.object({}).catchall(z.object({})).optional() }) @@ -242,12 +242,12 @@ export const flyMachineCheckSchema = z .object({ grace_period: z .lazy(() => flyDurationSchema) - .describe('The time to wait after a VM starts before checking its health') + .schema.describe('The time to wait after a VM starts before checking its health') .optional(), - headers: z.array(z.lazy(() => flyMachineHttpHeaderSchema)).optional(), + headers: z.array(z.lazy(() => flyMachineHttpHeaderSchema).schema).optional(), interval: z .lazy(() => flyDurationSchema) - .describe('The time between connectivity checks') + .schema.describe('The time between connectivity checks') .optional(), method: z.string().describe('For http checks, the HTTP method to use to when making the request').optional(), path: z.string().describe('For http checks, the path to send the request to').optional(), @@ -255,7 +255,7 @@ export const flyMachineCheckSchema = z protocol: z.string().describe('For http checks, whether to use http or https').optional(), timeout: z .lazy(() => flyDurationSchema) - .describe('The maximum time a connection can take before being reported as failing its health check') + .schema.describe('The maximum time a connection can take before being reported as failing its health check') .optional(), tls_server_name: z.string().describe('If the protocol is https, the hostname to use for TLS certificate validation').optional(), tls_skip_verify: z.boolean().describe('For http checks with https protocol, whether or not to verify the TLS certificate').optional(), @@ -267,29 +267,29 @@ export const flyMachineConfigSchema = z.object({ auto_destroy: z.boolean().describe('Optional boolean telling the Machine to destroy itself once it\u2019s complete (default false)').optional(), checks: z .object({}) - .catchall(z.lazy(() => flyMachineCheckSchema)) + .catchall(z.lazy(() => flyMachineCheckSchema).schema) .optional(), disable_machine_autostart: z.boolean().describe('Deprecated: use Service.Autostart instead').optional(), - dns: z.lazy(() => flyDnsConfigSchema).optional(), + dns: z.lazy(() => flyDnsConfigSchema).schema.optional(), env: z.object({}).catchall(z.string()).describe('An object filled with key/value pairs to be set as environment variables').optional(), - files: z.array(z.lazy(() => flyFileSchema)).optional(), - guest: z.lazy(() => flyMachineGuestSchema).optional(), + files: z.array(z.lazy(() => flyFileSchema).schema).optional(), + guest: z.lazy(() => flyMachineGuestSchema).schema.optional(), image: z.string().describe('The docker image to run').optional(), - init: z.lazy(() => flyMachineInitSchema).optional(), + init: z.lazy(() => flyMachineInitSchema).schema.optional(), metadata: z.object({}).catchall(z.string()).optional(), - metrics: z.lazy(() => flyMachineMetricsSchema).optional(), - mounts: z.array(z.lazy(() => flyMachineMountSchema)).optional(), - processes: z.array(z.lazy(() => flyMachineProcessSchema)).optional(), - restart: z.lazy(() => flyMachineRestartSchema).optional(), + metrics: z.lazy(() => flyMachineMetricsSchema).schema.optional(), + mounts: z.array(z.lazy(() => flyMachineMountSchema).schema).optional(), + processes: z.array(z.lazy(() => flyMachineProcessSchema).schema).optional(), + restart: z.lazy(() => flyMachineRestartSchema).schema.optional(), schedule: z.string().optional(), - services: z.array(z.lazy(() => flyMachineServiceSchema)).optional(), + services: z.array(z.lazy(() => flyMachineServiceSchema).schema).optional(), size: z.string().describe('Deprecated: use Guest instead').optional(), standbys: z .array(z.string()) .describe('Standbys enable a machine to be a standby for another. In the event of a hardware failure,\nthe standby machine will be started.') .optional(), - statics: z.array(z.lazy(() => flyStaticSchema)).optional(), - stop_config: z.lazy(() => flyStopConfigSchema).optional(), + statics: z.array(z.lazy(() => flyStaticSchema).schema).optional(), + stop_config: z.lazy(() => flyStopConfigSchema).schema.optional(), }) export const flyMachineGuestSchema = z.object({ @@ -334,11 +334,11 @@ export const flyMachinePortSchema = z.object({ end_port: z.number().optional(), force_https: z.boolean().optional(), handlers: z.array(z.string()).optional(), - http_options: z.lazy(() => flyHttpOptionsSchema).optional(), + http_options: z.lazy(() => flyHttpOptionsSchema).schema.optional(), port: z.number().optional(), - proxy_proto_options: z.lazy(() => flyProxyProtoOptionsSchema).optional(), + proxy_proto_options: z.lazy(() => flyProxyProtoOptionsSchema).schema.optional(), start_port: z.number().optional(), - tls_options: z.lazy(() => flyTlsOptionsSchema).optional(), + tls_options: z.lazy(() => flyTlsOptionsSchema).schema.optional(), }) export const flyMachineProcessSchema = z.object({ @@ -346,7 +346,7 @@ export const flyMachineProcessSchema = z.object({ entrypoint: z.array(z.string()).optional(), env: z.object({}).catchall(z.string()).optional(), env_from: z - .array(z.lazy(() => flyEnvFromSchema)) + .array(z.lazy(() => flyEnvFromSchema).schema) .describe('EnvFrom can be provided to set environment variables from machine fields.') .optional(), exec: z.array(z.string()).optional(), @@ -357,7 +357,7 @@ export const flyMachineProcessSchema = z.object({ ) .optional(), secrets: z - .array(z.lazy(() => flyMachineSecretSchema)) + .array(z.lazy(() => flyMachineSecretSchema).schema) .describe( 'Secrets can be provided at the process level to explicitly indicate which secrets should be\nused for the process. If not provided, the secrets provided at the machine level will be used.', ) @@ -400,13 +400,13 @@ export const flyMachineSecretSchema = z export const flyMachineServiceSchema = z.object({ autostart: z.boolean().optional(), autostop: z.boolean().optional(), - checks: z.array(z.lazy(() => flyMachineCheckSchema)).optional(), - concurrency: z.lazy(() => flyMachineServiceConcurrencySchema).optional(), + checks: z.array(z.lazy(() => flyMachineCheckSchema).schema).optional(), + concurrency: z.lazy(() => flyMachineServiceConcurrencySchema).schema.optional(), force_instance_description: z.string().optional(), force_instance_key: z.string().optional(), internal_port: z.number().optional(), min_machines_running: z.number().optional(), - ports: z.array(z.lazy(() => flyMachinePortSchema)).optional(), + ports: z.array(z.lazy(() => flyMachinePortSchema).schema).optional(), protocol: z.string().optional(), }) @@ -420,7 +420,7 @@ export const flyProxyProtoOptionsSchema = z.object({ version: z.string().optiona export const flyStaticSchema = z.object({ guest_path: z.string(), tigris_bucket: z.string().optional(), url_prefix: z.string() }) -export const flyStopConfigSchema = z.object({ signal: z.string().optional(), timeout: z.lazy(() => flyDurationSchema).optional() }) +export const flyStopConfigSchema = z.object({ signal: z.string().optional(), timeout: z.lazy(() => flyDurationSchema).schema.optional() }) export const flyTlsOptionsSchema = z.object({ alpn: z.array(z.string()).optional(), @@ -439,12 +439,12 @@ export const appsListQueryParamsSchema = z.object({ org_slug: z.string().describ /** * @description OK */ -export const appsList200Schema = z.lazy(() => listAppsResponseSchema) +export const appsList200Schema = z.lazy(() => listAppsResponseSchema).schema /** * @description OK */ -export const appsListQueryResponseSchema = z.lazy(() => listAppsResponseSchema) +export const appsListQueryResponseSchema = z.lazy(() => listAppsResponseSchema).schema /** * @description Created @@ -454,12 +454,12 @@ export const appsCreate201Schema = z.any() /** * @description Bad Request */ -export const appsCreate400Schema = z.lazy(() => errorResponseSchema) +export const appsCreate400Schema = z.lazy(() => errorResponseSchema).schema /** * @description App body */ -export const appsCreateMutationRequestSchema = z.lazy(() => createAppRequestSchema) +export const appsCreateMutationRequestSchema = z.lazy(() => createAppRequestSchema).schema export const appsCreateMutationResponseSchema = z.any() @@ -468,12 +468,12 @@ export const appsShowPathParamsSchema = z.object({ app_name: z.string().describe /** * @description OK */ -export const appsShow200Schema = z.lazy(() => appSchema) +export const appsShow200Schema = z.lazy(() => appSchema).schema /** * @description OK */ -export const appsShowQueryResponseSchema = z.lazy(() => appSchema) +export const appsShowQueryResponseSchema = z.lazy(() => appSchema).schema export const appsDeletePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name') }) @@ -493,63 +493,63 @@ export const machinesListQueryParamsSchema = z /** * @description OK */ -export const machinesList200Schema = z.array(z.lazy(() => machineSchema)) +export const machinesList200Schema = z.array(z.lazy(() => machineSchema).schema) /** * @description OK */ -export const machinesListQueryResponseSchema = z.array(z.lazy(() => machineSchema)) +export const machinesListQueryResponseSchema = z.array(z.lazy(() => machineSchema).schema) export const machinesCreatePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name') }) /** * @description OK */ -export const machinesCreate200Schema = z.lazy(() => machineSchema) +export const machinesCreate200Schema = z.lazy(() => machineSchema).schema /** * @description Create machine request */ -export const machinesCreateMutationRequestSchema = z.lazy(() => createMachineRequestSchema) +export const machinesCreateMutationRequestSchema = z.lazy(() => createMachineRequestSchema).schema /** * @description OK */ -export const machinesCreateMutationResponseSchema = z.lazy(() => machineSchema) +export const machinesCreateMutationResponseSchema = z.lazy(() => machineSchema).schema export const machinesShowPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) /** * @description OK */ -export const machinesShow200Schema = z.lazy(() => machineSchema) +export const machinesShow200Schema = z.lazy(() => machineSchema).schema /** * @description OK */ -export const machinesShowQueryResponseSchema = z.lazy(() => machineSchema) +export const machinesShowQueryResponseSchema = z.lazy(() => machineSchema).schema export const machinesUpdatePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) /** * @description OK */ -export const machinesUpdate200Schema = z.lazy(() => machineSchema) +export const machinesUpdate200Schema = z.lazy(() => machineSchema).schema /** * @description Bad Request */ -export const machinesUpdate400Schema = z.lazy(() => errorResponseSchema) +export const machinesUpdate400Schema = z.lazy(() => errorResponseSchema).schema /** * @description Request body */ -export const machinesUpdateMutationRequestSchema = z.lazy(() => updateMachineRequestSchema) +export const machinesUpdateMutationRequestSchema = z.lazy(() => updateMachineRequestSchema).schema /** * @description OK */ -export const machinesUpdateMutationResponseSchema = z.lazy(() => machineSchema) +export const machinesUpdateMutationResponseSchema = z.lazy(() => machineSchema).schema export const machinesDeletePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) @@ -576,12 +576,12 @@ export const machinesListEventsPathParamsSchema = z.object({ app_name: z.string( /** * @description OK */ -export const machinesListEvents200Schema = z.array(z.lazy(() => machineEventSchema)) +export const machinesListEvents200Schema = z.array(z.lazy(() => machineEventSchema).schema) /** * @description OK */ -export const machinesListEventsQueryResponseSchema = z.array(z.lazy(() => machineEventSchema)) +export const machinesListEventsQueryResponseSchema = z.array(z.lazy(() => machineEventSchema).schema) export const machinesExecPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) @@ -593,12 +593,12 @@ export const machinesExec200Schema = z.string() /** * @description Bad Request */ -export const machinesExec400Schema = z.lazy(() => errorResponseSchema) +export const machinesExec400Schema = z.lazy(() => errorResponseSchema).schema /** * @description Request body */ -export const machinesExecMutationRequestSchema = z.lazy(() => machineExecRequestSchema) +export const machinesExecMutationRequestSchema = z.lazy(() => machineExecRequestSchema).schema /** * @description Raw command output bytes are written back @@ -610,12 +610,12 @@ export const machinesShowLeasePathParamsSchema = z.object({ app_name: z.string() /** * @description OK */ -export const machinesShowLease200Schema = z.lazy(() => leaseSchema) +export const machinesShowLease200Schema = z.lazy(() => leaseSchema).schema /** * @description OK */ -export const machinesShowLeaseQueryResponseSchema = z.lazy(() => leaseSchema) +export const machinesShowLeaseQueryResponseSchema = z.lazy(() => leaseSchema).schema export const machinesCreateLeasePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) @@ -626,17 +626,17 @@ export const machinesCreateLeaseHeaderParamsSchema = z /** * @description OK */ -export const machinesCreateLease200Schema = z.lazy(() => leaseSchema) +export const machinesCreateLease200Schema = z.lazy(() => leaseSchema).schema /** * @description Request body */ -export const machinesCreateLeaseMutationRequestSchema = z.lazy(() => createLeaseRequestSchema) +export const machinesCreateLeaseMutationRequestSchema = z.lazy(() => createLeaseRequestSchema).schema /** * @description OK */ -export const machinesCreateLeaseMutationResponseSchema = z.lazy(() => leaseSchema) +export const machinesCreateLeaseMutationResponseSchema = z.lazy(() => leaseSchema).schema export const machinesReleaseLeasePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) @@ -675,7 +675,7 @@ export const machinesUpdateMetadata204Schema = z.any() /** * @description Bad Request */ -export const machinesUpdateMetadata400Schema = z.lazy(() => errorResponseSchema) +export const machinesUpdateMetadata400Schema = z.lazy(() => errorResponseSchema).schema export const machinesUpdateMetadataMutationResponseSchema = z.any() @@ -701,17 +701,17 @@ export const machinesListProcessesQueryParamsSchema = z /** * @description OK */ -export const machinesListProcesses200Schema = z.array(z.lazy(() => processStatSchema)) +export const machinesListProcesses200Schema = z.array(z.lazy(() => processStatSchema).schema) /** * @description Bad Request */ -export const machinesListProcesses400Schema = z.lazy(() => errorResponseSchema) +export const machinesListProcesses400Schema = z.lazy(() => errorResponseSchema).schema /** * @description OK */ -export const machinesListProcessesQueryResponseSchema = z.array(z.lazy(() => processStatSchema)) +export const machinesListProcessesQueryResponseSchema = z.array(z.lazy(() => processStatSchema).schema) export const machinesRestartPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) @@ -727,7 +727,7 @@ export const machinesRestart200Schema = z.any() /** * @description Bad Request */ -export const machinesRestart400Schema = z.lazy(() => errorResponseSchema) +export const machinesRestart400Schema = z.lazy(() => errorResponseSchema).schema export const machinesRestartMutationResponseSchema = z.any() @@ -741,12 +741,12 @@ export const machinesSignal200Schema = z.any() /** * @description Bad Request */ -export const machinesSignal400Schema = z.lazy(() => errorResponseSchema) +export const machinesSignal400Schema = z.lazy(() => errorResponseSchema).schema /** * @description Request body */ -export const machinesSignalMutationRequestSchema = z.lazy(() => signalRequestSchema) +export const machinesSignalMutationRequestSchema = z.lazy(() => signalRequestSchema).schema export const machinesSignalMutationResponseSchema = z.any() @@ -769,12 +769,12 @@ export const machinesStop200Schema = z.any() /** * @description Bad Request */ -export const machinesStop400Schema = z.lazy(() => errorResponseSchema) +export const machinesStop400Schema = z.lazy(() => errorResponseSchema).schema /** * @description Optional request body */ -export const machinesStopMutationRequestSchema = z.lazy(() => stopRequestSchema) +export const machinesStopMutationRequestSchema = z.lazy(() => stopRequestSchema).schema export const machinesStopMutationResponseSchema = z.any() @@ -792,12 +792,12 @@ export const machinesListVersionsPathParamsSchema = z.object({ app_name: z.strin /** * @description OK */ -export const machinesListVersions200Schema = z.array(z.lazy(() => machineVersionSchema)) +export const machinesListVersions200Schema = z.array(z.lazy(() => machineVersionSchema).schema) /** * @description OK */ -export const machinesListVersionsQueryResponseSchema = z.array(z.lazy(() => machineVersionSchema)) +export const machinesListVersionsQueryResponseSchema = z.array(z.lazy(() => machineVersionSchema).schema) export const machinesWaitPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), machine_id: z.string().describe('Machine ID') }) @@ -817,7 +817,7 @@ export const machinesWait200Schema = z.any() /** * @description Bad Request */ -export const machinesWait400Schema = z.lazy(() => errorResponseSchema) +export const machinesWait400Schema = z.lazy(() => errorResponseSchema).schema export const machinesWaitQueryResponseSchema = z.any() @@ -826,104 +826,104 @@ export const volumesListPathParamsSchema = z.object({ app_name: z.string().descr /** * @description OK */ -export const volumesList200Schema = z.array(z.lazy(() => volumeSchema)) +export const volumesList200Schema = z.array(z.lazy(() => volumeSchema).schema) /** * @description OK */ -export const volumesListQueryResponseSchema = z.array(z.lazy(() => volumeSchema)) +export const volumesListQueryResponseSchema = z.array(z.lazy(() => volumeSchema).schema) export const volumesCreatePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name') }) /** * @description OK */ -export const volumesCreate200Schema = z.lazy(() => volumeSchema) +export const volumesCreate200Schema = z.lazy(() => volumeSchema).schema /** * @description Request body */ -export const volumesCreateMutationRequestSchema = z.lazy(() => createVolumeRequestSchema) +export const volumesCreateMutationRequestSchema = z.lazy(() => createVolumeRequestSchema).schema /** * @description OK */ -export const volumesCreateMutationResponseSchema = z.lazy(() => volumeSchema) +export const volumesCreateMutationResponseSchema = z.lazy(() => volumeSchema).schema export const volumesGetByIdPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), volume_id: z.string().describe('Volume ID') }) /** * @description OK */ -export const volumesGetById200Schema = z.lazy(() => volumeSchema) +export const volumesGetById200Schema = z.lazy(() => volumeSchema).schema /** * @description OK */ -export const volumesGetByIdQueryResponseSchema = z.lazy(() => volumeSchema) +export const volumesGetByIdQueryResponseSchema = z.lazy(() => volumeSchema).schema export const volumesUpdatePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), volume_id: z.string().describe('Volume ID') }) /** * @description OK */ -export const volumesUpdate200Schema = z.lazy(() => volumeSchema) +export const volumesUpdate200Schema = z.lazy(() => volumeSchema).schema /** * @description Bad Request */ -export const volumesUpdate400Schema = z.lazy(() => errorResponseSchema) +export const volumesUpdate400Schema = z.lazy(() => errorResponseSchema).schema /** * @description Request body */ -export const volumesUpdateMutationRequestSchema = z.lazy(() => updateVolumeRequestSchema) +export const volumesUpdateMutationRequestSchema = z.lazy(() => updateVolumeRequestSchema).schema /** * @description OK */ -export const volumesUpdateMutationResponseSchema = z.lazy(() => volumeSchema) +export const volumesUpdateMutationResponseSchema = z.lazy(() => volumeSchema).schema export const volumeDeletePathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), volume_id: z.string().describe('Volume ID') }) /** * @description OK */ -export const volumeDelete200Schema = z.lazy(() => volumeSchema) +export const volumeDelete200Schema = z.lazy(() => volumeSchema).schema /** * @description OK */ -export const volumeDeleteMutationResponseSchema = z.lazy(() => volumeSchema) +export const volumeDeleteMutationResponseSchema = z.lazy(() => volumeSchema).schema export const volumesExtendPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), volume_id: z.string().describe('Volume ID') }) /** * @description OK */ -export const volumesExtend200Schema = z.lazy(() => extendVolumeResponseSchema) +export const volumesExtend200Schema = z.lazy(() => extendVolumeResponseSchema).schema /** * @description Request body */ -export const volumesExtendMutationRequestSchema = z.lazy(() => extendVolumeRequestSchema) +export const volumesExtendMutationRequestSchema = z.lazy(() => extendVolumeRequestSchema).schema /** * @description OK */ -export const volumesExtendMutationResponseSchema = z.lazy(() => extendVolumeResponseSchema) +export const volumesExtendMutationResponseSchema = z.lazy(() => extendVolumeResponseSchema).schema export const volumesListSnapshotsPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), volume_id: z.string().describe('Volume ID') }) /** * @description OK */ -export const volumesListSnapshots200Schema = z.array(z.lazy(() => volumeSnapshotSchema)) +export const volumesListSnapshots200Schema = z.array(z.lazy(() => volumeSnapshotSchema).schema) /** * @description OK */ -export const volumesListSnapshotsQueryResponseSchema = z.array(z.lazy(() => volumeSnapshotSchema)) +export const volumesListSnapshotsQueryResponseSchema = z.array(z.lazy(() => volumeSnapshotSchema).schema) export const createVolumeSnapshotPathParamsSchema = z.object({ app_name: z.string().describe('Fly App Name'), volume_id: z.string().describe('Volume ID') }) @@ -942,7 +942,7 @@ export const machinesGetOidcToken200Schema = z.string() /** * @description Request body */ -export const machinesGetOidcTokenMutationRequestSchema = z.lazy(() => createOidcTokenRequestSchema) +export const machinesGetOidcTokenMutationRequestSchema = z.lazy(() => createOidcTokenRequestSchema).schema /** * @description JWT token diff --git a/examples/solid-query/package.json b/examples/solid-query/package.json index 13ac6c7e7..a47570e4d 100644 --- a/examples/solid-query/package.json +++ b/examples/solid-query/package.json @@ -33,7 +33,7 @@ "tsup": "^8.0.2" }, "devDependencies": { - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/svelte-query/package.json b/examples/svelte-query/package.json index 1a4dd3b58..70407e8b6 100644 --- a/examples/svelte-query/package.json +++ b/examples/svelte-query/package.json @@ -33,7 +33,7 @@ "tsup": "^8.0.2" }, "devDependencies": { - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/typescript/package.json b/examples/typescript/package.json index 4f8f98706..29e13b368 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -28,7 +28,7 @@ "tsup": "^8.0.2" }, "devDependencies": { - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/vue-query-v5/src/gen/hooks/index.ts b/examples/vue-query-v5/src/gen/hooks/index.ts index 17d307880..2770566c1 100644 --- a/examples/vue-query-v5/src/gen/hooks/index.ts +++ b/examples/vue-query-v5/src/gen/hooks/index.ts @@ -1,19 +1,19 @@ -export * from './useAddPet' -export * from './useCreateUser' -export * from './useCreateUsersWithListInput' -export * from './useDeleteOrder' -export * from './useDeletePet' -export * from './useDeleteUser' -export * from './useFindPetsByStatus' -export * from './useFindPetsByTags' -export * from './useGetInventory' -export * from './useGetOrderById' -export * from './useGetPetById' -export * from './useGetUserByName' -export * from './useLoginUser' -export * from './useLogoutUser' -export * from './usePlaceOrder' -export * from './useUpdatePet' -export * from './useUpdatePetWithForm' -export * from './useUpdateUser' -export * from './useUploadFile' +export * from "./useAddPet"; +export * from "./useCreateUser"; +export * from "./useCreateUsersWithListInput"; +export * from "./useDeleteOrder"; +export * from "./useDeletePet"; +export * from "./useDeleteUser"; +export * from "./useFindPetsByStatus"; +export * from "./useFindPetsByTags"; +export * from "./useGetInventory"; +export * from "./useGetOrderById"; +export * from "./useGetPetById"; +export * from "./useGetUserByName"; +export * from "./useLoginUser"; +export * from "./useLogoutUser"; +export * from "./usePlaceOrder"; +export * from "./useUpdatePet"; +export * from "./useUpdatePetWithForm"; +export * from "./useUpdateUser"; +export * from "./useUploadFile"; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useAddPet.ts b/examples/vue-query-v5/src/gen/hooks/useAddPet.ts index dde9979fc..1b78e7562 100644 --- a/examples/vue-query-v5/src/gen/hooks/useAddPet.ts +++ b/examples/vue-query-v5/src/gen/hooks/useAddPet.ts @@ -1,44 +1,42 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import type { AddPet405, AddPetMutationRequest, AddPetMutationResponse } from '../models/AddPet' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from "../models/AddPet"; +import type { UseMutationOptions } from "@tanstack/vue-query"; -type AddPetClient = typeof client + type AddPetClient = typeof client; type AddPet = { - data: AddPetMutationResponse - error: AddPet405 - request: AddPetMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: AddPetMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: AddPetMutationResponse; + error: AddPet405; + request: AddPetMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: AddPetMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Add a new pet to the store * @summary Add a new pet to the store * @link /pet */ -export function useAddPet( - options: { - mutation?: UseMutationOptions - client?: AddPet['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/pet', - data, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useAddPet(options: { + mutation?: UseMutationOptions; + client?: AddPet["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/pet`, + data, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useCreateUser.ts b/examples/vue-query-v5/src/gen/hooks/useCreateUser.ts index c8d1efd86..9d16fab34 100644 --- a/examples/vue-query-v5/src/gen/hooks/useCreateUser.ts +++ b/examples/vue-query-v5/src/gen/hooks/useCreateUser.ts @@ -1,44 +1,42 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../models/CreateUser' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import type { CreateUserMutationRequest, CreateUserMutationResponse } from "../models/CreateUser"; +import type { UseMutationOptions } from "@tanstack/vue-query"; -type CreateUserClient = typeof client + type CreateUserClient = typeof client; type CreateUser = { - data: CreateUserMutationResponse - error: never - request: CreateUserMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: CreateUserMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: CreateUserMutationResponse; + error: never; + request: CreateUserMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: CreateUserMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description This can only be done by the logged in user. * @summary Create user * @link /user */ -export function useCreateUser( - options: { - mutation?: UseMutationOptions - client?: CreateUser['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/user', - data, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useCreateUser(options: { + mutation?: UseMutationOptions; + client?: CreateUser["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/user`, + data, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useCreateUsersWithListInput.ts b/examples/vue-query-v5/src/gen/hooks/useCreateUsersWithListInput.ts index 3edc4a624..7191323ae 100644 --- a/examples/vue-query-v5/src/gen/hooks/useCreateUsersWithListInput.ts +++ b/examples/vue-query-v5/src/gen/hooks/useCreateUsersWithListInput.ts @@ -1,44 +1,42 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputMutationResponse } from '../models/CreateUsersWithListInput' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputMutationResponse } from "../models/CreateUsersWithListInput"; +import type { UseMutationOptions } from "@tanstack/vue-query"; -type CreateUsersWithListInputClient = typeof client + type CreateUsersWithListInputClient = typeof client; type CreateUsersWithListInput = { - data: CreateUsersWithListInputMutationResponse - error: never - request: CreateUsersWithListInputMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: CreateUsersWithListInputMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: CreateUsersWithListInputMutationResponse; + error: never; + request: CreateUsersWithListInputMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: CreateUsersWithListInputMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Creates list of users with given input array * @summary Creates list of users with given input array * @link /user/createWithList */ -export function useCreateUsersWithListInput( - options: { - mutation?: UseMutationOptions - client?: CreateUsersWithListInput['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/user/createWithList', - data, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useCreateUsersWithListInput(options: { + mutation?: UseMutationOptions; + client?: CreateUsersWithListInput["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/user/createWithList`, + data, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useDeleteOrder.ts b/examples/vue-query-v5/src/gen/hooks/useDeleteOrder.ts index 28560b38e..5ba392b05 100644 --- a/examples/vue-query-v5/src/gen/hooks/useDeleteOrder.ts +++ b/examples/vue-query-v5/src/gen/hooks/useDeleteOrder.ts @@ -1,47 +1,44 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { DeleteOrder400, DeleteOrder404, DeleteOrderMutationResponse, DeleteOrderPathParams } from '../models/DeleteOrder' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { DeleteOrderMutationResponse, DeleteOrderPathParams, DeleteOrder400, DeleteOrder404 } from "../models/DeleteOrder"; +import type { UseMutationOptions } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type DeleteOrderClient = typeof client + type DeleteOrderClient = typeof client; type DeleteOrder = { - data: DeleteOrderMutationResponse - error: DeleteOrder400 | DeleteOrder404 - request: never - pathParams: DeleteOrderPathParams - queryParams: never - headerParams: never - response: DeleteOrderMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: DeleteOrderMutationResponse; + error: DeleteOrder400 | DeleteOrder404; + request: never; + pathParams: DeleteOrderPathParams; + queryParams: never; + headerParams: never; + response: DeleteOrderMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID * @link /store/order/:orderId */ -export function useDeleteOrder( - refOrderId: MaybeRef, - options: { - mutation?: UseMutationOptions - client?: DeleteOrder['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const orderId = unref(refOrderId) - const res = await client({ - method: 'delete', - url: `/store/order/${orderId}`, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useDeleteOrder(refOrderId: MaybeRef, options: { + mutation?: UseMutationOptions; + client?: DeleteOrder["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const orderId = unref(refOrderId); + const res = await client({ + method: "delete", + url: `/store/order/${orderId}`, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useDeletePet.ts b/examples/vue-query-v5/src/gen/hooks/useDeletePet.ts index 17795c800..1ad8fac29 100644 --- a/examples/vue-query-v5/src/gen/hooks/useDeletePet.ts +++ b/examples/vue-query-v5/src/gen/hooks/useDeletePet.ts @@ -1,50 +1,46 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { DeletePet400, DeletePetHeaderParams, DeletePetMutationResponse, DeletePetPathParams } from '../models/DeletePet' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { DeletePetMutationResponse, DeletePetPathParams, DeletePetHeaderParams, DeletePet400 } from "../models/DeletePet"; +import type { UseMutationOptions } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type DeletePetClient = typeof client + type DeletePetClient = typeof client; type DeletePet = { - data: DeletePetMutationResponse - error: DeletePet400 - request: never - pathParams: DeletePetPathParams - queryParams: never - headerParams: DeletePetHeaderParams - response: DeletePetMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: DeletePetMutationResponse; + error: DeletePet400; + request: never; + pathParams: DeletePetPathParams; + queryParams: never; + headerParams: DeletePetHeaderParams; + response: DeletePetMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description delete a pet * @summary Deletes a pet * @link /pet/:petId */ -export function useDeletePet( - refPetId: MaybeRef, - refHeaders?: MaybeRef, - options: { - mutation?: UseMutationOptions - client?: DeletePet['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const petId = unref(refPetId) - const headers = unref(refHeaders) - const res = await client({ - method: 'delete', - url: `/pet/${petId}`, - headers: { ...headers, ...clientOptions.headers }, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useDeletePet(refPetId: MaybeRef, refHeaders?: MaybeRef, options: { + mutation?: UseMutationOptions; + client?: DeletePet["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const petId = unref(refPetId); + const headers = unref(refHeaders); + const res = await client({ + method: "delete", + url: `/pet/${petId}`, + headers: { ...headers, ...clientOptions.headers }, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useDeleteUser.ts b/examples/vue-query-v5/src/gen/hooks/useDeleteUser.ts index 44c32968d..a873e08c6 100644 --- a/examples/vue-query-v5/src/gen/hooks/useDeleteUser.ts +++ b/examples/vue-query-v5/src/gen/hooks/useDeleteUser.ts @@ -1,47 +1,44 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { DeleteUser400, DeleteUser404, DeleteUserMutationResponse, DeleteUserPathParams } from '../models/DeleteUser' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { DeleteUserMutationResponse, DeleteUserPathParams, DeleteUser400, DeleteUser404 } from "../models/DeleteUser"; +import type { UseMutationOptions } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type DeleteUserClient = typeof client + type DeleteUserClient = typeof client; type DeleteUser = { - data: DeleteUserMutationResponse - error: DeleteUser400 | DeleteUser404 - request: never - pathParams: DeleteUserPathParams - queryParams: never - headerParams: never - response: DeleteUserMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: DeleteUserMutationResponse; + error: DeleteUser400 | DeleteUser404; + request: never; + pathParams: DeleteUserPathParams; + queryParams: never; + headerParams: never; + response: DeleteUserMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description This can only be done by the logged in user. * @summary Delete user * @link /user/:username */ -export function useDeleteUser( - refUsername: MaybeRef, - options: { - mutation?: UseMutationOptions - client?: DeleteUser['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const username = unref(refUsername) - const res = await client({ - method: 'delete', - url: `/user/${username}`, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useDeleteUser(refUsername: MaybeRef, options: { + mutation?: UseMutationOptions; + client?: DeleteUser["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const username = unref(refUsername); + const res = await client({ + method: "delete", + url: `/user/${username}`, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useFindPetsByStatus.ts b/examples/vue-query-v5/src/gen/hooks/useFindPetsByStatus.ts index de1a58816..ec56dab4d 100644 --- a/examples/vue-query-v5/src/gen/hooks/useFindPetsByStatus.ts +++ b/examples/vue-query-v5/src/gen/hooks/useFindPetsByStatus.ts @@ -1,70 +1,62 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { FindPetsByStatus400, FindPetsByStatusQueryParams, FindPetsByStatusQueryResponse } from '../models/FindPetsByStatus' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { FindPetsByStatusQueryResponse, FindPetsByStatusQueryParams, FindPetsByStatus400 } from "../models/FindPetsByStatus"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type FindPetsByStatusClient = typeof client + type FindPetsByStatusClient = typeof client; type FindPetsByStatus = { - data: FindPetsByStatusQueryResponse - error: FindPetsByStatus400 - request: never - pathParams: never - queryParams: FindPetsByStatusQueryParams - headerParams: never - response: FindPetsByStatusQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const findPetsByStatusQueryKey = (params?: MaybeRef) => - [{ url: '/pet/findByStatus' }, ...(params ? [params] : [])] as const -export type FindPetsByStatusQueryKey = ReturnType -export function findPetsByStatusQueryOptions(refParams?: MaybeRef, options: FindPetsByStatus['client']['parameters'] = {}) { - const queryKey = findPetsByStatusQueryKey(refParams) - return queryOptions({ - queryKey, - queryFn: async () => { - const params = unref(refParams) - const res = await client({ - method: 'get', - url: '/pet/findByStatus', - params, - ...options, - }) - return res.data - }, - }) + data: FindPetsByStatusQueryResponse; + error: FindPetsByStatus400; + request: never; + pathParams: never; + queryParams: FindPetsByStatusQueryParams; + headerParams: never; + response: FindPetsByStatusQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const findPetsByStatusQueryKey = (params?: MaybeRef) => [{ url: "/pet/findByStatus" }, ...(params ? [params] : [])] as const; +export type FindPetsByStatusQueryKey = ReturnType; +export function findPetsByStatusQueryOptions(refParams?: MaybeRef, options: FindPetsByStatus["client"]["parameters"] = {}) { + const queryKey = findPetsByStatusQueryKey(refParams); + return queryOptions({ + queryKey, + queryFn: async () => { + const params = unref(refParams); + const res = await client({ + method: "get", + url: `/pet/findByStatus`, + params, + ...options + }); + return res.data; + }, + }); } /** * @description Multiple status values can be provided with comma separated strings * @summary Finds Pets by status * @link /pet/findByStatus */ -export function useFindPetsByStatus< - TData = FindPetsByStatus['response'], - TQueryData = FindPetsByStatus['response'], - TQueryKey extends QueryKey = FindPetsByStatusQueryKey, ->( - refParams?: MaybeRef, - options: { - query?: Partial> - client?: FindPetsByStatus['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useFindPetsByStatus(refParams?: MaybeRef, options: { + query?: Partial>; + client?: FindPetsByStatus["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? findPetsByStatusQueryKey(refParams) - const query = useQuery({ - ...(findPetsByStatusQueryOptions(refParams, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? findPetsByStatusQueryKey(refParams); + const query = useQuery({ + ...findPetsByStatusQueryOptions(refParams, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useFindPetsByTags.ts b/examples/vue-query-v5/src/gen/hooks/useFindPetsByTags.ts index ea3fd6e9a..8946c44fc 100644 --- a/examples/vue-query-v5/src/gen/hooks/useFindPetsByTags.ts +++ b/examples/vue-query-v5/src/gen/hooks/useFindPetsByTags.ts @@ -1,69 +1,62 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { FindPetsByTags400, FindPetsByTagsQueryParams, FindPetsByTagsQueryResponse } from '../models/FindPetsByTags' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { FindPetsByTagsQueryResponse, FindPetsByTagsQueryParams, FindPetsByTags400 } from "../models/FindPetsByTags"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type FindPetsByTagsClient = typeof client + type FindPetsByTagsClient = typeof client; type FindPetsByTags = { - data: FindPetsByTagsQueryResponse - error: FindPetsByTags400 - request: never - pathParams: never - queryParams: FindPetsByTagsQueryParams - headerParams: never - response: FindPetsByTagsQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const findPetsByTagsQueryKey = (params?: MaybeRef) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const -export type FindPetsByTagsQueryKey = ReturnType -export function findPetsByTagsQueryOptions(refParams?: MaybeRef, options: FindPetsByTags['client']['parameters'] = {}) { - const queryKey = findPetsByTagsQueryKey(refParams) - return queryOptions({ - queryKey, - queryFn: async () => { - const params = unref(refParams) - const res = await client({ - method: 'get', - url: '/pet/findByTags', - params, - ...options, - }) - return res.data - }, - }) + data: FindPetsByTagsQueryResponse; + error: FindPetsByTags400; + request: never; + pathParams: never; + queryParams: FindPetsByTagsQueryParams; + headerParams: never; + response: FindPetsByTagsQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const findPetsByTagsQueryKey = (params?: MaybeRef) => [{ url: "/pet/findByTags" }, ...(params ? [params] : [])] as const; +export type FindPetsByTagsQueryKey = ReturnType; +export function findPetsByTagsQueryOptions(refParams?: MaybeRef, options: FindPetsByTags["client"]["parameters"] = {}) { + const queryKey = findPetsByTagsQueryKey(refParams); + return queryOptions({ + queryKey, + queryFn: async () => { + const params = unref(refParams); + const res = await client({ + method: "get", + url: `/pet/findByTags`, + params, + ...options + }); + return res.data; + }, + }); } /** * @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @link /pet/findByTags */ -export function useFindPetsByTags< - TData = FindPetsByTags['response'], - TQueryData = FindPetsByTags['response'], - TQueryKey extends QueryKey = FindPetsByTagsQueryKey, ->( - refParams?: MaybeRef, - options: { - query?: Partial> - client?: FindPetsByTags['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useFindPetsByTags(refParams?: MaybeRef, options: { + query?: Partial>; + client?: FindPetsByTags["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(refParams) - const query = useQuery({ - ...(findPetsByTagsQueryOptions(refParams, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(refParams); + const query = useQuery({ + ...findPetsByTagsQueryOptions(refParams, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useGetInventory.ts b/examples/vue-query-v5/src/gen/hooks/useGetInventory.ts index 863cd476a..86f76df5a 100644 --- a/examples/vue-query-v5/src/gen/hooks/useGetInventory.ts +++ b/examples/vue-query-v5/src/gen/hooks/useGetInventory.ts @@ -1,60 +1,58 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import type { GetInventoryQueryResponse } from '../models/GetInventory' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import type { GetInventoryQueryResponse } from "../models/GetInventory"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; -type GetInventoryClient = typeof client + type GetInventoryClient = typeof client; type GetInventory = { - data: GetInventoryQueryResponse - error: never - request: never - pathParams: never - queryParams: never - headerParams: never - response: GetInventoryQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getInventoryQueryKey = () => [{ url: '/store/inventory' }] as const -export type GetInventoryQueryKey = ReturnType -export function getInventoryQueryOptions(options: GetInventory['client']['parameters'] = {}) { - const queryKey = getInventoryQueryKey() - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/store/inventory', - ...options, - }) - return res.data - }, - }) + data: GetInventoryQueryResponse; + error: never; + request: never; + pathParams: never; + queryParams: never; + headerParams: never; + response: GetInventoryQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getInventoryQueryKey = () => [{ url: "/store/inventory" }] as const; +export type GetInventoryQueryKey = ReturnType; +export function getInventoryQueryOptions(options: GetInventory["client"]["parameters"] = {}) { + const queryKey = getInventoryQueryKey(); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/store/inventory`, + ...options + }); + return res.data; + }, + }); } /** * @description Returns a map of status codes to quantities * @summary Returns pet inventories by status * @link /store/inventory */ -export function useGetInventory( - options: { - query?: Partial> - client?: GetInventory['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useGetInventory(options: { + query?: Partial>; + client?: GetInventory["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getInventoryQueryKey() - const query = useQuery({ - ...(getInventoryQueryOptions(clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getInventoryQueryKey(); + const query = useQuery({ + ...getInventoryQueryOptions(clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useGetOrderById.ts b/examples/vue-query-v5/src/gen/hooks/useGetOrderById.ts index 75811effb..e79c4afef 100644 --- a/examples/vue-query-v5/src/gen/hooks/useGetOrderById.ts +++ b/examples/vue-query-v5/src/gen/hooks/useGetOrderById.ts @@ -1,65 +1,61 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { GetOrderById400, GetOrderById404, GetOrderByIdPathParams, GetOrderByIdQueryResponse } from '../models/GetOrderById' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { GetOrderByIdQueryResponse, GetOrderByIdPathParams, GetOrderById400, GetOrderById404 } from "../models/GetOrderById"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type GetOrderByIdClient = typeof client + type GetOrderByIdClient = typeof client; type GetOrderById = { - data: GetOrderByIdQueryResponse - error: GetOrderById400 | GetOrderById404 - request: never - pathParams: GetOrderByIdPathParams - queryParams: never - headerParams: never - response: GetOrderByIdQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getOrderByIdQueryKey = (orderId: MaybeRef) => - [{ url: '/store/order/:orderId', params: { orderId: orderId } }] as const -export type GetOrderByIdQueryKey = ReturnType -export function getOrderByIdQueryOptions(refOrderId: MaybeRef, options: GetOrderById['client']['parameters'] = {}) { - const queryKey = getOrderByIdQueryKey(refOrderId) - return queryOptions({ - queryKey, - queryFn: async () => { - const orderId = unref(refOrderId) - const res = await client({ - method: 'get', - url: `/store/order/${orderId}`, - ...options, - }) - return res.data - }, - }) + data: GetOrderByIdQueryResponse; + error: GetOrderById400 | GetOrderById404; + request: never; + pathParams: GetOrderByIdPathParams; + queryParams: never; + headerParams: never; + response: GetOrderByIdQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getOrderByIdQueryKey = (orderId: MaybeRef) => [{ url: "/store/order/:orderId", params: { orderId: orderId } }] as const; +export type GetOrderByIdQueryKey = ReturnType; +export function getOrderByIdQueryOptions(refOrderId: MaybeRef, options: GetOrderById["client"]["parameters"] = {}) { + const queryKey = getOrderByIdQueryKey(refOrderId); + return queryOptions({ + queryKey, + queryFn: async () => { + const orderId = unref(refOrderId); + const res = await client({ + method: "get", + url: `/store/order/${orderId}`, + ...options + }); + return res.data; + }, + }); } /** * @description For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. * @summary Find purchase order by ID * @link /store/order/:orderId */ -export function useGetOrderById( - refOrderId: GetOrderByIdPathParams['orderId'], - options: { - query?: Partial> - client?: GetOrderById['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useGetOrderById(refOrderId: GetOrderByIdPathParams["orderId"], options: { + query?: Partial>; + client?: GetOrderById["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getOrderByIdQueryKey(refOrderId) - const query = useQuery({ - ...(getOrderByIdQueryOptions(refOrderId, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getOrderByIdQueryKey(refOrderId); + const query = useQuery({ + ...getOrderByIdQueryOptions(refOrderId, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useGetPetById.ts b/examples/vue-query-v5/src/gen/hooks/useGetPetById.ts index 3f1bc40d3..73a626043 100644 --- a/examples/vue-query-v5/src/gen/hooks/useGetPetById.ts +++ b/examples/vue-query-v5/src/gen/hooks/useGetPetById.ts @@ -1,64 +1,61 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { GetPetById400, GetPetById404, GetPetByIdPathParams, GetPetByIdQueryResponse } from '../models/GetPetById' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { GetPetByIdQueryResponse, GetPetByIdPathParams, GetPetById400, GetPetById404 } from "../models/GetPetById"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type GetPetByIdClient = typeof client + type GetPetByIdClient = typeof client; type GetPetById = { - data: GetPetByIdQueryResponse - error: GetPetById400 | GetPetById404 - request: never - pathParams: GetPetByIdPathParams - queryParams: never - headerParams: never - response: GetPetByIdQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getPetByIdQueryKey = (petId: MaybeRef) => [{ url: '/pet/:petId', params: { petId: petId } }] as const -export type GetPetByIdQueryKey = ReturnType -export function getPetByIdQueryOptions(refPetId: MaybeRef, options: GetPetById['client']['parameters'] = {}) { - const queryKey = getPetByIdQueryKey(refPetId) - return queryOptions({ - queryKey, - queryFn: async () => { - const petId = unref(refPetId) - const res = await client({ - method: 'get', - url: `/pet/${petId}`, - ...options, - }) - return res.data - }, - }) + data: GetPetByIdQueryResponse; + error: GetPetById400 | GetPetById404; + request: never; + pathParams: GetPetByIdPathParams; + queryParams: never; + headerParams: never; + response: GetPetByIdQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getPetByIdQueryKey = (petId: MaybeRef) => [{ url: "/pet/:petId", params: { petId: petId } }] as const; +export type GetPetByIdQueryKey = ReturnType; +export function getPetByIdQueryOptions(refPetId: MaybeRef, options: GetPetById["client"]["parameters"] = {}) { + const queryKey = getPetByIdQueryKey(refPetId); + return queryOptions({ + queryKey, + queryFn: async () => { + const petId = unref(refPetId); + const res = await client({ + method: "get", + url: `/pet/${petId}`, + ...options + }); + return res.data; + }, + }); } /** * @description Returns a single pet * @summary Find pet by ID * @link /pet/:petId */ -export function useGetPetById( - refPetId: GetPetByIdPathParams['petId'], - options: { - query?: Partial> - client?: GetPetById['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useGetPetById(refPetId: GetPetByIdPathParams["petId"], options: { + query?: Partial>; + client?: GetPetById["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getPetByIdQueryKey(refPetId) - const query = useQuery({ - ...(getPetByIdQueryOptions(refPetId, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getPetByIdQueryKey(refPetId); + const query = useQuery({ + ...getPetByIdQueryOptions(refPetId, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useGetUserByName.ts b/examples/vue-query-v5/src/gen/hooks/useGetUserByName.ts index 5da551859..66241b03e 100644 --- a/examples/vue-query-v5/src/gen/hooks/useGetUserByName.ts +++ b/examples/vue-query-v5/src/gen/hooks/useGetUserByName.ts @@ -1,64 +1,60 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { GetUserByName400, GetUserByName404, GetUserByNamePathParams, GetUserByNameQueryResponse } from '../models/GetUserByName' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { GetUserByNameQueryResponse, GetUserByNamePathParams, GetUserByName400, GetUserByName404 } from "../models/GetUserByName"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type GetUserByNameClient = typeof client + type GetUserByNameClient = typeof client; type GetUserByName = { - data: GetUserByNameQueryResponse - error: GetUserByName400 | GetUserByName404 - request: never - pathParams: GetUserByNamePathParams - queryParams: never - headerParams: never - response: GetUserByNameQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const getUserByNameQueryKey = (username: MaybeRef) => - [{ url: '/user/:username', params: { username: username } }] as const -export type GetUserByNameQueryKey = ReturnType -export function getUserByNameQueryOptions(refUsername: MaybeRef, options: GetUserByName['client']['parameters'] = {}) { - const queryKey = getUserByNameQueryKey(refUsername) - return queryOptions({ - queryKey, - queryFn: async () => { - const username = unref(refUsername) - const res = await client({ - method: 'get', - url: `/user/${username}`, - ...options, - }) - return res.data - }, - }) + data: GetUserByNameQueryResponse; + error: GetUserByName400 | GetUserByName404; + request: never; + pathParams: GetUserByNamePathParams; + queryParams: never; + headerParams: never; + response: GetUserByNameQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const getUserByNameQueryKey = (username: MaybeRef) => [{ url: "/user/:username", params: { username: username } }] as const; +export type GetUserByNameQueryKey = ReturnType; +export function getUserByNameQueryOptions(refUsername: MaybeRef, options: GetUserByName["client"]["parameters"] = {}) { + const queryKey = getUserByNameQueryKey(refUsername); + return queryOptions({ + queryKey, + queryFn: async () => { + const username = unref(refUsername); + const res = await client({ + method: "get", + url: `/user/${username}`, + ...options + }); + return res.data; + }, + }); } /** * @summary Get user by user name * @link /user/:username */ -export function useGetUserByName( - refUsername: GetUserByNamePathParams['username'], - options: { - query?: Partial> - client?: GetUserByName['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useGetUserByName(refUsername: GetUserByNamePathParams["username"], options: { + query?: Partial>; + client?: GetUserByName["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getUserByNameQueryKey(refUsername) - const query = useQuery({ - ...(getUserByNameQueryOptions(refUsername, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? getUserByNameQueryKey(refUsername); + const query = useQuery({ + ...getUserByNameQueryOptions(refUsername, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useLoginUser.ts b/examples/vue-query-v5/src/gen/hooks/useLoginUser.ts index 458e22ed3..171d540bf 100644 --- a/examples/vue-query-v5/src/gen/hooks/useLoginUser.ts +++ b/examples/vue-query-v5/src/gen/hooks/useLoginUser.ts @@ -1,64 +1,61 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { LoginUser400, LoginUserQueryParams, LoginUserQueryResponse } from '../models/LoginUser' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { LoginUserQueryResponse, LoginUserQueryParams, LoginUser400 } from "../models/LoginUser"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type LoginUserClient = typeof client + type LoginUserClient = typeof client; type LoginUser = { - data: LoginUserQueryResponse - error: LoginUser400 - request: never - pathParams: never - queryParams: LoginUserQueryParams - headerParams: never - response: LoginUserQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const loginUserQueryKey = (params?: MaybeRef) => [{ url: '/user/login' }, ...(params ? [params] : [])] as const -export type LoginUserQueryKey = ReturnType -export function loginUserQueryOptions(refParams?: MaybeRef, options: LoginUser['client']['parameters'] = {}) { - const queryKey = loginUserQueryKey(refParams) - return queryOptions({ - queryKey, - queryFn: async () => { - const params = unref(refParams) - const res = await client({ - method: 'get', - url: '/user/login', - params, - ...options, - }) - return res.data - }, - }) + data: LoginUserQueryResponse; + error: LoginUser400; + request: never; + pathParams: never; + queryParams: LoginUserQueryParams; + headerParams: never; + response: LoginUserQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const loginUserQueryKey = (params?: MaybeRef) => [{ url: "/user/login" }, ...(params ? [params] : [])] as const; +export type LoginUserQueryKey = ReturnType; +export function loginUserQueryOptions(refParams?: MaybeRef, options: LoginUser["client"]["parameters"] = {}) { + const queryKey = loginUserQueryKey(refParams); + return queryOptions({ + queryKey, + queryFn: async () => { + const params = unref(refParams); + const res = await client({ + method: "get", + url: `/user/login`, + params, + ...options + }); + return res.data; + }, + }); } /** * @summary Logs user into the system * @link /user/login */ -export function useLoginUser( - refParams?: MaybeRef, - options: { - query?: Partial> - client?: LoginUser['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useLoginUser(refParams?: MaybeRef, options: { + query?: Partial>; + client?: LoginUser["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? loginUserQueryKey(refParams) - const query = useQuery({ - ...(loginUserQueryOptions(refParams, clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? loginUserQueryKey(refParams); + const query = useQuery({ + ...loginUserQueryOptions(refParams, clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useLogoutUser.ts b/examples/vue-query-v5/src/gen/hooks/useLogoutUser.ts index 59817e400..f4bd24473 100644 --- a/examples/vue-query-v5/src/gen/hooks/useLogoutUser.ts +++ b/examples/vue-query-v5/src/gen/hooks/useLogoutUser.ts @@ -1,59 +1,57 @@ -import client from '@kubb/swagger-client/client' -import { queryOptions, useQuery } from '@tanstack/vue-query' -import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/vue-query' -import type { LogoutUserQueryResponse } from '../models/LogoutUser' +import client from "@kubb/swagger-client/client"; +import { useQuery, queryOptions } from "@tanstack/vue-query"; +import type { LogoutUserQueryResponse } from "../models/LogoutUser"; +import type { QueryObserverOptions, UseQueryReturnType, QueryKey } from "@tanstack/vue-query"; -type LogoutUserClient = typeof client + type LogoutUserClient = typeof client; type LogoutUser = { - data: LogoutUserQueryResponse - error: never - request: never - pathParams: never - queryParams: never - headerParams: never - response: LogoutUserQueryResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} -export const logoutUserQueryKey = () => [{ url: '/user/logout' }] as const -export type LogoutUserQueryKey = ReturnType -export function logoutUserQueryOptions(options: LogoutUser['client']['parameters'] = {}) { - const queryKey = logoutUserQueryKey() - return queryOptions({ - queryKey, - queryFn: async () => { - const res = await client({ - method: 'get', - url: '/user/logout', - ...options, - }) - return res.data - }, - }) + data: LogoutUserQueryResponse; + error: never; + request: never; + pathParams: never; + queryParams: never; + headerParams: never; + response: LogoutUserQueryResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; +export const logoutUserQueryKey = () => [{ url: "/user/logout" }] as const; +export type LogoutUserQueryKey = ReturnType; +export function logoutUserQueryOptions(options: LogoutUser["client"]["parameters"] = {}) { + const queryKey = logoutUserQueryKey(); + return queryOptions({ + queryKey, + queryFn: async () => { + const res = await client({ + method: "get", + url: `/user/logout`, + ...options + }); + return res.data; + }, + }); } /** * @summary Logs out current logged in user session * @link /user/logout */ -export function useLogoutUser( - options: { - query?: Partial> - client?: LogoutUser['client']['parameters'] - } = {}, -): UseQueryReturnType & { - queryKey: TQueryKey +export function useLogoutUser(options: { + query?: Partial>; + client?: LogoutUser["client"]["parameters"]; +} = {}): UseQueryReturnType & { + queryKey: TQueryKey; } { - const { query: queryOptions, client: clientOptions = {} } = options ?? {} - const queryKey = queryOptions?.queryKey ?? logoutUserQueryKey() - const query = useQuery({ - ...(logoutUserQueryOptions(clientOptions) as unknown as QueryObserverOptions), - queryKey, - ...(queryOptions as unknown as Omit), - }) as UseQueryReturnType & { - queryKey: TQueryKey - } - query.queryKey = queryKey as TQueryKey - return query -} + const { query: queryOptions, client: clientOptions = {} } = options ?? {}; + const queryKey = queryOptions?.queryKey ?? logoutUserQueryKey(); + const query = useQuery({ + ...logoutUserQueryOptions(clientOptions) as unknown as QueryObserverOptions, + queryKey, + ...queryOptions as unknown as Omit + }) as UseQueryReturnType & { + queryKey: TQueryKey; + }; + query.queryKey = queryKey as TQueryKey; + return query; +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/usePlaceOrder.ts b/examples/vue-query-v5/src/gen/hooks/usePlaceOrder.ts index 64b05076d..6f969df2b 100644 --- a/examples/vue-query-v5/src/gen/hooks/usePlaceOrder.ts +++ b/examples/vue-query-v5/src/gen/hooks/usePlaceOrder.ts @@ -1,44 +1,42 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import type { PlaceOrder405, PlaceOrderMutationRequest, PlaceOrderMutationResponse } from '../models/PlaceOrder' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import type { PlaceOrderMutationRequest, PlaceOrderMutationResponse, PlaceOrder405 } from "../models/PlaceOrder"; +import type { UseMutationOptions } from "@tanstack/vue-query"; -type PlaceOrderClient = typeof client + type PlaceOrderClient = typeof client; type PlaceOrder = { - data: PlaceOrderMutationResponse - error: PlaceOrder405 - request: PlaceOrderMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: PlaceOrderMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: PlaceOrderMutationResponse; + error: PlaceOrder405; + request: PlaceOrderMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: PlaceOrderMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Place a new order in the store * @summary Place an order for a pet * @link /store/order */ -export function usePlaceOrder( - options: { - mutation?: UseMutationOptions - client?: PlaceOrder['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'post', - url: '/store/order', - data, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function usePlaceOrder(options: { + mutation?: UseMutationOptions; + client?: PlaceOrder["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "post", + url: `/store/order`, + data, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useUpdatePet.ts b/examples/vue-query-v5/src/gen/hooks/useUpdatePet.ts index ecfade8fb..c15a804d3 100644 --- a/examples/vue-query-v5/src/gen/hooks/useUpdatePet.ts +++ b/examples/vue-query-v5/src/gen/hooks/useUpdatePet.ts @@ -1,44 +1,42 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import type { UpdatePet400, UpdatePet404, UpdatePet405, UpdatePetMutationRequest, UpdatePetMutationResponse } from '../models/UpdatePet' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import type { UpdatePetMutationRequest, UpdatePetMutationResponse, UpdatePet400, UpdatePet404, UpdatePet405 } from "../models/UpdatePet"; +import type { UseMutationOptions } from "@tanstack/vue-query"; -type UpdatePetClient = typeof client + type UpdatePetClient = typeof client; type UpdatePet = { - data: UpdatePetMutationResponse - error: UpdatePet400 | UpdatePet404 | UpdatePet405 - request: UpdatePetMutationRequest - pathParams: never - queryParams: never - headerParams: never - response: UpdatePetMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: UpdatePetMutationResponse; + error: UpdatePet400 | UpdatePet404 | UpdatePet405; + request: UpdatePetMutationRequest; + pathParams: never; + queryParams: never; + headerParams: never; + response: UpdatePetMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description Update an existing pet by Id * @summary Update an existing pet * @link /pet */ -export function useUpdatePet( - options: { - mutation?: UseMutationOptions - client?: UpdatePet['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const res = await client({ - method: 'put', - url: '/pet', - data, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useUpdatePet(options: { + mutation?: UseMutationOptions; + client?: UpdatePet["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const res = await client({ + method: "put", + url: `/pet`, + data, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useUpdatePetWithForm.ts b/examples/vue-query-v5/src/gen/hooks/useUpdatePetWithForm.ts index 692188c1c..d12c0710b 100644 --- a/examples/vue-query-v5/src/gen/hooks/useUpdatePetWithForm.ts +++ b/examples/vue-query-v5/src/gen/hooks/useUpdatePetWithForm.ts @@ -1,54 +1,45 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { - UpdatePetWithForm405, - UpdatePetWithFormMutationResponse, - UpdatePetWithFormPathParams, - UpdatePetWithFormQueryParams, -} from '../models/UpdatePetWithForm' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { UpdatePetWithFormMutationResponse, UpdatePetWithFormPathParams, UpdatePetWithFormQueryParams, UpdatePetWithForm405 } from "../models/UpdatePetWithForm"; +import type { UseMutationOptions } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type UpdatePetWithFormClient = typeof client + type UpdatePetWithFormClient = typeof client; type UpdatePetWithForm = { - data: UpdatePetWithFormMutationResponse - error: UpdatePetWithForm405 - request: never - pathParams: UpdatePetWithFormPathParams - queryParams: UpdatePetWithFormQueryParams - headerParams: never - response: UpdatePetWithFormMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: UpdatePetWithFormMutationResponse; + error: UpdatePetWithForm405; + request: never; + pathParams: UpdatePetWithFormPathParams; + queryParams: UpdatePetWithFormQueryParams; + headerParams: never; + response: UpdatePetWithFormMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @summary Updates a pet in the store with form data * @link /pet/:petId */ -export function useUpdatePetWithForm( - refPetId: MaybeRef, - refParams?: MaybeRef, - options: { - mutation?: UseMutationOptions - client?: UpdatePetWithForm['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const petId = unref(refPetId) - const params = unref(refParams) - const res = await client({ - method: 'post', - url: `/pet/${petId}`, - params, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useUpdatePetWithForm(refPetId: MaybeRef, refParams?: MaybeRef, options: { + mutation?: UseMutationOptions; + client?: UpdatePetWithForm["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const petId = unref(refPetId); + const params = unref(refParams); + const res = await client({ + method: "post", + url: `/pet/${petId}`, + params, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useUpdateUser.ts b/examples/vue-query-v5/src/gen/hooks/useUpdateUser.ts index 768a8c18d..e35d5cce1 100644 --- a/examples/vue-query-v5/src/gen/hooks/useUpdateUser.ts +++ b/examples/vue-query-v5/src/gen/hooks/useUpdateUser.ts @@ -1,48 +1,45 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../models/UpdateUser' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from "../models/UpdateUser"; +import type { UseMutationOptions } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type UpdateUserClient = typeof client + type UpdateUserClient = typeof client; type UpdateUser = { - data: UpdateUserMutationResponse - error: never - request: UpdateUserMutationRequest - pathParams: UpdateUserPathParams - queryParams: never - headerParams: never - response: UpdateUserMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: UpdateUserMutationResponse; + error: never; + request: UpdateUserMutationRequest; + pathParams: UpdateUserPathParams; + queryParams: never; + headerParams: never; + response: UpdateUserMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @description This can only be done by the logged in user. * @summary Update user * @link /user/:username */ -export function useUpdateUser( - refUsername: MaybeRef, - options: { - mutation?: UseMutationOptions - client?: UpdateUser['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const username = unref(refUsername) - const res = await client({ - method: 'put', - url: `/user/${username}`, - data, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useUpdateUser(refUsername: MaybeRef, options: { + mutation?: UseMutationOptions; + client?: UpdateUser["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const username = unref(refUsername); + const res = await client({ + method: "put", + url: `/user/${username}`, + data, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/hooks/useUploadFile.ts b/examples/vue-query-v5/src/gen/hooks/useUploadFile.ts index e5b4f137a..7a5a37d75 100644 --- a/examples/vue-query-v5/src/gen/hooks/useUploadFile.ts +++ b/examples/vue-query-v5/src/gen/hooks/useUploadFile.ts @@ -1,50 +1,46 @@ -import client from '@kubb/swagger-client/client' -import { useMutation } from '@tanstack/vue-query' -import type { UseMutationOptions } from '@tanstack/vue-query' -import { unref } from 'vue' -import type { MaybeRef } from 'vue' -import type { UploadFileMutationRequest, UploadFileMutationResponse, UploadFilePathParams, UploadFileQueryParams } from '../models/UploadFile' +import client from "@kubb/swagger-client/client"; +import { useMutation } from "@tanstack/vue-query"; +import { unref } from "vue"; +import type { UploadFileMutationRequest, UploadFileMutationResponse, UploadFilePathParams, UploadFileQueryParams } from "../models/UploadFile"; +import type { UseMutationOptions } from "@tanstack/vue-query"; +import type { MaybeRef } from "vue"; -type UploadFileClient = typeof client + type UploadFileClient = typeof client; type UploadFile = { - data: UploadFileMutationResponse - error: never - request: UploadFileMutationRequest - pathParams: UploadFilePathParams - queryParams: UploadFileQueryParams - headerParams: never - response: UploadFileMutationResponse - client: { - parameters: Partial[0]> - return: Awaited> - } -} + data: UploadFileMutationResponse; + error: never; + request: UploadFileMutationRequest; + pathParams: UploadFilePathParams; + queryParams: UploadFileQueryParams; + headerParams: never; + response: UploadFileMutationResponse; + client: { + parameters: Partial[0]>; + return: Awaited>; + }; +}; /** * @summary uploads an image * @link /pet/:petId/uploadImage */ -export function useUploadFile( - refPetId: MaybeRef, - refParams?: MaybeRef, - options: { - mutation?: UseMutationOptions - client?: UploadFile['client']['parameters'] - } = {}, -) { - const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {} - return useMutation({ - mutationFn: async (data) => { - const petId = unref(refPetId) - const params = unref(refParams) - const res = await client({ - method: 'post', - url: `/pet/${petId}/uploadImage`, - params, - data, - ...clientOptions, - }) - return res.data - }, - ...mutationOptions, - }) -} +export function useUploadFile(refPetId: MaybeRef, refParams?: MaybeRef, options: { + mutation?: UseMutationOptions; + client?: UploadFile["client"]["parameters"]; +} = {}) { + const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}; + return useMutation({ + mutationFn: async (data) => { + const petId = unref(refPetId); + const params = unref(refParams); + const res = await client({ + method: "post", + url: `/pet/${petId}/uploadImage`, + params, + data, + ...clientOptions + }); + return res.data; + }, + ...mutationOptions + }); +} \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/index.ts b/examples/vue-query-v5/src/gen/index.ts index 6e6f12d44..91cd800f9 100644 --- a/examples/vue-query-v5/src/gen/index.ts +++ b/examples/vue-query-v5/src/gen/index.ts @@ -1,2 +1,2 @@ -export * from './models/index' -export * from './hooks/index' +export * from "./models/index"; +export * from "./hooks/index"; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/AddPet.ts b/examples/vue-query-v5/src/gen/models/AddPet.ts index 27d8963df..a748a6e58 100644 --- a/examples/vue-query-v5/src/gen/models/AddPet.ts +++ b/examples/vue-query-v5/src/gen/models/AddPet.ts @@ -1,27 +1,27 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -/** + /** * @description Successful operation - */ -export type AddPet200 = Pet +*/ +export type AddPet200 = Pet; -/** + /** * @description Invalid input - */ -export type AddPet405 = any +*/ +export type AddPet405 = any; -/** + /** * @description Create a new pet in the store - */ -export type AddPetMutationRequest = Pet +*/ +export type AddPetMutationRequest = Pet; -/** + /** * @description Successful operation - */ -export type AddPetMutationResponse = Pet +*/ +export type AddPetMutationResponse = Pet; -export type AddPetMutation = { - Response: AddPetMutationResponse - Request: AddPetMutationRequest - Errors: AddPet405 -} + export type AddPetMutation = { + Response: AddPetMutationResponse; + Request: AddPetMutationRequest; + Errors: AddPet405; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/Address.ts b/examples/vue-query-v5/src/gen/models/Address.ts index 6e6411f01..8c92666ca 100644 --- a/examples/vue-query-v5/src/gen/models/Address.ts +++ b/examples/vue-query-v5/src/gen/models/Address.ts @@ -1,26 +1,30 @@ export const addressIdentifier = { - NW: 'NW', - NE: 'NE', - SW: 'SW', - SE: 'SE', -} as const -export type AddressIdentifier = (typeof addressIdentifier)[keyof typeof addressIdentifier] + "NW": "NW", + "NE": "NE", + "SW": "SW", + "SE": "SE" +} as const; +export type AddressIdentifier = (typeof addressIdentifier)[keyof typeof addressIdentifier]; export type Address = { - /** - * @type string | undefined - */ - street?: string - /** - * @type string | undefined - */ - city?: string - /** - * @type string | undefined - */ - state?: string - /** - * @type string | undefined - */ - zip?: string - identifier?: [number, string, AddressIdentifier] -} + /** + * @type string | undefined + */ + street?: string; + /** + * @type string | undefined + */ + city?: string; + /** + * @type string | undefined + */ + state?: string; + /** + * @type string | undefined + */ + zip?: string; + identifier?: [ + number, + string, + AddressIdentifier + ]; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/ApiResponse.ts b/examples/vue-query-v5/src/gen/models/ApiResponse.ts index 499e9e9ca..c006d2618 100644 --- a/examples/vue-query-v5/src/gen/models/ApiResponse.ts +++ b/examples/vue-query-v5/src/gen/models/ApiResponse.ts @@ -1,14 +1,14 @@ export type ApiResponse = { - /** - * @type integer | undefined int32 - */ - code?: number - /** - * @type string | undefined - */ - type?: string - /** - * @type string | undefined - */ - message?: string -} + /** + * @type integer | undefined int32 + */ + code?: number; + /** + * @type string | undefined + */ + type?: string; + /** + * @type string | undefined + */ + message?: string; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/Category.ts b/examples/vue-query-v5/src/gen/models/Category.ts index 24b90a71a..bcf608c7d 100644 --- a/examples/vue-query-v5/src/gen/models/Category.ts +++ b/examples/vue-query-v5/src/gen/models/Category.ts @@ -1,10 +1,10 @@ export type Category = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - name?: string -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + name?: string; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/CreateUser.ts b/examples/vue-query-v5/src/gen/models/CreateUser.ts index ada359de3..048dec373 100644 --- a/examples/vue-query-v5/src/gen/models/CreateUser.ts +++ b/examples/vue-query-v5/src/gen/models/CreateUser.ts @@ -1,18 +1,18 @@ -import type { User } from './User' +import type { User } from "./User"; -/** + /** * @description successful operation - */ -export type CreateUserError = User +*/ +export type CreateUserError = User; -/** + /** * @description Created user object - */ -export type CreateUserMutationRequest = User +*/ +export type CreateUserMutationRequest = User; -export type CreateUserMutationResponse = any + export type CreateUserMutationResponse = any; -export type CreateUserMutation = { - Response: CreateUserMutationResponse - Request: CreateUserMutationRequest -} + export type CreateUserMutation = { + Response: CreateUserMutationResponse; + Request: CreateUserMutationRequest; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/CreateUsersWithListInput.ts b/examples/vue-query-v5/src/gen/models/CreateUsersWithListInput.ts index eb718eb51..daeaa03e6 100644 --- a/examples/vue-query-v5/src/gen/models/CreateUsersWithListInput.ts +++ b/examples/vue-query-v5/src/gen/models/CreateUsersWithListInput.ts @@ -1,23 +1,23 @@ -import type { User } from './User' +import type { User } from "./User"; -/** + /** * @description Successful operation - */ -export type CreateUsersWithListInput200 = User +*/ +export type CreateUsersWithListInput200 = User; -/** + /** * @description successful operation - */ -export type CreateUsersWithListInputError = any +*/ +export type CreateUsersWithListInputError = any; -export type CreateUsersWithListInputMutationRequest = User[] + export type CreateUsersWithListInputMutationRequest = User[]; -/** + /** * @description Successful operation - */ -export type CreateUsersWithListInputMutationResponse = User +*/ +export type CreateUsersWithListInputMutationResponse = User; -export type CreateUsersWithListInputMutation = { - Response: CreateUsersWithListInputMutationResponse - Request: CreateUsersWithListInputMutationRequest -} + export type CreateUsersWithListInputMutation = { + Response: CreateUsersWithListInputMutationResponse; + Request: CreateUsersWithListInputMutationRequest; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/Customer.ts b/examples/vue-query-v5/src/gen/models/Customer.ts index 5a6d435a3..38705efe9 100644 --- a/examples/vue-query-v5/src/gen/models/Customer.ts +++ b/examples/vue-query-v5/src/gen/models/Customer.ts @@ -1,16 +1,16 @@ -import type { Address } from './Address' +import { Address } from "./Address"; -export type Customer = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - username?: string - /** - * @type array | undefined - */ - address?: Address[] -} + export type Customer = { + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + username?: string; + /** + * @type array | undefined + */ + address?: Address[]; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/DeleteOrder.ts b/examples/vue-query-v5/src/gen/models/DeleteOrder.ts index d160f7c4e..ba913be7d 100644 --- a/examples/vue-query-v5/src/gen/models/DeleteOrder.ts +++ b/examples/vue-query-v5/src/gen/models/DeleteOrder.ts @@ -1,25 +1,25 @@ export type DeleteOrderPathParams = { - /** - * @description ID of the order that needs to be deleted - * @type integer int64 - */ - orderId: number -} + /** + * @description ID of the order that needs to be deleted + * @type integer int64 + */ + orderId: number; +}; -/** + /** * @description Invalid ID supplied - */ -export type DeleteOrder400 = any +*/ +export type DeleteOrder400 = any; -/** + /** * @description Order not found - */ -export type DeleteOrder404 = any +*/ +export type DeleteOrder404 = any; -export type DeleteOrderMutationResponse = any + export type DeleteOrderMutationResponse = any; -export type DeleteOrderMutation = { - Response: DeleteOrderMutationResponse - PathParams: DeleteOrderPathParams - Errors: DeleteOrder400 | DeleteOrder404 -} + export type DeleteOrderMutation = { + Response: DeleteOrderMutationResponse; + PathParams: DeleteOrderPathParams; + Errors: DeleteOrder400 | DeleteOrder404; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/DeletePet.ts b/examples/vue-query-v5/src/gen/models/DeletePet.ts index 6bb98c261..185a5ef2c 100644 --- a/examples/vue-query-v5/src/gen/models/DeletePet.ts +++ b/examples/vue-query-v5/src/gen/models/DeletePet.ts @@ -1,28 +1,28 @@ export type DeletePetPathParams = { - /** - * @description Pet id to delete - * @type integer int64 - */ - petId: number -} + /** + * @description Pet id to delete + * @type integer int64 + */ + petId: number; +}; -export type DeletePetHeaderParams = { - /** - * @type string | undefined - */ - api_key?: string -} + export type DeletePetHeaderParams = { + /** + * @type string | undefined + */ + api_key?: string; +}; -/** + /** * @description Invalid pet value - */ -export type DeletePet400 = any +*/ +export type DeletePet400 = any; -export type DeletePetMutationResponse = any + export type DeletePetMutationResponse = any; -export type DeletePetMutation = { - Response: DeletePetMutationResponse - PathParams: DeletePetPathParams - HeaderParams: DeletePetHeaderParams - Errors: DeletePet400 -} + export type DeletePetMutation = { + Response: DeletePetMutationResponse; + PathParams: DeletePetPathParams; + HeaderParams: DeletePetHeaderParams; + Errors: DeletePet400; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/DeleteUser.ts b/examples/vue-query-v5/src/gen/models/DeleteUser.ts index 63010e04f..16327e3b1 100644 --- a/examples/vue-query-v5/src/gen/models/DeleteUser.ts +++ b/examples/vue-query-v5/src/gen/models/DeleteUser.ts @@ -1,25 +1,25 @@ export type DeleteUserPathParams = { - /** - * @description The name that needs to be deleted - * @type string - */ - username: string -} + /** + * @description The name that needs to be deleted + * @type string + */ + username: string; +}; -/** + /** * @description Invalid username supplied - */ -export type DeleteUser400 = any +*/ +export type DeleteUser400 = any; -/** + /** * @description User not found - */ -export type DeleteUser404 = any +*/ +export type DeleteUser404 = any; -export type DeleteUserMutationResponse = any + export type DeleteUserMutationResponse = any; -export type DeleteUserMutation = { - Response: DeleteUserMutationResponse - PathParams: DeleteUserPathParams - Errors: DeleteUser400 | DeleteUser404 -} + export type DeleteUserMutation = { + Response: DeleteUserMutationResponse; + PathParams: DeleteUserPathParams; + Errors: DeleteUser400 | DeleteUser404; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts b/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts index 504347081..0e9680607 100644 --- a/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts +++ b/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts @@ -1,37 +1,37 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -export const findPetsByStatusQueryParamsStatus = { - available: 'available', - pending: 'pending', - sold: 'sold', -} as const -export type FindPetsByStatusQueryParamsStatus = (typeof findPetsByStatusQueryParamsStatus)[keyof typeof findPetsByStatusQueryParamsStatus] + export const findPetsByStatusQueryParamsStatus = { + "available": "available", + "pending": "pending", + "sold": "sold" +} as const; +export type FindPetsByStatusQueryParamsStatus = (typeof findPetsByStatusQueryParamsStatus)[keyof typeof findPetsByStatusQueryParamsStatus]; export type FindPetsByStatusQueryParams = { - /** - * @description Status values that need to be considered for filter - * @default "available" - * @type string | undefined - */ - status?: FindPetsByStatusQueryParamsStatus -} + /** + * @description Status values that need to be considered for filter + * @default "available" + * @type string | undefined + */ + status?: FindPetsByStatusQueryParamsStatus; +}; -/** + /** * @description successful operation - */ -export type FindPetsByStatus200 = Pet[] +*/ +export type FindPetsByStatus200 = Pet[]; -/** + /** * @description Invalid status value - */ -export type FindPetsByStatus400 = any +*/ +export type FindPetsByStatus400 = any; -/** + /** * @description successful operation - */ -export type FindPetsByStatusQueryResponse = Pet[] +*/ +export type FindPetsByStatusQueryResponse = Pet[]; -export type FindPetsByStatusQuery = { - Response: FindPetsByStatusQueryResponse - QueryParams: FindPetsByStatusQueryParams - Errors: FindPetsByStatus400 -} + export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse; + QueryParams: FindPetsByStatusQueryParams; + Errors: FindPetsByStatus400; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts b/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts index 1e0e76271..b7918500b 100644 --- a/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts +++ b/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts @@ -1,30 +1,30 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -export type FindPetsByTagsQueryParams = { - /** - * @description Tags to filter by - * @type array | undefined - */ - tags?: string[] -} + export type FindPetsByTagsQueryParams = { + /** + * @description Tags to filter by + * @type array | undefined + */ + tags?: string[]; +}; -/** + /** * @description successful operation - */ -export type FindPetsByTags200 = Pet[] +*/ +export type FindPetsByTags200 = Pet[]; -/** + /** * @description Invalid tag value - */ -export type FindPetsByTags400 = any +*/ +export type FindPetsByTags400 = any; -/** + /** * @description successful operation - */ -export type FindPetsByTagsQueryResponse = Pet[] +*/ +export type FindPetsByTagsQueryResponse = Pet[]; -export type FindPetsByTagsQuery = { - Response: FindPetsByTagsQueryResponse - QueryParams: FindPetsByTagsQueryParams - Errors: FindPetsByTags400 -} + export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse; + QueryParams: FindPetsByTagsQueryParams; + Errors: FindPetsByTags400; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/GetInventory.ts b/examples/vue-query-v5/src/gen/models/GetInventory.ts index ec0602416..23861c1bf 100644 --- a/examples/vue-query-v5/src/gen/models/GetInventory.ts +++ b/examples/vue-query-v5/src/gen/models/GetInventory.ts @@ -1,17 +1,17 @@ /** * @description successful operation - */ +*/ export type GetInventory200 = { - [key: string]: number -} + [key: string]: number; +}; -/** + /** * @description successful operation - */ +*/ export type GetInventoryQueryResponse = { - [key: string]: number -} + [key: string]: number; +}; -export type GetInventoryQuery = { - Response: GetInventoryQueryResponse -} + export type GetInventoryQuery = { + Response: GetInventoryQueryResponse; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/GetOrderById.ts b/examples/vue-query-v5/src/gen/models/GetOrderById.ts index 0d25b0ee9..33831c3ae 100644 --- a/examples/vue-query-v5/src/gen/models/GetOrderById.ts +++ b/examples/vue-query-v5/src/gen/models/GetOrderById.ts @@ -1,35 +1,35 @@ -import type { Order } from './Order' +import type { Order } from "./Order"; -export type GetOrderByIdPathParams = { - /** - * @description ID of order that needs to be fetched - * @type integer int64 - */ - orderId: number -} + export type GetOrderByIdPathParams = { + /** + * @description ID of order that needs to be fetched + * @type integer int64 + */ + orderId: number; +}; -/** + /** * @description successful operation - */ -export type GetOrderById200 = Order +*/ +export type GetOrderById200 = Order; -/** + /** * @description Invalid ID supplied - */ -export type GetOrderById400 = any +*/ +export type GetOrderById400 = any; -/** + /** * @description Order not found - */ -export type GetOrderById404 = any +*/ +export type GetOrderById404 = any; -/** + /** * @description successful operation - */ -export type GetOrderByIdQueryResponse = Order +*/ +export type GetOrderByIdQueryResponse = Order; -export type GetOrderByIdQuery = { - Response: GetOrderByIdQueryResponse - PathParams: GetOrderByIdPathParams - Errors: GetOrderById400 | GetOrderById404 -} + export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse; + PathParams: GetOrderByIdPathParams; + Errors: GetOrderById400 | GetOrderById404; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/GetPetById.ts b/examples/vue-query-v5/src/gen/models/GetPetById.ts index 437d1a7ef..2b23c27d2 100644 --- a/examples/vue-query-v5/src/gen/models/GetPetById.ts +++ b/examples/vue-query-v5/src/gen/models/GetPetById.ts @@ -1,35 +1,35 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -export type GetPetByIdPathParams = { - /** - * @description ID of pet to return - * @type integer int64 - */ - petId: number -} + export type GetPetByIdPathParams = { + /** + * @description ID of pet to return + * @type integer int64 + */ + petId: number; +}; -/** + /** * @description successful operation - */ -export type GetPetById200 = Pet +*/ +export type GetPetById200 = Pet; -/** + /** * @description Invalid ID supplied - */ -export type GetPetById400 = any +*/ +export type GetPetById400 = any; -/** + /** * @description Pet not found - */ -export type GetPetById404 = any +*/ +export type GetPetById404 = any; -/** + /** * @description successful operation - */ -export type GetPetByIdQueryResponse = Pet +*/ +export type GetPetByIdQueryResponse = Pet; -export type GetPetByIdQuery = { - Response: GetPetByIdQueryResponse - PathParams: GetPetByIdPathParams - Errors: GetPetById400 | GetPetById404 -} + export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse; + PathParams: GetPetByIdPathParams; + Errors: GetPetById400 | GetPetById404; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/GetUserByName.ts b/examples/vue-query-v5/src/gen/models/GetUserByName.ts index c2c975229..3a27c559c 100644 --- a/examples/vue-query-v5/src/gen/models/GetUserByName.ts +++ b/examples/vue-query-v5/src/gen/models/GetUserByName.ts @@ -1,35 +1,35 @@ -import type { User } from './User' +import type { User } from "./User"; -export type GetUserByNamePathParams = { - /** - * @description The name that needs to be fetched. Use user1 for testing. - * @type string - */ - username: string -} + export type GetUserByNamePathParams = { + /** + * @description The name that needs to be fetched. Use user1 for testing. + * @type string + */ + username: string; +}; -/** + /** * @description successful operation - */ -export type GetUserByName200 = User +*/ +export type GetUserByName200 = User; -/** + /** * @description Invalid username supplied - */ -export type GetUserByName400 = any +*/ +export type GetUserByName400 = any; -/** + /** * @description User not found - */ -export type GetUserByName404 = any +*/ +export type GetUserByName404 = any; -/** + /** * @description successful operation - */ -export type GetUserByNameQueryResponse = User +*/ +export type GetUserByNameQueryResponse = User; -export type GetUserByNameQuery = { - Response: GetUserByNameQueryResponse - PathParams: GetUserByNamePathParams - Errors: GetUserByName400 | GetUserByName404 -} + export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse; + PathParams: GetUserByNamePathParams; + Errors: GetUserByName400 | GetUserByName404; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/LoginUser.ts b/examples/vue-query-v5/src/gen/models/LoginUser.ts index 64e5db7b6..6658166a8 100644 --- a/examples/vue-query-v5/src/gen/models/LoginUser.ts +++ b/examples/vue-query-v5/src/gen/models/LoginUser.ts @@ -1,33 +1,33 @@ export type LoginUserQueryParams = { - /** - * @description The user name for login - * @type string | undefined - */ - username?: string - /** - * @description The password for login in clear text - * @type string | undefined - */ - password?: string -} + /** + * @description The user name for login + * @type string | undefined + */ + username?: string; + /** + * @description The password for login in clear text + * @type string | undefined + */ + password?: string; +}; -/** + /** * @description successful operation - */ -export type LoginUser200 = string +*/ +export type LoginUser200 = string; -/** + /** * @description Invalid username/password supplied - */ -export type LoginUser400 = any +*/ +export type LoginUser400 = any; -/** + /** * @description successful operation - */ -export type LoginUserQueryResponse = string +*/ +export type LoginUserQueryResponse = string; -export type LoginUserQuery = { - Response: LoginUserQueryResponse - QueryParams: LoginUserQueryParams - Errors: LoginUser400 -} + export type LoginUserQuery = { + Response: LoginUserQueryResponse; + QueryParams: LoginUserQueryParams; + Errors: LoginUser400; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/LogoutUser.ts b/examples/vue-query-v5/src/gen/models/LogoutUser.ts index 521837490..a685be5fa 100644 --- a/examples/vue-query-v5/src/gen/models/LogoutUser.ts +++ b/examples/vue-query-v5/src/gen/models/LogoutUser.ts @@ -1,10 +1,10 @@ /** * @description successful operation - */ -export type LogoutUserError = any +*/ +export type LogoutUserError = any; -export type LogoutUserQueryResponse = any + export type LogoutUserQueryResponse = any; -export type LogoutUserQuery = { - Response: LogoutUserQueryResponse -} + export type LogoutUserQuery = { + Response: LogoutUserQueryResponse; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/Order.ts b/examples/vue-query-v5/src/gen/models/Order.ts index 09cb16946..0b5120ff6 100644 --- a/examples/vue-query-v5/src/gen/models/Order.ts +++ b/examples/vue-query-v5/src/gen/models/Order.ts @@ -1,33 +1,33 @@ export const orderStatus = { - placed: 'placed', - approved: 'approved', - delivered: 'delivered', -} as const -export type OrderStatus = (typeof orderStatus)[keyof typeof orderStatus] + "placed": "placed", + "approved": "approved", + "delivered": "delivered" +} as const; +export type OrderStatus = (typeof orderStatus)[keyof typeof orderStatus]; export type Order = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type integer | undefined int64 - */ - petId?: number - /** - * @type integer | undefined int32 - */ - quantity?: number - /** - * @type string | undefined date-time - */ - shipDate?: string - /** - * @description Order Status - * @type string | undefined - */ - status?: OrderStatus - /** - * @type boolean | undefined - */ - complete?: boolean -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type integer | undefined int64 + */ + petId?: number; + /** + * @type integer | undefined int32 + */ + quantity?: number; + /** + * @type string | undefined date-time + */ + shipDate?: string; + /** + * @description Order Status + * @type string | undefined + */ + status?: OrderStatus; + /** + * @type boolean | undefined + */ + complete?: boolean; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/Pet.ts b/examples/vue-query-v5/src/gen/models/Pet.ts index 4eaf45ee1..5f7ecd2a0 100644 --- a/examples/vue-query-v5/src/gen/models/Pet.ts +++ b/examples/vue-query-v5/src/gen/models/Pet.ts @@ -1,33 +1,33 @@ -import type { Category } from './Category' -import type { Tag } from './Tag' +import { Category } from "./Category"; +import { Tag } from "./Tag"; -export const petStatus = { - available: 'available', - pending: 'pending', - sold: 'sold', -} as const -export type PetStatus = (typeof petStatus)[keyof typeof petStatus] + export const petStatus = { + "available": "available", + "pending": "pending", + "sold": "sold" +} as const; +export type PetStatus = (typeof petStatus)[keyof typeof petStatus]; export type Pet = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string - */ - name: string - category?: Category - /** - * @type array - */ - photoUrls: string[] - /** - * @type array | undefined - */ - tags?: Tag[] - /** - * @description pet status in the store - * @type string | undefined - */ - status?: PetStatus -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string + */ + name: string; + category?: Category; + /** + * @type array + */ + photoUrls: string[]; + /** + * @type array | undefined + */ + tags?: Tag[]; + /** + * @description pet status in the store + * @type string | undefined + */ + status?: PetStatus; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/PlaceOrder.ts b/examples/vue-query-v5/src/gen/models/PlaceOrder.ts index 20aa2ff08..fd29e6525 100644 --- a/examples/vue-query-v5/src/gen/models/PlaceOrder.ts +++ b/examples/vue-query-v5/src/gen/models/PlaceOrder.ts @@ -1,24 +1,24 @@ -import type { Order } from './Order' +import type { Order } from "./Order"; -/** + /** * @description successful operation - */ -export type PlaceOrder200 = Order +*/ +export type PlaceOrder200 = Order; -/** + /** * @description Invalid input - */ -export type PlaceOrder405 = any +*/ +export type PlaceOrder405 = any; -export type PlaceOrderMutationRequest = Order + export type PlaceOrderMutationRequest = Order; -/** + /** * @description successful operation - */ -export type PlaceOrderMutationResponse = Order +*/ +export type PlaceOrderMutationResponse = Order; -export type PlaceOrderMutation = { - Response: PlaceOrderMutationResponse - Request: PlaceOrderMutationRequest - Errors: PlaceOrder405 -} + export type PlaceOrderMutation = { + Response: PlaceOrderMutationResponse; + Request: PlaceOrderMutationRequest; + Errors: PlaceOrder405; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/Tag.ts b/examples/vue-query-v5/src/gen/models/Tag.ts index 5145ac12c..49a0b6cbf 100644 --- a/examples/vue-query-v5/src/gen/models/Tag.ts +++ b/examples/vue-query-v5/src/gen/models/Tag.ts @@ -1,10 +1,10 @@ export type Tag = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - name?: string -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + name?: string; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/UpdatePet.ts b/examples/vue-query-v5/src/gen/models/UpdatePet.ts index c8d59265f..d55cd8eeb 100644 --- a/examples/vue-query-v5/src/gen/models/UpdatePet.ts +++ b/examples/vue-query-v5/src/gen/models/UpdatePet.ts @@ -1,37 +1,37 @@ -import type { Pet } from './Pet' +import type { Pet } from "./Pet"; -/** + /** * @description Successful operation - */ -export type UpdatePet200 = Pet +*/ +export type UpdatePet200 = Pet; -/** + /** * @description Invalid ID supplied - */ -export type UpdatePet400 = any +*/ +export type UpdatePet400 = any; -/** + /** * @description Pet not found - */ -export type UpdatePet404 = any +*/ +export type UpdatePet404 = any; -/** + /** * @description Validation exception - */ -export type UpdatePet405 = any +*/ +export type UpdatePet405 = any; -/** + /** * @description Update an existent pet in the store - */ -export type UpdatePetMutationRequest = Pet +*/ +export type UpdatePetMutationRequest = Pet; -/** + /** * @description Successful operation - */ -export type UpdatePetMutationResponse = Pet +*/ +export type UpdatePetMutationResponse = Pet; -export type UpdatePetMutation = { - Response: UpdatePetMutationResponse - Request: UpdatePetMutationRequest - Errors: UpdatePet400 | UpdatePet404 | UpdatePet405 -} + export type UpdatePetMutation = { + Response: UpdatePetMutationResponse; + Request: UpdatePetMutationRequest; + Errors: UpdatePet400 | UpdatePet404 | UpdatePet405; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/UpdatePetWithForm.ts b/examples/vue-query-v5/src/gen/models/UpdatePetWithForm.ts index ada2c08ca..ef1b8fc2e 100644 --- a/examples/vue-query-v5/src/gen/models/UpdatePetWithForm.ts +++ b/examples/vue-query-v5/src/gen/models/UpdatePetWithForm.ts @@ -1,34 +1,34 @@ export type UpdatePetWithFormPathParams = { - /** - * @description ID of pet that needs to be updated - * @type integer int64 - */ - petId: number -} + /** + * @description ID of pet that needs to be updated + * @type integer int64 + */ + petId: number; +}; -export type UpdatePetWithFormQueryParams = { - /** - * @description Name of pet that needs to be updated - * @type string | undefined - */ - name?: string - /** - * @description Status of pet that needs to be updated - * @type string | undefined - */ - status?: string -} + export type UpdatePetWithFormQueryParams = { + /** + * @description Name of pet that needs to be updated + * @type string | undefined + */ + name?: string; + /** + * @description Status of pet that needs to be updated + * @type string | undefined + */ + status?: string; +}; -/** + /** * @description Invalid input - */ -export type UpdatePetWithForm405 = any +*/ +export type UpdatePetWithForm405 = any; -export type UpdatePetWithFormMutationResponse = any + export type UpdatePetWithFormMutationResponse = any; -export type UpdatePetWithFormMutation = { - Response: UpdatePetWithFormMutationResponse - PathParams: UpdatePetWithFormPathParams - QueryParams: UpdatePetWithFormQueryParams - Errors: UpdatePetWithForm405 -} + export type UpdatePetWithFormMutation = { + Response: UpdatePetWithFormMutationResponse; + PathParams: UpdatePetWithFormPathParams; + QueryParams: UpdatePetWithFormQueryParams; + Errors: UpdatePetWithForm405; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/UpdateUser.ts b/examples/vue-query-v5/src/gen/models/UpdateUser.ts index d636efeb0..9a44548d7 100644 --- a/examples/vue-query-v5/src/gen/models/UpdateUser.ts +++ b/examples/vue-query-v5/src/gen/models/UpdateUser.ts @@ -1,27 +1,27 @@ -import type { User } from './User' +import { User } from "./User"; -export type UpdateUserPathParams = { - /** - * @description name that need to be deleted - * @type string - */ - username: string -} + export type UpdateUserPathParams = { + /** + * @description name that need to be deleted + * @type string + */ + username: string; +}; -/** + /** * @description successful operation - */ -export type UpdateUserError = any +*/ +export type UpdateUserError = any; -/** + /** * @description Update an existent user in the store - */ -export type UpdateUserMutationRequest = User +*/ +export type UpdateUserMutationRequest = User; -export type UpdateUserMutationResponse = any + export type UpdateUserMutationResponse = any; -export type UpdateUserMutation = { - Response: UpdateUserMutationResponse - Request: UpdateUserMutationRequest - PathParams: UpdateUserPathParams -} + export type UpdateUserMutation = { + Response: UpdateUserMutationResponse; + Request: UpdateUserMutationRequest; + PathParams: UpdateUserPathParams; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/UploadFile.ts b/examples/vue-query-v5/src/gen/models/UploadFile.ts index 0c0956bea..99d23f9ba 100644 --- a/examples/vue-query-v5/src/gen/models/UploadFile.ts +++ b/examples/vue-query-v5/src/gen/models/UploadFile.ts @@ -1,36 +1,36 @@ -import type { ApiResponse } from './ApiResponse' +import type { ApiResponse } from "./ApiResponse"; -export type UploadFilePathParams = { - /** - * @description ID of pet to update - * @type integer int64 - */ - petId: number -} + export type UploadFilePathParams = { + /** + * @description ID of pet to update + * @type integer int64 + */ + petId: number; +}; -export type UploadFileQueryParams = { - /** - * @description Additional Metadata - * @type string | undefined - */ - additionalMetadata?: string -} + export type UploadFileQueryParams = { + /** + * @description Additional Metadata + * @type string | undefined + */ + additionalMetadata?: string; +}; -/** + /** * @description successful operation - */ -export type UploadFile200 = ApiResponse +*/ +export type UploadFile200 = ApiResponse; -export type UploadFileMutationRequest = string + export type UploadFileMutationRequest = string; -/** + /** * @description successful operation - */ -export type UploadFileMutationResponse = ApiResponse +*/ +export type UploadFileMutationResponse = ApiResponse; -export type UploadFileMutation = { - Response: UploadFileMutationResponse - Request: UploadFileMutationRequest - PathParams: UploadFilePathParams - QueryParams: UploadFileQueryParams -} + export type UploadFileMutation = { + Response: UploadFileMutationResponse; + Request: UploadFileMutationRequest; + PathParams: UploadFilePathParams; + QueryParams: UploadFileQueryParams; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/User.ts b/examples/vue-query-v5/src/gen/models/User.ts index fd722d07d..6d8cc00d6 100644 --- a/examples/vue-query-v5/src/gen/models/User.ts +++ b/examples/vue-query-v5/src/gen/models/User.ts @@ -1,35 +1,35 @@ export type User = { - /** - * @type integer | undefined int64 - */ - id?: number - /** - * @type string | undefined - */ - username?: string - /** - * @type string | undefined - */ - firstName?: string - /** - * @type string | undefined - */ - lastName?: string - /** - * @type string | undefined - */ - email?: string - /** - * @type string | undefined - */ - password?: string - /** - * @type string | undefined - */ - phone?: string - /** - * @description User Status - * @type integer | undefined int32 - */ - userStatus?: number -} + /** + * @type integer | undefined int64 + */ + id?: number; + /** + * @type string | undefined + */ + username?: string; + /** + * @type string | undefined + */ + firstName?: string; + /** + * @type string | undefined + */ + lastName?: string; + /** + * @type string | undefined + */ + email?: string; + /** + * @type string | undefined + */ + password?: string; + /** + * @type string | undefined + */ + phone?: string; + /** + * @description User Status + * @type integer | undefined int32 + */ + userStatus?: number; +}; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/UserArray.ts b/examples/vue-query-v5/src/gen/models/UserArray.ts index effb23af2..21e14e46a 100644 --- a/examples/vue-query-v5/src/gen/models/UserArray.ts +++ b/examples/vue-query-v5/src/gen/models/UserArray.ts @@ -1,3 +1,3 @@ -import type { User } from './User' +import { User } from "./User"; -export type UserArray = User[] + export type UserArray = User[]; \ No newline at end of file diff --git a/examples/vue-query-v5/src/gen/models/index.ts b/examples/vue-query-v5/src/gen/models/index.ts index d3a6835ce..c6fbcf0bc 100644 --- a/examples/vue-query-v5/src/gen/models/index.ts +++ b/examples/vue-query-v5/src/gen/models/index.ts @@ -1,28 +1,28 @@ -export * from './AddPet' -export * from './Address' -export * from './ApiResponse' -export * from './Category' -export * from './CreateUser' -export * from './CreateUsersWithListInput' -export * from './Customer' -export * from './DeleteOrder' -export * from './DeletePet' -export * from './DeleteUser' -export * from './FindPetsByStatus' -export * from './FindPetsByTags' -export * from './GetInventory' -export * from './GetOrderById' -export * from './GetPetById' -export * from './GetUserByName' -export * from './LoginUser' -export * from './LogoutUser' -export * from './Order' -export * from './Pet' -export * from './PlaceOrder' -export * from './Tag' -export * from './UpdatePet' -export * from './UpdatePetWithForm' -export * from './UpdateUser' -export * from './UploadFile' -export * from './User' -export * from './UserArray' +export * from "./AddPet"; +export * from "./Address"; +export * from "./ApiResponse"; +export * from "./Category"; +export * from "./CreateUser"; +export * from "./CreateUsersWithListInput"; +export * from "./Customer"; +export * from "./DeleteOrder"; +export * from "./DeletePet"; +export * from "./DeleteUser"; +export * from "./FindPetsByStatus"; +export * from "./FindPetsByTags"; +export * from "./GetInventory"; +export * from "./GetOrderById"; +export * from "./GetPetById"; +export * from "./GetUserByName"; +export * from "./LoginUser"; +export * from "./LogoutUser"; +export * from "./Order"; +export * from "./Pet"; +export * from "./PlaceOrder"; +export * from "./Tag"; +export * from "./UpdatePet"; +export * from "./UpdatePetWithForm"; +export * from "./UpdateUser"; +export * from "./UploadFile"; +export * from "./User"; +export * from "./UserArray"; \ No newline at end of file diff --git a/examples/zod/package.json b/examples/zod/package.json index d45eef672..d58fa2471 100644 --- a/examples/zod/package.json +++ b/examples/zod/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@kubb/ts-config": "workspace:*", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/zod/src/gen/zod/addPetRequestSchema.ts b/examples/zod/src/gen/zod/addPetRequestSchema.ts index 880f97422..9e6b25c1a 100644 --- a/examples/zod/src/gen/zod/addPetRequestSchema.ts +++ b/examples/zod/src/gen/zod/addPetRequestSchema.ts @@ -5,8 +5,8 @@ import { tagSchema } from './tagSchema' export const addPetRequestSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagSchema)).optional(), + tags: z.array(z.lazy(() => tagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) diff --git a/examples/zod/src/gen/zod/addPetSchema.ts b/examples/zod/src/gen/zod/addPetSchema.ts index 4109b3f15..1cc44f6f3 100644 --- a/examples/zod/src/gen/zod/addPetSchema.ts +++ b/examples/zod/src/gen/zod/addPetSchema.ts @@ -5,7 +5,7 @@ import { petSchema } from './petSchema' /** * @description Successful operation */ -export const addPet200Schema = z.lazy(() => petSchema) +export const addPet200Schema = z.lazy(() => petSchema).schema /** * @description Pet not found @@ -15,9 +15,9 @@ export const addPet405Schema = z.object({ code: z.number().optional(), message: /** * @description Create a new pet in the store */ -export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema) +export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema).schema /** * @description Successful operation */ -export const addPetMutationResponseSchema = z.lazy(() => petSchema) +export const addPetMutationResponseSchema = z.lazy(() => petSchema).schema diff --git a/examples/zod/src/gen/zod/createPetsSchema.ts b/examples/zod/src/gen/zod/createPetsSchema.ts index f9040a40b..638b24c68 100644 --- a/examples/zod/src/gen/zod/createPetsSchema.ts +++ b/examples/zod/src/gen/zod/createPetsSchema.ts @@ -15,7 +15,7 @@ export const createPets201Schema = z.any() /** * @description unexpected error */ -export const createPetsErrorSchema = z.lazy(() => petNotFoundSchema).describe('Pet not found') +export const createPetsErrorSchema = z.lazy(() => petNotFoundSchema).schema.describe('Pet not found') export const createPetsMutationRequestSchema = z.object({ name: z.string(), tag: z.string() }) diff --git a/examples/zod/src/gen/zod/createUserSchema.ts b/examples/zod/src/gen/zod/createUserSchema.ts index 6f8d730de..7b02f1a6d 100644 --- a/examples/zod/src/gen/zod/createUserSchema.ts +++ b/examples/zod/src/gen/zod/createUserSchema.ts @@ -4,11 +4,11 @@ import { userSchema } from './userSchema' /** * @description successful operation */ -export const createUserErrorSchema = z.lazy(() => userSchema) +export const createUserErrorSchema = z.lazy(() => userSchema).schema /** * @description Created user object */ -export const createUserMutationRequestSchema = z.lazy(() => userSchema) +export const createUserMutationRequestSchema = z.lazy(() => userSchema).schema export const createUserMutationResponseSchema = z.any() diff --git a/examples/zod/src/gen/zod/createUsersWithListInputSchema.ts b/examples/zod/src/gen/zod/createUsersWithListInputSchema.ts index e1a4ffdc9..c5ffbef93 100644 --- a/examples/zod/src/gen/zod/createUsersWithListInputSchema.ts +++ b/examples/zod/src/gen/zod/createUsersWithListInputSchema.ts @@ -4,16 +4,16 @@ import { userSchema } from './userSchema' /** * @description Successful operation */ -export const createUsersWithListInput200Schema = z.lazy(() => userSchema) +export const createUsersWithListInput200Schema = z.lazy(() => userSchema).schema /** * @description successful operation */ export const createUsersWithListInputErrorSchema = z.any() -export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema)) +export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema).schema) /** * @description Successful operation */ -export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema) +export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema).schema diff --git a/examples/zod/src/gen/zod/customerSchema.ts b/examples/zod/src/gen/zod/customerSchema.ts index 7ce857d12..3b9085dfa 100644 --- a/examples/zod/src/gen/zod/customerSchema.ts +++ b/examples/zod/src/gen/zod/customerSchema.ts @@ -1,4 +1,8 @@ import { z } from 'zod' import { addressSchema } from './addressSchema' -export const customerSchema = z.object({ id: z.number().optional(), username: z.string().optional(), address: z.array(z.lazy(() => addressSchema)).optional() }) +export const customerSchema = z.object({ + id: z.number().optional(), + username: z.string().optional(), + address: z.array(z.lazy(() => addressSchema).schema).optional(), +}) diff --git a/examples/zod/src/gen/zod/findPetsByStatusSchema.ts b/examples/zod/src/gen/zod/findPetsByStatusSchema.ts index 5919f00f4..5dc671259 100644 --- a/examples/zod/src/gen/zod/findPetsByStatusSchema.ts +++ b/examples/zod/src/gen/zod/findPetsByStatusSchema.ts @@ -8,7 +8,7 @@ export const findPetsByStatusQueryParamsSchema = z /** * @description successful operation */ -export const findPetsByStatus200Schema = z.array(z.lazy(() => petSchema)) +export const findPetsByStatus200Schema = z.array(z.lazy(() => petSchema).schema) /** * @description Invalid status value @@ -18,4 +18,4 @@ export const findPetsByStatus400Schema = z.any() /** * @description successful operation */ -export const findPetsByStatusQueryResponseSchema = z.array(z.lazy(() => petSchema)) +export const findPetsByStatusQueryResponseSchema = z.array(z.lazy(() => petSchema).schema) diff --git a/examples/zod/src/gen/zod/findPetsByTagsSchema.ts b/examples/zod/src/gen/zod/findPetsByTagsSchema.ts index bb5b21b5c..b71c08e9a 100644 --- a/examples/zod/src/gen/zod/findPetsByTagsSchema.ts +++ b/examples/zod/src/gen/zod/findPetsByTagsSchema.ts @@ -14,7 +14,7 @@ export const findPetsByTagsHeaderParamsSchema = z.object({ 'X-EXAMPLE': z.enum([ /** * @description successful operation */ -export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema)) +export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema).schema) /** * @description Invalid tag value @@ -24,4 +24,4 @@ export const findPetsByTags400Schema = z.any() /** * @description successful operation */ -export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema)) +export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema).schema) diff --git a/examples/zod/src/gen/zod/getOrderByIdSchema.ts b/examples/zod/src/gen/zod/getOrderByIdSchema.ts index ba940437e..0a6bf8452 100644 --- a/examples/zod/src/gen/zod/getOrderByIdSchema.ts +++ b/examples/zod/src/gen/zod/getOrderByIdSchema.ts @@ -6,7 +6,7 @@ export const getOrderByIdPathParamsSchema = z.object({ orderId: z.number().descr /** * @description successful operation */ -export const getOrderById200Schema = z.lazy(() => orderSchema) +export const getOrderById200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid ID supplied @@ -21,4 +21,4 @@ export const getOrderById404Schema = z.any() /** * @description successful operation */ -export const getOrderByIdQueryResponseSchema = z.lazy(() => orderSchema) +export const getOrderByIdQueryResponseSchema = z.lazy(() => orderSchema).schema diff --git a/examples/zod/src/gen/zod/getPetByIdSchema.ts b/examples/zod/src/gen/zod/getPetByIdSchema.ts index 5467addea..5b6a2171b 100644 --- a/examples/zod/src/gen/zod/getPetByIdSchema.ts +++ b/examples/zod/src/gen/zod/getPetByIdSchema.ts @@ -6,7 +6,7 @@ export const getPetByIdPathParamsSchema = z.object({ petId: z.number().describe( /** * @description successful operation */ -export const getPetById200Schema = z.lazy(() => petSchema) +export const getPetById200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied @@ -21,4 +21,4 @@ export const getPetById404Schema = z.any() /** * @description successful operation */ -export const getPetByIdQueryResponseSchema = z.lazy(() => petSchema) +export const getPetByIdQueryResponseSchema = z.lazy(() => petSchema).schema diff --git a/examples/zod/src/gen/zod/getUserByNameSchema.ts b/examples/zod/src/gen/zod/getUserByNameSchema.ts index 8627b7d8d..833ac245a 100644 --- a/examples/zod/src/gen/zod/getUserByNameSchema.ts +++ b/examples/zod/src/gen/zod/getUserByNameSchema.ts @@ -6,7 +6,7 @@ export const getUserByNamePathParamsSchema = z.object({ username: z.string().des /** * @description successful operation */ -export const getUserByName200Schema = z.lazy(() => userSchema) +export const getUserByName200Schema = z.lazy(() => userSchema).schema /** * @description Invalid username supplied @@ -21,4 +21,4 @@ export const getUserByName404Schema = z.any() /** * @description successful operation */ -export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema) +export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema).schema diff --git a/examples/zod/src/gen/zod/petSchema.ts b/examples/zod/src/gen/zod/petSchema.ts index 2bafaaeaf..e5682f0fe 100644 --- a/examples/zod/src/gen/zod/petSchema.ts +++ b/examples/zod/src/gen/zod/petSchema.ts @@ -5,8 +5,8 @@ import { tagSchema } from './tagSchema' export const petSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagSchema)).optional(), + tags: z.array(z.lazy(() => tagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) diff --git a/examples/zod/src/gen/zod/placeOrderPatchSchema.ts b/examples/zod/src/gen/zod/placeOrderPatchSchema.ts index 76321227b..4668e2a66 100644 --- a/examples/zod/src/gen/zod/placeOrderPatchSchema.ts +++ b/examples/zod/src/gen/zod/placeOrderPatchSchema.ts @@ -4,16 +4,16 @@ import { orderSchema } from './orderSchema' /** * @description successful operation */ -export const placeOrderPatch200Schema = z.lazy(() => orderSchema) +export const placeOrderPatch200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid input */ export const placeOrderPatch405Schema = z.any() -export const placeOrderPatchMutationRequestSchema = z.lazy(() => orderSchema) +export const placeOrderPatchMutationRequestSchema = z.lazy(() => orderSchema).schema /** * @description successful operation */ -export const placeOrderPatchMutationResponseSchema = z.lazy(() => orderSchema) +export const placeOrderPatchMutationResponseSchema = z.lazy(() => orderSchema).schema diff --git a/examples/zod/src/gen/zod/placeOrderSchema.ts b/examples/zod/src/gen/zod/placeOrderSchema.ts index 20b6b25e8..ad67f384f 100644 --- a/examples/zod/src/gen/zod/placeOrderSchema.ts +++ b/examples/zod/src/gen/zod/placeOrderSchema.ts @@ -4,16 +4,16 @@ import { orderSchema } from './orderSchema' /** * @description successful operation */ -export const placeOrder200Schema = z.lazy(() => orderSchema) +export const placeOrder200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid input */ export const placeOrder405Schema = z.any() -export const placeOrderMutationRequestSchema = z.lazy(() => orderSchema) +export const placeOrderMutationRequestSchema = z.lazy(() => orderSchema).schema /** * @description successful operation */ -export const placeOrderMutationResponseSchema = z.lazy(() => orderSchema) +export const placeOrderMutationResponseSchema = z.lazy(() => orderSchema).schema diff --git a/examples/zod/src/gen/zod/updatePetSchema.ts b/examples/zod/src/gen/zod/updatePetSchema.ts index 53abe1a2c..67b91fd93 100644 --- a/examples/zod/src/gen/zod/updatePetSchema.ts +++ b/examples/zod/src/gen/zod/updatePetSchema.ts @@ -4,7 +4,7 @@ import { petSchema } from './petSchema' /** * @description Successful operation */ -export const updatePet200Schema = z.lazy(() => petSchema) +export const updatePet200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied @@ -24,9 +24,9 @@ export const updatePet405Schema = z.any() /** * @description Update an existent pet in the store */ -export const updatePetMutationRequestSchema = z.lazy(() => petSchema) +export const updatePetMutationRequestSchema = z.lazy(() => petSchema).schema /** * @description Successful operation */ -export const updatePetMutationResponseSchema = z.lazy(() => petSchema) +export const updatePetMutationResponseSchema = z.lazy(() => petSchema).schema diff --git a/examples/zod/src/gen/zod/updateUserSchema.ts b/examples/zod/src/gen/zod/updateUserSchema.ts index 49120e75c..ecd34a2be 100644 --- a/examples/zod/src/gen/zod/updateUserSchema.ts +++ b/examples/zod/src/gen/zod/updateUserSchema.ts @@ -11,6 +11,6 @@ export const updateUserErrorSchema = z.any() /** * @description Update an existent user in the store */ -export const updateUserMutationRequestSchema = z.lazy(() => userSchema) +export const updateUserMutationRequestSchema = z.lazy(() => userSchema).schema export const updateUserMutationResponseSchema = z.any() diff --git a/examples/zod/src/gen/zod/uploadFileSchema.ts b/examples/zod/src/gen/zod/uploadFileSchema.ts index 20ac28e77..0104f20ca 100644 --- a/examples/zod/src/gen/zod/uploadFileSchema.ts +++ b/examples/zod/src/gen/zod/uploadFileSchema.ts @@ -8,11 +8,11 @@ export const uploadFileQueryParamsSchema = z.object({ additionalMetadata: z.stri /** * @description successful operation */ -export const uploadFile200Schema = z.lazy(() => apiResponseSchema) +export const uploadFile200Schema = z.lazy(() => apiResponseSchema).schema export const uploadFileMutationRequestSchema = z.string() /** * @description successful operation */ -export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema) +export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema).schema diff --git a/examples/zod/src/gen/zod/userArraySchema.ts b/examples/zod/src/gen/zod/userArraySchema.ts index d0e838ab6..8765f18c4 100644 --- a/examples/zod/src/gen/zod/userArraySchema.ts +++ b/examples/zod/src/gen/zod/userArraySchema.ts @@ -1,4 +1,4 @@ import { z } from 'zod' import { userSchema } from './userSchema' -export const userArraySchema = z.array(z.lazy(() => userSchema)) +export const userArraySchema = z.array(z.lazy(() => userSchema).schema) diff --git a/examples/zodios/package.json b/examples/zodios/package.json index 0833ef845..7ad447dfa 100644 --- a/examples/zodios/package.json +++ b/examples/zodios/package.json @@ -41,7 +41,7 @@ "@types/cors": "^2.8.17", "@types/express": "^4.17.21", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/examples/zodios/src/gen/zod/addPetRequestSchema.ts b/examples/zodios/src/gen/zod/addPetRequestSchema.ts index 880f97422..9e6b25c1a 100644 --- a/examples/zodios/src/gen/zod/addPetRequestSchema.ts +++ b/examples/zodios/src/gen/zod/addPetRequestSchema.ts @@ -5,8 +5,8 @@ import { tagSchema } from './tagSchema' export const addPetRequestSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagSchema)).optional(), + tags: z.array(z.lazy(() => tagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) diff --git a/examples/zodios/src/gen/zod/addPetSchema.ts b/examples/zodios/src/gen/zod/addPetSchema.ts index 4109b3f15..1cc44f6f3 100644 --- a/examples/zodios/src/gen/zod/addPetSchema.ts +++ b/examples/zodios/src/gen/zod/addPetSchema.ts @@ -5,7 +5,7 @@ import { petSchema } from './petSchema' /** * @description Successful operation */ -export const addPet200Schema = z.lazy(() => petSchema) +export const addPet200Schema = z.lazy(() => petSchema).schema /** * @description Pet not found @@ -15,9 +15,9 @@ export const addPet405Schema = z.object({ code: z.number().optional(), message: /** * @description Create a new pet in the store */ -export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema) +export const addPetMutationRequestSchema = z.lazy(() => addPetRequestSchema).schema /** * @description Successful operation */ -export const addPetMutationResponseSchema = z.lazy(() => petSchema) +export const addPetMutationResponseSchema = z.lazy(() => petSchema).schema diff --git a/examples/zodios/src/gen/zod/createUserSchema.ts b/examples/zodios/src/gen/zod/createUserSchema.ts index 6f8d730de..7b02f1a6d 100644 --- a/examples/zodios/src/gen/zod/createUserSchema.ts +++ b/examples/zodios/src/gen/zod/createUserSchema.ts @@ -4,11 +4,11 @@ import { userSchema } from './userSchema' /** * @description successful operation */ -export const createUserErrorSchema = z.lazy(() => userSchema) +export const createUserErrorSchema = z.lazy(() => userSchema).schema /** * @description Created user object */ -export const createUserMutationRequestSchema = z.lazy(() => userSchema) +export const createUserMutationRequestSchema = z.lazy(() => userSchema).schema export const createUserMutationResponseSchema = z.any() diff --git a/examples/zodios/src/gen/zod/createUsersWithListInputSchema.ts b/examples/zodios/src/gen/zod/createUsersWithListInputSchema.ts index e1a4ffdc9..c5ffbef93 100644 --- a/examples/zodios/src/gen/zod/createUsersWithListInputSchema.ts +++ b/examples/zodios/src/gen/zod/createUsersWithListInputSchema.ts @@ -4,16 +4,16 @@ import { userSchema } from './userSchema' /** * @description Successful operation */ -export const createUsersWithListInput200Schema = z.lazy(() => userSchema) +export const createUsersWithListInput200Schema = z.lazy(() => userSchema).schema /** * @description successful operation */ export const createUsersWithListInputErrorSchema = z.any() -export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema)) +export const createUsersWithListInputMutationRequestSchema = z.array(z.lazy(() => userSchema).schema) /** * @description Successful operation */ -export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema) +export const createUsersWithListInputMutationResponseSchema = z.lazy(() => userSchema).schema diff --git a/examples/zodios/src/gen/zod/customerSchema.ts b/examples/zodios/src/gen/zod/customerSchema.ts index 7ce857d12..3b9085dfa 100644 --- a/examples/zodios/src/gen/zod/customerSchema.ts +++ b/examples/zodios/src/gen/zod/customerSchema.ts @@ -1,4 +1,8 @@ import { z } from 'zod' import { addressSchema } from './addressSchema' -export const customerSchema = z.object({ id: z.number().optional(), username: z.string().optional(), address: z.array(z.lazy(() => addressSchema)).optional() }) +export const customerSchema = z.object({ + id: z.number().optional(), + username: z.string().optional(), + address: z.array(z.lazy(() => addressSchema).schema).optional(), +}) diff --git a/examples/zodios/src/gen/zod/findPetsByStatusSchema.ts b/examples/zodios/src/gen/zod/findPetsByStatusSchema.ts index 5919f00f4..5dc671259 100644 --- a/examples/zodios/src/gen/zod/findPetsByStatusSchema.ts +++ b/examples/zodios/src/gen/zod/findPetsByStatusSchema.ts @@ -8,7 +8,7 @@ export const findPetsByStatusQueryParamsSchema = z /** * @description successful operation */ -export const findPetsByStatus200Schema = z.array(z.lazy(() => petSchema)) +export const findPetsByStatus200Schema = z.array(z.lazy(() => petSchema).schema) /** * @description Invalid status value @@ -18,4 +18,4 @@ export const findPetsByStatus400Schema = z.any() /** * @description successful operation */ -export const findPetsByStatusQueryResponseSchema = z.array(z.lazy(() => petSchema)) +export const findPetsByStatusQueryResponseSchema = z.array(z.lazy(() => petSchema).schema) diff --git a/examples/zodios/src/gen/zod/findPetsByTagsSchema.ts b/examples/zodios/src/gen/zod/findPetsByTagsSchema.ts index b42091009..188307956 100644 --- a/examples/zodios/src/gen/zod/findPetsByTagsSchema.ts +++ b/examples/zodios/src/gen/zod/findPetsByTagsSchema.ts @@ -12,7 +12,7 @@ export const findPetsByTagsQueryParamsSchema = z /** * @description successful operation */ -export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema)) +export const findPetsByTags200Schema = z.array(z.lazy(() => petSchema).schema) /** * @description Invalid tag value @@ -22,4 +22,4 @@ export const findPetsByTags400Schema = z.any() /** * @description successful operation */ -export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema)) +export const findPetsByTagsQueryResponseSchema = z.array(z.lazy(() => petSchema).schema) diff --git a/examples/zodios/src/gen/zod/getOrderByIdSchema.ts b/examples/zodios/src/gen/zod/getOrderByIdSchema.ts index ba940437e..0a6bf8452 100644 --- a/examples/zodios/src/gen/zod/getOrderByIdSchema.ts +++ b/examples/zodios/src/gen/zod/getOrderByIdSchema.ts @@ -6,7 +6,7 @@ export const getOrderByIdPathParamsSchema = z.object({ orderId: z.number().descr /** * @description successful operation */ -export const getOrderById200Schema = z.lazy(() => orderSchema) +export const getOrderById200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid ID supplied @@ -21,4 +21,4 @@ export const getOrderById404Schema = z.any() /** * @description successful operation */ -export const getOrderByIdQueryResponseSchema = z.lazy(() => orderSchema) +export const getOrderByIdQueryResponseSchema = z.lazy(() => orderSchema).schema diff --git a/examples/zodios/src/gen/zod/getPetByIdSchema.ts b/examples/zodios/src/gen/zod/getPetByIdSchema.ts index 5467addea..5b6a2171b 100644 --- a/examples/zodios/src/gen/zod/getPetByIdSchema.ts +++ b/examples/zodios/src/gen/zod/getPetByIdSchema.ts @@ -6,7 +6,7 @@ export const getPetByIdPathParamsSchema = z.object({ petId: z.number().describe( /** * @description successful operation */ -export const getPetById200Schema = z.lazy(() => petSchema) +export const getPetById200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied @@ -21,4 +21,4 @@ export const getPetById404Schema = z.any() /** * @description successful operation */ -export const getPetByIdQueryResponseSchema = z.lazy(() => petSchema) +export const getPetByIdQueryResponseSchema = z.lazy(() => petSchema).schema diff --git a/examples/zodios/src/gen/zod/getUserByNameSchema.ts b/examples/zodios/src/gen/zod/getUserByNameSchema.ts index 8627b7d8d..833ac245a 100644 --- a/examples/zodios/src/gen/zod/getUserByNameSchema.ts +++ b/examples/zodios/src/gen/zod/getUserByNameSchema.ts @@ -6,7 +6,7 @@ export const getUserByNamePathParamsSchema = z.object({ username: z.string().des /** * @description successful operation */ -export const getUserByName200Schema = z.lazy(() => userSchema) +export const getUserByName200Schema = z.lazy(() => userSchema).schema /** * @description Invalid username supplied @@ -21,4 +21,4 @@ export const getUserByName404Schema = z.any() /** * @description successful operation */ -export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema) +export const getUserByNameQueryResponseSchema = z.lazy(() => userSchema).schema diff --git a/examples/zodios/src/gen/zod/petSchema.ts b/examples/zodios/src/gen/zod/petSchema.ts index 2bafaaeaf..e5682f0fe 100644 --- a/examples/zodios/src/gen/zod/petSchema.ts +++ b/examples/zodios/src/gen/zod/petSchema.ts @@ -5,8 +5,8 @@ import { tagSchema } from './tagSchema' export const petSchema = z.object({ id: z.number().optional(), name: z.string(), - category: z.lazy(() => categorySchema).optional(), + category: z.lazy(() => categorySchema).schema.optional(), photoUrls: z.array(z.string()), - tags: z.array(z.lazy(() => tagSchema)).optional(), + tags: z.array(z.lazy(() => tagSchema).schema).optional(), status: z.enum(['available', 'pending', 'sold']).describe('pet status in the store').optional(), }) diff --git a/examples/zodios/src/gen/zod/placeOrderPatchSchema.ts b/examples/zodios/src/gen/zod/placeOrderPatchSchema.ts index 76321227b..4668e2a66 100644 --- a/examples/zodios/src/gen/zod/placeOrderPatchSchema.ts +++ b/examples/zodios/src/gen/zod/placeOrderPatchSchema.ts @@ -4,16 +4,16 @@ import { orderSchema } from './orderSchema' /** * @description successful operation */ -export const placeOrderPatch200Schema = z.lazy(() => orderSchema) +export const placeOrderPatch200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid input */ export const placeOrderPatch405Schema = z.any() -export const placeOrderPatchMutationRequestSchema = z.lazy(() => orderSchema) +export const placeOrderPatchMutationRequestSchema = z.lazy(() => orderSchema).schema /** * @description successful operation */ -export const placeOrderPatchMutationResponseSchema = z.lazy(() => orderSchema) +export const placeOrderPatchMutationResponseSchema = z.lazy(() => orderSchema).schema diff --git a/examples/zodios/src/gen/zod/placeOrderSchema.ts b/examples/zodios/src/gen/zod/placeOrderSchema.ts index 20b6b25e8..ad67f384f 100644 --- a/examples/zodios/src/gen/zod/placeOrderSchema.ts +++ b/examples/zodios/src/gen/zod/placeOrderSchema.ts @@ -4,16 +4,16 @@ import { orderSchema } from './orderSchema' /** * @description successful operation */ -export const placeOrder200Schema = z.lazy(() => orderSchema) +export const placeOrder200Schema = z.lazy(() => orderSchema).schema /** * @description Invalid input */ export const placeOrder405Schema = z.any() -export const placeOrderMutationRequestSchema = z.lazy(() => orderSchema) +export const placeOrderMutationRequestSchema = z.lazy(() => orderSchema).schema /** * @description successful operation */ -export const placeOrderMutationResponseSchema = z.lazy(() => orderSchema) +export const placeOrderMutationResponseSchema = z.lazy(() => orderSchema).schema diff --git a/examples/zodios/src/gen/zod/updatePetSchema.ts b/examples/zodios/src/gen/zod/updatePetSchema.ts index 53abe1a2c..67b91fd93 100644 --- a/examples/zodios/src/gen/zod/updatePetSchema.ts +++ b/examples/zodios/src/gen/zod/updatePetSchema.ts @@ -4,7 +4,7 @@ import { petSchema } from './petSchema' /** * @description Successful operation */ -export const updatePet200Schema = z.lazy(() => petSchema) +export const updatePet200Schema = z.lazy(() => petSchema).schema /** * @description Invalid ID supplied @@ -24,9 +24,9 @@ export const updatePet405Schema = z.any() /** * @description Update an existent pet in the store */ -export const updatePetMutationRequestSchema = z.lazy(() => petSchema) +export const updatePetMutationRequestSchema = z.lazy(() => petSchema).schema /** * @description Successful operation */ -export const updatePetMutationResponseSchema = z.lazy(() => petSchema) +export const updatePetMutationResponseSchema = z.lazy(() => petSchema).schema diff --git a/examples/zodios/src/gen/zod/updateUserSchema.ts b/examples/zodios/src/gen/zod/updateUserSchema.ts index 49120e75c..ecd34a2be 100644 --- a/examples/zodios/src/gen/zod/updateUserSchema.ts +++ b/examples/zodios/src/gen/zod/updateUserSchema.ts @@ -11,6 +11,6 @@ export const updateUserErrorSchema = z.any() /** * @description Update an existent user in the store */ -export const updateUserMutationRequestSchema = z.lazy(() => userSchema) +export const updateUserMutationRequestSchema = z.lazy(() => userSchema).schema export const updateUserMutationResponseSchema = z.any() diff --git a/examples/zodios/src/gen/zod/uploadFileSchema.ts b/examples/zodios/src/gen/zod/uploadFileSchema.ts index 20ac28e77..0104f20ca 100644 --- a/examples/zodios/src/gen/zod/uploadFileSchema.ts +++ b/examples/zodios/src/gen/zod/uploadFileSchema.ts @@ -8,11 +8,11 @@ export const uploadFileQueryParamsSchema = z.object({ additionalMetadata: z.stri /** * @description successful operation */ -export const uploadFile200Schema = z.lazy(() => apiResponseSchema) +export const uploadFile200Schema = z.lazy(() => apiResponseSchema).schema export const uploadFileMutationRequestSchema = z.string() /** * @description successful operation */ -export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema) +export const uploadFileMutationResponseSchema = z.lazy(() => apiResponseSchema).schema diff --git a/examples/zodios/src/gen/zod/userArraySchema.ts b/examples/zodios/src/gen/zod/userArraySchema.ts index d0e838ab6..8765f18c4 100644 --- a/examples/zodios/src/gen/zod/userArraySchema.ts +++ b/examples/zodios/src/gen/zod/userArraySchema.ts @@ -1,4 +1,4 @@ import { z } from 'zod' import { userSchema } from './userSchema' -export const userArraySchema = z.array(z.lazy(() => userSchema)) +export const userArraySchema = z.array(z.lazy(() => userSchema).schema) diff --git a/package.json b/package.json index fb27f6803..d8c60de89 100644 --- a/package.json +++ b/package.json @@ -59,16 +59,16 @@ "@changesets/cli": "^2.27.1", "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", - "@types/node": "^20.12.5", - "@vitest/coverage-v8": "^1.4.0", - "@vitest/ui": "^1.4.0", + "@types/node": "^20.12.7", + "@vitest/coverage-v8": "^1.5.0", + "@vitest/ui": "^1.5.0", "bun-types": "^1.1.3", "rimraf": "^5.0.5", "ts-node": "^10.9.2", "turbo": "^1.13.2", - "typescript": "^5.4.4", + "typescript": "^5.4.5", "vite-tsconfig-paths": "^4.3.2", - "vitest": "^1.4.0" + "vitest": "^1.5.0" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/packages/cli/package.json b/packages/cli/package.json index f8331f4e6..4b92e9fb8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -56,10 +56,10 @@ "@kubb/swagger": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/node": "^20.12.5", + "@types/node": "^20.12.7", "source-map-support": "^0.5.21", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/packages/config/ts-config/package.json b/packages/config/ts-config/package.json index ac5f70e81..82d2405fe 100644 --- a/packages/config/ts-config/package.json +++ b/packages/config/ts-config/package.json @@ -9,6 +9,6 @@ "bundler.json" ], "devDependencies": { - "typescript": "^5.4.4" + "typescript": "^5.4.5" } } diff --git a/packages/config/tsup-config/package.json b/packages/config/tsup-config/package.json index 28862b74a..59570d368 100644 --- a/packages/config/tsup-config/package.json +++ b/packages/config/tsup-config/package.json @@ -33,14 +33,14 @@ "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false" }, "dependencies": { - "@microsoft/api-extractor": "^7.43.0", + "@microsoft/api-extractor": "^7.43.1", "esbuild-plugin-file-path-extensions": "^2.0.0", "fast-glob": "^3.3.2", "tinyrainbow": "^1.1.1" }, "devDependencies": { "@kubb/ts-config": "workspace:*", - "@types/node": "^20.12.5", + "@types/node": "^20.12.7", "tsup": "^8.0.2" }, "peerDependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index 05e68016c..181abf94b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -81,9 +81,9 @@ "find-up": "^7.0.0", "fs-extra": "^11.2.0", "js-runtime": "^0.0.7", - "remeda": "^1.57.2", "natural-orderby": "^3.0.2", "p-queue": "^8.0.1", + "remeda": "^1.58.1", "seedrandom": "^3.0.5", "semver": "^7.6.0", "unraw": "^3.0.0" @@ -93,14 +93,14 @@ "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", "@types/fs-extra": "^11.0.4", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "@types/seedrandom": "^3.0.8", "@types/semver": "^7.5.8", "ora": "^8.0.1", "prettier": "^3.2.5", "tinyrainbow": "^1.1.1", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/packages/kubb/package.json b/packages/kubb/package.json index 088eb3c06..9d9a1a19c 100644 --- a/packages/kubb/package.json +++ b/packages/kubb/package.json @@ -37,9 +37,9 @@ "devDependencies": { "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/node": "^20.12.5", + "@types/node": "^20.12.7", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/packages/parser/package.json b/packages/parser/package.json index 05564585b..95ed9f40d 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -47,8 +47,8 @@ "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false" }, "dependencies": { - "remeda": "^1.57.2", - "typescript": "^5.4.4" + "remeda": "^1.58.1", + "typescript": "^5.4.5" }, "devDependencies": { "@kubb/biome-config": "workspace:*", diff --git a/packages/react/package.json b/packages/react/package.json index 9789aa55e..9e35b2456 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -70,13 +70,13 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "@types/react-reconciler": "^0.28.8", "prettier": "^3.2.5", "react": "^18.2.0", "react-reconciler": "^0.29.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/packages/swagger-client/mocks/petStore.yaml b/packages/swagger-client/mocks/petStore.yaml index ca0e9a16b..af1ca33d3 100644 --- a/packages/swagger-client/mocks/petStore.yaml +++ b/packages/swagger-client/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/packages/swagger-client/package.json b/packages/swagger-client/package.json index 2d45d8dd9..59ca852a2 100644 --- a/packages/swagger-client/package.json +++ b/packages/swagger-client/package.json @@ -67,11 +67,11 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "axios": "^1.6.8", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "peerDependencies": { "axios": "^1.6.8", diff --git a/packages/swagger-faker/mocks/petStore.yaml b/packages/swagger-faker/mocks/petStore.yaml index 2823edd82..347cd7fa7 100644 --- a/packages/swagger-faker/mocks/petStore.yaml +++ b/packages/swagger-faker/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/packages/swagger-faker/package.json b/packages/swagger-faker/package.json index 775d9eb2f..8a31d30ac 100644 --- a/packages/swagger-faker/package.json +++ b/packages/swagger-faker/package.json @@ -57,10 +57,10 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "peerDependencies": { "@kubb/react": "workspace:*" diff --git a/packages/swagger-faker/src/OperationGenerator.test.tsx b/packages/swagger-faker/src/OperationGenerator.test.tsx index 8a01303d3..9ca2a3a99 100644 --- a/packages/swagger-faker/src/OperationGenerator.test.tsx +++ b/packages/swagger-faker/src/OperationGenerator.test.tsx @@ -22,6 +22,7 @@ describe('OperationGenerator', async () => { transformers: {}, unknownType: 'any', mapper: {}, + override: [], } const og = await new OperationGenerator(options, { @@ -56,6 +57,7 @@ describe('OperationGenerator', async () => { transformers: {}, unknownType: 'any', mapper: {}, + override: [], } const og = await new OperationGenerator(options, { @@ -90,6 +92,7 @@ describe('OperationGenerator', async () => { transformers: {}, unknownType: 'any', mapper: {}, + override: [], } const og = await new OperationGenerator(options, { @@ -117,6 +120,7 @@ describe('OperationGenerator', async () => { transformers: {}, unknownType: 'any', mapper: {}, + override: [], } const og = await new OperationGenerator(options, { diff --git a/packages/swagger-faker/src/SchemaGenerator.test.tsx b/packages/swagger-faker/src/SchemaGenerator.test.tsx index 4291fd007..f0558f02d 100644 --- a/packages/swagger-faker/src/SchemaGenerator.test.tsx +++ b/packages/swagger-faker/src/SchemaGenerator.test.tsx @@ -20,6 +20,7 @@ describe('Faker SchemaGenerator enums', async () => { transformers: {}, unknownType: 'any', mapper: {}, + override: [], }, { oas, @@ -28,6 +29,7 @@ describe('Faker SchemaGenerator enums', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) diff --git a/packages/swagger-faker/src/__snapshots__/fakerParser.test.ts.snap b/packages/swagger-faker/src/__snapshots__/fakerParser.test.ts.snap index 4d057c699..3cd7cab8f 100644 --- a/packages/swagger-faker/src/__snapshots__/fakerParser.test.ts.snap +++ b/packages/swagger-faker/src/__snapshots__/fakerParser.test.ts.snap @@ -99,6 +99,8 @@ exports[`parseFakerMeta > 'objectArray' 1`] = `"{"ids": faker.helpers.arrayEleme exports[`parseFakerMeta > 'objectEmpty' 1`] = `"{}"`; +exports[`parseFakerMeta > 'objectEnum' 1`] = `"{"version": faker.helpers.arrayElement(["A", "B", "C", 2])}"`; + exports[`parseFakerMeta > 'objectOptional' 1`] = `"{"firstName": faker.string.alpha(),"address": faker.string.alpha()}"`; exports[`parseFakerMeta > 'ref' 1`] = `"Pet()"`; diff --git a/packages/swagger-faker/src/components/OperationSchema.test.tsx b/packages/swagger-faker/src/components/OperationSchema.test.tsx index 046b11f30..c3861ca3e 100644 --- a/packages/swagger-faker/src/components/OperationSchema.test.tsx +++ b/packages/swagger-faker/src/components/OperationSchema.test.tsx @@ -35,6 +35,7 @@ describe('', async () => { transformers: {}, unknownType: 'any', mapper: {}, + override: [], } const plugin = { options } as Plugin diff --git a/packages/swagger-faker/src/components/OperationSchema.tsx b/packages/swagger-faker/src/components/OperationSchema.tsx index 3b2851d79..7c160fab0 100644 --- a/packages/swagger-faker/src/components/OperationSchema.tsx +++ b/packages/swagger-faker/src/components/OperationSchema.tsx @@ -31,6 +31,7 @@ OperationSchema.File = function ({}: FileProps): ReactNode { plugin, pluginManager, mode, + override: plugin.options.override, }) const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean) diff --git a/packages/swagger-faker/src/components/Schema.test.tsx b/packages/swagger-faker/src/components/Schema.test.tsx index df88ddb35..cd0c3078d 100644 --- a/packages/swagger-faker/src/components/Schema.test.tsx +++ b/packages/swagger-faker/src/components/Schema.test.tsx @@ -35,6 +35,7 @@ describe('', async () => { transformers: {}, unknownType: 'any', mapper: {}, + override: [], } const plugin = { options } as Plugin diff --git a/packages/swagger-faker/src/plugin.ts b/packages/swagger-faker/src/plugin.ts index 72391c65f..e36d80f3b 100644 --- a/packages/swagger-faker/src/plugin.ts +++ b/packages/swagger-faker/src/plugin.ts @@ -41,6 +41,7 @@ export const definePlugin = createPlugin((options) => { seed, unknownType, mapper, + override, }, pre: [swaggerPluginName, swaggerTypeScriptPluginName], resolvePath(baseName, pathMode, options) { @@ -95,6 +96,7 @@ export const definePlugin = createPlugin((options) => { plugin: this.plugin, contentType: swaggerPlugin.api.contentType, include: undefined, + override, mode, output: output.path, }) diff --git a/packages/swagger-faker/src/types.ts b/packages/swagger-faker/src/types.ts index 8724c2416..7bbe4e9f0 100644 --- a/packages/swagger-faker/src/types.ts +++ b/packages/swagger-faker/src/types.ts @@ -92,6 +92,7 @@ type ResolvedOptions = { dateType: NonNullable unknownType: NonNullable transformers: NonNullable + override: NonNullable seed: NonNullable | undefined mapper: Record } diff --git a/packages/swagger-msw/mocks/petStore.yaml b/packages/swagger-msw/mocks/petStore.yaml index 2823edd82..347cd7fa7 100644 --- a/packages/swagger-msw/mocks/petStore.yaml +++ b/packages/swagger-msw/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/packages/swagger-msw/package.json b/packages/swagger-msw/package.json index 9b4d2c6d1..6a18e8eb1 100644 --- a/packages/swagger-msw/package.json +++ b/packages/swagger-msw/package.json @@ -58,10 +58,10 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "peerDependencies": { "@kubb/react": "workspace:*" diff --git a/packages/swagger-swr/mocks/petStore.yaml b/packages/swagger-swr/mocks/petStore.yaml index 2823edd82..347cd7fa7 100644 --- a/packages/swagger-swr/mocks/petStore.yaml +++ b/packages/swagger-swr/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/packages/swagger-swr/package.json b/packages/swagger-swr/package.json index 582492311..260b4406b 100644 --- a/packages/swagger-swr/package.json +++ b/packages/swagger-swr/package.json @@ -58,10 +58,10 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "peerDependencies": { "@kubb/react": "workspace:*" diff --git a/packages/swagger-tanstack-query/package.json b/packages/swagger-tanstack-query/package.json index 4d32dae26..bf8c74059 100644 --- a/packages/swagger-tanstack-query/package.json +++ b/packages/swagger-tanstack-query/package.json @@ -59,10 +59,10 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "peerDependencies": { "@kubb/react": "workspace:*" diff --git a/packages/swagger-ts/mocks/petStore.yaml b/packages/swagger-ts/mocks/petStore.yaml index a45534e13..472cf4175 100644 --- a/packages/swagger-ts/mocks/petStore.yaml +++ b/packages/swagger-ts/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/packages/swagger-ts/mocks/petStoreRef.yaml b/packages/swagger-ts/mocks/petStoreRef.yaml index 60ddcccc5..902c4604c 100644 --- a/packages/swagger-ts/mocks/petStoreRef.yaml +++ b/packages/swagger-ts/mocks/petStoreRef.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore ref diff --git a/packages/swagger-ts/package.json b/packages/swagger-ts/package.json index 82721fb79..45779511d 100644 --- a/packages/swagger-ts/package.json +++ b/packages/swagger-ts/package.json @@ -64,7 +64,7 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "expect-type": "^0.19.0", "prettier": "^3.2.5", "react": "^18.2.0", diff --git a/packages/swagger-ts/src/OperationGenerator.test.tsx b/packages/swagger-ts/src/OperationGenerator.test.tsx index 1fd4145dd..09bba10a3 100644 --- a/packages/swagger-ts/src/OperationGenerator.test.tsx +++ b/packages/swagger-ts/src/OperationGenerator.test.tsx @@ -25,6 +25,7 @@ describe('OperationGenerator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], } const og = await new OperationGenerator(options, { @@ -62,6 +63,7 @@ describe('OperationGenerator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], } const og = await new OperationGenerator(options, { @@ -92,6 +94,7 @@ describe('OperationGenerator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], } const og = await new OperationGenerator(options, { @@ -121,6 +124,7 @@ describe('OperationGenerator', async () => { transformers: {}, oasType: false, unknownType: 'unknown', + override: [], } const og = await new OperationGenerator(options, { diff --git a/packages/swagger-ts/src/SchemaGenerator.test.tsx b/packages/swagger-ts/src/SchemaGenerator.test.tsx index 32a13244c..0da0bf9c8 100644 --- a/packages/swagger-ts/src/SchemaGenerator.test.tsx +++ b/packages/swagger-ts/src/SchemaGenerator.test.tsx @@ -24,6 +24,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -32,6 +33,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -52,6 +54,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -60,6 +63,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -80,6 +84,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -88,6 +93,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -108,6 +114,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas: {} as Oas, @@ -119,6 +126,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -148,6 +156,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -156,6 +165,7 @@ describe('TypeScript SchemaGenerator petStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -181,6 +191,7 @@ describe('SchemaGenerator petStoreRef', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -189,6 +200,7 @@ describe('SchemaGenerator petStoreRef', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -214,6 +226,7 @@ describe('SchemaGenerator discriminator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -222,6 +235,7 @@ describe('SchemaGenerator discriminator', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -242,6 +256,7 @@ describe('SchemaGenerator discriminator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -250,6 +265,7 @@ describe('SchemaGenerator discriminator', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -270,6 +286,7 @@ describe('SchemaGenerator discriminator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -278,6 +295,7 @@ describe('SchemaGenerator discriminator', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -298,6 +316,7 @@ describe('SchemaGenerator discriminator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -306,6 +325,7 @@ describe('SchemaGenerator discriminator', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) const schemas = oas.getDefinition().components?.schemas @@ -325,6 +345,7 @@ describe('SchemaGenerator discriminator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -333,6 +354,7 @@ describe('SchemaGenerator discriminator', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -353,6 +375,7 @@ describe('SchemaGenerator discriminator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -361,6 +384,7 @@ describe('SchemaGenerator discriminator', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -381,6 +405,7 @@ describe('SchemaGenerator discriminator', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -389,6 +414,7 @@ describe('SchemaGenerator discriminator', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -412,6 +438,7 @@ describe('SchemaGenerator enums', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -420,6 +447,7 @@ describe('SchemaGenerator enums', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -478,6 +506,7 @@ describe('SchemaGenerator enums', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -486,6 +515,7 @@ describe('SchemaGenerator enums', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -505,6 +535,7 @@ describe('SchemaGenerator enums', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -513,6 +544,7 @@ describe('SchemaGenerator enums', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -532,6 +564,7 @@ describe('SchemaGenerator enums', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -540,6 +573,7 @@ describe('SchemaGenerator enums', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -559,6 +593,7 @@ describe('SchemaGenerator enums', async () => { transformers: {}, oasType: false, unknownType: 'any', + override: [], }, { oas, @@ -567,6 +602,7 @@ describe('SchemaGenerator enums', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) diff --git a/packages/swagger-ts/src/__snapshots__/typeParser.test.ts.snap b/packages/swagger-ts/src/__snapshots__/typeParser.test.ts.snap index 919ca9fbe..962f67e77 100644 --- a/packages/swagger-ts/src/__snapshots__/typeParser.test.ts.snap +++ b/packages/swagger-ts/src/__snapshots__/typeParser.test.ts.snap @@ -130,6 +130,16 @@ exports[`parseTypeMeta > 'objectEmpty' 1`] = ` " `; +exports[`parseTypeMeta > 'objectEnum' 1`] = ` +"{ + /** + * @description Your address + */ + version: Enum; +} +" +`; + exports[`parseTypeMeta > 'objectOptional' 1`] = ` "{ firstName?: string; diff --git a/packages/swagger-ts/src/components/OperationSchema.test.tsx b/packages/swagger-ts/src/components/OperationSchema.test.tsx index 188ffaaf0..188a9b16f 100644 --- a/packages/swagger-ts/src/components/OperationSchema.test.tsx +++ b/packages/swagger-ts/src/components/OperationSchema.test.tsx @@ -27,6 +27,7 @@ describe('', async () => { oasType: false, optionalType: 'undefined', usedEnumNames: {}, + override: [], } const plugin = { options } as Plugin diff --git a/packages/swagger-ts/src/components/OperationSchema.tsx b/packages/swagger-ts/src/components/OperationSchema.tsx index 9ea6ccae0..ab598a1df 100644 --- a/packages/swagger-ts/src/components/OperationSchema.tsx +++ b/packages/swagger-ts/src/components/OperationSchema.tsx @@ -78,7 +78,7 @@ export function OperationSchema({}: Props): ReactNode { type FileProps = {} OperationSchema.File = function ({}: FileProps): ReactNode { - const { pluginManager, plugin, mode } = useApp() + const { pluginManager, plugin, mode, fileManager } = useApp() const oas = useOas() const { getSchemas, getFile, getName } = useOperationManager() const operation = useOperation() @@ -91,6 +91,7 @@ OperationSchema.File = function ({}: FileProps): ReactNode { plugin, pluginManager, mode, + override: plugin.options.override, }) const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean) diff --git a/packages/swagger-ts/src/plugin.ts b/packages/swagger-ts/src/plugin.ts index a768ee51c..2cd1337e5 100644 --- a/packages/swagger-ts/src/plugin.ts +++ b/packages/swagger-ts/src/plugin.ts @@ -43,6 +43,7 @@ export const definePlugin = createPlugin((options) => { // keep the used enumnames between SchemaGenerator and OperationGenerator per plugin(pluginKey) usedEnumNames: {}, unknownType, + override, }, pre: [swaggerPluginName], resolvePath(baseName, pathMode, options) { @@ -94,6 +95,7 @@ export const definePlugin = createPlugin((options) => { plugin: this.plugin, contentType: swaggerPlugin.api.contentType, include: undefined, + override, mode, output: output.path, }) diff --git a/packages/swagger-ts/src/types.ts b/packages/swagger-ts/src/types.ts index 9f65e4aa1..d16609871 100644 --- a/packages/swagger-ts/src/types.ts +++ b/packages/swagger-ts/src/types.ts @@ -100,6 +100,7 @@ type ResolvedOptions = { dateType: NonNullable unknownType: NonNullable optionalType: NonNullable + override: NonNullable transformers: NonNullable oasType: NonNullable usedEnumNames: Record diff --git a/packages/swagger-zod/mocks/enums.yaml b/packages/swagger-zod/mocks/enums.yaml index 779b79f8f..affd50779 100644 --- a/packages/swagger-zod/mocks/enums.yaml +++ b/packages/swagger-zod/mocks/enums.yaml @@ -1,19 +1,4 @@ -definitions: - enumVarNames.Type: - enum: - - 0 - - 1 - type: integer - x-enum-varnames: - - Pending - - Received - enumNames.Type: - enum: - - 0 - - 1 - x-enumNames: - - Pending - - Received + swagger: "2.0" info: title: test @@ -37,3 +22,19 @@ paths: description: Success schema: $ref: '#/definitions/enumNames.Type' +definitions: + enumVarNames.Type: + enum: + - 0 + - 1 + type: integer + x-enum-varnames: + - Pending + - Received + enumNames.Type: + enum: + - 0 + - 1 + x-enumNames: + - Pending + - Received diff --git a/packages/swagger-zod/mocks/enums3_1.yaml b/packages/swagger-zod/mocks/enums3_1.yaml new file mode 100644 index 000000000..1e41bdb5d --- /dev/null +++ b/packages/swagger-zod/mocks/enums3_1.yaml @@ -0,0 +1,25 @@ +openapi: 3.1.0 +info: + title: test + version: "1.0.0" + +components: + schemas: + enumNullable: + type: + - "string" + - "null" + enum: + - Pending + - Received + +paths: + /var-names: + get: + consumes: + - application/json + responses: + 200: + description: Success + schema: + $ref: '#/definitions/enumNullable' diff --git a/packages/swagger-zod/mocks/petStore.yaml b/packages/swagger-zod/mocks/petStore.yaml index 7b3109036..4937ea6cf 100644 --- a/packages/swagger-zod/mocks/petStore.yaml +++ b/packages/swagger-zod/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.1.0 info: version: 1.0.0 title: Swagger Petstore @@ -101,7 +101,7 @@ paths: components: schemas: Pet: - type: object + type: [object] required: - id - name diff --git a/packages/swagger-zod/mocks/petStoreRef.yaml b/packages/swagger-zod/mocks/petStoreRef.yaml index 60ddcccc5..902c4604c 100644 --- a/packages/swagger-zod/mocks/petStoreRef.yaml +++ b/packages/swagger-zod/mocks/petStoreRef.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore ref diff --git a/packages/swagger-zod/package.json b/packages/swagger-zod/package.json index 7ff0b5082..93f6d4813 100644 --- a/packages/swagger-zod/package.json +++ b/packages/swagger-zod/package.json @@ -57,11 +57,11 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "prettier": "^3.2.5", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "peerDependencies": { "@kubb/react": "workspace:*" diff --git a/packages/swagger-zod/src/SchemaGenerator.test.tsx b/packages/swagger-zod/src/SchemaGenerator.test.tsx index b765a701c..f18e838dd 100644 --- a/packages/swagger-zod/src/SchemaGenerator.test.tsx +++ b/packages/swagger-zod/src/SchemaGenerator.test.tsx @@ -36,6 +36,7 @@ describe('Zod SchemaGenerator PetStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -67,6 +68,7 @@ describe('Zod SchemaGenerator PetStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -98,6 +100,7 @@ describe('Zod SchemaGenerator PetStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -129,6 +132,7 @@ describe('Zod SchemaGenerator PetStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -160,6 +164,7 @@ describe('Zod SchemaGenerator PetStore', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -194,6 +199,7 @@ describe('ZodGenerator constCases', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -282,6 +288,7 @@ describe('Zod SchemaGenerator lazy', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -316,6 +323,7 @@ describe('Zod SchemaGenerator enums', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -360,6 +368,7 @@ describe('Zod SchemaGenerator recursive', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -394,6 +403,7 @@ describe('Zod SchemaGenerator anyof', async () => { contentType: undefined, include: undefined, mode: 'split', + override: [], }, ) @@ -406,3 +416,40 @@ describe('Zod SchemaGenerator anyof', async () => { expect(node).toMatchSnapshot() }) }) + +describe('Zod SchemaGenerator enums', async () => { + const schemaPath = path.resolve(__dirname, '../mocks/enums3_1.yaml') + const oas = await new OasManager().parse(schemaPath) + const generator = new SchemaGenerator( + { + transformers: {}, + dateType: 'string', + unknownType: 'any', + exclude: undefined, + override: undefined, + typed: false, + include: undefined, + templates: { + operations: Operations.templates, + }, + mapper: {}, + }, + { + oas, + pluginManager: mockedPluginManager, + plugin: {} as Plugin, + contentType: undefined, + include: undefined, + mode: 'split', + override: [], + }, + ) + + const schemas = oas.getDefinition().components?.schemas + + test('generate nullable 3.1 enums ', async () => { + const node = generator.buildSource('enumNullable', schemas?.['enumNullable'] as SchemaObject) + + expect(node).toMatchSnapshot() + }) +}) diff --git a/packages/swagger-zod/src/__snapshots__/OperationGenerator.test.tsx.snap b/packages/swagger-zod/src/__snapshots__/OperationGenerator.test.tsx.snap index e60fae596..bce0fee01 100644 --- a/packages/swagger-zod/src/__snapshots__/OperationGenerator.test.tsx.snap +++ b/packages/swagger-zod/src/__snapshots__/OperationGenerator.test.tsx.snap @@ -55,17 +55,17 @@ export const ListPetsQueryParams = z.object({ "limit": z.string().describe("How /** * @description A paged array of pets */ -export const ListPets200 = z.lazy(() => Pets); +export const ListPets200 = z.lazy(() => Pets).schema; /** * @description unexpected error */ -export const ListPetsError = z.lazy(() => Error); +export const ListPetsError = z.lazy(() => Error).schema; /** * @description A paged array of pets */ -export const ListPetsQueryResponse = z.lazy(() => Pets); +export const ListPetsQueryResponse = z.lazy(() => Pets).schema; " @@ -82,17 +82,17 @@ export const ShowPetByIdPathParams = z.object({ "petId": z.string().describe("Th /** * @description Expected response to a valid request */ -export const ShowPetById200 = z.lazy(() => Pet); +export const ShowPetById200 = z.lazy(() => Pet).schema; /** * @description unexpected error */ -export const ShowPetByIdError = z.lazy(() => Error); +export const ShowPetByIdError = z.lazy(() => Error).schema; /** * @description Expected response to a valid request */ -export const ShowPetByIdQueryResponse = z.lazy(() => Pet); +export const ShowPetByIdQueryResponse = z.lazy(() => Pet).schema; " @@ -110,7 +110,7 @@ export const CreatePets201 = z.any(); /** * @description unexpected error */ -export const CreatePetsError = z.lazy(() => Error); +export const CreatePetsError = z.lazy(() => Error).schema; export const CreatePetsMutationRequest = z.object({ "name": z.string(), "tag": z.string() }); diff --git a/packages/swagger-zod/src/__snapshots__/SchemaGenerator.test.tsx.snap b/packages/swagger-zod/src/__snapshots__/SchemaGenerator.test.tsx.snap index d4b3fe16f..25e9d4f23 100644 --- a/packages/swagger-zod/src/__snapshots__/SchemaGenerator.test.tsx.snap +++ b/packages/swagger-zod/src/__snapshots__/SchemaGenerator.test.tsx.snap @@ -19,7 +19,7 @@ export const OptionalPet = z.object({"id": z.number().optional(),"name": z.strin exports[`Zod SchemaGenerator PetStore > generate schema for Pet 1`] = ` [ " -export const Pet = z.object({"id": z.number(),"name": z.string(),"tag": z.string().optional()}) +export const Pet = z.object({"id": z.number(),"name": z.string(),"tag": z.string().min(5).max(100).optional()}) ", ] `; @@ -27,7 +27,7 @@ export const Pet = z.object({"id": z.number(),"name": z.string(),"tag": z.string exports[`Zod SchemaGenerator PetStore > generate schema for PetArray 1`] = ` [ " -export const PetArray = z.array(z.lazy(() => Pet)).min(1).max(3).describe("List of Pet object") +export const PetArray = z.array(z.lazy(() => Pet).schema).min(1).max(3).describe("List of Pet object") ", ] `; @@ -48,6 +48,14 @@ export const test = z.union([z.object({"propertyA": z.string()}).strict(), z.obj ] `; +exports[`Zod SchemaGenerator enums > generate nullable 3.1 enums 1`] = ` +[ + " +export const enumNullable = z.enum(["Pending", "Received"]).nullable() +", +] +`; + exports[`Zod SchemaGenerator enums > generate x-enum-varnames types 1`] = ` [ " @@ -67,7 +75,7 @@ export const enumNames = z.enum(["0", "1"]) exports[`Zod SchemaGenerator lazy > generate schema for Example 1`] = ` [ " -export const Example = z.object({"nestedExamples": z.lazy(() => Example).optional()}) +export const Example = z.object({"nestedExamples": z.lazy(() => Example).schema.optional()}) ", ] `; @@ -75,7 +83,7 @@ export const Example = z.object({"nestedExamples": z.lazy(() => Example).optiona exports[`Zod SchemaGenerator recursive > generate schema for Example 1`] = ` [ " -export const Example = z.object({"name": z.string(),"children": z.array(z.lazy(() => Example))}) +export const Example = z.object({"name": z.string(),"children": z.array(z.lazy(() => Example).schema)}) ", ] `; diff --git a/packages/swagger-zod/src/__snapshots__/zodParser.test.ts.snap b/packages/swagger-zod/src/__snapshots__/zodParser.test.ts.snap index 8c4e087f3..e6c3a055a 100644 --- a/packages/swagger-zod/src/__snapshots__/zodParser.test.ts.snap +++ b/packages/swagger-zod/src/__snapshots__/zodParser.test.ts.snap @@ -10,7 +10,7 @@ exports[`parseZodMeta > 'arrayAdvanced' 1`] = `"z.array(z.number().min(1).max(10 exports[`parseZodMeta > 'arrayEmpty' 1`] = `"z.array()"`; -exports[`parseZodMeta > 'arrayRef' 1`] = `"z.array(z.lazy(() => Pet))"`; +exports[`parseZodMeta > 'arrayRef' 1`] = `"z.array(z.lazy(() => Pet).schema)"`; exports[`parseZodMeta > 'arrayRegex' 1`] = `"z.array(z.string().regex(new RegExp('^[a-zA-Z0-9]{1,13}$'))).min(3).max(10)"`; @@ -18,7 +18,7 @@ exports[`parseZodMeta > 'blob' 1`] = `undefined`; exports[`parseZodMeta > 'boolean' 1`] = `"z.boolean()"`; -exports[`parseZodMeta > 'catchall' 1`] = `"z.object({}).catchall(z.lazy(() => Pet))"`; +exports[`parseZodMeta > 'catchall' 1`] = `"z.object({}).catchall(z.lazy(() => Pet).schema)"`; exports[`parseZodMeta > 'date' 1`] = `"z.date()"`; @@ -34,25 +34,27 @@ exports[`parseZodMeta > 'matches' 1`] = `".regex(new RegExp('^[A-Z]{2}$'))"`; exports[`parseZodMeta > 'matchesReg' 1`] = `".regex(new RegExp('node_modules'))"`; -exports[`parseZodMeta > 'max' 1`] = `undefined`; +exports[`parseZodMeta > 'max' 1`] = `".max(2)"`; -exports[`parseZodMeta > 'min' 1`] = `undefined`; +exports[`parseZodMeta > 'min' 1`] = `".min(2)"`; exports[`parseZodMeta > 'nullable' 1`] = `".nullable()"`; exports[`parseZodMeta > 'number' 1`] = `"z.number()"`; -exports[`parseZodMeta > 'object' 1`] = `"z.object({"firstName": z.string(),"address": z.string().describe("Your address").nullable()})"`; +exports[`parseZodMeta > 'object' 1`] = `"z.object({"firstName": z.string().min(2),"address": z.string().describe("Your address").nullable()})"`; -exports[`parseZodMeta > 'objectAnd' 1`] = `"z.object({"firstName": z.string().default(test),"age": z.number().default(2),"address": z.string().and(z.number()).describe("Your address").nullable()})"`; +exports[`parseZodMeta > 'objectAnd' 1`] = `"z.object({"firstName": z.string().min(2).default(test),"age": z.number().min(3).default(2),"address": z.string().and(z.number()).describe("Your address").nullable()})"`; exports[`parseZodMeta > 'objectArray' 1`] = `"z.object({"ids": z.array(z.string().regex(new RegExp('^[a-zA-Z0-9]{1,13}$'))).min(3).max(10)})"`; exports[`parseZodMeta > 'objectEmpty' 1`] = `"z.object({})"`; -exports[`parseZodMeta > 'objectOptional' 1`] = `"z.object({"firstName": z.string().optional(),"address": z.string().describe("Your address").nullable()})"`; +exports[`parseZodMeta > 'objectEnum' 1`] = `"z.object({"version": z.enum(["A", "B", "C", "2"]).min(4).describe("Your address")})"`; -exports[`parseZodMeta > 'ref' 1`] = `"z.lazy(() => Pet)"`; +exports[`parseZodMeta > 'objectOptional' 1`] = `"z.object({"firstName": z.string().min(2).optional(),"address": z.string().describe("Your address").nullable()})"`; + +exports[`parseZodMeta > 'ref' 1`] = `"z.lazy(() => Pet).schema"`; exports[`parseZodMeta > 'string' 1`] = `"z.string()"`; @@ -70,7 +72,7 @@ exports[`parseZodMeta > 'unknown' 1`] = `"z.unknown()"`; exports[`zodParser > 'Object' 1`] = ` " -export const Object = z.object({"firstName": z.string().default(test),"age": z.number().default(2),"address": z.string().and(z.number()).describe("Your address").nullable()}).describe("Your address").nullable() +export const Object = z.object({"firstName": z.string().min(2).default(test),"age": z.number().min(2).default(2),"address": z.string().and(z.number()).describe("Your address").nullable()}).describe("Your address").nullable() " `; diff --git a/packages/swagger-zod/src/components/OperationSchema.tsx b/packages/swagger-zod/src/components/OperationSchema.tsx index dab268304..988ba55ab 100644 --- a/packages/swagger-zod/src/components/OperationSchema.tsx +++ b/packages/swagger-zod/src/components/OperationSchema.tsx @@ -30,6 +30,7 @@ OperationSchema.File = function ({}: FileProps): ReactNode { plugin, pluginManager, mode, + override: plugin.options.override, }) const items = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response].flat().filter(Boolean) diff --git a/packages/swagger-zod/src/components/__snapshots__/Schema/pets.ts b/packages/swagger-zod/src/components/__snapshots__/Schema/pets.ts index e62b1f79f..5ff26c754 100644 --- a/packages/swagger-zod/src/components/__snapshots__/Schema/pets.ts +++ b/packages/swagger-zod/src/components/__snapshots__/Schema/pets.ts @@ -6,7 +6,7 @@ export const CreatePets201 = z.any() /** * @description unexpected error */ -export const CreatePetsError = z.lazy(() => Error) +export const CreatePetsError = z.lazy(() => Error).schema export const CreatePetsMutationRequest = z.object({ name: z.string(), tag: z.string() }) diff --git a/packages/swagger-zod/src/components/__snapshots__/Schema/showPetById.ts b/packages/swagger-zod/src/components/__snapshots__/Schema/showPetById.ts index 0f0abb0e0..4a2a9e563 100644 --- a/packages/swagger-zod/src/components/__snapshots__/Schema/showPetById.ts +++ b/packages/swagger-zod/src/components/__snapshots__/Schema/showPetById.ts @@ -6,14 +6,14 @@ export const ShowPetByIdPathParams = z.object({ /** * @description Expected response to a valid request */ -export const ShowPetById200 = z.lazy(() => Pet) +export const ShowPetById200 = z.lazy(() => Pet).schema /** * @description unexpected error */ -export const ShowPetByIdError = z.lazy(() => Error) +export const ShowPetByIdError = z.lazy(() => Error).schema /** * @description Expected response to a valid request */ -export const ShowPetByIdQueryResponse = z.lazy(() => Pet) +export const ShowPetByIdQueryResponse = z.lazy(() => Pet).schema diff --git a/packages/swagger-zod/src/plugin.ts b/packages/swagger-zod/src/plugin.ts index ef1f92e16..e6782144c 100644 --- a/packages/swagger-zod/src/plugin.ts +++ b/packages/swagger-zod/src/plugin.ts @@ -103,6 +103,7 @@ export const definePlugin = createPlugin((options) => { plugin: this.plugin, contentType: swaggerPlugin.api.contentType, include: undefined, + override, mode, output: output.path, }) diff --git a/packages/swagger-zod/src/zodParser.tsx b/packages/swagger-zod/src/zodParser.tsx index c02cc47c9..3921a4ed5 100644 --- a/packages/swagger-zod/src/zodParser.tsx +++ b/packages/swagger-zod/src/zodParser.tsx @@ -48,7 +48,7 @@ export const zodKeywordMapper = { password: undefined, phone: undefined, readOnly: undefined, - ref: (value?: string) => (value ? `z.lazy(() => ${value})` : undefined), + ref: (value?: string) => (value ? `z.lazy(() => ${value}).schema` : undefined), blob: undefined, deprecated: undefined, example: undefined, @@ -66,6 +66,7 @@ function sort(items?: Schema[]): Schema[] { schemaKeywords.string, schemaKeywords.number, schemaKeywords.object, + schemaKeywords.enum, schemaKeywords.url, schemaKeywords.email, schemaKeywords.firstName, @@ -191,7 +192,9 @@ export function parseZodMeta(parent: Schema | undefined, current: Schema, option } return `"${name}": ${sort(schemas) - .map((schema) => parseZodMeta(current, schema, options)) + .map((schema, i, array) => { + return parseZodMeta(current, schema, options) + }) .filter(Boolean) .join('')}` }) @@ -247,28 +250,18 @@ export function parseZodMeta(parent: Schema | undefined, current: Schema, option } if (isKeyword(current, schemaKeywords.string)) { - if (parent) { - const minSchema = SchemaGenerator.find([parent], schemaKeywords.min) - const maxSchema = SchemaGenerator.find([parent], schemaKeywords.max) - - return zodKeywordMapper.string(minSchema?.args, maxSchema?.args) - } - return zodKeywordMapper.string() } if (isKeyword(current, schemaKeywords.number) || isKeyword(current, schemaKeywords.integer)) { - if (parent) { - const minSchema = SchemaGenerator.find([parent], schemaKeywords.min) - const maxSchema = SchemaGenerator.find([parent], schemaKeywords.max) - - return zodKeywordMapper.number(minSchema?.args, maxSchema?.args) - } return zodKeywordMapper.number() } - if (isKeyword(current, schemaKeywords.min) || isKeyword(current, schemaKeywords.max)) { - return undefined + if (isKeyword(current, schemaKeywords.min)) { + return zodKeywordMapper.min(current.args) + } + if (isKeyword(current, schemaKeywords.max)) { + return zodKeywordMapper.max(current.args) } if (current.keyword in zodKeywordMapper && 'args' in current) { @@ -302,7 +295,7 @@ export function zodParser(schemas: Schema[], options: ParserOptions): string { .join('') if (options.keysToOmit?.length) { - const suffix = output.endsWith('.nullable()') ? '.unwrap().schema.and' : '.schema.and' + const suffix = output.endsWith('.nullable()') ? '.unwrap().and' : '.and' const omitText = `${suffix}(z.object({ ${options.keysToOmit.map((key) => `${key}: z.never()`).join(',')} }))` return `${constName} = ${output}${omitText}${typeName}\n` } diff --git a/packages/swagger-zodios/mocks/petStore.yaml b/packages/swagger-zodios/mocks/petStore.yaml index a073139d5..2d7878cd2 100644 --- a/packages/swagger-zodios/mocks/petStore.yaml +++ b/packages/swagger-zodios/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/packages/swagger-zodios/mocks/petStoreRef.yaml b/packages/swagger-zodios/mocks/petStoreRef.yaml index 60ddcccc5..902c4604c 100644 --- a/packages/swagger-zodios/mocks/petStoreRef.yaml +++ b/packages/swagger-zodios/mocks/petStoreRef.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore ref diff --git a/packages/swagger-zodios/package.json b/packages/swagger-zodios/package.json index 16e7ce7d0..d63904f10 100644 --- a/packages/swagger-zodios/package.json +++ b/packages/swagger-zodios/package.json @@ -57,11 +57,11 @@ "@kubb/biome-config": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "prettier": "^3.2.5", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/packages/swagger/mocks/petStore.yaml b/packages/swagger/mocks/petStore.yaml index 2823edd82..347cd7fa7 100644 --- a/packages/swagger/mocks/petStore.yaml +++ b/packages/swagger/mocks/petStore.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.0' +openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore diff --git a/packages/swagger/mocks/schemas.ts b/packages/swagger/mocks/schemas.ts index c478e60ac..cc69f2903 100644 --- a/packages/swagger/mocks/schemas.ts +++ b/packages/swagger/mocks/schemas.ts @@ -110,6 +110,7 @@ const basic: Array<{ name: string; schema: Schema }> = [ }, }, }, + { name: 'tuple', schema: { @@ -307,6 +308,42 @@ const basic: Array<{ name: string; schema: Schema }> = [ }, }, }, + { + name: 'objectEnum', + schema: { + keyword: schemaKeywords.object, + args: { + properties: { + version: [ + { + keyword: schemaKeywords.format, + args: 'string', + }, + { + keyword: schemaKeywords.enum, + args: { + name: 'enum', + typeName: 'Enum', + asConst: false, + items: [ + { name: 'A', value: 'A', format: schemaKeywords.string }, + { name: 'B', value: 'B', format: schemaKeywords.string }, + { name: 'C', value: 'C', format: schemaKeywords.string }, + { name: 2, value: 2, format: schemaKeywords.number }, + ], + }, + }, + { + keyword: schemaKeywords.min, + args: 4, + }, + { keyword: schemaKeywords.describe, args: 'Your address' }, + ], + }, + additionalProperties: [], + }, + }, + }, { name: 'objectEmpty', schema: { diff --git a/packages/swagger/package.json b/packages/swagger/package.json index 54b95350b..e5a854f54 100644 --- a/packages/swagger/package.json +++ b/packages/swagger/package.json @@ -65,14 +65,14 @@ "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false" }, "dependencies": { - "remeda": "^1.57.2", "@apidevtools/swagger-parser": "^10.1.0", "@kubb/core": "workspace:*", "@kubb/react": "workspace:*", "js-yaml": "^4.1.0", - "oas": "^24.2.0", - "oas-normalize": "^11.0.2", + "oas": "^24.2.1", + "oas-normalize": "^11.0.3", "openapi-types": "^12.1.3", + "remeda": "^1.58.1", "swagger2openapi": "^7.0.8" }, "devDependencies": { @@ -80,11 +80,11 @@ "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", "@types/js-yaml": "^4.0.9", - "@types/react": "^18.2.74", + "@types/react": "^18.2.77", "@types/swagger2openapi": "^7.0.4", "react": "^18.2.0", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "peerDependencies": { "@kubb/react": "workspace:*" diff --git a/packages/swagger/src/OasManager.test.ts b/packages/swagger/src/OasManager.test.ts index 1d8ed82f4..b6716b280 100644 --- a/packages/swagger/src/OasManager.test.ts +++ b/packages/swagger/src/OasManager.test.ts @@ -11,7 +11,7 @@ describe('OasManager', () => { const petStoreV2 = path.resolve(__dirname, '../mocks/petStoreV2.json') const yamlPetStoreString = ` -openapi: '3.0.0' +openapi: 3.0.0 info: title: Swagger Petstore version: 1.0.0 diff --git a/packages/swagger/src/OperationGenerator.ts b/packages/swagger/src/OperationGenerator.ts index 438d56e7b..2eb250d01 100644 --- a/packages/swagger/src/OperationGenerator.ts +++ b/packages/swagger/src/OperationGenerator.ts @@ -69,7 +69,7 @@ export abstract class OperationGenerator< ) } - isExcluded(operation: Operation, method: HttpMethod): boolean { + #isExcluded(operation: Operation, method: HttpMethod): boolean { const { exclude = [] } = this.context let matched = false @@ -93,7 +93,7 @@ export abstract class OperationGenerator< return matched } - isIncluded(operation: Operation, method: HttpMethod): boolean { + #isIncluded(operation: Operation, method: HttpMethod): boolean { const { include = [] } = this.context let matched = false @@ -394,8 +394,8 @@ export abstract class OperationGenerator< methods.forEach((method) => { const operation = oas.operation(path, method) if (operation && this.#methods[method]) { - const isExcluded = this.isExcluded(operation, method) - const isIncluded = this.context.include ? this.isIncluded(operation, method) : true + const isExcluded = this.#isExcluded(operation, method) + const isIncluded = this.context.include ? this.#isIncluded(operation, method) : true if (isIncluded && !isExcluded) { if (!acc[path]) { diff --git a/packages/swagger/src/SchemaGenerator.ts b/packages/swagger/src/SchemaGenerator.ts index 78aeeeaf2..ad7058ad3 100644 --- a/packages/swagger/src/SchemaGenerator.ts +++ b/packages/swagger/src/SchemaGenerator.ts @@ -11,7 +11,7 @@ import { isReference } from './utils/isReference.ts' import type { KubbFile, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from '@kubb/core' import type { Schema, SchemaKeywordMapper, SchemaMapper } from './SchemaMapper.ts' import type { Oas, OpenAPIV3, SchemaObject } from './oas/index.ts' -import type { ContentType, OperationSchema, Refs } from './types.ts' +import type { ContentType, OperationSchema, Override, Refs } from './types.ts' export type SchemaMethodResult = Promise | Array> | null> @@ -24,6 +24,7 @@ type Context = { plugin: Plugin mode: KubbFile.Mode include?: Array<'schemas' | 'responses' | 'requestBodies'> + override: Array> | undefined contentType?: ContentType output?: string } @@ -62,18 +63,16 @@ export abstract class SchemaGenerator< // Keep track of already used type aliases #usedAliasNames: Record = {} - #usedEnumNames = this.options.usedEnumNames || {} - /** - * Cached schemas - */ - #schemasCache: Record = {} + /** * Creates a type node from a given schema. * Delegates to getBaseTypeFromSchema internally and * optionally adds a union with null. */ buildSchemas(schema: SchemaObject | undefined, baseName?: string): Schema[] { - return this.options.transformers.schema?.(schema, baseName) || this.#parseSchemaObject(schema, baseName) || [] + const options = this.#getOptions(schema, baseName) + + return options.transformers?.schema?.(schema, baseName) || this.#parseSchemaObject(schema, baseName) || [] } deepSearch(schemas: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T][] { @@ -192,8 +191,30 @@ export abstract class SchemaGenerator< return foundItem } - get #unknownReturn() { - if (this.options.unknownType === 'any') { + #getUsedEnumNames(schema: SchemaObject | undefined, baseName: string | undefined) { + const options = this.#getOptions(schema, baseName) + + return options.usedEnumNames || {} + } + + #getOptions(_schema: SchemaObject | undefined, baseName: string | undefined): Partial { + const { override = [] } = this.context + + return ( + override.find(({ pattern, type }) => { + if (baseName && type === 'schemaName') { + return !!baseName.match(pattern) + } + + return false + })?.options || this.options + ) + } + + #getUnknownReturn(schema: SchemaObject | undefined, baseName: string | undefined) { + const options = this.#getOptions(schema, baseName) + + if (options.unknownType === 'any') { return schemaKeywords.any } @@ -238,7 +259,8 @@ export abstract class SchemaGenerator< const members: Schema[] = [] if (additionalProperties) { - additionalPropertieschemas = additionalProperties === true ? [{ keyword: this.#unknownReturn }] : this.buildSchemas(additionalProperties as SchemaObject) + additionalPropertieschemas = + additionalProperties === true ? [{ keyword: this.#getUnknownReturn(baseSchema, baseName) }] : this.buildSchemas(additionalProperties as SchemaObject) } members.push({ @@ -309,10 +331,12 @@ export abstract class SchemaGenerator< * schema and returns the appropriate type. */ #parseSchemaObject(_schema: SchemaObject | undefined, baseName?: string): Schema[] { + const options = this.#getOptions(_schema, baseName) + const unknownReturn = this.#getUnknownReturn(_schema, baseName) const { schema, version } = this.#getParsedSchemaObject(_schema) if (!schema) { - return [{ keyword: this.#unknownReturn }] + return [{ keyword: unknownReturn }] } const baseItems: Schema[] = [] @@ -347,6 +371,14 @@ export abstract class SchemaGenerator< keyword: schemaKeywords.type, args: schema.type as string, }) + + if (Array.isArray(schema.type)) { + const [_schema, nullable] = schema.type + + if (nullable === 'null') { + baseItems.push({ keyword: schemaKeywords.nullable }) + } + } } if (max !== undefined) { @@ -385,7 +417,7 @@ export abstract class SchemaGenerator< }) .filter(Boolean) .filter((item) => { - return item && item.keyword !== this.#unknownReturn + return item && item.keyword !== unknownReturn }), } if (schemaWithoutOneOf.properties) { @@ -407,7 +439,7 @@ export abstract class SchemaGenerator< }) .filter(Boolean) .filter((item) => { - return item && item.keyword !== this.#unknownReturn + return item && item.keyword !== unknownReturn }) .map((item) => { if (isKeyword(item, schemaKeywords.object)) { @@ -440,7 +472,7 @@ export abstract class SchemaGenerator< }) .filter(Boolean) .filter((item) => { - return item && item.keyword !== this.#unknownReturn + return item && item.keyword !== unknownReturn }), } @@ -458,7 +490,7 @@ export abstract class SchemaGenerator< } if (schema.enum) { - const name = getUniqueName(pascalCase([baseName, this.options.enumSuffix].join(' ')), this.#usedEnumNames) + const name = getUniqueName(pascalCase([baseName, options.enumSuffix].join(' ')), this.#getUsedEnumNames(_schema, baseName)) const typeName = this.context.pluginManager.resolveName({ name, pluginKey: this.context.plugin.key, @@ -483,7 +515,7 @@ export abstract class SchemaGenerator< })), }, }, - ...baseItems, + ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max), ] }) @@ -512,7 +544,7 @@ export abstract class SchemaGenerator< }), }, }, - ...baseItems, + ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max), ] } @@ -534,7 +566,7 @@ export abstract class SchemaGenerator< })), }, }, - ...baseItems, + ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max), ] } @@ -567,7 +599,7 @@ export abstract class SchemaGenerator< max, }, }, - ...baseItems, + ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max), ] } @@ -595,7 +627,7 @@ export abstract class SchemaGenerator< if (schema.type) { if (Array.isArray(schema.type)) { // OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0 - const [type, nullable] = schema.type as Array + const [type] = schema.type as Array return [ ...this.buildSchemas( @@ -605,7 +637,7 @@ export abstract class SchemaGenerator< }, baseName, ), - nullable ? { keyword: schemaKeywords.nullable } : undefined, + ...baseItems, ].filter(Boolean) } @@ -617,7 +649,7 @@ export abstract class SchemaGenerator< } if (['date', 'date-time'].some((item) => item === schema.format)) { - if (this.options.dateType === 'date') { + if (options.dateType === 'date') { baseItems.unshift({ keyword: schemaKeywords.date }) return baseItems @@ -651,7 +683,7 @@ export abstract class SchemaGenerator< return [{ keyword: schemaKeywords.blob }] } - return [{ keyword: this.#unknownReturn }] + return [{ keyword: unknownReturn }] } async build(): Promise>> { diff --git a/packages/swagger/src/types.ts b/packages/swagger/src/types.ts index 2dcf49bd9..c7659bf65 100644 --- a/packages/swagger/src/types.ts +++ b/packages/swagger/src/types.ts @@ -128,10 +128,15 @@ type ByMethod = { pattern: HttpMethod | RegExp } -export type Exclude = ByTag | ByOperationId | ByPath | ByMethod -export type Include = ByTag | ByOperationId | ByPath | ByMethod +type BySchemaName = { + type: 'schemaName' + pattern: string | RegExp +} + +export type Exclude = ByTag | ByOperationId | ByPath | ByMethod | BySchemaName +export type Include = ByTag | ByOperationId | ByPath | ByMethod | BySchemaName -export type Override = (ByTag | ByOperationId | ByPath | ByMethod) & { +export type Override = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName) & { options: Partial } diff --git a/packages/types/package.json b/packages/types/package.json index beba1de05..6483d192a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -42,7 +42,7 @@ "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", "tsup": "^8.0.2", - "typescript": "^5.4.4" + "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.0", "engines": { diff --git a/packages/unplugin/package.json b/packages/unplugin/package.json index f65cef658..20ec22a16 100644 --- a/packages/unplugin/package.json +++ b/packages/unplugin/package.json @@ -114,19 +114,19 @@ "unplugin": "^1.10.1" }, "devDependencies": { - "@kubb/core": "workspace:*", "@kubb/biome-config": "workspace:*", + "@kubb/core": "workspace:*", "@kubb/ts-config": "workspace:*", "@kubb/tsup-config": "workspace:*", "@nuxt/kit": "^3.11.2", "@nuxt/schema": "^3.11.2", - "@types/node": "^20.12.5", + "@types/node": "^20.12.7", "rimraf": "^5.0.5", - "rollup": "^4.14.1", + "rollup": "^4.14.2", "tsup": "^8.0.2", - "typescript": "^5.4.4", + "typescript": "^5.4.5", "vite": "^5.2.8", - "vitest": "^1.4.0", + "vitest": "^1.5.0", "webpack": "^5.91.0" }, "packageManager": "pnpm@8.15.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 715d933eb..e664ec8f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,14 +29,14 @@ importers: specifier: workspace:* version: link:packages/config/ts-config '@types/node': - specifier: ^20.12.5 - version: 20.12.5 + specifier: ^20.12.7 + version: 20.12.7 '@vitest/coverage-v8': - specifier: ^1.4.0 - version: 1.4.0(vitest@1.4.0) + specifier: ^1.5.0 + version: 1.5.0(vitest@1.5.0) '@vitest/ui': - specifier: ^1.4.0 - version: 1.4.0(vitest@1.4.0) + specifier: ^1.5.0 + version: 1.5.0(vitest@1.5.0) bun-types: specifier: ^1.1.3 version: 1.1.3 @@ -45,19 +45,19 @@ importers: version: 5.0.5 ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.12.5)(typescript@5.4.4) + version: 10.9.2(@types/node@20.12.7)(typescript@5.4.5) turbo: specifier: ^1.13.2 version: 1.13.2 typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 vite-tsconfig-paths: specifier: ^4.3.2 - version: 4.3.2(typescript@5.4.4) + version: 4.3.2(typescript@5.4.5) vitest: - specifier: ^1.4.0 - version: 1.4.0(@types/node@20.12.5)(@vitest/ui@1.4.0) + specifier: ^1.5.0 + version: 1.5.0(@types/node@20.12.7)(@vitest/ui@1.5.0) docs: dependencies: @@ -71,15 +71,15 @@ importers: specifier: ^7.1.1 version: 7.1.1 vitepress: - specifier: ^1.0.2 - version: 1.0.2(@algolia/client-search@4.23.2)(@types/node@20.12.5)(search-insights@2.13.0)(typescript@5.4.4) + specifier: ^1.1.0 + version: 1.1.0(@algolia/client-search@4.23.2)(@types/node@20.12.7)(search-insights@2.13.0)(typescript@5.4.5) vue: specifier: ^3.4.21 - version: 3.4.21(typescript@5.4.4) + version: 3.4.21(typescript@5.4.5) devDependencies: '@types/node': - specifier: ^20.12.5 - version: 20.12.5 + specifier: ^20.12.7 + version: 20.12.7 e2e: dependencies: @@ -120,11 +120,11 @@ importers: specifier: workspace:* version: link:../packages/swagger-zodios '@tanstack/react-query': - specifier: ^5.29.0 - version: 5.29.0(react@18.2.0) + specifier: ^5.29.2 + version: 5.29.2(react@18.2.0) '@tanstack/solid-query': - specifier: ^5.29.0 - version: 5.29.0(solid-js@1.8.16) + specifier: ^5.29.3 + version: 5.29.3(solid-js@1.8.16) '@tanstack/svelte-query': specifier: ^5.29.0 version: 5.29.0(svelte@3.59.2) @@ -292,10 +292,10 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 examples/faker: dependencies: @@ -325,14 +325,14 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) devDependencies: '@kubb/ts-config': specifier: workspace:* version: link:../../packages/config/ts-config typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 examples/msw: dependencies: @@ -463,17 +463,17 @@ importers: specifier: workspace:* version: link:../../packages/config/ts-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 '@types/react-dom': - specifier: ^18.2.24 - version: 18.2.24 + specifier: ^18.2.25 + version: 18.2.25 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 examples/react-query: dependencies: @@ -512,11 +512,11 @@ importers: version: 18.2.0(react@18.2.0) devDependencies: '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 '@types/react-dom': - specifier: ^18.2.24 - version: 18.2.24 + specifier: ^18.2.25 + version: 18.2.25 '@vitejs/plugin-react': specifier: ^4.2.1 version: 4.2.1(vite@4.5.3) @@ -531,7 +531,7 @@ importers: version: 5.2.2 vite: specifier: ^4.5.3 - version: 4.5.3(@types/node@20.12.5) + version: 4.5.3(@types/node@20.12.7) examples/react-query-v5: dependencies: @@ -557,11 +557,11 @@ importers: specifier: workspace:* version: link:../../packages/swagger-ts '@tanstack/react-query': - specifier: ^5.29.0 - version: 5.29.0(react@18.2.0) + specifier: ^5.29.2 + version: 5.29.2(react@18.2.0) '@tanstack/react-query-devtools': specifier: 5.0.0 - version: 5.0.0(@tanstack/react-query@5.29.0)(react-dom@18.2.0)(react@18.2.0) + version: 5.0.0(@tanstack/react-query@5.29.2)(react-dom@18.2.0)(react@18.2.0) axios: specifier: ^1.6.8 version: 1.6.8 @@ -573,11 +573,11 @@ importers: version: 18.2.0(react@18.2.0) devDependencies: '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 '@types/react-dom': - specifier: ^18.2.24 - version: 18.2.24 + specifier: ^18.2.25 + version: 18.2.25 '@vitejs/plugin-react': specifier: ^4.2.1 version: 4.2.1(vite@4.5.3) @@ -595,7 +595,7 @@ importers: version: link:../../packages/unplugin vite: specifier: ^4.5.3 - version: 4.5.3(@types/node@20.12.5) + version: 4.5.3(@types/node@20.12.7) examples/simple-single: dependencies: @@ -631,7 +631,7 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) zod: specifier: ^3.22.4 version: 3.22.4 @@ -670,11 +670,11 @@ importers: version: 1.8.16 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) devDependencies: typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 examples/svelte-query: dependencies: @@ -710,11 +710,11 @@ importers: version: 3.59.2 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) devDependencies: typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 examples/swr: dependencies: @@ -750,7 +750,7 @@ importers: version: 2.2.5(react@18.2.0) tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) examples/typescript: dependencies: @@ -771,11 +771,11 @@ importers: version: 1.6.8 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) devDependencies: typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 examples/vue-query: dependencies: @@ -824,7 +824,7 @@ importers: version: 5.2.2 vite: specifier: ^4.5.3 - version: 4.5.3(@types/node@20.12.5) + version: 4.5.3(@types/node@20.12.7) examples/vue-query-v5: dependencies: @@ -876,7 +876,7 @@ importers: version: 5.2.2 vite: specifier: ^4.5.3 - version: 4.5.3(@types/node@20.12.5) + version: 4.5.3(@types/node@20.12.7) examples/zod: dependencies: @@ -903,7 +903,7 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) zod: specifier: ^3.22.4 version: 3.22.4 @@ -912,8 +912,8 @@ importers: specifier: workspace:* version: link:../../packages/config/ts-config typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 examples/zodios: dependencies: @@ -968,10 +968,10 @@ importers: version: 4.17.21 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/cli: dependencies: @@ -989,7 +989,7 @@ importers: version: 3.6.0 cosmiconfig: specifier: ^9.0.0 - version: 9.0.0(typescript@5.4.4) + version: 9.0.0(typescript@5.4.5) esbuild: specifier: ^0.20.2 version: 0.20.2 @@ -1022,31 +1022,31 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/node': - specifier: ^20.12.5 - version: 20.12.5 + specifier: ^20.12.7 + version: 20.12.7 source-map-support: specifier: ^0.5.21 version: 0.5.21 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/config/biome-config: {} packages/config/ts-config: devDependencies: typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/config/tsup-config: dependencies: '@microsoft/api-extractor': - specifier: ^7.43.0 - version: 7.43.0(@types/node@20.12.5) + specifier: ^7.43.1 + version: 7.43.1(@types/node@20.12.7) esbuild-plugin-file-path-extensions: specifier: ^2.0.0 version: 2.0.0 @@ -1061,11 +1061,11 @@ importers: specifier: workspace:* version: link:../ts-config '@types/node': - specifier: ^20.12.5 - version: 20.12.5 + specifier: ^20.12.7 + version: 20.12.7 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) packages/core: dependencies: @@ -1097,8 +1097,8 @@ importers: specifier: ^8.0.1 version: 8.0.1 remeda: - specifier: ^1.57.2 - version: 1.57.2 + specifier: ^1.58.1 + version: 1.58.1 seedrandom: specifier: ^3.0.5 version: 3.0.5 @@ -1122,8 +1122,8 @@ importers: specifier: ^11.0.4 version: 11.0.4 '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 '@types/seedrandom': specifier: ^3.0.8 version: 3.0.8 @@ -1141,10 +1141,10 @@ importers: version: 1.1.1 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/kubb: dependencies: @@ -1162,23 +1162,23 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/node': - specifier: ^20.12.5 - version: 20.12.5 + specifier: ^20.12.7 + version: 20.12.7 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/parser: dependencies: remeda: - specifier: ^1.57.2 - version: 1.57.2 + specifier: ^1.58.1 + version: 1.58.1 typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 devDependencies: '@kubb/biome-config': specifier: workspace:* @@ -1194,7 +1194,7 @@ importers: version: 3.2.5 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) packages/react: dependencies: @@ -1215,8 +1215,8 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 '@types/react-reconciler': specifier: ^0.28.8 version: 0.28.8 @@ -1231,10 +1231,10 @@ importers: version: 0.29.0(react@18.2.0) tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger: dependencies: @@ -1251,17 +1251,17 @@ importers: specifier: ^4.1.0 version: 4.1.0 oas: - specifier: ^24.2.0 - version: 24.2.0 + specifier: ^24.2.1 + version: 24.2.1 oas-normalize: - specifier: ^11.0.2 - version: 11.0.2 + specifier: ^11.0.3 + version: 11.0.3 openapi-types: specifier: ^12.1.3 version: 12.1.3 remeda: - specifier: ^1.57.2 - version: 1.57.2 + specifier: ^1.58.1 + version: 1.58.1 swagger2openapi: specifier: ^7.0.8 version: 7.0.8 @@ -1279,8 +1279,8 @@ importers: specifier: ^4.0.9 version: 4.0.9 '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 '@types/swagger2openapi': specifier: ^7.0.4 version: 7.0.4 @@ -1289,10 +1289,10 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger-client: dependencies: @@ -1322,8 +1322,8 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 axios: specifier: ^1.6.8 version: 1.6.8 @@ -1332,10 +1332,10 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger-faker: dependencies: @@ -1365,17 +1365,17 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 react: specifier: ^18.2.0 version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger-msw: dependencies: @@ -1408,17 +1408,17 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 react: specifier: ^18.2.0 version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger-swr: dependencies: @@ -1451,17 +1451,17 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 react: specifier: ^18.2.0 version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger-tanstack-query: dependencies: @@ -1497,17 +1497,17 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 react: specifier: ^18.2.0 version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger-ts: dependencies: @@ -1546,8 +1546,8 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 expect-type: specifier: ^0.19.0 version: 0.19.0 @@ -1559,7 +1559,7 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) packages/swagger-zod: dependencies: @@ -1589,8 +1589,8 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 prettier: specifier: ^3.2.5 version: 3.2.5 @@ -1599,10 +1599,10 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/swagger-zodios: dependencies: @@ -1632,8 +1632,8 @@ importers: specifier: workspace:* version: link:../config/tsup-config '@types/react': - specifier: ^18.2.74 - version: 18.2.74 + specifier: ^18.2.77 + version: 18.2.77 prettier: specifier: ^3.2.5 version: 3.2.5 @@ -1642,10 +1642,10 @@ importers: version: 18.2.0 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/types: devDependencies: @@ -1660,10 +1660,10 @@ importers: version: link:../config/tsup-config tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 packages/unplugin: dependencies: @@ -1688,31 +1688,31 @@ importers: version: link:../config/tsup-config '@nuxt/kit': specifier: ^3.11.2 - version: 3.11.2(rollup@4.14.1) + version: 3.11.2(rollup@4.14.2) '@nuxt/schema': specifier: ^3.11.2 - version: 3.11.2(rollup@4.14.1) + version: 3.11.2(rollup@4.14.2) '@types/node': - specifier: ^20.12.5 - version: 20.12.5 + specifier: ^20.12.7 + version: 20.12.7 rimraf: specifier: ^5.0.5 version: 5.0.5 rollup: - specifier: ^4.14.1 - version: 4.14.1 + specifier: ^4.14.2 + version: 4.14.2 tsup: specifier: ^8.0.2 - version: 8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4) + version: 8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5) typescript: - specifier: ^5.4.4 - version: 5.4.4 + specifier: ^5.4.5 + version: 5.4.5 vite: specifier: ^5.2.8 - version: 5.2.8(@types/node@20.12.5) + version: 5.2.8(@types/node@20.12.7) vitest: - specifier: ^1.4.0 - version: 1.4.0(@types/node@20.12.5)(@vitest/ui@1.4.0) + specifier: ^1.5.0 + version: 1.5.0(@types/node@20.12.7)(@vitest/ui@1.5.0) webpack: specifier: ^5.91.0 version: 5.91.0(esbuild@0.20.2) @@ -3081,7 +3081,7 @@ packages: dependencies: '@inquirer/type': 1.2.1 '@types/mute-stream': 0.0.4 - '@types/node': 20.12.5 + '@types/node': 20.12.7 '@types/wrap-ansi': 3.0.0 ansi-escapes: 4.3.2 chalk: 4.1.2 @@ -3185,26 +3185,26 @@ packages: read-yaml-file: 1.1.0 dev: true - /@microsoft/api-extractor-model@7.28.13(@types/node@20.12.5): - resolution: {integrity: sha512-39v/JyldX4MS9uzHcdfmjjfS6cYGAoXV+io8B5a338pkHiSt+gy2eXQ0Q7cGFJ7quSa1VqqlMdlPrB6sLR/cAw==} + /@microsoft/api-extractor-model@7.28.14(@types/node@20.12.7): + resolution: {integrity: sha512-Bery/c8A8SsKPSvA82cTTuy/+OcxZbLRmKhPkk91/AJOQzxZsShcrmHFAGeiEqSIrv1nPZ3tKq9kfMLdCHmsqg==} dependencies: '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 4.0.2(@types/node@20.12.5) + '@rushstack/node-core-library': 4.1.0(@types/node@20.12.7) transitivePeerDependencies: - '@types/node' - /@microsoft/api-extractor@7.43.0(@types/node@20.12.5): - resolution: {integrity: sha512-GFhTcJpB+MI6FhvXEI9b2K0snulNLWHqC/BbcJtyNYcKUiw7l3Lgis5ApsYncJ0leALX7/of4XfmXk+maT111w==} + /@microsoft/api-extractor@7.43.1(@types/node@20.12.7): + resolution: {integrity: sha512-ohg40SsvFFgzHFAtYq5wKJc8ZDyY46bphjtnSvhSSlXpPTG7GHwyyXkn48UZiUCBwr2WC7TRC1Jfwz7nreuiyQ==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.28.13(@types/node@20.12.5) + '@microsoft/api-extractor-model': 7.28.14(@types/node@20.12.7) '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 4.0.2(@types/node@20.12.5) + '@rushstack/node-core-library': 4.1.0(@types/node@20.12.7) '@rushstack/rig-package': 0.5.2 - '@rushstack/terminal': 0.10.0(@types/node@20.12.5) - '@rushstack/ts-command-line': 4.19.1(@types/node@20.12.5) + '@rushstack/terminal': 0.10.1(@types/node@20.12.7) + '@rushstack/ts-command-line': 4.19.2(@types/node@20.12.7) lodash: 4.17.21 minimatch: 3.0.8 resolve: 1.22.8 @@ -3308,11 +3308,11 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - /@nuxt/kit@3.11.2(rollup@4.14.1): + /@nuxt/kit@3.11.2(rollup@4.14.2): resolution: {integrity: sha512-yiYKP0ZWMW7T3TCmsv4H8+jEsB/nFriRAR8bKoSqSV9bkVYWPE36sf7JDux30dQ91jSlQG6LQkB3vCHYTS2cIg==} engines: {node: ^14.18.0 || >=16.10.0} dependencies: - '@nuxt/schema': 3.11.2(rollup@4.14.1) + '@nuxt/schema': 3.11.2(rollup@4.14.2) c12: 1.10.0 consola: 3.2.3 defu: 6.1.4 @@ -3328,14 +3328,14 @@ packages: semver: 7.6.0 ufo: 1.5.3 unctx: 2.3.1 - unimport: 3.7.1(rollup@4.14.1) + unimport: 3.7.1(rollup@4.14.2) untyped: 1.4.2 transitivePeerDependencies: - rollup - supports-color dev: true - /@nuxt/schema@3.11.2(rollup@4.14.1): + /@nuxt/schema@3.11.2(rollup@4.14.2): resolution: {integrity: sha512-Z0bx7N08itD5edtpkstImLctWMNvxTArsKXzS35ZuqyAyKBPcRjO1CU01slH0ahO30Gg9kbck3/RKNZPwfOjJg==} engines: {node: ^14.18.0 || >=16.10.0} dependencies: @@ -3348,7 +3348,7 @@ packages: scule: 1.3.0 std-env: 3.7.0 ufo: 1.5.3 - unimport: 3.7.1(rollup@4.14.1) + unimport: 3.7.1(rollup@4.14.2) untyped: 1.4.2 transitivePeerDependencies: - rollup @@ -3445,7 +3445,7 @@ packages: mustache: 4.2.0 dev: false - /@rollup/pluginutils@5.1.0(rollup@4.14.1): + /@rollup/pluginutils@5.1.0(rollup@4.14.2): resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} peerDependencies: @@ -3457,7 +3457,7 @@ packages: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 4.14.1 + rollup: 4.14.2 dev: true /@rollup/rollup-android-arm-eabi@4.13.2: @@ -3467,8 +3467,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-android-arm-eabi@4.14.1: - resolution: {integrity: sha512-fH8/o8nSUek8ceQnT7K4EQbSiV7jgkHq81m9lWZFIXjJ7lJzpWXbQFpT/Zh6OZYnpFykvzC3fbEvEAFZu03dPA==} + /@rollup/rollup-android-arm-eabi@4.14.2: + resolution: {integrity: sha512-ahxSgCkAEk+P/AVO0vYr7DxOD3CwAQrT0Go9BJyGQ9Ef0QxVOfjDZMiF4Y2s3mLyPrjonchIMH/tbWHucJMykQ==} cpu: [arm] os: [android] requiresBuild: true @@ -3481,8 +3481,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-android-arm64@4.14.1: - resolution: {integrity: sha512-Y/9OHLjzkunF+KGEoJr3heiD5X9OLa8sbT1lm0NYeKyaM3oMhhQFvPB0bNZYJwlq93j8Z6wSxh9+cyKQaxS7PQ==} + /@rollup/rollup-android-arm64@4.14.2: + resolution: {integrity: sha512-lAarIdxZWbFSHFSDao9+I/F5jDaKyCqAPMq5HqnfpBw8dKDiCaaqM0lq5h1pQTLeIqueeay4PieGR5jGZMWprw==} cpu: [arm64] os: [android] requiresBuild: true @@ -3495,8 +3495,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-darwin-arm64@4.14.1: - resolution: {integrity: sha512-+kecg3FY84WadgcuSVm6llrABOdQAEbNdnpi5X3UwWiFVhZIZvKgGrF7kmLguvxHNQy+UuRV66cLVl3S+Rkt+Q==} + /@rollup/rollup-darwin-arm64@4.14.2: + resolution: {integrity: sha512-SWsr8zEUk82KSqquIMgZEg2GE5mCSfr9sE/thDROkX6pb3QQWPp8Vw8zOq2GyxZ2t0XoSIUlvHDkrf5Gmf7x3Q==} cpu: [arm64] os: [darwin] requiresBuild: true @@ -3509,8 +3509,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-darwin-x64@4.14.1: - resolution: {integrity: sha512-2pYRzEjVqq2TB/UNv47BV/8vQiXkFGVmPFwJb+1E0IFFZbIX8/jo1olxqqMbo6xCXf8kabANhp5bzCij2tFLUA==} + /@rollup/rollup-darwin-x64@4.14.2: + resolution: {integrity: sha512-o/HAIrQq0jIxJAhgtIvV5FWviYK4WB0WwV91SLUnsliw1lSAoLsmgEEgRWzDguAFeUEUUoIWXiJrPqU7vGiVkA==} cpu: [x64] os: [darwin] requiresBuild: true @@ -3523,8 +3523,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.14.1: - resolution: {integrity: sha512-mS6wQ6Do6/wmrF9aTFVpIJ3/IDXhg1EZcQFYHZLHqw6AzMBjTHWnCG35HxSqUNphh0EHqSM6wRTT8HsL1C0x5g==} + /@rollup/rollup-linux-arm-gnueabihf@4.14.2: + resolution: {integrity: sha512-nwlJ65UY9eGq91cBi6VyDfArUJSKOYt5dJQBq8xyLhvS23qO+4Nr/RreibFHjP6t+5ap2ohZrUJcHv5zk5ju/g==} cpu: [arm] os: [linux] requiresBuild: true @@ -3537,8 +3537,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.14.1: - resolution: {integrity: sha512-p9rGKYkHdFMzhckOTFubfxgyIO1vw//7IIjBBRVzyZebWlzRLeNhqxuSaZ7kCEKVkm/kuC9fVRW9HkC/zNRG2w==} + /@rollup/rollup-linux-arm64-gnu@4.14.2: + resolution: {integrity: sha512-Pg5TxxO2IVlMj79+c/9G0LREC9SY3HM+pfAwX7zj5/cAuwrbfj2Wv9JbMHIdPCfQpYsI4g9mE+2Bw/3aeSs2rQ==} cpu: [arm64] os: [linux] requiresBuild: true @@ -3551,8 +3551,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-arm64-musl@4.14.1: - resolution: {integrity: sha512-nDY6Yz5xS/Y4M2i9JLQd3Rofh5OR8Bn8qe3Mv/qCVpHFlwtZSBYSPaU4mrGazWkXrdQ98GB//H0BirGR/SKFSw==} + /@rollup/rollup-linux-arm64-musl@4.14.2: + resolution: {integrity: sha512-cAOTjGNm84gc6tS02D1EXtG7tDRsVSDTBVXOLbj31DkwfZwgTPYZ6aafSU7rD/4R2a34JOwlF9fQayuTSkoclA==} cpu: [arm64] os: [linux] requiresBuild: true @@ -3565,9 +3565,9 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-powerpc64le-gnu@4.14.1: - resolution: {integrity: sha512-im7HE4VBL+aDswvcmfx88Mp1soqL9OBsdDBU8NqDEYtkri0qV0THhQsvZtZeNNlLeCUQ16PZyv7cqutjDF35qw==} - cpu: [ppc64le] + /@rollup/rollup-linux-powerpc64le-gnu@4.14.2: + resolution: {integrity: sha512-4RyT6v1kXb7C0fn6zV33rvaX05P0zHoNzaXI/5oFHklfKm602j+N4mn2YvoezQViRLPnxP8M1NaY4s/5kXO5cw==} + cpu: [ppc64] os: [linux] requiresBuild: true optional: true @@ -3579,8 +3579,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.14.1: - resolution: {integrity: sha512-RWdiHuAxWmzPJgaHJdpvUUlDz8sdQz4P2uv367T2JocdDa98iRw2UjIJ4QxSyt077mXZT2X6pKfT2iYtVEvOFw==} + /@rollup/rollup-linux-riscv64-gnu@4.14.2: + resolution: {integrity: sha512-KNUH6jC/vRGAKSorySTyc/yRYlCwN/5pnMjXylfBniwtJx5O7X17KG/0efj8XM3TZU7raYRXJFFReOzNmL1n1w==} cpu: [riscv64] os: [linux] requiresBuild: true @@ -3593,8 +3593,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-s390x-gnu@4.14.1: - resolution: {integrity: sha512-VMgaGQ5zRX6ZqV/fas65/sUGc9cPmsntq2FiGmayW9KMNfWVG/j0BAqImvU4KTeOOgYSf1F+k6at1UfNONuNjA==} + /@rollup/rollup-linux-s390x-gnu@4.14.2: + resolution: {integrity: sha512-xPV4y73IBEXToNPa3h5lbgXOi/v0NcvKxU0xejiFw6DtIYQqOTMhZ2DN18/HrrP0PmiL3rGtRG9gz1QE8vFKXQ==} cpu: [s390x] os: [linux] requiresBuild: true @@ -3607,8 +3607,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-x64-gnu@4.14.1: - resolution: {integrity: sha512-9Q7DGjZN+hTdJomaQ3Iub4m6VPu1r94bmK2z3UeWP3dGUecRC54tmVu9vKHTm1bOt3ASoYtEz6JSRLFzrysKlA==} + /@rollup/rollup-linux-x64-gnu@4.14.2: + resolution: {integrity: sha512-QBhtr07iFGmF9egrPOWyO5wciwgtzKkYPNLVCFZTmr4TWmY0oY2Dm/bmhHjKRwZoGiaKdNcKhFtUMBKvlchH+Q==} cpu: [x64] os: [linux] requiresBuild: true @@ -3621,8 +3621,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-linux-x64-musl@4.14.1: - resolution: {integrity: sha512-JNEG/Ti55413SsreTguSx0LOVKX902OfXIKVg+TCXO6Gjans/k9O6ww9q3oLGjNDaTLxM+IHFMeXy/0RXL5R/g==} + /@rollup/rollup-linux-x64-musl@4.14.2: + resolution: {integrity: sha512-8zfsQRQGH23O6qazZSFY5jP5gt4cFvRuKTpuBsC1ZnSWxV8ZKQpPqOZIUtdfMOugCcBvFGRa1pDC/tkf19EgBw==} cpu: [x64] os: [linux] requiresBuild: true @@ -3635,8 +3635,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.14.1: - resolution: {integrity: sha512-ryS22I9y0mumlLNwDFYZRDFLwWh3aKaC72CWjFcFvxK0U6v/mOkM5Up1bTbCRAhv3kEIwW2ajROegCIQViUCeA==} + /@rollup/rollup-win32-arm64-msvc@4.14.2: + resolution: {integrity: sha512-H4s8UjgkPnlChl6JF5empNvFHp77Jx+Wfy2EtmYPe9G22XV+PMuCinZVHurNe8ggtwoaohxARJZbaH/3xjB/FA==} cpu: [arm64] os: [win32] requiresBuild: true @@ -3649,8 +3649,8 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.14.1: - resolution: {integrity: sha512-TdloItiGk+T0mTxKx7Hp279xy30LspMso+GzQvV2maYePMAWdmrzqSNZhUpPj3CGw12aGj57I026PgLCTu8CGg==} + /@rollup/rollup-win32-ia32-msvc@4.14.2: + resolution: {integrity: sha512-djqpAjm/i8erWYF0K6UY4kRO3X5+T4TypIqw60Q8MTqSBaQNpNXDhxdjpZ3ikgb+wn99svA7jxcXpiyg9MUsdw==} cpu: [ia32] os: [win32] requiresBuild: true @@ -3663,22 +3663,22 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-win32-x64-msvc@4.14.1: - resolution: {integrity: sha512-wQGI+LY/Py20zdUPq+XCem7JcPOyzIJBm3dli+56DJsQOHbnXZFEwgmnC6el1TPAfC8lBT3m+z69RmLykNUbew==} + /@rollup/rollup-win32-x64-msvc@4.14.2: + resolution: {integrity: sha512-teAqzLT0yTYZa8ZP7zhFKEx4cotS8Tkk5XiqNMJhD4CpaWB1BHARE4Qy+RzwnXvSAYv+Q3jAqCVBS+PS+Yee8Q==} cpu: [x64] os: [win32] requiresBuild: true optional: true - /@rushstack/node-core-library@4.0.2(@types/node@20.12.5): - resolution: {integrity: sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg==} + /@rushstack/node-core-library@4.1.0(@types/node@20.12.7): + resolution: {integrity: sha512-qz4JFBZJCf1YN5cAXa1dP6Mki/HrsQxc/oYGAGx29dF2cwF2YMxHoly0FBhMw3IEnxo5fMj0boVfoHVBkpkx/w==} peerDependencies: '@types/node': '*' peerDependenciesMeta: '@types/node': optional: true dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 fs-extra: 7.0.1 import-lazy: 4.0.0 jju: 1.4.0 @@ -3692,36 +3692,36 @@ packages: resolve: 1.22.8 strip-json-comments: 3.1.1 - /@rushstack/terminal@0.10.0(@types/node@20.12.5): - resolution: {integrity: sha512-UbELbXnUdc7EKwfH2sb8ChqNgapUOdqcCIdQP4NGxBpTZV2sQyeekuK3zmfQSa/MN+/7b4kBogl2wq0vpkpYGw==} + /@rushstack/terminal@0.10.1(@types/node@20.12.7): + resolution: {integrity: sha512-C6Vi/m/84IYJTkfzmXr1+W8Wi3MmBjVF/q3za91Gb3VYjKbpALHVxY6FgH625AnDe5Z0Kh4MHKWA3Z7bqgAezA==} peerDependencies: '@types/node': '*' peerDependenciesMeta: '@types/node': optional: true dependencies: - '@rushstack/node-core-library': 4.0.2(@types/node@20.12.5) - '@types/node': 20.12.5 + '@rushstack/node-core-library': 4.1.0(@types/node@20.12.7) + '@types/node': 20.12.7 supports-color: 8.1.1 - /@rushstack/ts-command-line@4.19.1(@types/node@20.12.5): - resolution: {integrity: sha512-J7H768dgcpG60d7skZ5uSSwyCZs/S2HrWP1Ds8d1qYAyaaeJmpmmLr9BVw97RjFzmQPOYnoXcKA4GkqDCkduQg==} + /@rushstack/ts-command-line@4.19.2(@types/node@20.12.7): + resolution: {integrity: sha512-cqmXXmBEBlzo9WtyUrHtF9e6kl0LvBY7aTSVX4jfnBfXWZQWnPq9JTFPlQZ+L/ZwjZ4HrNwQsOVvhe9oOucZkw==} dependencies: - '@rushstack/terminal': 0.10.0(@types/node@20.12.5) + '@rushstack/terminal': 0.10.1(@types/node@20.12.7) '@types/argparse': 1.0.38 argparse: 1.0.10 string-argv: 0.3.2 transitivePeerDependencies: - '@types/node' - /@shikijs/core@1.2.1: - resolution: {integrity: sha512-KaIS0H4EQ3KI2d++TjYqRNgwp8E3M/68e9veR4QtInzA7kKFgcjeiJqb80fuXW+blDy5fmd11PN9g9soz/3ANQ==} + /@shikijs/core@1.3.0: + resolution: {integrity: sha512-7fedsBfuILDTBmrYZNFI8B6ATTxhQAasUHllHmjvSZPnoq4bULWoTpHwmuQvZ8Aq03/tAa2IGo6RXqWtHdWaCA==} dev: false - /@shikijs/transformers@1.2.1: - resolution: {integrity: sha512-H7cVtrdv6BW2kx83t2IQgP5ri1IA50mE3QnzgJ0AvOKCGtCEieXu0JIP3245cgjNLrL+LBwb8DtTXdky1iQL9Q==} + /@shikijs/transformers@1.3.0: + resolution: {integrity: sha512-3mlpg2I9CjhjE96dEWQOGeCWoPcyTov3s4aAsHmgvnTHa8MBknEnCQy8/xivJPSpD+olqOqIEoHnLfbNJK29AA==} dependencies: - shiki: 1.2.1 + shiki: 1.3.0 dev: false /@sinclair/typebox@0.27.8: @@ -3767,7 +3767,7 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /@tanstack/react-query-devtools@5.0.0(@tanstack/react-query@5.29.0)(react-dom@18.2.0)(react@18.2.0): + /@tanstack/react-query-devtools@5.0.0(@tanstack/react-query@5.29.2)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-4yw29d89eOqUmliRKGmEOjuq2AGSM3i4jjw/YFMrErg0neVITy2bkoU3fPXZ339czlupqq0b4e20uFVtqkEqGQ==} peerDependencies: '@tanstack/react-query': ^5.0.0 @@ -3775,7 +3775,7 @@ packages: react-dom: ^18.0.0 dependencies: '@tanstack/query-devtools': 5.0.0 - '@tanstack/react-query': 5.29.0(react@18.2.0) + '@tanstack/react-query': 5.29.2(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -3798,8 +3798,8 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /@tanstack/react-query@5.29.0(react@18.2.0): - resolution: {integrity: sha512-yxlhHB73jaBla6h5B6zPaGmQjokkzAhMHN4veotkPNiQ3Ac/mCxgABRZPsJJrgCTvhpcncBZcDBFxaR2B37vug==} + /@tanstack/react-query@5.29.2(react@18.2.0): + resolution: {integrity: sha512-nyuWILR4u7H5moLGSiifLh8kIqQDLNOHGuSz0rcp+J75fNc8aQLyr5+I2JCHU3n+nJrTTW1ssgAD8HiKD7IFBQ==} peerDependencies: react: ^18.0.0 dependencies: @@ -3816,8 +3816,8 @@ packages: solid-js: 1.8.16 dev: false - /@tanstack/solid-query@5.29.0(solid-js@1.8.16): - resolution: {integrity: sha512-bHr4v9cMMfQz7qytaXgqnBiKN4HMLF4wEDFj14th1vN/zW066TgYukCbKb+fSfDTYQAeZS7xmUMFuITNnSGwTA==} + /@tanstack/solid-query@5.29.3(solid-js@1.8.16): + resolution: {integrity: sha512-mIDdVcEnbBHG88T8wWRfnSc9slWqejt63jeeABVovZVMQCDS+OUD4xB+7oA37XhgDgo+nj/HwcTpvD/DcwWToA==} peerDependencies: solid-js: ^1.6.0 dependencies: @@ -3923,13 +3923,13 @@ packages: resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} dependencies: '@types/connect': 3.4.38 - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@types/connect@3.4.38: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@types/cookie@0.4.1: @@ -3942,7 +3942,7 @@ packages: /@types/cors@2.8.17: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@types/debug@4.1.12: @@ -3970,7 +3970,7 @@ packages: /@types/express-serve-static-core@4.17.43: resolution: {integrity: sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 '@types/qs': 6.9.14 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -3989,17 +3989,13 @@ packages: resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@types/http-errors@2.0.4: resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} dev: true - /@types/istanbul-lib-coverage@2.0.6: - resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} - dev: true - /@types/js-levenshtein@1.1.3: resolution: {integrity: sha512-jd+Q+sD20Qfu9e2aEXogiO3vpOC1PYJOUdyN9gvs4Qrvkg4wF43L5OhqrPeokdv8TL0/mXoYfpkcoGZMNN2pkQ==} @@ -4013,7 +4009,7 @@ packages: /@types/jsonfile@6.1.4: resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@types/linkify-it@3.0.5: @@ -4049,7 +4045,7 @@ packages: /@types/mute-stream@0.0.4: resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: false /@types/node@12.20.55: @@ -4066,8 +4062,8 @@ packages: undici-types: 5.26.5 dev: true - /@types/node@20.12.5: - resolution: {integrity: sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw==} + /@types/node@20.12.7: + resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} dependencies: undici-types: 5.26.5 @@ -4087,20 +4083,20 @@ packages: resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} dev: true - /@types/react-dom@18.2.24: - resolution: {integrity: sha512-cN6upcKd8zkGy4HU9F1+/s98Hrp6D4MOcippK4PoE8OZRngohHZpbJn1GsaDLz87MqvHNoT13nHvNqM9ocRHZg==} + /@types/react-dom@18.2.25: + resolution: {integrity: sha512-o/V48vf4MQh7juIKZU2QGDfli6p1+OOi5oXx36Hffpc9adsHeXjVp8rHuPkjd8VT8sOJ2Zp05HR7CdpGTIUFUA==} dependencies: - '@types/react': 18.2.74 + '@types/react': 18.2.77 dev: true /@types/react-reconciler@0.28.8: resolution: {integrity: sha512-SN9c4kxXZonFhbX4hJrZy37yw9e7EIxcpHCxQv5JUS18wDE5ovkQKlqQEkufdJCCMfuI9BnjUJvhYeJ9x5Ra7g==} dependencies: - '@types/react': 18.2.74 + '@types/react': 18.2.77 dev: true - /@types/react@18.2.74: - resolution: {integrity: sha512-9AEqNZZyBx8OdZpxzQlaFEVCSFUM2YXJH46yPOiOpm078k6ZLOCcuAzGum/zK8YBwY+dbahVNbHrbgrAwIRlqw==} + /@types/react@18.2.77: + resolution: {integrity: sha512-CUT9KUUF+HytDM7WiXKLF9qUSg4tGImwy4FXTlfEDPEkkNUzJ7rVFolYweJ9fS1ljoIaP7M7Rdjc5eUm/Yu5AA==} dependencies: '@types/prop-types': 15.7.12 csstype: 3.1.3 @@ -4109,7 +4105,7 @@ packages: /@types/sax@1.2.7: resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: false /@types/seedrandom@3.0.8: @@ -4124,7 +4120,7 @@ packages: resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} dependencies: '@types/mime': 1.3.5 - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@types/serve-static@1.15.5: @@ -4132,13 +4128,13 @@ packages: dependencies: '@types/http-errors': 2.0.4 '@types/mime': 3.0.4 - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@types/set-cookie-parser@2.4.7: resolution: {integrity: sha512-+ge/loa0oTozxip6zmhRIk8Z/boU51wl9Q6QdLZcokIGMzY5lFXYy/x7Htj2HTC6/KZP1hUbZ1ekx8DYXICvWg==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 /@types/statuses@2.0.5: resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==} @@ -4147,7 +4143,7 @@ packages: /@types/swagger2openapi@7.0.4: resolution: {integrity: sha512-ffMqzciTDihOKH4Q//9Ond1yb5JP1P5FC/aFPsLK4blea1Fwk2aYctiNCkAh5etDYFswFXS+5LV/vuGkf+PU6A==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 openapi-types: 12.1.3 dev: true @@ -4162,7 +4158,7 @@ packages: /@types/ws@8.5.10: resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 dev: true /@vercel/analytics@1.2.2: @@ -4203,7 +4199,7 @@ packages: vue-router: optional: true dependencies: - vue: 3.4.21(typescript@5.4.4) + vue: 3.4.21(typescript@5.4.5) dev: false /@vitejs/plugin-react@4.2.1(vite@4.5.3): @@ -4217,7 +4213,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.3) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 4.5.3(@types/node@20.12.5) + vite: 4.5.3(@types/node@20.12.7) transitivePeerDependencies: - supports-color dev: true @@ -4229,25 +4225,25 @@ packages: vite: ^4.0.0 || ^5.0.0 vue: ^3.2.25 dependencies: - vite: 4.5.3(@types/node@20.12.5) + vite: 4.5.3(@types/node@20.12.7) vue: 3.4.21(typescript@5.2.2) dev: true - /@vitejs/plugin-vue@5.0.4(vite@5.2.7)(vue@3.4.21): + /@vitejs/plugin-vue@5.0.4(vite@5.2.8)(vue@3.4.21): resolution: {integrity: sha512-WS3hevEszI6CEVEx28F8RjTX97k3KsrcY6kvTg7+Whm5y3oYvcqzVeGCU3hxSAn4uY2CLCkeokkGKpoctccilQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: vite: ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.2.7(@types/node@20.12.5) - vue: 3.4.21(typescript@5.4.4) + vite: 5.2.8(@types/node@20.12.7) + vue: 3.4.21(typescript@5.4.5) dev: false - /@vitest/coverage-v8@1.4.0(vitest@1.4.0): - resolution: {integrity: sha512-4hDGyH1SvKpgZnIByr9LhGgCEuF9DKM34IBLCC/fVfy24Z3+PZ+Ii9hsVBsHvY1umM1aGPEjceRkzxCfcQ10wg==} + /@vitest/coverage-v8@1.5.0(vitest@1.5.0): + resolution: {integrity: sha512-1igVwlcqw1QUMdfcMlzzY4coikSIBN944pkueGi0pawrX5I5Z+9hxdTR+w3Sg6Q3eZhvdMAs8ZaF9JuTG1uYOQ==} peerDependencies: - vitest: 1.4.0 + vitest: 1.5.0 dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -4262,59 +4258,58 @@ packages: std-env: 3.7.0 strip-literal: 2.0.0 test-exclude: 6.0.0 - v8-to-istanbul: 9.2.0 - vitest: 1.4.0(@types/node@20.12.5)(@vitest/ui@1.4.0) + vitest: 1.5.0(@types/node@20.12.7)(@vitest/ui@1.5.0) transitivePeerDependencies: - supports-color dev: true - /@vitest/expect@1.4.0: - resolution: {integrity: sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==} + /@vitest/expect@1.5.0: + resolution: {integrity: sha512-0pzuCI6KYi2SIC3LQezmxujU9RK/vwC1U9R0rLuGlNGcOuDWxqWKu6nUdFsX9tH1WU0SXtAxToOsEjeUn1s3hA==} dependencies: - '@vitest/spy': 1.4.0 - '@vitest/utils': 1.4.0 + '@vitest/spy': 1.5.0 + '@vitest/utils': 1.5.0 chai: 4.4.1 dev: true - /@vitest/runner@1.4.0: - resolution: {integrity: sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==} + /@vitest/runner@1.5.0: + resolution: {integrity: sha512-7HWwdxXP5yDoe7DTpbif9l6ZmDwCzcSIK38kTSIt6CFEpMjX4EpCgT6wUmS0xTXqMI6E/ONmfgRKmaujpabjZQ==} dependencies: - '@vitest/utils': 1.4.0 + '@vitest/utils': 1.5.0 p-limit: 5.0.0 pathe: 1.1.2 dev: true - /@vitest/snapshot@1.4.0: - resolution: {integrity: sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==} + /@vitest/snapshot@1.5.0: + resolution: {integrity: sha512-qpv3fSEuNrhAO3FpH6YYRdaECnnRjg9VxbhdtPwPRnzSfHVXnNzzrpX4cJxqiwgRMo7uRMWDFBlsBq4Cr+rO3A==} dependencies: magic-string: 0.30.8 pathe: 1.1.2 pretty-format: 29.7.0 dev: true - /@vitest/spy@1.4.0: - resolution: {integrity: sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==} + /@vitest/spy@1.5.0: + resolution: {integrity: sha512-vu6vi6ew5N5MMHJjD5PoakMRKYdmIrNJmyfkhRpQt5d9Ewhw9nZ5Aqynbi3N61bvk9UvZ5UysMT6ayIrZ8GA9w==} dependencies: tinyspy: 2.2.1 dev: true - /@vitest/ui@1.4.0(vitest@1.4.0): - resolution: {integrity: sha512-XC6CMhN1gzYcGbpn6/Oanj4Au2EXwQEX6vpcOeLlZv8dy7g11Ukx8zwtYQbwxs9duK2s9j2o5rbQiCP5DPAcmw==} + /@vitest/ui@1.5.0(vitest@1.5.0): + resolution: {integrity: sha512-ETcToK2TzICf/Oartvt19IH7yR4oCs8GrQk5hRhZ5oZFaSdDHTh6o3EdzyxOaY24NZ20cXYYNGjj1se/5vHfFg==} peerDependencies: - vitest: 1.4.0 + vitest: 1.5.0 dependencies: - '@vitest/utils': 1.4.0 + '@vitest/utils': 1.5.0 fast-glob: 3.3.2 fflate: 0.8.2 flatted: 3.3.1 pathe: 1.1.2 picocolors: 1.0.0 sirv: 2.0.4 - vitest: 1.4.0(@types/node@20.12.5)(@vitest/ui@1.4.0) + vitest: 1.5.0(@types/node@20.12.7)(@vitest/ui@1.5.0) dev: true - /@vitest/utils@1.4.0: - resolution: {integrity: sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==} + /@vitest/utils@1.5.0: + resolution: {integrity: sha512-BDU0GNL8MWkRkSRdNFvCUCAVOeHaUlVJ9Tx0TYBZyXaaOTmGtUFObzchCivIBrIwKzvZA7A9sCejVhXM2aY98A==} dependencies: diff-sequences: 29.6.3 estree-walker: 3.0.3 @@ -4378,7 +4373,7 @@ packages: mitt: 3.0.1 perfect-debounce: 1.0.0 speakingurl: 14.0.1 - vue: 3.4.21(typescript@5.4.4) + vue: 3.4.21(typescript@5.4.5) dev: false /@vue/devtools-shared@7.0.25: @@ -5311,7 +5306,7 @@ packages: vary: 1.1.2 dev: false - /cosmiconfig@9.0.0(typescript@5.4.4): + /cosmiconfig@9.0.0(typescript@5.4.5): resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: @@ -5324,7 +5319,7 @@ packages: import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 - typescript: 5.4.4 + typescript: 5.4.5 dev: false /create-require@1.1.1: @@ -6838,7 +6833,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -7547,8 +7542,8 @@ packages: yaml: 1.10.2 dev: false - /oas-normalize@11.0.2: - resolution: {integrity: sha512-UE1VXIuqT1KKGB/QEnm/VqdPhRe3q9zgHHwEdDLlRC//vbj9cGvf27U9ONDhNnw3rY78H2e9ogpoVb237AhcrQ==} + /oas-normalize@11.0.3: + resolution: {integrity: sha512-YsPjVgbHuybhRXblRCRv+Jie5U26N30FLJSS+IyI/vkTryOlxnUbTKuALkO3/5vU9Ki/KIwl13KsIdf8mrdI0Q==} engines: {node: '>=18'} dependencies: '@readme/openapi-parser': 2.5.0(openapi-types@12.1.3) @@ -7588,8 +7583,8 @@ packages: yaml: 1.10.2 dev: false - /oas@24.2.0: - resolution: {integrity: sha512-du2JcGeVKJYU9lIpJi4t8kSEq2jltgFrHS3gV10htPvfSr5KuI5dLVLWmPcdTHYnFMyN8zUxMj0VL50w5sdveA==} + /oas@24.2.1: + resolution: {integrity: sha512-lk8/TXgfqq3StKe1wMYx/vGd0zojudhBwjTNqAVgVD32PaJRoocVB25hDPEjTu3XyNOUJsTAZ7dvSahkZ3ZUZQ==} engines: {node: '>=18'} dependencies: '@readme/json-schema-ref-parser': 1.2.0 @@ -7598,7 +7593,7 @@ packages: jsonpath-plus: 8.1.0 jsonpointer: 5.0.1 memoizee: 0.4.15 - oas-normalize: 11.0.2 + oas-normalize: 11.0.3 openapi-types: 12.1.3 path-to-regexp: 6.2.2 remove-undefined-objects: 5.0.0 @@ -7911,7 +7906,7 @@ packages: optional: true dependencies: lilconfig: 3.1.1 - ts-node: 10.9.2(@types/node@20.12.5)(typescript@5.4.4) + ts-node: 10.9.2(@types/node@20.12.7)(typescript@5.4.5) yaml: 2.4.1 /postcss@8.4.38: @@ -8136,8 +8131,8 @@ packages: set-function-name: 2.0.2 dev: true - /remeda@1.57.2: - resolution: {integrity: sha512-48srClA3Em1E+n+/L9iILVP4G80yG+CKDtrWFgsBbbWYC9/OmvI19Ag9I5baDMdgTTaWSOh8yXbUD3SzGunSnQ==} + /remeda@1.58.1: + resolution: {integrity: sha512-jTLnELfFSIaQxA7A/lkQdgdOSfzrta22OhRvdp5Y7RY3VY2jSBhXsiJRJbZAULfka/IfQUg1Lt/4rW/r6qNC5Q==} dev: false /remove-accents@0.5.0: @@ -8257,28 +8252,28 @@ packages: '@rollup/rollup-win32-x64-msvc': 4.13.2 fsevents: 2.3.3 - /rollup@4.14.1: - resolution: {integrity: sha512-4LnHSdd3QK2pa1J6dFbfm1HN0D7vSK/ZuZTsdyUAlA6Rr1yTouUTL13HaDOGJVgby461AhrNGBS7sCGXXtT+SA==} + /rollup@4.14.2: + resolution: {integrity: sha512-WkeoTWvuBoFjFAhsEOHKRoZ3r9GfTyhh7Vff1zwebEFLEFjT1lG3784xEgKiTa7E+e70vsC81roVL2MP4tgEEQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.14.1 - '@rollup/rollup-android-arm64': 4.14.1 - '@rollup/rollup-darwin-arm64': 4.14.1 - '@rollup/rollup-darwin-x64': 4.14.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.14.1 - '@rollup/rollup-linux-arm64-gnu': 4.14.1 - '@rollup/rollup-linux-arm64-musl': 4.14.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.14.1 - '@rollup/rollup-linux-riscv64-gnu': 4.14.1 - '@rollup/rollup-linux-s390x-gnu': 4.14.1 - '@rollup/rollup-linux-x64-gnu': 4.14.1 - '@rollup/rollup-linux-x64-musl': 4.14.1 - '@rollup/rollup-win32-arm64-msvc': 4.14.1 - '@rollup/rollup-win32-ia32-msvc': 4.14.1 - '@rollup/rollup-win32-x64-msvc': 4.14.1 + '@rollup/rollup-android-arm-eabi': 4.14.2 + '@rollup/rollup-android-arm64': 4.14.2 + '@rollup/rollup-darwin-arm64': 4.14.2 + '@rollup/rollup-darwin-x64': 4.14.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.14.2 + '@rollup/rollup-linux-arm64-gnu': 4.14.2 + '@rollup/rollup-linux-arm64-musl': 4.14.2 + '@rollup/rollup-linux-powerpc64le-gnu': 4.14.2 + '@rollup/rollup-linux-riscv64-gnu': 4.14.2 + '@rollup/rollup-linux-s390x-gnu': 4.14.2 + '@rollup/rollup-linux-x64-gnu': 4.14.2 + '@rollup/rollup-linux-x64-musl': 4.14.2 + '@rollup/rollup-win32-arm64-msvc': 4.14.2 + '@rollup/rollup-win32-ia32-msvc': 4.14.2 + '@rollup/rollup-win32-x64-msvc': 4.14.2 fsevents: 2.3.3 /run-async@2.4.1: @@ -8490,10 +8485,10 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - /shiki@1.2.1: - resolution: {integrity: sha512-u+XW6o0vCkUNlneZb914dLO+AayEIwK5tI62WeS//R5HIXBFiYaj/Hc5xcq27Yh83Grr4JbNtUBV8W6zyK4hWg==} + /shiki@1.3.0: + resolution: {integrity: sha512-9aNdQy/etMXctnPzsje1h1XIGm9YfRcSksKOGqZWXA/qP9G18/8fpz5Bjpma8bOgz3tqIpjERAd6/lLjFyzoww==} dependencies: - '@shikijs/core': 1.2.1 + '@shikijs/core': 1.3.0 dev: false /should-equal@2.0.0: @@ -9051,7 +9046,7 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - /ts-node@10.9.2(@types/node@20.12.5)(typescript@5.4.4): + /ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -9070,14 +9065,14 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.12.5 + '@types/node': 20.12.7 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.4.4 + typescript: 5.4.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -9085,7 +9080,7 @@ packages: resolution: {integrity: sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==} dev: false - /tsconfck@3.0.3(typescript@5.4.4): + /tsconfck@3.0.3(typescript@5.4.5): resolution: {integrity: sha512-4t0noZX9t6GcPTfBAbIbbIU4pfpCwh0ueq3S4O/5qXI1VwK1outmxhe9dOiEWqMz3MW2LKgDTpqWV+37IWuVbA==} engines: {node: ^18 || >=20} hasBin: true @@ -9095,13 +9090,13 @@ packages: typescript: optional: true dependencies: - typescript: 5.4.4 + typescript: 5.4.5 dev: true /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} - /tsup@8.0.2(@microsoft/api-extractor@7.43.0)(ts-node@10.9.2)(typescript@5.4.4): + /tsup@8.0.2(@microsoft/api-extractor@7.43.1)(ts-node@10.9.2)(typescript@5.4.5): resolution: {integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==} engines: {node: '>=18'} hasBin: true @@ -9120,7 +9115,7 @@ packages: typescript: optional: true dependencies: - '@microsoft/api-extractor': 7.43.0(@types/node@20.12.5) + '@microsoft/api-extractor': 7.43.1(@types/node@20.12.7) bundle-require: 4.0.2(esbuild@0.19.12) cac: 6.7.14 chokidar: 3.6.0 @@ -9135,7 +9130,7 @@ packages: source-map: 0.8.0-beta.0 sucrase: 3.35.0 tree-kill: 1.2.2 - typescript: 5.4.4 + typescript: 5.4.5 transitivePeerDependencies: - supports-color - ts-node @@ -9351,8 +9346,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - /typescript@5.4.4: - resolution: {integrity: sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==} + /typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} hasBin: true @@ -9395,10 +9390,10 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} - /unimport@3.7.1(rollup@4.14.1): + /unimport@3.7.1(rollup@4.14.2): resolution: {integrity: sha512-V9HpXYfsZye5bPPYUgs0Otn3ODS1mDUciaBlXljI4C2fTwfFpvFZRywmlOu943puN9sncxROMZhsZCjNXEpzEQ==} dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.14.1) + '@rollup/pluginutils': 5.1.0(rollup@4.14.2) acorn: 8.11.3 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 @@ -9505,15 +9500,6 @@ packages: /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - /v8-to-istanbul@9.2.0: - resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} - engines: {node: '>=10.12.0'} - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - '@types/istanbul-lib-coverage': 2.0.6 - convert-source-map: 2.0.0 - dev: true - /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: @@ -9555,8 +9541,8 @@ packages: engines: {node: '>= 0.8'} dev: false - /vite-node@1.4.0(@types/node@20.12.5): - resolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==} + /vite-node@1.5.0(@types/node@20.12.7): + resolution: {integrity: sha512-tV8h6gMj6vPzVCa7l+VGq9lwoJjW8Y79vst8QZZGiuRAfijU+EEWuc0kFpmndQrWhMMhet1jdSF+40KSZUqIIw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: @@ -9564,7 +9550,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.2.8(@types/node@20.12.5) + vite: 5.2.8(@types/node@20.12.7) transitivePeerDependencies: - '@types/node' - less @@ -9576,7 +9562,7 @@ packages: - terser dev: true - /vite-tsconfig-paths@4.3.2(typescript@5.4.4): + /vite-tsconfig-paths@4.3.2(typescript@5.4.5): resolution: {integrity: sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==} peerDependencies: vite: '*' @@ -9586,13 +9572,13 @@ packages: dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 3.0.3(typescript@5.4.4) + tsconfck: 3.0.3(typescript@5.4.5) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.5.3(@types/node@20.12.5): + /vite@4.5.3(@types/node@20.12.7): resolution: {integrity: sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -9620,7 +9606,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 esbuild: 0.18.20 postcss: 8.4.38 rollup: 3.29.4 @@ -9628,43 +9614,7 @@ packages: fsevents: 2.3.3 dev: true - /vite@5.2.7(@types/node@20.12.5): - resolution: {integrity: sha512-k14PWOKLI6pMaSzAuGtT+Cf0YmIx12z9YGon39onaJNy8DLBfBJrzg9FQEmkAM5lpHBZs9wksWAsyF/HkpEwJA==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - dependencies: - '@types/node': 20.12.5 - esbuild: 0.20.2 - postcss: 8.4.38 - rollup: 4.14.1 - optionalDependencies: - fsevents: 2.3.3 - dev: false - - /vite@5.2.8(@types/node@20.12.5): + /vite@5.2.8(@types/node@20.12.7): resolution: {integrity: sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -9692,16 +9642,15 @@ packages: terser: optional: true dependencies: - '@types/node': 20.12.5 + '@types/node': 20.12.7 esbuild: 0.20.2 postcss: 8.4.38 - rollup: 4.14.1 + rollup: 4.14.2 optionalDependencies: fsevents: 2.3.3 - dev: true - /vitepress@1.0.2(@algolia/client-search@4.23.2)(@types/node@20.12.5)(search-insights@2.13.0)(typescript@5.4.4): - resolution: {integrity: sha512-bEj9yTEdWyewJFOhEREZF+mXuAgOq27etuJZT6DZSp+J3XpQstXMJc5piSVwhZBtuj8OfA0iXy+jdP1c71KMYQ==} + /vitepress@1.1.0(@algolia/client-search@4.23.2)(@types/node@20.12.7)(search-insights@2.13.0)(typescript@5.4.5): + resolution: {integrity: sha512-G+NS5I2OETxC0SfGAMDO75JWNkrcir0UCptuhQMNoaZhhlqvYtTDQhph4qGc5dtiTtZkcFa/bCcSx+A2gSS3lA==} hasBin: true peerDependencies: markdown-it-mathjax3: ^4 @@ -9714,19 +9663,19 @@ packages: dependencies: '@docsearch/css': 3.6.0 '@docsearch/js': 3.6.0(@algolia/client-search@4.23.2)(search-insights@2.13.0) - '@shikijs/core': 1.2.1 - '@shikijs/transformers': 1.2.1 + '@shikijs/core': 1.3.0 + '@shikijs/transformers': 1.3.0 '@types/markdown-it': 13.0.7 - '@vitejs/plugin-vue': 5.0.4(vite@5.2.7)(vue@3.4.21) + '@vitejs/plugin-vue': 5.0.4(vite@5.2.8)(vue@3.4.21) '@vue/devtools-api': 7.0.25(vue@3.4.21) '@vueuse/core': 10.9.0(vue@3.4.21) '@vueuse/integrations': 10.9.0(focus-trap@7.5.4)(vue@3.4.21) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 6.3.0 - shiki: 1.2.1 - vite: 5.2.7(@types/node@20.12.5) - vue: 3.4.21(typescript@5.4.4) + shiki: 1.3.0 + vite: 5.2.8(@types/node@20.12.7) + vue: 3.4.21(typescript@5.4.5) transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -9755,15 +9704,15 @@ packages: - universal-cookie dev: false - /vitest@1.4.0(@types/node@20.12.5)(@vitest/ui@1.4.0): - resolution: {integrity: sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==} + /vitest@1.5.0(@types/node@20.12.7)(@vitest/ui@1.5.0): + resolution: {integrity: sha512-d8UKgR0m2kjdxDWX6911uwxout6GHS0XaGH1cksSIVVG8kRlE7G7aBw7myKQCvDI5dT4j7ZMa+l706BIORMDLw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 1.4.0 - '@vitest/ui': 1.4.0 + '@vitest/browser': 1.5.0 + '@vitest/ui': 1.5.0 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -9780,13 +9729,13 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.12.5 - '@vitest/expect': 1.4.0 - '@vitest/runner': 1.4.0 - '@vitest/snapshot': 1.4.0 - '@vitest/spy': 1.4.0 - '@vitest/ui': 1.4.0(vitest@1.4.0) - '@vitest/utils': 1.4.0 + '@types/node': 20.12.7 + '@vitest/expect': 1.5.0 + '@vitest/runner': 1.5.0 + '@vitest/snapshot': 1.5.0 + '@vitest/spy': 1.5.0 + '@vitest/ui': 1.5.0(vitest@1.5.0) + '@vitest/utils': 1.5.0 acorn-walk: 8.3.2 chai: 4.4.1 debug: 4.3.4 @@ -9799,8 +9748,8 @@ packages: strip-literal: 2.0.0 tinybench: 2.6.0 tinypool: 0.8.3 - vite: 5.2.8(@types/node@20.12.5) - vite-node: 1.4.0(@types/node@20.12.5) + vite: 5.2.8(@types/node@20.12.7) + vite-node: 1.5.0(@types/node@20.12.7) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -9857,7 +9806,7 @@ packages: '@vue/shared': 3.4.21 typescript: 5.2.2 - /vue@3.4.21(typescript@5.4.4): + /vue@3.4.21(typescript@5.4.5): resolution: {integrity: sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==} peerDependencies: typescript: '*' @@ -9870,7 +9819,7 @@ packages: '@vue/runtime-dom': 3.4.21 '@vue/server-renderer': 3.4.21(vue@3.4.21) '@vue/shared': 3.4.21 - typescript: 5.4.4 + typescript: 5.4.5 dev: false /watchpack@2.4.1: