Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Mar 9, 2024
1 parent 39da99a commit 7e2e691
Show file tree
Hide file tree
Showing 57 changed files with 240 additions and 865 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ type CreateUser = {
* @summary Create user
* @link /user */
export function useCreateUser(options: {
mutation?: UseMutationOptions<CreateUser['response'], CreateUser['error'], {
data: CreateUser['request']
}>
mutation?: UseMutationOptions<CreateUser['response'], CreateUser['error'], CreateUser['request']>
client?: CreateUser['client']['parameters']
} = {}): UseMutationResult<CreateUser['response'], CreateUser['error'], {
data: CreateUser['request']
}> {
} = {}): UseMutationResult<CreateUser['response'], CreateUser['error'], CreateUser['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<CreateUser['response'], CreateUser['error'], {
data: CreateUser['request']
}>({
mutationFn: async ({ data }) => {
return useMutation<CreateUser['response'], CreateUser['error'], CreateUser['request']>({
mutationFn: async (data) => {
const res = await client<CreateUser['data'], CreateUser['error'], CreateUser['request']>({
method: 'post',
url: `/user`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,12 @@ type CreateUsersWithListInput = {
* @summary Creates list of users with given input array
* @link /user/createWithList */
export function useCreateUsersWithListInput(options: {
mutation?: UseMutationOptions<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], {
data: CreateUsersWithListInput['request']
}>
mutation?: UseMutationOptions<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>
client?: CreateUsersWithListInput['client']['parameters']
} = {}): UseMutationResult<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], {
data: CreateUsersWithListInput['request']
}> {
} = {}): UseMutationResult<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], {
data: CreateUsersWithListInput['request']
}>({
mutationFn: async ({ data }) => {
return useMutation<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>({
mutationFn: async (data) => {
const res = await client<CreateUsersWithListInput['data'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>({
method: 'post',
url: `/user/createWithList`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ type DeleteUser = {
* @summary Delete user
* @link /user/:username */
export function useDeleteUser(username: DeleteUserPathParams['username'], options: {
mutation?: UseMutationOptions<DeleteUser['response'], DeleteUser['error'], {
data: DeleteUser['request']
}>
mutation?: UseMutationOptions<DeleteUser['response'], DeleteUser['error'], DeleteUser['request']>
client?: DeleteUser['client']['parameters']
} = {}): UseMutationResult<DeleteUser['response'], DeleteUser['error'], {
data: DeleteUser['request']
}> {
} = {}): UseMutationResult<DeleteUser['response'], DeleteUser['error'], DeleteUser['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<DeleteUser['response'], DeleteUser['error'], {
data: DeleteUser['request']
}>({
return useMutation<DeleteUser['response'], DeleteUser['error'], never>({
mutationFn: async () => {
const res = await client<DeleteUser['data'], DeleteUser['error'], DeleteUser['request']>({
method: 'delete',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ type UpdateUser = {
* @summary Update user
* @link /user/:username */
export function useUpdateUser(username: UpdateUserPathParams['username'], options: {
mutation?: UseMutationOptions<UpdateUser['response'], UpdateUser['error'], {
data: UpdateUser['request']
}>
mutation?: UseMutationOptions<UpdateUser['response'], UpdateUser['error'], UpdateUser['request']>
client?: UpdateUser['client']['parameters']
} = {}): UseMutationResult<UpdateUser['response'], UpdateUser['error'], {
data: UpdateUser['request']
}> {
} = {}): UseMutationResult<UpdateUser['response'], UpdateUser['error'], UpdateUser['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<UpdateUser['response'], UpdateUser['error'], {
data: UpdateUser['request']
}>({
mutationFn: async ({ data }) => {
return useMutation<UpdateUser['response'], UpdateUser['error'], UpdateUser['request']>({
mutationFn: async (data) => {
const res = await client<UpdateUser['data'], UpdateUser['error'], UpdateUser['request']>({
method: 'put',
url: `/user/${username}`,
Expand Down
6 changes: 2 additions & 4 deletions examples/react-query-v5/src/gen/hooks/useAddPetHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ type AddPet = {
* @summary Add a new pet to the store
* @link /pet */
export function useAddPetHook(options: {
mutation?: UseMutationOptions<AddPet['response'], AddPet['error'], {
data: AddPet['request']
}>
mutation?: UseMutationOptions<AddPet['response'], AddPet['error'], AddPet['request']>
client?: AddPet['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('useAddPetHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<AddPet['data'], AddPet['error'], AddPet['request']>({
method: 'post',
url: `/pet`,
Expand Down
6 changes: 2 additions & 4 deletions examples/react-query-v5/src/gen/hooks/useCreateUserHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ type CreateUser = {
* @summary Create user
* @link /user */
export function useCreateUserHook(options: {
mutation?: UseMutationOptions<CreateUser['response'], CreateUser['error'], {
data: CreateUser['request']
}>
mutation?: UseMutationOptions<CreateUser['response'], CreateUser['error'], CreateUser['request']>
client?: CreateUser['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('useCreateUserHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<CreateUser['data'], CreateUser['error'], CreateUser['request']>({
method: 'post',
url: `/user`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ type CreateUsersWithListInput = {
* @summary Creates list of users with given input array
* @link /user/createWithList */
export function useCreateUsersWithListInputHook(options: {
mutation?: UseMutationOptions<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], {
data: CreateUsersWithListInput['request']
}>
mutation?: UseMutationOptions<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>
client?: CreateUsersWithListInput['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('useCreateUsersWithListInputHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<CreateUsersWithListInput['data'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>({
method: 'post',
url: `/user/createWithList`,
Expand Down
4 changes: 1 addition & 3 deletions examples/react-query-v5/src/gen/hooks/useDeleteOrderHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ type DeleteOrder = {
* @summary Delete purchase order by ID
* @link /store/order/:orderId */
export function useDeleteOrderHook(orderId: DeleteOrderPathParams['orderId'], options: {
mutation?: UseMutationOptions<DeleteOrder['response'], DeleteOrder['error'], {
data: DeleteOrder['request']
}>
mutation?: UseMutationOptions<DeleteOrder['response'], DeleteOrder['error'], DeleteOrder['request']>
client?: DeleteOrder['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
Expand Down
4 changes: 1 addition & 3 deletions examples/react-query-v5/src/gen/hooks/useDeletePetHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ type DeletePet = {
* @summary Deletes a pet
* @link /pet/:petId */
export function useDeletePetHook(petId: DeletePetPathParams['petId'], headers?: DeletePet['headerParams'], options: {
mutation?: UseMutationOptions<DeletePet['response'], DeletePet['error'], {
data: DeletePet['request']
}>
mutation?: UseMutationOptions<DeletePet['response'], DeletePet['error'], DeletePet['request']>
client?: DeletePet['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
Expand Down
4 changes: 1 addition & 3 deletions examples/react-query-v5/src/gen/hooks/useDeleteUserHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ type DeleteUser = {
* @summary Delete user
* @link /user/:username */
export function useDeleteUserHook(username: DeleteUserPathParams['username'], options: {
mutation?: UseMutationOptions<DeleteUser['response'], DeleteUser['error'], {
data: DeleteUser['request']
}>
mutation?: UseMutationOptions<DeleteUser['response'], DeleteUser['error'], DeleteUser['request']>
client?: DeleteUser['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
Expand Down
6 changes: 2 additions & 4 deletions examples/react-query-v5/src/gen/hooks/usePlaceOrderHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ type PlaceOrder = {
* @summary Place an order for a pet
* @link /store/order */
export function usePlaceOrderHook(options: {
mutation?: UseMutationOptions<PlaceOrder['response'], PlaceOrder['error'], {
data: PlaceOrder['request']
}>
mutation?: UseMutationOptions<PlaceOrder['response'], PlaceOrder['error'], PlaceOrder['request']>
client?: PlaceOrder['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('usePlaceOrderHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<PlaceOrder['data'], PlaceOrder['error'], PlaceOrder['request']>({
method: 'post',
url: `/store/order`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ type PlaceOrderPatch = {
* @summary Place an order for a pet with patch
* @link /store/order */
export function usePlaceOrderPatchHook(options: {
mutation?: UseMutationOptions<PlaceOrderPatch['response'], PlaceOrderPatch['error'], {
data: PlaceOrderPatch['request']
}>
mutation?: UseMutationOptions<PlaceOrderPatch['response'], PlaceOrderPatch['error'], PlaceOrderPatch['request']>
client?: PlaceOrderPatch['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('usePlaceOrderPatchHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<PlaceOrderPatch['data'], PlaceOrderPatch['error'], PlaceOrderPatch['request']>({
method: 'patch',
url: `/store/order`,
Expand Down
6 changes: 2 additions & 4 deletions examples/react-query-v5/src/gen/hooks/useUpdatePetHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ type UpdatePet = {
* @summary Update an existing pet
* @link /pet */
export function useUpdatePetHook(options: {
mutation?: UseMutationOptions<UpdatePet['response'], UpdatePet['error'], {
data: UpdatePet['request']
}>
mutation?: UseMutationOptions<UpdatePet['response'], UpdatePet['error'], UpdatePet['request']>
client?: UpdatePet['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('useUpdatePetHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<UpdatePet['data'], UpdatePet['error'], UpdatePet['request']>({
method: 'put',
url: `/pet`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ type UpdatePetWithForm = {
* @summary Updates a pet in the store with form data
* @link /pet/:petId */
export function useUpdatePetWithFormHook(petId: UpdatePetWithFormPathParams['petId'], params?: UpdatePetWithForm['queryParams'], options: {
mutation?: UseMutationOptions<UpdatePetWithForm['response'], UpdatePetWithForm['error'], {
data: UpdatePetWithForm['request']
}>
mutation?: UseMutationOptions<UpdatePetWithForm['response'], UpdatePetWithForm['error'], UpdatePetWithForm['request']>
client?: UpdatePetWithForm['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
Expand Down
6 changes: 2 additions & 4 deletions examples/react-query-v5/src/gen/hooks/useUpdateUserHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ type UpdateUser = {
* @summary Update user
* @link /user/:username */
export function useUpdateUserHook(username: UpdateUserPathParams['username'], options: {
mutation?: UseMutationOptions<UpdateUser['response'], UpdateUser['error'], {
data: UpdateUser['request']
}>
mutation?: UseMutationOptions<UpdateUser['response'], UpdateUser['error'], UpdateUser['request']>
client?: UpdateUser['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('useUpdateUserHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<UpdateUser['data'], UpdateUser['error'], UpdateUser['request']>({
method: 'put',
url: `/user/${username}`,
Expand Down
6 changes: 2 additions & 4 deletions examples/react-query-v5/src/gen/hooks/useUploadFileHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ type UploadFile = {
* @summary uploads an image
* @link /pet/:petId/uploadImage */
export function useUploadFileHook(petId: UploadFilePathParams['petId'], params?: UploadFile['queryParams'], options: {
mutation?: UseMutationOptions<UploadFile['response'], UploadFile['error'], {
data: UploadFile['request']
}>
mutation?: UseMutationOptions<UploadFile['response'], UploadFile['error'], UploadFile['request']>
client?: UploadFile['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
const invalidationOnSuccess = useInvalidationForMutation('useUploadFileHook')
return useMutation({
mutationFn: async ({ data }) => {
mutationFn: async (data) => {
const res = await client<UploadFile['data'], UploadFile['error'], UploadFile['request']>({
method: 'post',
url: `/pet/${petId}/uploadImage`,
Expand Down
2 changes: 1 addition & 1 deletion examples/react-query-v5/src/gen/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './models/index'
export * from './hooks/index'
export * from './models/index'
14 changes: 4 additions & 10 deletions examples/react-query/src/gen/hooks/useAddPetHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ type AddPet = {
* @summary Add a new pet to the store
* @link /pet */
export function useAddPetHook(options: {
mutation?: UseMutationOptions<AddPet['response'], AddPet['error'], {
data: AddPet['request']
}>
mutation?: UseMutationOptions<AddPet['response'], AddPet['error'], AddPet['request']>
client?: AddPet['client']['parameters']
} = {}): UseMutationResult<AddPet['response'], AddPet['error'], {
data: AddPet['request']
}> {
} = {}): UseMutationResult<AddPet['response'], AddPet['error'], AddPet['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<AddPet['response'], AddPet['error'], {
data: AddPet['request']
}>({
mutationFn: async ({ data }) => {
return useMutation<AddPet['response'], AddPet['error'], AddPet['request']>({
mutationFn: async (data) => {
const res = await client<AddPet['data'], AddPet['error'], AddPet['request']>({
method: 'post',
url: `/pet`,
Expand Down
14 changes: 4 additions & 10 deletions examples/react-query/src/gen/hooks/useCreateUserHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ type CreateUser = {
* @summary Create user
* @link /user */
export function useCreateUserHook(options: {
mutation?: UseMutationOptions<CreateUser['response'], CreateUser['error'], {
data: CreateUser['request']
}>
mutation?: UseMutationOptions<CreateUser['response'], CreateUser['error'], CreateUser['request']>
client?: CreateUser['client']['parameters']
} = {}): UseMutationResult<CreateUser['response'], CreateUser['error'], {
data: CreateUser['request']
}> {
} = {}): UseMutationResult<CreateUser['response'], CreateUser['error'], CreateUser['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<CreateUser['response'], CreateUser['error'], {
data: CreateUser['request']
}>({
mutationFn: async ({ data }) => {
return useMutation<CreateUser['response'], CreateUser['error'], CreateUser['request']>({
mutationFn: async (data) => {
const res = await client<CreateUser['data'], CreateUser['error'], CreateUser['request']>({
method: 'post',
url: `/user`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ type CreateUsersWithListInput = {
* @summary Creates list of users with given input array
* @link /user/createWithList */
export function useCreateUsersWithListInputHook(options: {
mutation?: UseMutationOptions<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], {
data: CreateUsersWithListInput['request']
}>
mutation?: UseMutationOptions<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>
client?: CreateUsersWithListInput['client']['parameters']
} = {}): UseMutationResult<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], {
data: CreateUsersWithListInput['request']
}> {
} = {}): UseMutationResult<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], {
data: CreateUsersWithListInput['request']
}>({
mutationFn: async ({ data }) => {
return useMutation<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>({
mutationFn: async (data) => {
const res = await client<CreateUsersWithListInput['data'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>({
method: 'post',
url: `/user/createWithList`,
Expand Down
12 changes: 3 additions & 9 deletions examples/react-query/src/gen/hooks/useDeleteOrderHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ type DeleteOrder = {
* @summary Delete purchase order by ID
* @link /store/order/:orderId */
export function useDeleteOrderHook(orderId: DeleteOrderPathParams['orderId'], options: {
mutation?: UseMutationOptions<DeleteOrder['response'], DeleteOrder['error'], {
data: DeleteOrder['request']
}>
mutation?: UseMutationOptions<DeleteOrder['response'], DeleteOrder['error'], DeleteOrder['request']>
client?: DeleteOrder['client']['parameters']
} = {}): UseMutationResult<DeleteOrder['response'], DeleteOrder['error'], {
data: DeleteOrder['request']
}> {
} = {}): UseMutationResult<DeleteOrder['response'], DeleteOrder['error'], DeleteOrder['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<DeleteOrder['response'], DeleteOrder['error'], {
data: DeleteOrder['request']
}>({
return useMutation<DeleteOrder['response'], DeleteOrder['error'], never>({
mutationFn: async () => {
const res = await client<DeleteOrder['data'], DeleteOrder['error'], DeleteOrder['request']>({
method: 'delete',
Expand Down
12 changes: 3 additions & 9 deletions examples/react-query/src/gen/hooks/useDeletePetHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ type DeletePet = {
* @summary Deletes a pet
* @link /pet/:petId */
export function useDeletePetHook(petId: DeletePetPathParams['petId'], headers?: DeletePet['headerParams'], options: {
mutation?: UseMutationOptions<DeletePet['response'], DeletePet['error'], {
data: DeletePet['request']
}>
mutation?: UseMutationOptions<DeletePet['response'], DeletePet['error'], DeletePet['request']>
client?: DeletePet['client']['parameters']
} = {}): UseMutationResult<DeletePet['response'], DeletePet['error'], {
data: DeletePet['request']
}> {
} = {}): UseMutationResult<DeletePet['response'], DeletePet['error'], DeletePet['request']> {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation<DeletePet['response'], DeletePet['error'], {
data: DeletePet['request']
}>({
return useMutation<DeletePet['response'], DeletePet['error'], never>({
mutationFn: async () => {
const res = await client<DeletePet['data'], DeletePet['error'], DeletePet['request']>({
method: 'delete',
Expand Down
Loading

0 comments on commit 7e2e691

Please sign in to comment.