Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Mar 9, 2024
1 parent 93a334e commit 0b3755a
Show file tree
Hide file tree
Showing 56 changed files with 1,941 additions and 1,875 deletions.
2 changes: 1 addition & 1 deletion examples/faker/petStore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ components:
example: 1
nationalityCode:
type: string
pattern: "^[A-Z]{2}$"
pattern: ^[A-Z]{2}$
xml:
name: user
Tag:
Expand Down
42 changes: 21 additions & 21 deletions examples/react-query-v5/src/gen/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
export * from "./operations";
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 './operations'
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'
42 changes: 21 additions & 21 deletions examples/react-query-v5/src/gen/hooks/operations.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
export function updatePet() {
return "/pet";
return '/pet'
}
export function addPet() {
return "/pet";
return '/pet'
}
export function findPetsByStatus() {
return "/pet/findByStatus";
return '/pet/findByStatus'
}
export function findPetsByTags() {
return "/pet/findByTags";
return '/pet/findByTags'
}
export function getPetById() {
return "/pet/{petId}";
return '/pet/{petId}'
}
export function updatePetWithForm() {
return "/pet/{petId}";
return '/pet/{petId}'
}
export function deletePet() {
return "/pet/{petId}";
return '/pet/{petId}'
}
export function uploadFile() {
return "/pet/{petId}/uploadImage";
return '/pet/{petId}/uploadImage'
}
export function getInventory() {
return "/store/inventory";
return '/store/inventory'
}
export function placeOrder() {
return "/store/order";
return '/store/order'
}
export function placeOrderPatch() {
return "/store/order";
return '/store/order'
}
export function getOrderById() {
return "/store/order/{orderId}";
return '/store/order/{orderId}'
}
export function deleteOrder() {
return "/store/order/{orderId}";
return '/store/order/{orderId}'
}
export function createUser() {
return "/user";
return '/user'
}
export function createUsersWithListInput() {
return "/user/createWithList";
return '/user/createWithList'
}
export function loginUser() {
return "/user/login";
return '/user/login'
}
export function logoutUser() {
return "/user/logout";
return '/user/logout'
}
export function getUserByName() {
return "/user/{username}";
return '/user/{username}'
}
export function updateUser() {
return "/user/{username}";
return '/user/{username}'
}
export function deleteUser() {
return "/user/{username}";
}
return '/user/{username}'
}
72 changes: 36 additions & 36 deletions examples/react-query-v5/src/gen/hooks/useAddPetHook.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import client from "@kubb/swagger-client/client";
import { useMutation } from "@tanstack/react-query";
import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from "../models/AddPet";
import type { UseMutationOptions } from "@tanstack/react-query";
import client from '@kubb/swagger-client/client'
import { useMutation } from '@tanstack/react-query'
import type { AddPetMutationRequest, AddPetMutationResponse, AddPet405 } from '../models/AddPet'
import type { UseMutationOptions } from '@tanstack/react-query'

