- 백엔드 SDK 이전: FastAPI OpenAPI → orval 자동생성 (React Query 훅 포함) - HTTP 어댑터: ky 기반 customFetcher, fetch httpClient 시그니처 - 아키텍처: features 모듈 / shared 레이어 컨벤션 정의 - 디자인 시스템: Tailwind v4 CSS-first 토큰 (브랜드 색 / status / shadcn) - 커스텀 CSS: utilities / animations 를 custom.css 로 분리 - Docker: 개발(Dockerfile.dev + compose) / 프로덕션(nginx) 셋업 - README: 기술 스펙 / 프로젝트 구조 / 디자인 토큰 / 폰트 / SDK 사용법 정리 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
120 lines
3.4 KiB
TypeScript
120 lines
3.4 KiB
TypeScript
/**
|
|
* Generated by orval v7.21.0 🍺
|
|
* Do not edit manually.
|
|
* FastAPI
|
|
* OpenAPI spec version: 0.1.0
|
|
*/
|
|
import {
|
|
useMutation
|
|
} from '@tanstack/react-query';
|
|
import type {
|
|
MutationFunction,
|
|
QueryClient,
|
|
UseMutationOptions,
|
|
UseMutationResult
|
|
} from '@tanstack/react-query';
|
|
|
|
import type {
|
|
ChannelVerifyRequest,
|
|
ChannelVerifyResponse,
|
|
HTTPValidationError
|
|
} from '../../model';
|
|
|
|
import { customFetcher } from '../../api';
|
|
|
|
|
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
|
|
|
|
|
/**
|
|
* @summary Verify Channels
|
|
*/
|
|
export type verifyChannelsResponse200 = {
|
|
data: ChannelVerifyResponse
|
|
status: 200
|
|
}
|
|
|
|
export type verifyChannelsResponse422 = {
|
|
data: HTTPValidationError
|
|
status: 422
|
|
}
|
|
|
|
export type verifyChannelsResponseSuccess = (verifyChannelsResponse200) & {
|
|
headers: Headers;
|
|
};
|
|
export type verifyChannelsResponseError = (verifyChannelsResponse422) & {
|
|
headers: Headers;
|
|
};
|
|
|
|
export type verifyChannelsResponse = (verifyChannelsResponseSuccess | verifyChannelsResponseError)
|
|
|
|
export const getVerifyChannelsUrl = () => {
|
|
|
|
|
|
|
|
|
|
return `/api/channels/verify`
|
|
}
|
|
|
|
export const verifyChannels = async (channelVerifyRequest: ChannelVerifyRequest, options?: RequestInit): Promise<verifyChannelsResponse> => {
|
|
|
|
return customFetcher<verifyChannelsResponse>(getVerifyChannelsUrl(),
|
|
{
|
|
...options,
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
body: JSON.stringify(
|
|
channelVerifyRequest,)
|
|
}
|
|
);}
|
|
|
|
|
|
|
|
|
|
export const getVerifyChannelsMutationOptions = <TError = HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof verifyChannels>>, TError,{data: ChannelVerifyRequest}, TContext>, request?: SecondParameter<typeof customFetcher>}
|
|
): UseMutationOptions<Awaited<ReturnType<typeof verifyChannels>>, TError,{data: ChannelVerifyRequest}, TContext> => {
|
|
|
|
const mutationKey = ['verifyChannels'];
|
|
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
options
|
|
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
: {mutation: { mutationKey, }, request: undefined};
|
|
|
|
|
|
|
|
|
|
const mutationFn: MutationFunction<Awaited<ReturnType<typeof verifyChannels>>, {data: ChannelVerifyRequest}> = (props) => {
|
|
const {data} = props ?? {};
|
|
|
|
return verifyChannels(data,requestOptions)
|
|
}
|
|
|
|
|
|
|
|
|
|
return { mutationFn, ...mutationOptions }}
|
|
|
|
export type VerifyChannelsMutationResult = NonNullable<Awaited<ReturnType<typeof verifyChannels>>>
|
|
export type VerifyChannelsMutationBody = ChannelVerifyRequest
|
|
export type VerifyChannelsMutationError = HTTPValidationError
|
|
|
|
/**
|
|
* @summary Verify Channels
|
|
*/
|
|
export const useVerifyChannels = <TError = HTTPValidationError,
|
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof verifyChannels>>, TError,{data: ChannelVerifyRequest}, TContext>, request?: SecondParameter<typeof customFetcher>}
|
|
, queryClient?: QueryClient): UseMutationResult<
|
|
Awaited<ReturnType<typeof verifyChannels>>,
|
|
TError,
|
|
{data: ChannelVerifyRequest},
|
|
TContext
|
|
> => {
|
|
|
|
const mutationOptions = getVerifyChannelsMutationOptions(options);
|
|
|
|
return useMutation(mutationOptions, queryClient);
|
|
}
|
|
|