Skip to content

Commit

Permalink
chore: correct generation
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Feb 18, 2024
1 parent 46ffc65 commit 91a5952
Show file tree
Hide file tree
Showing 155 changed files with 309 additions and 1,061 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import type {
CreatePetsPathParams,
CreatePetsQueryParams,
CreatePetsHeaderParams,
CreatePets201,
CreatePetsError,
} from '../../../models/ts/petsController/CreatePets'
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'

type CreatePetsClient = typeof client<CreatePetsMutationResponse, CreatePets201 | CreatePetsError, CreatePetsMutationRequest>
type CreatePetsClient = typeof client<CreatePetsMutationResponse, never, CreatePetsMutationRequest>
type CreatePets = {
data: CreatePetsMutationResponse
error: CreatePets201 | CreatePetsError
error: never
request: CreatePetsMutationRequest
pathParams: CreatePetsPathParams
queryParams: CreatePetsQueryParams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import client from '../../../../tanstack-query-client.ts'
import { useMutation } from '@tanstack/react-query'
import type { CreateUserMutationRequest, CreateUserMutationResponse, CreateUserError } from '../../../models/ts/userController/CreateUser'
import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../../../models/ts/userController/CreateUser'
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'

type CreateUserClient = typeof client<CreateUserMutationResponse, CreateUserError, CreateUserMutationRequest>
type CreateUserClient = typeof client<CreateUserMutationResponse, never, CreateUserMutationRequest>
type CreateUser = {
data: CreateUserMutationResponse
error: CreateUserError
error: never
request: CreateUserMutationRequest
pathParams: never
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ import { useMutation } from '@tanstack/react-query'
import type {
CreateUsersWithListInputMutationRequest,
CreateUsersWithListInputMutationResponse,
CreateUsersWithListInputError,
} from '../../../models/ts/userController/CreateUsersWithListInput'
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'

type CreateUsersWithListInputClient = typeof client<
CreateUsersWithListInputMutationResponse,
CreateUsersWithListInputError,
CreateUsersWithListInputMutationRequest
>
type CreateUsersWithListInputClient = typeof client<CreateUsersWithListInputMutationResponse, never, CreateUsersWithListInputMutationRequest>
type CreateUsersWithListInput = {
data: CreateUsersWithListInputMutationResponse
error: CreateUsersWithListInputError
error: never
request: CreateUsersWithListInputMutationRequest
pathParams: never
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { logoutUserQueryResponseSchema } from '../../../zod/userController/logoutUserSchema'
import client from '../../../../tanstack-query-client.ts'
import { useQuery, useInfiniteQuery } from '@tanstack/react-query'
import type { LogoutUserQueryResponse, LogoutUserError } from '../../../models/ts/userController/LogoutUser'
import type { LogoutUserQueryResponse } from '../../../models/ts/userController/LogoutUser'
import type {
UseBaseQueryOptions,
UseQueryResult,
Expand All @@ -12,10 +12,10 @@ import type {
InfiniteData,
} from '@tanstack/react-query'

type LogoutUserClient = typeof client<LogoutUserQueryResponse, LogoutUserError, never>
type LogoutUserClient = typeof client<LogoutUserQueryResponse, never, never>
type LogoutUser = {
data: LogoutUserQueryResponse
error: LogoutUserError
error: never
request: never
pathParams: never
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import client from '../../../../tanstack-query-client.ts'
import { useMutation } from '@tanstack/react-query'
import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams, UpdateUserError } from '../../../models/ts/userController/UpdateUser'
import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../../../models/ts/userController/UpdateUser'
import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'

type UpdateUserClient = typeof client<UpdateUserMutationResponse, UpdateUserError, UpdateUserMutationRequest>
type UpdateUserClient = typeof client<UpdateUserMutationResponse, never, UpdateUserMutationRequest>
type UpdateUser = {
data: UpdateUserMutationResponse
error: UpdateUserError
error: never
request: UpdateUserMutationRequest
pathParams: UpdateUserPathParams
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import type {
CreatePetsPathParams,
CreatePetsQueryParams,
CreatePetsHeaderParams,
CreatePets201,
CreatePetsError,
} from '../../../models/ts/petsController/CreatePets'

type CreatePetsClient = typeof client<CreatePetsMutationResponse, CreatePets201 | CreatePetsError, CreatePetsMutationRequest>
type CreatePetsClient = typeof client<CreatePetsMutationResponse, never, CreatePetsMutationRequest>
type CreatePets = {
data: CreatePetsMutationResponse
error: CreatePets201 | CreatePetsError
error: never
request: CreatePetsMutationRequest
pathParams: CreatePetsPathParams
queryParams: CreatePetsQueryParams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import useSWRMutation from 'swr/mutation'
import client from '../../../../swr-client.ts'
import type { SWRMutationConfiguration, SWRMutationResponse } from 'swr/mutation'
import type { CreateUserMutationRequest, CreateUserMutationResponse, CreateUserError } from '../../../models/ts/userController/CreateUser'
import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../../../models/ts/userController/CreateUser'

type CreateUserClient = typeof client<CreateUserMutationResponse, CreateUserError, CreateUserMutationRequest>
type CreateUserClient = typeof client<CreateUserMutationResponse, never, CreateUserMutationRequest>
type CreateUser = {
data: CreateUserMutationResponse
error: CreateUserError
error: never
request: CreateUserMutationRequest
pathParams: never
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ import type { SWRMutationConfiguration, SWRMutationResponse } from 'swr/mutation
import type {
CreateUsersWithListInputMutationRequest,
CreateUsersWithListInputMutationResponse,
CreateUsersWithListInputError,
} from '../../../models/ts/userController/CreateUsersWithListInput'

type CreateUsersWithListInputClient = typeof client<
CreateUsersWithListInputMutationResponse,
CreateUsersWithListInputError,
CreateUsersWithListInputMutationRequest
>
type CreateUsersWithListInputClient = typeof client<CreateUsersWithListInputMutationResponse, never, CreateUsersWithListInputMutationRequest>
type CreateUsersWithListInput = {
data: CreateUsersWithListInputMutationResponse
error: CreateUsersWithListInputError
error: never
request: CreateUsersWithListInputMutationRequest
pathParams: never
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import useSWR from 'swr'
import client from '../../../../swr-client.ts'
import type { SWRConfiguration, SWRResponse } from 'swr'
import type { LogoutUserQueryResponse, LogoutUserError } from '../../../models/ts/userController/LogoutUser'
import type { LogoutUserQueryResponse } from '../../../models/ts/userController/LogoutUser'

type LogoutUserClient = typeof client<LogoutUserQueryResponse, LogoutUserError, never>
type LogoutUserClient = typeof client<LogoutUserQueryResponse, never, never>
type LogoutUser = {
data: LogoutUserQueryResponse
error: LogoutUserError
error: never
request: never
pathParams: never
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import useSWRMutation from 'swr/mutation'
import client from '../../../../swr-client.ts'
import type { SWRMutationConfiguration, SWRMutationResponse } from 'swr/mutation'
import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams, UpdateUserError } from '../../../models/ts/userController/UpdateUser'
import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../../../models/ts/userController/UpdateUser'

type UpdateUserClient = typeof client<UpdateUserMutationResponse, UpdateUserError, UpdateUserMutationRequest>
type UpdateUserClient = typeof client<UpdateUserMutationResponse, never, UpdateUserMutationRequest>
type UpdateUser = {
data: UpdateUserMutationResponse
error: UpdateUserError
error: never
request: UpdateUserMutationRequest
pathParams: UpdateUserPathParams
queryParams: never
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { faker } from '@faker-js/faker'
import { createApiResponse } from '../createApiResponse'
import type {
UploadFileMutationRequest,
UploadFileMutationResponse,
Expand All @@ -9,13 +10,6 @@ import type {
export function createUploadFileMutationRequest(override?: NonNullable<Partial<UploadFileMutationRequest>>): NonNullable<UploadFileMutationRequest> {
return faker.string.alpha()
}
/**
* @description successful operation
*/

export function createUploadFileMutationResponse(override?: NonNullable<Partial<UploadFileMutationResponse>>): NonNullable<UploadFileMutationResponse> {
return undefined
}

export function createUploadFilePathParams(override: NonNullable<Partial<UploadFilePathParams>> = {}): NonNullable<UploadFilePathParams> {
return {
Expand All @@ -30,3 +24,10 @@ export function createUploadFileQueryParams(override: NonNullable<Partial<Upload
...override,
}
}
/**
* @description successful operation
*/

export function createUploadFileMutationResponse(override?: NonNullable<Partial<UploadFileMutationResponse>>): NonNullable<UploadFileMutationResponse> {
return createApiResponse(override)
}
17 changes: 0 additions & 17 deletions examples/advanced/src/gen/mocks/petsController/createCreatePets.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
import { faker } from '@faker-js/faker'
import type {
CreatePets201,
CreatePetsError,
CreatePetsHeaderParams,
CreatePetsMutationRequest,
CreatePetsMutationResponse,
CreatePetsPathParams,
CreatePetsQueryParams,
} from '../../models/ts/petsController/CreatePets'

/**
* @description Null response
*/

export function createCreatePets201(override?: NonNullable<Partial<CreatePets201>>): NonNullable<CreatePets201> {
return undefined
}
/**
* @description unexpected error
*/

export function createCreatePetsError(override?: NonNullable<Partial<CreatePetsError>>): NonNullable<CreatePetsError> {
return undefined
}

export function createCreatePetsHeaderParams(override: NonNullable<Partial<CreatePetsHeaderParams>> = {}): NonNullable<CreatePetsHeaderParams> {
return {
...{ 'X-EXAMPLE': faker.helpers.arrayElement<any>([`ONE`, `TWO`, `THREE`]) },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import { createUser } from '../createUser'
import type { CreateUserError, CreateUserMutationRequest, CreateUserMutationResponse } from '../../models/ts/userController/CreateUser'

/**
* @description successful operation
*/

export function createCreateUserError(override?: NonNullable<Partial<CreateUserError>>): NonNullable<CreateUserError> {
return undefined
}
import type { CreateUserMutationRequest, CreateUserMutationResponse } from '../../models/ts/userController/CreateUser'

export function createCreateUserMutationResponse(override?: NonNullable<Partial<CreateUserMutationResponse>>): NonNullable<CreateUserMutationResponse> {
return undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
import { faker } from '@faker-js/faker'
import { createUser } from '../createUser'
import type {
CreateUsersWithListInputError,
CreateUsersWithListInputMutationRequest,
CreateUsersWithListInputMutationResponse,
} from '../../models/ts/userController/CreateUsersWithListInput'

/**
* @description successful operation
*/

export function createCreateUsersWithListInputError(
override?: NonNullable<Partial<CreateUsersWithListInputError>>,
): NonNullable<CreateUsersWithListInputError> {
return createUser(override)
}
import type { CreateUsersWithListInputMutationRequest, CreateUsersWithListInputMutationResponse } from '../../models/ts/userController/CreateUsersWithListInput'

export function createCreateUsersWithListInputMutationRequest(
override: NonNullable<Partial<CreateUsersWithListInputMutationRequest>> = [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import type { LogoutUserError, LogoutUserQueryResponse } from '../../models/ts/userController/LogoutUser'

/**
* @description successful operation
*/

export function createLogoutUserError(override?: NonNullable<Partial<LogoutUserError>>): NonNullable<LogoutUserError> {
return undefined
}
import type { LogoutUserQueryResponse } from '../../models/ts/userController/LogoutUser'

export function createLogoutUserQueryResponse(override?: NonNullable<Partial<LogoutUserQueryResponse>>): NonNullable<LogoutUserQueryResponse> {
return undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import { faker } from '@faker-js/faker'
import { createUser } from '../createUser'
import type { UpdateUserError, UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../../models/ts/userController/UpdateUser'

/**
* @description successful operation
*/

export function createUpdateUserError(override?: NonNullable<Partial<UpdateUserError>>): NonNullable<UpdateUserError> {
return undefined
}
import type { UpdateUserMutationRequest, UpdateUserMutationResponse, UpdateUserPathParams } from '../../models/ts/userController/UpdateUser'

export function createUpdateUserMutationResponse(override?: NonNullable<Partial<UpdateUserMutationResponse>>): NonNullable<UpdateUserMutationResponse> {
return undefined
Expand Down
12 changes: 7 additions & 5 deletions examples/advanced/src/gen/models/ts/petController/UploadFile.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export type UploadFileMutationRequest = string
import type { ApiResponse } from '../ApiResponse'

/**
* @description successful operation
*/
export type UploadFileMutationResponse = any | null
export type UploadFileMutationRequest = string

export type UploadFilePathParams = {
/**
Expand All @@ -20,6 +17,11 @@ export type UploadFileQueryParams = {
*/
additionalMetadata?: string
} | undefined

/**
* @description successful operation
*/
export type UploadFileMutationResponse = ApiResponse
export type UploadFileMutation = {
Response: UploadFileMutationResponse
Request: UploadFileMutationRequest
Expand Down
11 changes: 0 additions & 11 deletions examples/advanced/src/gen/models/ts/petsController/CreatePets.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/**
* @description Null response
*/
export type CreatePets201 = any | null

/**
* @description unexpected error
*/
export type CreatePetsError = any | null

export const CreatePetsHeaderParamsXExample = {
'ONE': 'ONE',
'TWO': 'TWO',
Expand Down Expand Up @@ -56,5 +46,4 @@ export type CreatePetsMutation = {
PathParams: CreatePetsPathParams
QueryParams: CreatePetsQueryParams
HeaderParams: CreatePetsHeaderParams
Errors: CreatePets201 | CreatePetsError
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import type { User } from '../User'

/**
* @description successful operation
*/
export type CreateUserError = any | null

export type CreateUserMutationResponse = any | null

/**
Expand All @@ -14,5 +9,4 @@ export type CreateUserMutationRequest = User
export type CreateUserMutation = {
Response: CreateUserMutationResponse
Request: CreateUserMutationRequest
Errors: CreateUserError
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import type { User } from '../User'

/**
* @description successful operation
*/
export type CreateUsersWithListInputError = User

export type CreateUsersWithListInputMutationRequest = User[]

/**
Expand All @@ -14,5 +9,4 @@ export type CreateUsersWithListInputMutationResponse = User
export type CreateUsersWithListInputMutation = {
Response: CreateUsersWithListInputMutationResponse
Request: CreateUsersWithListInputMutationRequest
Errors: CreateUsersWithListInputError
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/**
* @description successful operation
*/
export type LogoutUserError = any | null

export type LogoutUserQueryResponse = any | null
export type LogoutUserQuery = {
Response: LogoutUserQueryResponse
Errors: LogoutUserError
}
Loading

0 comments on commit 91a5952

Please sign in to comment.