type AddPetClient = typeof client<AddPetMutationResponse, AddPet405, AddPetMutationRequest>;
type AddPetClient = typeof client<AddPetMutationResponse, AddPet405, AddPetMutationRequest>
type AddPet = {
data: AddPetMutationResponse;
error: AddPet405;
request: AddPetMutationRequest;
pathParams: never;
queryParams: never;
headerParams: never;
response: AddPetMutationResponse;
client: {
parameters: Partial<Parameters<AddPetClient>[0]>;
return: Awaited<ReturnType<AddPetClient>>;
};
};
data: AddPetMutationResponse
error: AddPet405
request: AddPetMutationRequest
pathParams: never
queryParams: never
headerParams: never
response: AddPetMutationResponse
client: {
parameters: Partial<Parameters<AddPetClient>[0]>
return: Awaited<ReturnType<AddPetClient>>
}
}
/**
* @description Add a new pet to the store
* @summary Add a new pet to the store
* @link /pet */
* @description Add a new pet to the store
* @summary Add a new pet to the store
* @link /pet */
export function useAddPetHook(options: {
mutation?: UseMutationOptions<AddPet["response"], AddPet["error"], AddPet["request"]>;
client?: AddPet["client"]["parameters"];
mutation?: UseMutationOptions<AddPet['response'], AddPet['error'], AddPet['request']>
client?: AddPet['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {};
return useMutation({
mutationFn: async (data) => {
const res = await client<AddPet["data"], AddPet["error"], AddPet["request"]>({
method: "post",
url: `/pet`,
data,
...clientOptions
});
return res.data;
},
...mutationOptions
});
}
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation({
mutationFn: async (data) => {
const res = await client<AddPet['data'], AddPet['error'], AddPet['request']>({
method: 'post',
url: `/pet`,
data,
...clientOptions,
})
return res.data
},
...mutationOptions,
})
}
72 changes: 36 additions & 36 deletions examples/react-query-v5/src/gen/hooks/useCreateUserHook.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import client from "@kubb/swagger-client/client";
import { useMutation } from "@tanstack/react-query";
import type { CreateUserMutationRequest, CreateUserMutationResponse } from "../models/CreateUser";
import type { UseMutationOptions } from "@tanstack/react-query";
import client from '@kubb/swagger-client/client'
import { useMutation } from '@tanstack/react-query'
import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../models/CreateUser'
import type { UseMutationOptions } from '@tanstack/react-query'

type CreateUserClient = typeof client<CreateUserMutationResponse, never, CreateUserMutationRequest>;
type CreateUserClient = typeof client<CreateUserMutationResponse, never, CreateUserMutationRequest>
type CreateUser = {
data: CreateUserMutationResponse;
error: never;
request: CreateUserMutationRequest;
pathParams: never;
queryParams: never;
headerParams: never;
response: CreateUserMutationResponse;
client: {
parameters: Partial<Parameters<CreateUserClient>[0]>;
return: Awaited<ReturnType<CreateUserClient>>;
};
};
data: CreateUserMutationResponse
error: never
request: CreateUserMutationRequest
pathParams: never
queryParams: never
headerParams: never
response: CreateUserMutationResponse
client: {
parameters: Partial<Parameters<CreateUserClient>[0]>
return: Awaited<ReturnType<CreateUserClient>>
}
}
/**
* @description This can only be done by the logged in user.
* @summary Create user
* @link /user */
* @description This can only be done by the logged in user.
* @summary Create user
* @link /user */
export function useCreateUserHook(options: {
mutation?: UseMutationOptions<CreateUser["response"], CreateUser["error"], CreateUser["request"]>;
client?: CreateUser["client"]["parameters"];
mutation?: UseMutationOptions<CreateUser['response'], CreateUser['error'], CreateUser['request']>
client?: CreateUser['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {};
return useMutation({
mutationFn: async (data) => {
const res = await client<CreateUser["data"], CreateUser["error"], CreateUser["request"]>({
method: "post",
url: `/user`,
data,
...clientOptions
});
return res.data;
},
...mutationOptions
});
}
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation({
mutationFn: async (data) => {
const res = await client<CreateUser['data'], CreateUser['error'], CreateUser['request']>({
method: 'post',
url: `/user`,
data,
...clientOptions,
})
return res.data
},
...mutationOptions,
})
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import client from "@kubb/swagger-client/client";
import { useMutation } from "@tanstack/react-query";
import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputMutationResponse } from "../models/CreateUsersWithListInput";
import type { UseMutationOptions } from "@tanstack/react-query";
import client from '@kubb/swagger-client/client'
import { useMutation } from '@tanstack/react-query'
import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputMutationResponse } from '../models/CreateUsersWithListInput'
import type { UseMutationOptions } from '@tanstack/react-query'

type CreateUsersWithListInputClient = typeof client<CreateUsersWithListInputMutationResponse, never, CreateUsersWithListInputMutationRequest>;
type CreateUsersWithListInputClient = typeof client<CreateUsersWithListInputMutationResponse, never, CreateUsersWithListInputMutationRequest>
type CreateUsersWithListInput = {
data: CreateUsersWithListInputMutationResponse;
error: never;
request: CreateUsersWithListInputMutationRequest;
pathParams: never;
queryParams: never;
headerParams: never;
response: CreateUsersWithListInputMutationResponse;
client: {
parameters: Partial<Parameters<CreateUsersWithListInputClient>[0]>;
return: Awaited<ReturnType<CreateUsersWithListInputClient>>;
};
};
data: CreateUsersWithListInputMutationResponse
error: never
request: CreateUsersWithListInputMutationRequest
pathParams: never
queryParams: never
headerParams: never
response: CreateUsersWithListInputMutationResponse
client: {
parameters: Partial<Parameters<CreateUsersWithListInputClient>[0]>
return: Awaited<ReturnType<CreateUsersWithListInputClient>>
}
}
/**
* @description Creates list of users with given input array
* @summary Creates list of users with given input array
* @link /user/createWithList */
* @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<CreateUsersWithListInput["response"], CreateUsersWithListInput["error"], CreateUsersWithListInput["request"]>;
client?: CreateUsersWithListInput["client"]["parameters"];
mutation?: UseMutationOptions<CreateUsersWithListInput['response'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>
client?: CreateUsersWithListInput['client']['parameters']
} = {}) {
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {};
return useMutation({
mutationFn: async (data) => {
const res = await client<CreateUsersWithListInput["data"], CreateUsersWithListInput["error"], CreateUsersWithListInput["request"]>({
method: "post",
url: `/user/createWithList`,
data,
...clientOptions
});
return res.data;
},
...mutationOptions
});
}
const { mutation: mutationOptions, client: clientOptions = {} } = options ?? {}
return useMutation({
mutationFn: async (data) => {
const res = await client<CreateUsersWithListInput['data'], CreateUsersWithListInput['error'], CreateUsersWithListInput['request']>({
method: 'post',
url: `/user/createWithList`,
data,
...clientOptions,
})
return res.data
},
...mutationOptions,
})
}
Loading

0 comments on commit 0b3755a

Please sign in to comment.