406 lines
18 KiB
TypeScript
406 lines
18 KiB
TypeScript
/**
|
|
* Generated by orval v7.17.0 🍺
|
|
* Do not edit manually.
|
|
* MangaMochi API
|
|
* OpenAPI spec version: 1.0
|
|
*/
|
|
import {
|
|
useQuery
|
|
} from '@tanstack/react-query';
|
|
import type {
|
|
DataTag,
|
|
DefinedInitialDataOptions,
|
|
DefinedUseQueryResult,
|
|
QueryClient,
|
|
QueryFunction,
|
|
QueryKey,
|
|
UndefinedInitialDataOptions,
|
|
UseQueryOptions,
|
|
UseQueryResult
|
|
} from '@tanstack/react-query';
|
|
|
|
import type {
|
|
DefaultResponseDTOListMangaProxyDataDTO,
|
|
DefaultResponseDTOMangaProxyDataDTO
|
|
} from '../api.schemas';
|
|
|
|
import { customInstance } from '../../api';
|
|
|
|
|
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
|
|
|
|
|
|
/**
|
|
* Fetches manga information from MyAnimeList using the provided title. This endpoint serves as a proxy to search for manga data without directly exposing the MyAnimeList API.
|
|
* @summary Get manga data from MyAnimeList by title
|
|
*/
|
|
export const searchMyAnimeListMangaDataByTitle = (
|
|
title: string,
|
|
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customInstance<DefaultResponseDTOListMangaProxyDataDTO>(
|
|
{url: `/catalog/proxy/myanimelist/${encodeURIComponent(String(title))}/search`, method: 'GET', signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getSearchMyAnimeListMangaDataByTitleQueryKey = (title?: string,) => {
|
|
return [
|
|
`/catalog/proxy/myanimelist/${title}/search`
|
|
] as const;
|
|
}
|
|
|
|
|
|
export const getSearchMyAnimeListMangaDataByTitleQueryOptions = <TData = Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError = unknown>(title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getSearchMyAnimeListMangaDataByTitleQueryKey(title);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>> = ({ signal }) => searchMyAnimeListMangaDataByTitle(title, requestOptions, signal);
|
|
|
|
|
|
|
|
|
|
|
|
return { queryKey, queryFn, enabled: !!(title), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
}
|
|
|
|
export type SearchMyAnimeListMangaDataByTitleQueryResult = NonNullable<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>>
|
|
export type SearchMyAnimeListMangaDataByTitleQueryError = unknown
|
|
|
|
|
|
export function useSearchMyAnimeListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError, TData>> & Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useSearchMyAnimeListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError, TData>> & Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useSearchMyAnimeListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
/**
|
|
* @summary Get manga data from MyAnimeList by title
|
|
*/
|
|
|
|
export function useSearchMyAnimeListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchMyAnimeListMangaDataByTitle>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
|
|
const queryOptions = getSearchMyAnimeListMangaDataByTitleQueryOptions(title,options)
|
|
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
|
|
query.queryKey = queryOptions.queryKey ;
|
|
|
|
return query;
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Fetches manga information from MyAnimeList using the provided ID. This endpoint serves as a proxy to retrieve manga data without directly exposing the MyAnimeList API.
|
|
* @summary Get manga data from MyAnimeList by ID
|
|
*/
|
|
export const getMyAnimeListMangaDataById = (
|
|
id: number,
|
|
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customInstance<DefaultResponseDTOMangaProxyDataDTO>(
|
|
{url: `/catalog/proxy/myanimelist/${encodeURIComponent(String(id))}`, method: 'GET', signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getGetMyAnimeListMangaDataByIdQueryKey = (id?: number,) => {
|
|
return [
|
|
`/catalog/proxy/myanimelist/${id}`
|
|
] as const;
|
|
}
|
|
|
|
|
|
export const getGetMyAnimeListMangaDataByIdQueryOptions = <TData = Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError = unknown>(id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getGetMyAnimeListMangaDataByIdQueryKey(id);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>> = ({ signal }) => getMyAnimeListMangaDataById(id, requestOptions, signal);
|
|
|
|
|
|
|
|
|
|
|
|
return { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
}
|
|
|
|
export type GetMyAnimeListMangaDataByIdQueryResult = NonNullable<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>>
|
|
export type GetMyAnimeListMangaDataByIdQueryError = unknown
|
|
|
|
|
|
export function useGetMyAnimeListMangaDataById<TData = Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError = unknown>(
|
|
id: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError, TData>> & Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useGetMyAnimeListMangaDataById<TData = Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError = unknown>(
|
|
id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError, TData>> & Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useGetMyAnimeListMangaDataById<TData = Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError = unknown>(
|
|
id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
/**
|
|
* @summary Get manga data from MyAnimeList by ID
|
|
*/
|
|
|
|
export function useGetMyAnimeListMangaDataById<TData = Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError = unknown>(
|
|
id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMyAnimeListMangaDataById>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
|
|
const queryOptions = getGetMyAnimeListMangaDataByIdQueryOptions(id,options)
|
|
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
|
|
query.queryKey = queryOptions.queryKey ;
|
|
|
|
return query;
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Fetches manga information from AniList using the provided title. This endpoint serves as a proxy to search for manga data without directly exposing the AniList API.
|
|
* @summary Get manga data from AniList by title
|
|
*/
|
|
export const searchAniListMangaDataByTitle = (
|
|
title: string,
|
|
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customInstance<DefaultResponseDTOListMangaProxyDataDTO>(
|
|
{url: `/catalog/proxy/anilist/${encodeURIComponent(String(title))}/search`, method: 'GET', signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getSearchAniListMangaDataByTitleQueryKey = (title?: string,) => {
|
|
return [
|
|
`/catalog/proxy/anilist/${title}/search`
|
|
] as const;
|
|
}
|
|
|
|
|
|
export const getSearchAniListMangaDataByTitleQueryOptions = <TData = Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError = unknown>(title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getSearchAniListMangaDataByTitleQueryKey(title);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>> = ({ signal }) => searchAniListMangaDataByTitle(title, requestOptions, signal);
|
|
|
|
|
|
|
|
|
|
|
|
return { queryKey, queryFn, enabled: !!(title), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
}
|
|
|
|
export type SearchAniListMangaDataByTitleQueryResult = NonNullable<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>>
|
|
export type SearchAniListMangaDataByTitleQueryError = unknown
|
|
|
|
|
|
export function useSearchAniListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError, TData>> & Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useSearchAniListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError, TData>> & Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useSearchAniListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
/**
|
|
* @summary Get manga data from AniList by title
|
|
*/
|
|
|
|
export function useSearchAniListMangaDataByTitle<TData = Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError = unknown>(
|
|
title: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof searchAniListMangaDataByTitle>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
|
|
const queryOptions = getSearchAniListMangaDataByTitleQueryOptions(title,options)
|
|
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
|
|
query.queryKey = queryOptions.queryKey ;
|
|
|
|
return query;
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Fetches manga information from AniList using the provided ID. This endpoint serves as a proxy to retrieve manga data without directly exposing the AniList API.
|
|
* @summary Get manga data from AniList by ID
|
|
*/
|
|
export const getAniListMangaDataById = (
|
|
id: number,
|
|
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
) => {
|
|
|
|
|
|
return customInstance<DefaultResponseDTOMangaProxyDataDTO>(
|
|
{url: `/catalog/proxy/anilist/${encodeURIComponent(String(id))}`, method: 'GET', signal
|
|
},
|
|
options);
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getGetAniListMangaDataByIdQueryKey = (id?: number,) => {
|
|
return [
|
|
`/catalog/proxy/anilist/${id}`
|
|
] as const;
|
|
}
|
|
|
|
|
|
export const getGetAniListMangaDataByIdQueryOptions = <TData = Awaited<ReturnType<typeof getAniListMangaDataById>>, TError = unknown>(id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAniListMangaDataById>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
) => {
|
|
|
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
|
const queryKey = queryOptions?.queryKey ?? getGetAniListMangaDataByIdQueryKey(id);
|
|
|
|
|
|
|
|
const queryFn: QueryFunction<Awaited<ReturnType<typeof getAniListMangaDataById>>> = ({ signal }) => getAniListMangaDataById(id, requestOptions, signal);
|
|
|
|
|
|
|
|
|
|
|
|
return { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getAniListMangaDataById>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
}
|
|
|
|
export type GetAniListMangaDataByIdQueryResult = NonNullable<Awaited<ReturnType<typeof getAniListMangaDataById>>>
|
|
export type GetAniListMangaDataByIdQueryError = unknown
|
|
|
|
|
|
export function useGetAniListMangaDataById<TData = Awaited<ReturnType<typeof getAniListMangaDataById>>, TError = unknown>(
|
|
id: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAniListMangaDataById>>, TError, TData>> & Pick<
|
|
DefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof getAniListMangaDataById>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof getAniListMangaDataById>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useGetAniListMangaDataById<TData = Awaited<ReturnType<typeof getAniListMangaDataById>>, TError = unknown>(
|
|
id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAniListMangaDataById>>, TError, TData>> & Pick<
|
|
UndefinedInitialDataOptions<
|
|
Awaited<ReturnType<typeof getAniListMangaDataById>>,
|
|
TError,
|
|
Awaited<ReturnType<typeof getAniListMangaDataById>>
|
|
> , 'initialData'
|
|
>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
export function useGetAniListMangaDataById<TData = Awaited<ReturnType<typeof getAniListMangaDataById>>, TError = unknown>(
|
|
id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAniListMangaDataById>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
/**
|
|
* @summary Get manga data from AniList by ID
|
|
*/
|
|
|
|
export function useGetAniListMangaDataById<TData = Awaited<ReturnType<typeof getAniListMangaDataById>>, TError = unknown>(
|
|
id: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAniListMangaDataById>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
, queryClient?: QueryClient
|
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
|
|
const queryOptions = getGetAniListMangaDataByIdQueryOptions(id,options)
|
|
|
|
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
|
|
query.queryKey = queryOptions.queryKey ;
|
|
|
|
return query;
|
|
}
|
|
|
|
|
|
|
|
|