diff --git a/.env.local b/.env.local index c6f9b15..c418598 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,2 @@ VITE_API_BASE_URL=http://localhost:8080 -VITE_OMV_BASE_URL=http://omv.badger-pirarucu.ts.net:9000/mangamochi \ No newline at end of file +VITE_OMV_BASE_URL=http://omv.badger-pirarucu.ts.net:9000/mangamochi-dev \ No newline at end of file diff --git a/src/api/generated/api.schemas.ts b/src/api/generated/api.schemas.ts index bc1c485..92ad298 100644 --- a/src/api/generated/api.schemas.ts +++ b/src/api/generated/api.schemas.ts @@ -4,6 +4,12 @@ * OpenAPI definition * OpenAPI spec version: v0 */ +export interface RegistrationRequestDTO { + name?: string; + email?: string; + password?: string; +} + export interface DefaultResponseDTOVoid { timestamp?: string; data?: unknown; @@ -26,14 +32,9 @@ export interface ImportMangaResponseDTO { id: number; } -export interface RegistrationRequestDTO { - name?: string; - email?: string; - password?: string; -} - -export interface RefreshTokenRequestDTO { - refreshToken: string; +export interface AuthenticationRequestDTO { + email: string; + password: string; } export type AuthenticationResponseDTORole = typeof AuthenticationResponseDTORole[keyof typeof AuthenticationResponseDTORole]; @@ -59,24 +60,62 @@ export interface DefaultResponseDTOAuthenticationResponseDTO { message?: string; } -export interface AuthenticationRequestDTO { - email: string; - password: string; +export interface RefreshTokenRequestDTO { + refreshToken: string; } -export interface DefaultResponseDTOProviderListDTO { - timestamp?: string; - data?: ProviderListDTO; - message?: string; -} - -export interface ProviderDTO { - id: number; +export interface ContentProviderDTO { + id?: number; + /** @minLength 1 */ name: string; } -export interface ProviderListDTO { - providers: ProviderDTO[]; +export interface ContentProviderListDTO { + providers: ContentProviderDTO[]; +} + +export interface DefaultResponseDTOContentProviderListDTO { + timestamp?: string; + data?: ContentProviderListDTO; + message?: string; +} + +export interface DefaultResponseDTOListMangaContentDTO { + timestamp?: string; + data?: MangaContentDTO[]; + message?: string; +} + +export interface LanguageDTO { + id: number; + /** @minLength 1 */ + code: string; + /** @minLength 1 */ + name: string; +} + +export interface MangaContentDTO { + id: number; + /** @minLength 1 */ + title: string; + downloaded: boolean; + isRead: boolean; + language?: LanguageDTO; +} + +export interface DefaultResponseDTOMangaContentImagesDTO { + timestamp?: string; + data?: MangaContentImagesDTO; + message?: string; +} + +export interface MangaContentImagesDTO { + id: number; + /** @minLength 1 */ + mangaTitle: string; + previousContentId?: number; + nextContentId?: number; + contentImageKeys: string[]; } export interface DefaultResponseDTOPageMangaListDTO { @@ -85,12 +124,24 @@ export interface DefaultResponseDTOPageMangaListDTO { message?: string; } +export type MangaListDTOStatus = typeof MangaListDTOStatus[keyof typeof MangaListDTOStatus]; + + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const MangaListDTOStatus = { + ONGOING: 'ONGOING', + COMPLETED: 'COMPLETED', + HIATUS: 'HIATUS', + CANCELLED: 'CANCELLED', + UNKNOWN: 'UNKNOWN', +} as const; + export interface MangaListDTO { id: number; /** @minLength 1 */ title: string; coverImageKey?: string; - status?: string; + status?: MangaListDTOStatus; publishedFrom?: string; publishedTo?: string; providerCount?: number; @@ -115,9 +166,9 @@ export interface PageMangaListDTO { } export interface PageableObject { - paged?: boolean; pageNumber?: number; pageSize?: number; + paged?: boolean; unpaged?: boolean; offset?: number; sort?: SortObject; @@ -129,41 +180,30 @@ export interface SortObject { empty?: boolean; } -export interface DefaultResponseDTOListMangaChapterDTO { - timestamp?: string; - data?: MangaChapterDTO[]; - message?: string; -} - -export interface LanguageDTO { - id: number; - /** @minLength 1 */ - code: string; - /** @minLength 1 */ - name: string; -} - -export interface MangaChapterDTO { - id: number; - /** @minLength 1 */ - title: string; - downloaded: boolean; - isRead: boolean; - language?: LanguageDTO; -} - export interface DefaultResponseDTOMangaDTO { timestamp?: string; data?: MangaDTO; message?: string; } +export type MangaDTOStatus = typeof MangaDTOStatus[keyof typeof MangaDTOStatus]; + + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const MangaDTOStatus = { + ONGOING: 'ONGOING', + COMPLETED: 'COMPLETED', + HIATUS: 'HIATUS', + CANCELLED: 'CANCELLED', + UNKNOWN: 'UNKNOWN', +} as const; + export interface MangaDTO { id: number; /** @minLength 1 */ title: string; coverImageKey?: string; - status?: string; + status?: MangaDTOStatus; publishedFrom?: string; publishedTo?: string; synopsis?: string; @@ -178,52 +218,28 @@ export interface MangaDTO { following: boolean; } -export type MangaProviderDTOProviderStatus = typeof MangaProviderDTOProviderStatus[keyof typeof MangaProviderDTOProviderStatus]; - - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const MangaProviderDTOProviderStatus = { - ACTIVE: 'ACTIVE', - INACTIVE: 'INACTIVE', -} as const; - export interface MangaProviderDTO { - id: number; + id?: number; /** @minLength 1 */ providerName: string; - providerStatus: MangaProviderDTOProviderStatus; + active?: boolean; chaptersAvailable: number; chaptersDownloaded: number; supportsChapterFetch: boolean; } -export interface DefaultResponseDTOMangaChapterImagesDTO { +export interface DefaultResponseDTOListMangaIngestReviewDTO { timestamp?: string; - data?: MangaChapterImagesDTO; + data?: MangaIngestReviewDTO[]; message?: string; } -export interface MangaChapterImagesDTO { - id: number; - /** @minLength 1 */ - mangaTitle: string; - previousChapterId?: number; - nextChapterId?: number; - chapterImageKeys: string[]; -} - -export interface DefaultResponseDTOListImportReviewDTO { - timestamp?: string; - data?: ImportReviewDTO[]; - message?: string; -} - -export interface ImportReviewDTO { +export interface MangaIngestReviewDTO { id: number; /** @minLength 1 */ title: string; /** @minLength 1 */ - providerName: string; + contentProviderName: string; externalUrl?: string; /** @minLength 1 */ reason: string; @@ -262,16 +278,12 @@ export type ImportMultipleFilesBody = { files: Blob[]; }; -export type ResolveImportReviewParams = { -importReviewId: number; +export type ResolveMangaIngestReviewParams = { +id: number; malId: string; }; -export type UpdateProviderMangaListParams = { -providerId: number; -}; - -export type GetProvidersParams = { +export type GetContentProvidersParams = { manualImport?: boolean; }; diff --git a/src/api/generated/auth/auth.ts b/src/api/generated/authentication/authentication.ts similarity index 52% rename from src/api/generated/auth/auth.ts rename to src/api/generated/authentication/authentication.ts index 9068bb8..cb643dc 100644 --- a/src/api/generated/auth/auth.ts +++ b/src/api/generated/authentication/authentication.ts @@ -17,9 +17,7 @@ import type { import type { AuthenticationRequestDTO, DefaultResponseDTOAuthenticationResponseDTO, - DefaultResponseDTOVoid, - RefreshTokenRequestDTO, - RegistrationRequestDTO + RefreshTokenRequestDTO } from '../api.schemas'; import { customInstance } from '../../api'; @@ -30,30 +28,30 @@ type SecondParameter unknown> = Parameters[1]; /** - * Register a new user. - * @summary Register user + * Authenticate an user with email and password. + * @summary Authenticate an user */ -export const registerUser = ( - registrationRequestDTO: RegistrationRequestDTO, +export const login = ( + authenticationRequestDTO: AuthenticationRequestDTO, options?: SecondParameter,signal?: AbortSignal ) => { - return customInstance( - {url: `/auth/register`, method: 'POST', + return customInstance( + {url: `/authentication`, method: 'POST', headers: {'Content-Type': 'application/json', }, - data: registrationRequestDTO, signal + data: authenticationRequestDTO, signal }, options); } -export const getRegisterUserMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: RegistrationRequestDTO}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{data: RegistrationRequestDTO}, TContext> => { +export const getLoginMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: AuthenticationRequestDTO}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{data: AuthenticationRequestDTO}, TContext> => { -const mutationKey = ['registerUser']; +const mutationKey = ['login']; const {mutation: mutationOptions, request: requestOptions} = options ? options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ? options @@ -63,10 +61,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ? - const mutationFn: MutationFunction>, {data: RegistrationRequestDTO}> = (props) => { + const mutationFn: MutationFunction>, {data: AuthenticationRequestDTO}> = (props) => { const {data} = props ?? {}; - return registerUser(data,requestOptions) + return login(data,requestOptions) } @@ -74,23 +72,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ? return { mutationFn, ...mutationOptions }} - export type RegisterUserMutationResult = NonNullable>> - export type RegisterUserMutationBody = RegistrationRequestDTO - export type RegisterUserMutationError = unknown + export type LoginMutationResult = NonNullable>> + export type LoginMutationBody = AuthenticationRequestDTO + export type LoginMutationError = unknown /** - * @summary Register user + * @summary Authenticate an user */ -export const useRegisterUser = (options?: { mutation?:UseMutationOptions>, TError,{data: RegistrationRequestDTO}, TContext>, request?: SecondParameter} +export const useLogin = (options?: { mutation?:UseMutationOptions>, TError,{data: AuthenticationRequestDTO}, TContext>, request?: SecondParameter} , queryClient?: QueryClient): UseMutationResult< - Awaited>, + Awaited>, TError, - {data: RegistrationRequestDTO}, + {data: AuthenticationRequestDTO}, TContext > => { - const mutationOptions = getRegisterUserMutationOptions(options); + const mutationOptions = getLoginMutationOptions(options); return useMutation(mutationOptions, queryClient); } @@ -105,7 +103,7 @@ export const refreshAuthToken = ( return customInstance( - {url: `/auth/refresh`, method: 'POST', + {url: `/authentication/refresh`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: refreshTokenRequestDTO, signal }, @@ -159,69 +157,4 @@ export const useRefreshAuthToken = ,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/auth/login`, method: 'POST', - headers: {'Content-Type': 'application/json', }, - data: authenticationRequestDTO, signal - }, - options); - } - - - -export const getAuthenticateUserMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: AuthenticationRequestDTO}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{data: AuthenticationRequestDTO}, TContext> => { - -const mutationKey = ['authenticateUser']; -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>, {data: AuthenticationRequestDTO}> = (props) => { - const {data} = props ?? {}; - - return authenticateUser(data,requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type AuthenticateUserMutationResult = NonNullable>> - export type AuthenticateUserMutationBody = AuthenticationRequestDTO - export type AuthenticateUserMutationError = unknown - - /** - * @summary Authenticate user - */ -export const useAuthenticateUser = (options?: { mutation?:UseMutationOptions>, TError,{data: AuthenticationRequestDTO}, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - {data: AuthenticationRequestDTO}, - TContext - > => { - - const mutationOptions = getAuthenticateUserMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } \ No newline at end of file diff --git a/src/api/generated/catalog/catalog.ts b/src/api/generated/catalog/catalog.ts new file mode 100644 index 0000000..138e88f --- /dev/null +++ b/src/api/generated/catalog/catalog.ts @@ -0,0 +1,315 @@ +/** + * Generated by orval v7.17.0 🍺 + * Do not edit manually. + * OpenAPI definition + * OpenAPI spec version: v0 + */ +import { + useQuery +} from '@tanstack/react-query'; +import type { + DataTag, + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryClient, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult +} from '@tanstack/react-query'; + +import type { + DefaultResponseDTOListGenreDTO, + DefaultResponseDTOMangaDTO, + DefaultResponseDTOPageMangaListDTO, + GetMangasParams +} from '../api.schemas'; + +import { customInstance } from '../../api'; + + +type SecondParameter unknown> = Parameters[1]; + + + +/** + * Retrieve a list of mangas with their details. + * @summary Get a list of mangas + */ +export const getMangas = ( + params?: GetMangasParams, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/catalog/mangas`, method: 'GET', + params, signal + }, + options); + } + + + + +export const getGetMangasQueryKey = (params?: GetMangasParams,) => { + return [ + `/catalog/mangas`, ...(params ? [params]: []) + ] as const; + } + + +export const getGetMangasQueryOptions = >, TError = unknown>(params?: GetMangasParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetMangasQueryKey(params); + + + + const queryFn: QueryFunction>> = ({ signal }) => getMangas(params, requestOptions, signal); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } +} + +export type GetMangasQueryResult = NonNullable>> +export type GetMangasQueryError = unknown + + +export function useGetMangas>, TError = unknown>( + params: undefined | GetMangasParams, options: { query:Partial>, TError, TData>> & Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): DefinedUseQueryResult & { queryKey: DataTag } +export function useGetMangas>, TError = unknown>( + params?: GetMangasParams, options?: { query?:Partial>, TError, TData>> & Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +export function useGetMangas>, TError = unknown>( + params?: GetMangasParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +/** + * @summary Get a list of mangas + */ + +export function useGetMangas>, TError = unknown>( + params?: GetMangasParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } { + + const queryOptions = getGetMangasQueryOptions(params,options) + + const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + +/** + * Get the details of a manga by its ID + * @summary Get the details of a manga + */ +export const getManga = ( + mangaId: number, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/catalog/mangas/${encodeURIComponent(String(mangaId))}`, method: 'GET', signal + }, + options); + } + + + + +export const getGetMangaQueryKey = (mangaId?: number,) => { + return [ + `/catalog/mangas/${mangaId}` + ] as const; + } + + +export const getGetMangaQueryOptions = >, TError = unknown>(mangaId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetMangaQueryKey(mangaId); + + + + const queryFn: QueryFunction>> = ({ signal }) => getManga(mangaId, requestOptions, signal); + + + + + + return { queryKey, queryFn, enabled: !!(mangaId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } +} + +export type GetMangaQueryResult = NonNullable>> +export type GetMangaQueryError = unknown + + +export function useGetManga>, TError = unknown>( + mangaId: number, options: { query:Partial>, TError, TData>> & Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): DefinedUseQueryResult & { queryKey: DataTag } +export function useGetManga>, TError = unknown>( + mangaId: number, options?: { query?:Partial>, TError, TData>> & Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +export function useGetManga>, TError = unknown>( + mangaId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +/** + * @summary Get the details of a manga + */ + +export function useGetManga>, TError = unknown>( + mangaId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } { + + const queryOptions = getGetMangaQueryOptions(mangaId,options) + + const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + +/** + * Retrieve a list of manga genres. + * @summary Get a list of manga genres + */ +export const getGenres = ( + + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/catalog/genres`, method: 'GET', signal + }, + options); + } + + + + +export const getGetGenresQueryKey = () => { + return [ + `/catalog/genres` + ] as const; + } + + +export const getGetGenresQueryOptions = >, TError = unknown>( options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetGenresQueryKey(); + + + + const queryFn: QueryFunction>> = ({ signal }) => getGenres(requestOptions, signal); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } +} + +export type GetGenresQueryResult = NonNullable>> +export type GetGenresQueryError = unknown + + +export function useGetGenres>, TError = unknown>( + options: { query:Partial>, TError, TData>> & Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): DefinedUseQueryResult & { queryKey: DataTag } +export function useGetGenres>, TError = unknown>( + options?: { query?:Partial>, TError, TData>> & Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +export function useGetGenres>, TError = unknown>( + options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +/** + * @summary Get a list of manga genres + */ + +export function useGetGenres>, TError = unknown>( + options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } { + + const queryOptions = getGetGenresQueryOptions(options) + + const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + diff --git a/src/api/generated/content/content.ts b/src/api/generated/content/content.ts new file mode 100644 index 0000000..74a3470 --- /dev/null +++ b/src/api/generated/content/content.ts @@ -0,0 +1,219 @@ +/** + * Generated by orval v7.17.0 🍺 + * Do not edit manually. + * OpenAPI definition + * OpenAPI spec version: v0 + */ +import { + useQuery +} from '@tanstack/react-query'; +import type { + DataTag, + DefinedInitialDataOptions, + DefinedUseQueryResult, + QueryClient, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseQueryOptions, + UseQueryResult +} from '@tanstack/react-query'; + +import type { + DefaultResponseDTOListMangaContentDTO, + DefaultResponseDTOMangaContentImagesDTO +} from '../api.schemas'; + +import { customInstance } from '../../api'; + + +type SecondParameter unknown> = Parameters[1]; + + + +/** + * Retrieve the content for a specific manga/content provider combination. + * @summary Get the content for a specific manga/content provider combination + */ +export const getMangaProviderContent = ( + mangaContentProviderId: number, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/content/${encodeURIComponent(String(mangaContentProviderId))}`, method: 'GET', signal + }, + options); + } + + + + +export const getGetMangaProviderContentQueryKey = (mangaContentProviderId?: number,) => { + return [ + `/content/${mangaContentProviderId}` + ] as const; + } + + +export const getGetMangaProviderContentQueryOptions = >, TError = unknown>(mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetMangaProviderContentQueryKey(mangaContentProviderId); + + + + const queryFn: QueryFunction>> = ({ signal }) => getMangaProviderContent(mangaContentProviderId, requestOptions, signal); + + + + + + return { queryKey, queryFn, enabled: !!(mangaContentProviderId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } +} + +export type GetMangaProviderContentQueryResult = NonNullable>> +export type GetMangaProviderContentQueryError = unknown + + +export function useGetMangaProviderContent>, TError = unknown>( + mangaContentProviderId: number, options: { query:Partial>, TError, TData>> & Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): DefinedUseQueryResult & { queryKey: DataTag } +export function useGetMangaProviderContent>, TError = unknown>( + mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>> & Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +export function useGetMangaProviderContent>, TError = unknown>( + mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +/** + * @summary Get the content for a specific manga/content provider combination + */ + +export function useGetMangaProviderContent>, TError = unknown>( + mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } { + + const queryOptions = getGetMangaProviderContentQueryOptions(mangaContentProviderId,options) + + const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + +/** + * Retrieve a list of manga content images for a specific manga/provider combination. + * @summary Get the content images for a specific manga/provider combination + */ +export const getMangaContentImages = ( + mangaContentId: number, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/content/${encodeURIComponent(String(mangaContentId))}/images`, method: 'GET', signal + }, + options); + } + + + + +export const getGetMangaContentImagesQueryKey = (mangaContentId?: number,) => { + return [ + `/content/${mangaContentId}/images` + ] as const; + } + + +export const getGetMangaContentImagesQueryOptions = >, TError = unknown>(mangaContentId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetMangaContentImagesQueryKey(mangaContentId); + + + + const queryFn: QueryFunction>> = ({ signal }) => getMangaContentImages(mangaContentId, requestOptions, signal); + + + + + + return { queryKey, queryFn, enabled: !!(mangaContentId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } +} + +export type GetMangaContentImagesQueryResult = NonNullable>> +export type GetMangaContentImagesQueryError = unknown + + +export function useGetMangaContentImages>, TError = unknown>( + mangaContentId: number, options: { query:Partial>, TError, TData>> & Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): DefinedUseQueryResult & { queryKey: DataTag } +export function useGetMangaContentImages>, TError = unknown>( + mangaContentId: number, options?: { query?:Partial>, TError, TData>> & Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +export function useGetMangaContentImages>, TError = unknown>( + mangaContentId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +/** + * @summary Get the content images for a specific manga/provider combination + */ + +export function useGetMangaContentImages>, TError = unknown>( + mangaContentId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } { + + const queryOptions = getGetMangaContentImagesQueryOptions(mangaContentId,options) + + const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + diff --git a/src/api/generated/genre/genre.ts b/src/api/generated/genre/genre.ts deleted file mode 100644 index 7714f47..0000000 --- a/src/api/generated/genre/genre.ts +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Generated by orval v7.17.0 🍺 - * Do not edit manually. - * OpenAPI definition - * OpenAPI spec version: v0 - */ -import { - useQuery -} from '@tanstack/react-query'; -import type { - DataTag, - DefinedInitialDataOptions, - DefinedUseQueryResult, - QueryClient, - QueryFunction, - QueryKey, - UndefinedInitialDataOptions, - UseQueryOptions, - UseQueryResult -} from '@tanstack/react-query'; - -import type { - DefaultResponseDTOListGenreDTO -} from '../api.schemas'; - -import { customInstance } from '../../api'; - - -type SecondParameter unknown> = Parameters[1]; - - - -/** - * Retrieve a list of genres. - * @summary Get a list of genres - */ -export const getGenres = ( - - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/genres`, method: 'GET', signal - }, - options); - } - - - - -export const getGetGenresQueryKey = () => { - return [ - `/genres` - ] as const; - } - - -export const getGetGenresQueryOptions = >, TError = unknown>( options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -) => { - -const {query: queryOptions, request: requestOptions} = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetGenresQueryKey(); - - - - const queryFn: QueryFunction>> = ({ signal }) => getGenres(requestOptions, signal); - - - - - - return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } -} - -export type GetGenresQueryResult = NonNullable>> -export type GetGenresQueryError = unknown - - -export function useGetGenres>, TError = unknown>( - options: { query:Partial>, TError, TData>> & Pick< - DefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): DefinedUseQueryResult & { queryKey: DataTag } -export function useGetGenres>, TError = unknown>( - options?: { query?:Partial>, TError, TData>> & Pick< - UndefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -export function useGetGenres>, TError = unknown>( - options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -/** - * @summary Get a list of genres - */ - -export function useGetGenres>, TError = unknown>( - options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } { - - const queryOptions = getGetGenresQueryOptions(options) - - const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; - - query.queryKey = queryOptions.queryKey ; - - return query; -} - - - - diff --git a/src/api/generated/ingestion/ingestion.ts b/src/api/generated/ingestion/ingestion.ts new file mode 100644 index 0000000..0ce1ae3 --- /dev/null +++ b/src/api/generated/ingestion/ingestion.ts @@ -0,0 +1,384 @@ +/** + * Generated by orval v7.17.0 🍺 + * Do not edit manually. + * OpenAPI definition + * OpenAPI spec version: v0 + */ +import { + useMutation, + useQuery +} from '@tanstack/react-query'; +import type { + DataTag, + DefinedInitialDataOptions, + DefinedUseQueryResult, + MutationFunction, + QueryClient, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseMutationOptions, + UseMutationResult, + UseQueryOptions, + UseQueryResult +} from '@tanstack/react-query'; + +import type { + DefaultResponseDTOContentProviderListDTO, + DefaultResponseDTOVoid, + GetContentProvidersParams +} from '../api.schemas'; + +import { customInstance } from '../../api'; + + +type SecondParameter unknown> = Parameters[1]; + + + +/** + * Triggers the ingestion process for a specific content provider, fetching manga data and queuing it for processing. + * @summary Fetch mangas from a content provider + */ +export const fetchContentProviderMangas = ( + providerId: number, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/ingestion/providers/${encodeURIComponent(String(providerId))}/fetch`, method: 'POST', signal + }, + options); + } + + + +export const getFetchContentProviderMangasMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{providerId: number}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{providerId: number}, TContext> => { + +const mutationKey = ['fetchContentProviderMangas']; +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>, {providerId: number}> = (props) => { + const {providerId} = props ?? {}; + + return fetchContentProviderMangas(providerId,requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type FetchContentProviderMangasMutationResult = NonNullable>> + + export type FetchContentProviderMangasMutationError = unknown + + /** + * @summary Fetch mangas from a content provider + */ +export const useFetchContentProviderMangas = (options?: { mutation?:UseMutationOptions>, TError,{providerId: number}, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + {providerId: number}, + TContext + > => { + + const mutationOptions = getFetchContentProviderMangasMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + /** + * Triggers the ingestion process for all content providers, fetching manga data and queuing them for processing. + * @summary Fetch mangas from all content providers + */ +export const fetchAllContentProviderMangas = ( + + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/ingestion/providers/fetch`, method: 'POST', signal + }, + options); + } + + + +export const getFetchAllContentProviderMangasMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,void, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,void, TContext> => { + +const mutationKey = ['fetchAllContentProviderMangas']; +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>, void> = () => { + + + return fetchAllContentProviderMangas(requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type FetchAllContentProviderMangasMutationResult = NonNullable>> + + export type FetchAllContentProviderMangasMutationError = unknown + + /** + * @summary Fetch mangas from all content providers + */ +export const useFetchAllContentProviderMangas = (options?: { mutation?:UseMutationOptions>, TError,void, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + void, + TContext + > => { + + const mutationOptions = getFetchAllContentProviderMangasMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + /** + * Fetch the content (images) from the content provider + * @summary Fetch content from a content provider + */ +export const fetchContentProviderContent = ( + mangaContentId: number, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/ingestion/manga-content/${encodeURIComponent(String(mangaContentId))}/fetch`, method: 'POST', signal + }, + options); + } + + + +export const getFetchContentProviderContentMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{mangaContentId: number}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{mangaContentId: number}, TContext> => { + +const mutationKey = ['fetchContentProviderContent']; +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>, {mangaContentId: number}> = (props) => { + const {mangaContentId} = props ?? {}; + + return fetchContentProviderContent(mangaContentId,requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type FetchContentProviderContentMutationResult = NonNullable>> + + export type FetchContentProviderContentMutationError = unknown + + /** + * @summary Fetch content from a content provider + */ +export const useFetchContentProviderContent = (options?: { mutation?:UseMutationOptions>, TError,{mangaContentId: number}, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + {mangaContentId: number}, + TContext + > => { + + const mutationOptions = getFetchContentProviderContentMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + /** + * Triggers the ingestion process for a specific content provider, fetching content list and queuing it for processing. + * @summary Fetch content list from a content provider + */ +export const fetchContentProviderContentList = ( + mangaContentProviderId: number, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/ingestion/manga-content-providers/${encodeURIComponent(String(mangaContentProviderId))}/fetch`, method: 'POST', signal + }, + options); + } + + + +export const getFetchContentProviderContentListMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{mangaContentProviderId: number}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{mangaContentProviderId: number}, TContext> => { + +const mutationKey = ['fetchContentProviderContentList']; +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>, {mangaContentProviderId: number}> = (props) => { + const {mangaContentProviderId} = props ?? {}; + + return fetchContentProviderContentList(mangaContentProviderId,requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type FetchContentProviderContentListMutationResult = NonNullable>> + + export type FetchContentProviderContentListMutationError = unknown + + /** + * @summary Fetch content list from a content provider + */ +export const useFetchContentProviderContentList = (options?: { mutation?:UseMutationOptions>, TError,{mangaContentProviderId: number}, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + {mangaContentProviderId: number}, + TContext + > => { + + const mutationOptions = getFetchContentProviderContentListMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + /** + * Retrieve a list of content providers + * @summary Get a list of content providers + */ +export const getContentProviders = ( + params?: GetContentProvidersParams, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/ingestion/providers`, method: 'GET', + params, signal + }, + options); + } + + + + +export const getGetContentProvidersQueryKey = (params?: GetContentProvidersParams,) => { + return [ + `/ingestion/providers`, ...(params ? [params]: []) + ] as const; + } + + +export const getGetContentProvidersQueryOptions = >, TError = unknown>(params?: GetContentProvidersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetContentProvidersQueryKey(params); + + + + const queryFn: QueryFunction>> = ({ signal }) => getContentProviders(params, requestOptions, signal); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } +} + +export type GetContentProvidersQueryResult = NonNullable>> +export type GetContentProvidersQueryError = unknown + + +export function useGetContentProviders>, TError = unknown>( + params: undefined | GetContentProvidersParams, options: { query:Partial>, TError, TData>> & Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): DefinedUseQueryResult & { queryKey: DataTag } +export function useGetContentProviders>, TError = unknown>( + params?: GetContentProvidersParams, options?: { query?:Partial>, TError, TData>> & Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +export function useGetContentProviders>, TError = unknown>( + params?: GetContentProvidersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +/** + * @summary Get a list of content providers + */ + +export function useGetContentProviders>, TError = unknown>( + params?: GetContentProvidersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } { + + const queryOptions = getGetContentProvidersQueryOptions(params,options) + + const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + diff --git a/src/api/generated/management/management.ts b/src/api/generated/management/management.ts index 315f5de..8df96a2 100644 --- a/src/api/generated/management/management.ts +++ b/src/api/generated/management/management.ts @@ -15,8 +15,7 @@ import type { } from '@tanstack/react-query'; import type { - DefaultResponseDTOVoid, - UpdateProviderMangaListParams + DefaultResponseDTOVoid } from '../api.schemas'; import { customInstance } from '../../api'; @@ -90,196 +89,6 @@ export const useUserFollowUpdate = ,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/management/update-provider-manga-list`, method: 'POST', - params, signal - }, - options); - } - - - -export const getUpdateProviderMangaListMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{params: UpdateProviderMangaListParams}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{params: UpdateProviderMangaListParams}, TContext> => { - -const mutationKey = ['updateProviderMangaList']; -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>, {params: UpdateProviderMangaListParams}> = (props) => { - const {params} = props ?? {}; - - return updateProviderMangaList(params,requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type UpdateProviderMangaListMutationResult = NonNullable>> - - export type UpdateProviderMangaListMutationError = unknown - - /** - * @summary Queue update provider manga list - */ -export const useUpdateProviderMangaList = (options?: { mutation?:UseMutationOptions>, TError,{params: UpdateProviderMangaListParams}, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - {params: UpdateProviderMangaListParams}, - TContext - > => { - - const mutationOptions = getUpdateProviderMangaListMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } - /** - * Queue the retrieval of the manga lists from the content providers - * @summary Queue update manga list - */ -export const updateMangaList = ( - - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/management/update-manga-list`, method: 'POST', signal - }, - options); - } - - - -export const getUpdateMangaListMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,void, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,void, TContext> => { - -const mutationKey = ['updateMangaList']; -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>, void> = () => { - - - return updateMangaList(requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type UpdateMangaListMutationResult = NonNullable>> - - export type UpdateMangaListMutationError = unknown - - /** - * @summary Queue update manga list - */ -export const useUpdateMangaList = (options?: { mutation?:UseMutationOptions>, TError,void, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - void, - TContext - > => { - - const mutationOptions = getUpdateMangaListMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } - /** - * Triggers the update of the metadata for a manga by its ID - * @summary Trigger manga data update - */ -export const triggerUpdateMangaData = ( - mangaId: number, - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/management/update-manga-data/${encodeURIComponent(String(mangaId))}`, method: 'POST', signal - }, - options); - } - - - -export const getTriggerUpdateMangaDataMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{mangaId: number}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{mangaId: number}, TContext> => { - -const mutationKey = ['triggerUpdateMangaData']; -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>, {mangaId: number}> = (props) => { - const {mangaId} = props ?? {}; - - return triggerUpdateMangaData(mangaId,requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type TriggerUpdateMangaDataMutationResult = NonNullable>> - - export type TriggerUpdateMangaDataMutationError = unknown - - /** - * @summary Trigger manga data update - */ -export const useTriggerUpdateMangaData = (options?: { mutation?:UseMutationOptions>, TError,{mangaId: number}, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - {mangaId: number}, - TContext - > => { - - const mutationOptions = getTriggerUpdateMangaDataMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } - /** * Sends a test notification to all users * @summary Test notification */ diff --git a/src/api/generated/manga-chapter/manga-chapter.ts b/src/api/generated/manga-chapter/manga-chapter.ts index d1dcc5a..cb3fb90 100644 --- a/src/api/generated/manga-chapter/manga-chapter.ts +++ b/src/api/generated/manga-chapter/manga-chapter.ts @@ -5,26 +5,16 @@ * OpenAPI spec version: v0 */ import { - useMutation, - useQuery + useMutation } from '@tanstack/react-query'; import type { - DataTag, - DefinedInitialDataOptions, - DefinedUseQueryResult, MutationFunction, QueryClient, - QueryFunction, - QueryKey, - UndefinedInitialDataOptions, UseMutationOptions, - UseMutationResult, - UseQueryOptions, - UseQueryResult + UseMutationResult } from '@tanstack/react-query'; import type { - DefaultResponseDTOMangaChapterImagesDTO, DefaultResponseDTOVoid, DownloadChapterArchiveParams } from '../api.schemas'; @@ -163,69 +153,6 @@ export const useMarkAsRead = ,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/mangas/chapters/${encodeURIComponent(String(chapterId))}/fetch`, method: 'POST', signal - }, - options); - } - - - -export const getFetchChapterMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{chapterId: number}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{chapterId: number}, TContext> => { - -const mutationKey = ['fetchChapter']; -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>, {chapterId: number}> = (props) => { - const {chapterId} = props ?? {}; - - return fetchChapter(chapterId,requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type FetchChapterMutationResult = NonNullable>> - - export type FetchChapterMutationError = unknown - - /** - * @summary Fetch chapter - */ -export const useFetchChapter = (options?: { mutation?:UseMutationOptions>, TError,{chapterId: number}, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - {chapterId: number}, - TContext - > => { - - const mutationOptions = getFetchChapterMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } - /** * Download a chapter as a compressed file by its ID. * @summary Download chapter archive */ @@ -291,96 +218,4 @@ export const useDownloadChapterArchive = ,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/mangas/chapters/${encodeURIComponent(String(chapterId))}/images`, method: 'GET', signal - }, - options); - } - - - - -export const getGetMangaChapterImagesQueryKey = (chapterId?: number,) => { - return [ - `/mangas/chapters/${chapterId}/images` - ] as const; - } - - -export const getGetMangaChapterImagesQueryOptions = >, TError = unknown>(chapterId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -) => { - -const {query: queryOptions, request: requestOptions} = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetMangaChapterImagesQueryKey(chapterId); - - - - const queryFn: QueryFunction>> = ({ signal }) => getMangaChapterImages(chapterId, requestOptions, signal); - - - - - - return { queryKey, queryFn, enabled: !!(chapterId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } -} - -export type GetMangaChapterImagesQueryResult = NonNullable>> -export type GetMangaChapterImagesQueryError = unknown - - -export function useGetMangaChapterImages>, TError = unknown>( - chapterId: number, options: { query:Partial>, TError, TData>> & Pick< - DefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): DefinedUseQueryResult & { queryKey: DataTag } -export function useGetMangaChapterImages>, TError = unknown>( - chapterId: number, options?: { query?:Partial>, TError, TData>> & Pick< - UndefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -export function useGetMangaChapterImages>, TError = unknown>( - chapterId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -/** - * @summary Get the images for a specific manga/provider combination - */ - -export function useGetMangaChapterImages>, TError = unknown>( - chapterId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } { - - const queryOptions = getGetMangaChapterImagesQueryOptions(chapterId,options) - - const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; - - query.queryKey = queryOptions.queryKey ; - - return query; -} - - - - + \ No newline at end of file diff --git a/src/api/generated/manga-import-review/manga-import-review.ts b/src/api/generated/manga-import-review/manga-import-review.ts deleted file mode 100644 index dc07a9f..0000000 --- a/src/api/generated/manga-import-review/manga-import-review.ts +++ /dev/null @@ -1,258 +0,0 @@ -/** - * Generated by orval v7.17.0 🍺 - * Do not edit manually. - * OpenAPI definition - * OpenAPI spec version: v0 - */ -import { - useMutation, - useQuery -} from '@tanstack/react-query'; -import type { - DataTag, - DefinedInitialDataOptions, - DefinedUseQueryResult, - MutationFunction, - QueryClient, - QueryFunction, - QueryKey, - UndefinedInitialDataOptions, - UseMutationOptions, - UseMutationResult, - UseQueryOptions, - UseQueryResult -} from '@tanstack/react-query'; - -import type { - DefaultResponseDTOListImportReviewDTO, - DefaultResponseDTOVoid, - ResolveImportReviewParams -} from '../api.schemas'; - -import { customInstance } from '../../api'; - - -type SecondParameter unknown> = Parameters[1]; - - - -/** - * Get list of pending import reviews. - * @summary Get list of pending import reviews - */ -export const getImportReviews = ( - - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/manga/import/review`, method: 'GET', signal - }, - options); - } - - - - -export const getGetImportReviewsQueryKey = () => { - return [ - `/manga/import/review` - ] as const; - } - - -export const getGetImportReviewsQueryOptions = >, TError = unknown>( options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -) => { - -const {query: queryOptions, request: requestOptions} = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetImportReviewsQueryKey(); - - - - const queryFn: QueryFunction>> = ({ signal }) => getImportReviews(requestOptions, signal); - - - - - - return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } -} - -export type GetImportReviewsQueryResult = NonNullable>> -export type GetImportReviewsQueryError = unknown - - -export function useGetImportReviews>, TError = unknown>( - options: { query:Partial>, TError, TData>> & Pick< - DefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): DefinedUseQueryResult & { queryKey: DataTag } -export function useGetImportReviews>, TError = unknown>( - options?: { query?:Partial>, TError, TData>> & Pick< - UndefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -export function useGetImportReviews>, TError = unknown>( - options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -/** - * @summary Get list of pending import reviews - */ - -export function useGetImportReviews>, TError = unknown>( - options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } { - - const queryOptions = getGetImportReviewsQueryOptions(options) - - const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; - - query.queryKey = queryOptions.queryKey ; - - return query; -} - - - - -/** - * Resolve import review by ID. - * @summary Resolve import review - */ -export const resolveImportReview = ( - params: ResolveImportReviewParams, - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/manga/import/review`, method: 'POST', - params, signal - }, - options); - } - - - -export const getResolveImportReviewMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{params: ResolveImportReviewParams}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{params: ResolveImportReviewParams}, TContext> => { - -const mutationKey = ['resolveImportReview']; -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>, {params: ResolveImportReviewParams}> = (props) => { - const {params} = props ?? {}; - - return resolveImportReview(params,requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type ResolveImportReviewMutationResult = NonNullable>> - - export type ResolveImportReviewMutationError = unknown - - /** - * @summary Resolve import review - */ -export const useResolveImportReview = (options?: { mutation?:UseMutationOptions>, TError,{params: ResolveImportReviewParams}, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - {params: ResolveImportReviewParams}, - TContext - > => { - - const mutationOptions = getResolveImportReviewMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } - /** - * Delete pending import review by ID. - * @summary Delete pending import review - */ -export const deleteImportReview = ( - id: number, - options?: SecondParameter,) => { - - - return customInstance( - {url: `/manga/import/review/${encodeURIComponent(String(id))}`, method: 'DELETE' - }, - options); - } - - - -export const getDeleteImportReviewMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{id: number}, TContext> => { - -const mutationKey = ['deleteImportReview']; -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>, {id: number}> = (props) => { - const {id} = props ?? {}; - - return deleteImportReview(id,requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type DeleteImportReviewMutationResult = NonNullable>> - - export type DeleteImportReviewMutationError = unknown - - /** - * @summary Delete pending import review - */ -export const useDeleteImportReview = (options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - {id: number}, - TContext - > => { - - const mutationOptions = getDeleteImportReviewMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } - \ No newline at end of file diff --git a/src/api/generated/manga-ingest-review/manga-ingest-review.ts b/src/api/generated/manga-ingest-review/manga-ingest-review.ts new file mode 100644 index 0000000..965e8af --- /dev/null +++ b/src/api/generated/manga-ingest-review/manga-ingest-review.ts @@ -0,0 +1,258 @@ +/** + * Generated by orval v7.17.0 🍺 + * Do not edit manually. + * OpenAPI definition + * OpenAPI spec version: v0 + */ +import { + useMutation, + useQuery +} from '@tanstack/react-query'; +import type { + DataTag, + DefinedInitialDataOptions, + DefinedUseQueryResult, + MutationFunction, + QueryClient, + QueryFunction, + QueryKey, + UndefinedInitialDataOptions, + UseMutationOptions, + UseMutationResult, + UseQueryOptions, + UseQueryResult +} from '@tanstack/react-query'; + +import type { + DefaultResponseDTOListMangaIngestReviewDTO, + DefaultResponseDTOVoid, + ResolveMangaIngestReviewParams +} from '../api.schemas'; + +import { customInstance } from '../../api'; + + +type SecondParameter unknown> = Parameters[1]; + + + +/** + * Get list of pending manga ingest reviews. + * @summary Get list of pending manga ingest reviews + */ +export const getMangaIngestReviews = ( + + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/catalog/ingest-reviews`, method: 'GET', signal + }, + options); + } + + + + +export const getGetMangaIngestReviewsQueryKey = () => { + return [ + `/catalog/ingest-reviews` + ] as const; + } + + +export const getGetMangaIngestReviewsQueryOptions = >, TError = unknown>( options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} +) => { + +const {query: queryOptions, request: requestOptions} = options ?? {}; + + const queryKey = queryOptions?.queryKey ?? getGetMangaIngestReviewsQueryKey(); + + + + const queryFn: QueryFunction>> = ({ signal }) => getMangaIngestReviews(requestOptions, signal); + + + + + + return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } +} + +export type GetMangaIngestReviewsQueryResult = NonNullable>> +export type GetMangaIngestReviewsQueryError = unknown + + +export function useGetMangaIngestReviews>, TError = unknown>( + options: { query:Partial>, TError, TData>> & Pick< + DefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): DefinedUseQueryResult & { queryKey: DataTag } +export function useGetMangaIngestReviews>, TError = unknown>( + options?: { query?:Partial>, TError, TData>> & Pick< + UndefinedInitialDataOptions< + Awaited>, + TError, + Awaited> + > , 'initialData' + >, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +export function useGetMangaIngestReviews>, TError = unknown>( + options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } +/** + * @summary Get list of pending manga ingest reviews + */ + +export function useGetMangaIngestReviews>, TError = unknown>( + options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} + , queryClient?: QueryClient + ): UseQueryResult & { queryKey: DataTag } { + + const queryOptions = getGetMangaIngestReviewsQueryOptions(options) + + const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; + + query.queryKey = queryOptions.queryKey ; + + return query; +} + + + + +/** + * Resolve manga ingest review by ID. + * @summary Resolve manga ingest review + */ +export const resolveMangaIngestReview = ( + params: ResolveMangaIngestReviewParams, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/catalog/ingest-reviews`, method: 'POST', + params, signal + }, + options); + } + + + +export const getResolveMangaIngestReviewMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{params: ResolveMangaIngestReviewParams}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{params: ResolveMangaIngestReviewParams}, TContext> => { + +const mutationKey = ['resolveMangaIngestReview']; +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>, {params: ResolveMangaIngestReviewParams}> = (props) => { + const {params} = props ?? {}; + + return resolveMangaIngestReview(params,requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type ResolveMangaIngestReviewMutationResult = NonNullable>> + + export type ResolveMangaIngestReviewMutationError = unknown + + /** + * @summary Resolve manga ingest review + */ +export const useResolveMangaIngestReview = (options?: { mutation?:UseMutationOptions>, TError,{params: ResolveMangaIngestReviewParams}, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + {params: ResolveMangaIngestReviewParams}, + TContext + > => { + + const mutationOptions = getResolveMangaIngestReviewMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + /** + * Delete pending manga ingest review by ID. + * @summary Delete pending manga ingest review + */ +export const deleteMangaIngestReview = ( + id: number, + options?: SecondParameter,) => { + + + return customInstance( + {url: `/catalog/ingest-reviews/${encodeURIComponent(String(id))}`, method: 'DELETE' + }, + options); + } + + + +export const getDeleteMangaIngestReviewMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{id: number}, TContext> => { + +const mutationKey = ['deleteMangaIngestReview']; +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>, {id: number}> = (props) => { + const {id} = props ?? {}; + + return deleteMangaIngestReview(id,requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type DeleteMangaIngestReviewMutationResult = NonNullable>> + + export type DeleteMangaIngestReviewMutationError = unknown + + /** + * @summary Delete pending manga ingest review + */ +export const useDeleteMangaIngestReview = (options?: { mutation?:UseMutationOptions>, TError,{id: number}, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + {id: number}, + TContext + > => { + + const mutationOptions = getDeleteMangaIngestReviewMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + \ No newline at end of file diff --git a/src/api/generated/manga/manga.ts b/src/api/generated/manga/manga.ts index 62ba2b1..fc5caf9 100644 --- a/src/api/generated/manga/manga.ts +++ b/src/api/generated/manga/manga.ts @@ -5,30 +5,17 @@ * OpenAPI spec version: v0 */ import { - useMutation, - useQuery + useMutation } from '@tanstack/react-query'; import type { - DataTag, - DefinedInitialDataOptions, - DefinedUseQueryResult, MutationFunction, QueryClient, - QueryFunction, - QueryKey, - UndefinedInitialDataOptions, UseMutationOptions, - UseMutationResult, - UseQueryOptions, - UseQueryResult + UseMutationResult } from '@tanstack/react-query'; import type { - DefaultResponseDTOListMangaChapterDTO, - DefaultResponseDTOMangaDTO, - DefaultResponseDTOPageMangaListDTO, - DefaultResponseDTOVoid, - GetMangasParams + DefaultResponseDTOVoid } from '../api.schemas'; import { customInstance } from '../../api'; @@ -39,69 +26,6 @@ type SecondParameter unknown> = Parameters[1]; /** - * Fetch a list of manga chapters for a specific manga/provider combination. - * @summary Fetch the available chapters for a specific manga/provider combination - */ -export const fetchMangaChapters = ( - mangaProviderId: number, - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/mangas/${encodeURIComponent(String(mangaProviderId))}/fetch-chapters`, method: 'POST', signal - }, - options); - } - - - -export const getFetchMangaChaptersMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{mangaProviderId: number}, TContext>, request?: SecondParameter} -): UseMutationOptions>, TError,{mangaProviderId: number}, TContext> => { - -const mutationKey = ['fetchMangaChapters']; -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>, {mangaProviderId: number}> = (props) => { - const {mangaProviderId} = props ?? {}; - - return fetchMangaChapters(mangaProviderId,requestOptions) - } - - - - - return { mutationFn, ...mutationOptions }} - - export type FetchMangaChaptersMutationResult = NonNullable>> - - export type FetchMangaChaptersMutationError = unknown - - /** - * @summary Fetch the available chapters for a specific manga/provider combination - */ -export const useFetchMangaChapters = (options?: { mutation?:UseMutationOptions>, TError,{mangaProviderId: number}, TContext>, request?: SecondParameter} - , queryClient?: QueryClient): UseMutationResult< - Awaited>, - TError, - {mangaProviderId: number}, - TContext - > => { - - const mutationOptions = getFetchMangaChaptersMutationOptions(options); - - return useMutation(mutationOptions, queryClient); - } - /** * Unfollow the manga specified by its ID. * @summary Unfollow the manga specified by its ID */ @@ -227,283 +151,4 @@ export const useFollowManga = ,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/mangas`, method: 'GET', - params, signal - }, - options); - } - - - - -export const getGetMangasQueryKey = (params?: GetMangasParams,) => { - return [ - `/mangas`, ...(params ? [params]: []) - ] as const; - } - - -export const getGetMangasQueryOptions = >, TError = unknown>(params?: GetMangasParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -) => { - -const {query: queryOptions, request: requestOptions} = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetMangasQueryKey(params); - - - - const queryFn: QueryFunction>> = ({ signal }) => getMangas(params, requestOptions, signal); - - - - - - return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } -} - -export type GetMangasQueryResult = NonNullable>> -export type GetMangasQueryError = unknown - - -export function useGetMangas>, TError = unknown>( - params: undefined | GetMangasParams, options: { query:Partial>, TError, TData>> & Pick< - DefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): DefinedUseQueryResult & { queryKey: DataTag } -export function useGetMangas>, TError = unknown>( - params?: GetMangasParams, options?: { query?:Partial>, TError, TData>> & Pick< - UndefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -export function useGetMangas>, TError = unknown>( - params?: GetMangasParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -/** - * @summary Get a list of mangas - */ - -export function useGetMangas>, TError = unknown>( - params?: GetMangasParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } { - - const queryOptions = getGetMangasQueryOptions(params,options) - - const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; - - query.queryKey = queryOptions.queryKey ; - - return query; -} - - - - -/** - * Retrieve a list of manga chapters for a specific manga/provider combination. - * @summary Get the available chapters for a specific manga/provider combination - */ -export const getMangaChapters = ( - mangaProviderId: number, - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/mangas/${encodeURIComponent(String(mangaProviderId))}/chapters`, method: 'GET', signal - }, - options); - } - - - - -export const getGetMangaChaptersQueryKey = (mangaProviderId?: number,) => { - return [ - `/mangas/${mangaProviderId}/chapters` - ] as const; - } - - -export const getGetMangaChaptersQueryOptions = >, TError = unknown>(mangaProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -) => { - -const {query: queryOptions, request: requestOptions} = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetMangaChaptersQueryKey(mangaProviderId); - - - - const queryFn: QueryFunction>> = ({ signal }) => getMangaChapters(mangaProviderId, requestOptions, signal); - - - - - - return { queryKey, queryFn, enabled: !!(mangaProviderId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } -} - -export type GetMangaChaptersQueryResult = NonNullable>> -export type GetMangaChaptersQueryError = unknown - - -export function useGetMangaChapters>, TError = unknown>( - mangaProviderId: number, options: { query:Partial>, TError, TData>> & Pick< - DefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): DefinedUseQueryResult & { queryKey: DataTag } -export function useGetMangaChapters>, TError = unknown>( - mangaProviderId: number, options?: { query?:Partial>, TError, TData>> & Pick< - UndefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -export function useGetMangaChapters>, TError = unknown>( - mangaProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -/** - * @summary Get the available chapters for a specific manga/provider combination - */ - -export function useGetMangaChapters>, TError = unknown>( - mangaProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } { - - const queryOptions = getGetMangaChaptersQueryOptions(mangaProviderId,options) - - const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; - - query.queryKey = queryOptions.queryKey ; - - return query; -} - - - - -/** - * Get the details of a manga by its ID - * @summary Get the details of a manga - */ -export const getManga = ( - mangaId: number, - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/mangas/${encodeURIComponent(String(mangaId))}`, method: 'GET', signal - }, - options); - } - - - - -export const getGetMangaQueryKey = (mangaId?: number,) => { - return [ - `/mangas/${mangaId}` - ] as const; - } - - -export const getGetMangaQueryOptions = >, TError = unknown>(mangaId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -) => { - -const {query: queryOptions, request: requestOptions} = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetMangaQueryKey(mangaId); - - - - const queryFn: QueryFunction>> = ({ signal }) => getManga(mangaId, requestOptions, signal); - - - - - - return { queryKey, queryFn, enabled: !!(mangaId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } -} - -export type GetMangaQueryResult = NonNullable>> -export type GetMangaQueryError = unknown - - -export function useGetManga>, TError = unknown>( - mangaId: number, options: { query:Partial>, TError, TData>> & Pick< - DefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): DefinedUseQueryResult & { queryKey: DataTag } -export function useGetManga>, TError = unknown>( - mangaId: number, options?: { query?:Partial>, TError, TData>> & Pick< - UndefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -export function useGetManga>, TError = unknown>( - mangaId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -/** - * @summary Get the details of a manga - */ - -export function useGetManga>, TError = unknown>( - mangaId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } { - - const queryOptions = getGetMangaQueryOptions(mangaId,options) - - const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; - - query.queryKey = queryOptions.queryKey ; - - return query; -} - - - - + \ No newline at end of file diff --git a/src/api/generated/provider/provider.ts b/src/api/generated/provider/provider.ts deleted file mode 100644 index c6cfba9..0000000 --- a/src/api/generated/provider/provider.ts +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Generated by orval v7.17.0 🍺 - * Do not edit manually. - * OpenAPI definition - * OpenAPI spec version: v0 - */ -import { - useQuery -} from '@tanstack/react-query'; -import type { - DataTag, - DefinedInitialDataOptions, - DefinedUseQueryResult, - QueryClient, - QueryFunction, - QueryKey, - UndefinedInitialDataOptions, - UseQueryOptions, - UseQueryResult -} from '@tanstack/react-query'; - -import type { - DefaultResponseDTOProviderListDTO, - GetProvidersParams -} from '../api.schemas'; - -import { customInstance } from '../../api'; - - -type SecondParameter unknown> = Parameters[1]; - - - -/** - * Retrieve a list of content providers - * @summary Get a list of providers - */ -export const getProviders = ( - params?: GetProvidersParams, - options?: SecondParameter,signal?: AbortSignal -) => { - - - return customInstance( - {url: `/providers`, method: 'GET', - params, signal - }, - options); - } - - - - -export const getGetProvidersQueryKey = (params?: GetProvidersParams,) => { - return [ - `/providers`, ...(params ? [params]: []) - ] as const; - } - - -export const getGetProvidersQueryOptions = >, TError = unknown>(params?: GetProvidersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} -) => { - -const {query: queryOptions, request: requestOptions} = options ?? {}; - - const queryKey = queryOptions?.queryKey ?? getGetProvidersQueryKey(params); - - - - const queryFn: QueryFunction>> = ({ signal }) => getProviders(params, requestOptions, signal); - - - - - - return { queryKey, queryFn, ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } -} - -export type GetProvidersQueryResult = NonNullable>> -export type GetProvidersQueryError = unknown - - -export function useGetProviders>, TError = unknown>( - params: undefined | GetProvidersParams, options: { query:Partial>, TError, TData>> & Pick< - DefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): DefinedUseQueryResult & { queryKey: DataTag } -export function useGetProviders>, TError = unknown>( - params?: GetProvidersParams, options?: { query?:Partial>, TError, TData>> & Pick< - UndefinedInitialDataOptions< - Awaited>, - TError, - Awaited> - > , 'initialData' - >, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -export function useGetProviders>, TError = unknown>( - params?: GetProvidersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } -/** - * @summary Get a list of providers - */ - -export function useGetProviders>, TError = unknown>( - params?: GetProvidersParams, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} - , queryClient?: QueryClient - ): UseQueryResult & { queryKey: DataTag } { - - const queryOptions = getGetProvidersQueryOptions(params,options) - - const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; - - query.queryKey = queryOptions.queryKey ; - - return query; -} - - - - diff --git a/src/api/generated/user/user.ts b/src/api/generated/user/user.ts new file mode 100644 index 0000000..614b367 --- /dev/null +++ b/src/api/generated/user/user.ts @@ -0,0 +1,94 @@ +/** + * Generated by orval v7.17.0 🍺 + * Do not edit manually. + * OpenAPI definition + * OpenAPI spec version: v0 + */ +import { + useMutation +} from '@tanstack/react-query'; +import type { + MutationFunction, + QueryClient, + UseMutationOptions, + UseMutationResult +} from '@tanstack/react-query'; + +import type { + DefaultResponseDTOVoid, + RegistrationRequestDTO +} from '../api.schemas'; + +import { customInstance } from '../../api'; + + +type SecondParameter unknown> = Parameters[1]; + + + +/** + * Register a new user. + * @summary Register an user + */ +export const registerUser = ( + registrationRequestDTO: RegistrationRequestDTO, + options?: SecondParameter,signal?: AbortSignal +) => { + + + return customInstance( + {url: `/user/register`, method: 'POST', + headers: {'Content-Type': 'application/json', }, + data: registrationRequestDTO, signal + }, + options); + } + + + +export const getRegisterUserMutationOptions = (options?: { mutation?:UseMutationOptions>, TError,{data: RegistrationRequestDTO}, TContext>, request?: SecondParameter} +): UseMutationOptions>, TError,{data: RegistrationRequestDTO}, TContext> => { + +const mutationKey = ['registerUser']; +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>, {data: RegistrationRequestDTO}> = (props) => { + const {data} = props ?? {}; + + return registerUser(data,requestOptions) + } + + + + + return { mutationFn, ...mutationOptions }} + + export type RegisterUserMutationResult = NonNullable>> + export type RegisterUserMutationBody = RegistrationRequestDTO + export type RegisterUserMutationError = unknown + + /** + * @summary Register an user + */ +export const useRegisterUser = (options?: { mutation?:UseMutationOptions>, TError,{data: RegistrationRequestDTO}, TContext>, request?: SecondParameter} + , queryClient?: QueryClient): UseMutationResult< + Awaited>, + TError, + {data: RegistrationRequestDTO}, + TContext + > => { + + const mutationOptions = getRegisterUserMutationOptions(options); + + return useMutation(mutationOptions, queryClient); + } + \ No newline at end of file diff --git a/src/contexts/AuthContext.tsx b/src/contexts/AuthContext.tsx index 4d2c288..b0c62e2 100644 --- a/src/contexts/AuthContext.tsx +++ b/src/contexts/AuthContext.tsx @@ -6,10 +6,8 @@ import { useState, } from "react"; import { toast } from "sonner"; -import { - useAuthenticateUser, - useRegisterUser, -} from "@/api/generated/auth/auth.ts"; +import {useRegisterUser} from "@/api/generated/user/user.ts"; +import {useLogin} from "@/api/generated/authentication/authentication.ts"; export interface UserPreferences { theme: "light" | "dark"; @@ -55,7 +53,7 @@ export function AuthProvider({ children }: { children: ReactNode }) { }); const { mutate: mutateAuthenticateUser, isPending: isPendingLoginUser } = - useAuthenticateUser({ + useLogin({ mutation: { onSuccess: (response) => { if (!response.data) { diff --git a/src/features/home/components/FilterSidebar.tsx b/src/features/home/components/FilterSidebar.tsx index e7f4c99..0387dd9 100644 --- a/src/features/home/components/FilterSidebar.tsx +++ b/src/features/home/components/FilterSidebar.tsx @@ -1,11 +1,11 @@ import { Star, X } from "lucide-react"; -import { useGetGenres } from "@/api/generated/genre/genre.ts"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator.tsx"; import { Skeleton } from "@/components/ui/skeleton.tsx"; import { Switch } from "@/components/ui/switch.tsx"; import { useAuth } from "@/contexts/AuthContext.tsx"; +import {useGetGenres} from "@/api/generated/catalog/catalog.ts"; interface FilterSidebarProps { selectedGenres: number[]; diff --git a/src/features/home/components/ProviderImportDialog.tsx b/src/features/home/components/ProviderImportDialog.tsx index 412e693..b2b4190 100644 --- a/src/features/home/components/ProviderImportDialog.tsx +++ b/src/features/home/components/ProviderImportDialog.tsx @@ -4,7 +4,6 @@ import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; import { useImportFromProvider } from "@/api/generated/manga-import/manga-import.ts"; -import { useGetProviders } from "@/api/generated/provider/provider.ts"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -31,6 +30,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select.tsx"; +import {useGetContentProviders} from "@/api/generated/ingestion/ingestion.ts"; interface ProviderImportDialogProps { dialogOpen: boolean; @@ -59,7 +59,7 @@ export const ProviderImportDialog = ({ }); const { data: providerData, isFetching: isFetchingProviders } = - useGetProviders({ manualImport: true }); + useGetContentProviders({ manualImport: true }); const { mutate: importFromProvider, isPending: isPendingImportFromProvider } = useImportFromProvider({ @@ -122,7 +122,7 @@ export const ProviderImportDialog = ({ {providerData?.data?.providers?.map((provider) => ( {provider.name} diff --git a/src/features/import-review/ImportReviewCard.tsx b/src/features/import-review/ImportReviewCard.tsx index 6fd1ad3..f6911c9 100644 --- a/src/features/import-review/ImportReviewCard.tsx +++ b/src/features/import-review/ImportReviewCard.tsx @@ -2,17 +2,17 @@ import { useQueryClient } from "@tanstack/react-query"; import { ExternalLink, Trash2 } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; -import type { ImportReviewDTO } from "@/api/generated/api.schemas.ts"; -import { - useDeleteImportReview, - useResolveImportReview, -} from "@/api/generated/manga-import-review/manga-import-review.ts"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; +import type {MangaIngestReviewDTO} from "@/api/generated/api.schemas.ts"; +import { + useDeleteMangaIngestReview, + useResolveMangaIngestReview +} from "@/api/generated/manga-ingest-review/manga-ingest-review.ts"; interface ImportReviewCardProps { - importReview: ImportReviewDTO; + importReview: MangaIngestReviewDTO; queryKey: any; } @@ -24,7 +24,7 @@ export function ImportReviewCard({ const [malId, setMalId] = useState(""); - const { mutate: mutateDeleteImportReview } = useDeleteImportReview({ + const { mutate: mutateDeleteImportReview } = useDeleteMangaIngestReview({ mutation: { onSuccess: () => { queryClient.invalidateQueries({ queryKey }); @@ -37,7 +37,7 @@ export function ImportReviewCard({ const { mutate: mutateResolveImportReview, isPending: isPendingResolveImportReview, - } = useResolveImportReview({ + } = useResolveMangaIngestReview({ mutation: { onSuccess: () => { queryClient.invalidateQueries({ queryKey }); @@ -53,7 +53,7 @@ export function ImportReviewCard({ } mutateResolveImportReview({ - params: { importReviewId: importReview.id, malId }, + params: { id: importReview.id, malId }, }); }; @@ -73,7 +73,7 @@ export function ImportReviewCard({

Provider:{" "} - {importReview.providerName} •{" "} + {importReview.contentProviderName} •{" "} {importDate}

diff --git a/src/features/manga/MangaChapter.tsx b/src/features/manga/MangaChapter.tsx index 62dd4bc..3e6e105 100644 --- a/src/features/manga/MangaChapter.tsx +++ b/src/features/manga/MangaChapter.tsx @@ -2,13 +2,13 @@ import { useQueryClient } from "@tanstack/react-query"; import { Check, Database, Download, Eye, Loader2 } from "lucide-react"; import { useCallback, useState } from "react"; import { useNavigate } from "react-router"; -import { useGetMangaChapters } from "@/api/generated/manga/manga.ts"; import { useDownloadChapterArchive, - useFetchChapter, } from "@/api/generated/manga-chapter/manga-chapter.ts"; import { Button } from "@/components/ui/button"; import ReactCountryFlag from "react-country-flag"; +import {useGetMangaProviderContent} from "@/api/generated/content/content.ts"; +import {useFetchContentProviderContent} from "@/api/generated/ingestion/ingestion.ts"; interface MangaChapterProps { mangaId: number; @@ -21,7 +21,7 @@ export const MangaChapter = ({ }: MangaChapterProps) => { const navigate = useNavigate(); - const { isPending, data, queryKey } = useGetMangaChapters(mangaProviderId); + const { isPending, data, queryKey } = useGetMangaProviderContent(mangaProviderId); const queryClient = useQueryClient(); @@ -40,7 +40,7 @@ export const MangaChapter = ({ }, }); - const { mutate, isPending: isPendingFetchChapter } = useFetchChapter({ + const { mutate, isPending: isPendingFetchChapter } = useFetchContentProviderContent({ mutation: { onSuccess: () => queryClient.invalidateQueries({ queryKey }), onSettled: () => setFetchingId(null), @@ -52,7 +52,7 @@ export const MangaChapter = ({ const fetchChapter = useCallback( (mangaChapterId: number) => { setFetchingId(mangaChapterId); - mutate({ chapterId: mangaChapterId }); + mutate({ mangaContentId: mangaChapterId }); }, [mutate], ); diff --git a/src/pages/Chapter.tsx b/src/pages/Chapter.tsx index 856ba32..0a24c8a 100644 --- a/src/pages/Chapter.tsx +++ b/src/pages/Chapter.tsx @@ -2,12 +2,12 @@ import { ArrowLeft, ChevronLeft, ChevronRight, Home } from "lucide-react"; import { useEffect, useRef, useState } from "react"; import { useNavigate, useParams } from "react-router"; import { - useGetMangaChapterImages, useMarkAsRead, } from "@/api/generated/manga-chapter/manga-chapter.ts"; import { ThemeToggle } from "@/components/ThemeToggle.tsx"; import { Button } from "@/components/ui/button"; import { useReadingTracker } from "@/features/chapter/hooks/useReadingTracker.ts"; +import {useGetMangaContentImages} from "@/api/generated/content/content.ts"; const Chapter = () => { const { setCurrentChapterPage, getCurrentChapterPage } = useReadingTracker(); @@ -23,7 +23,7 @@ const Chapter = () => { const [infiniteScroll, setInfiniteScroll] = useState(true); - const { data, isLoading } = useGetMangaChapterImages(chapterNumber); + const { data, isLoading } = useGetMangaContentImages(chapterNumber); const { mutate } = useMarkAsRead(); // For infinite scroll mode @@ -34,7 +34,7 @@ const Chapter = () => { useEffect(() => { if (!data || isLoading) return; - if (currentPage === data.data?.chapterImageKeys.length) { + if (currentPage === data.data?.contentImageKeys.length) { mutate({ chapterId: chapterNumber }); } }, [data, mutate, currentPage]); @@ -63,7 +63,7 @@ const Chapter = () => { const obs = new IntersectionObserver((entries) => { if (entries[0].isIntersecting) { setVisibleCount((count) => - Math.min(count + 2, data?.data?.chapterImageKeys.length ?? 0), + Math.min(count + 2, data?.data?.contentImageKeys.length ?? 0), ); } }); @@ -126,7 +126,7 @@ const Chapter = () => { ); } - const images = data.data.chapterImageKeys; + const images = data.data.contentImageKeys; /** Standard navigation (non-infinite mode) */ const goToNextPage = () => { diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 5e86f38..0433ddf 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,7 +1,6 @@ import { BookOpen, Search } from "lucide-react"; import { useEffect, useRef } from "react"; import { useDebounce } from "use-debounce"; -import { useGetMangas } from "@/api/generated/manga/manga.ts"; import { AuthHeader } from "@/components/AuthHeader.tsx"; import { Pagination } from "@/components/Pagination.tsx"; import { ThemeToggle } from "@/components/ThemeToggle.tsx"; @@ -14,6 +13,7 @@ import { } from "@/features/home/components/SortDropdown.tsx"; import { useUIState } from "@/contexts/UIStateContext.tsx"; import { useDynamicPageSize } from "@/hooks/useDynamicPageSize.ts"; +import {useGetMangas} from "@/api/generated/catalog/catalog.ts"; const ROWS_PER_PAGE = 4; diff --git a/src/pages/ImportReview.tsx b/src/pages/ImportReview.tsx index 377e85b..6e97dc0 100644 --- a/src/pages/ImportReview.tsx +++ b/src/pages/ImportReview.tsx @@ -3,16 +3,16 @@ import { AlertCircle } from "lucide-react"; import { useEffect } from "react"; import { useNavigate } from "react-router"; -import { useGetImportReviews } from "@/api/generated/manga-import-review/manga-import-review.ts"; import { Card } from "@/components/ui/card"; import { useAuth } from "@/contexts/AuthContext.tsx"; import { ImportReviewCard } from "@/features/import-review/ImportReviewCard.tsx"; +import {useGetMangaIngestReviews} from "@/api/generated/manga-ingest-review/manga-ingest-review.ts"; export default function ImportReviewPage() { const navigate = useNavigate(); const { user, isAuthenticated } = useAuth(); - const { data: importReviewData, queryKey } = useGetImportReviews(); + const { data: importReviewData, queryKey } = useGetMangaIngestReviews(); useEffect(() => { if (!user) { diff --git a/src/pages/Manga.tsx b/src/pages/Manga.tsx index f27b1bf..f53e5c6 100644 --- a/src/pages/Manga.tsx +++ b/src/pages/Manga.tsx @@ -18,12 +18,10 @@ import { useSetUnfavorite, } from "@/api/generated/favorite-mangas/favorite-mangas.ts"; import { - useFetchMangaChapters, useFollowManga, - useGetManga, useUnfollowManga, } from "@/api/generated/manga/manga.ts"; -import { useFetchAllChapters } from "@/api/generated/manga-chapter/manga-chapter.ts"; +// import { useFetchAllChapters } from "@/api/generated/manga-chapter/manga-chapter.ts"; import { ThemeToggle } from "@/components/ThemeToggle.tsx"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; @@ -38,6 +36,8 @@ import { useUIState } from "@/contexts/UIStateContext.tsx"; import { useScrollPersistence } from "@/hooks/useScrollPersistence.ts"; import { MangaChapter } from "@/features/manga/MangaChapter.tsx"; import { formatToTwoDigitsDateRange } from "@/utils/dateFormatter.ts"; +import {useGetManga} from "@/api/generated/catalog/catalog.ts"; +import {useFetchContentProviderContentList} from "@/api/generated/ingestion/ingestion.ts"; const Manga = () => { const { isAuthenticated } = useAuth(); @@ -49,20 +49,20 @@ const Manga = () => { const { data: mangaData, queryKey } = useGetManga(mangaId); - const { mutate, isPending: fetchPending } = useFetchMangaChapters({ + const { mutate, isPending: fetchPending } = useFetchContentProviderContentList({ mutation: { onSuccess: () => queryClient.invalidateQueries({ queryKey }), }, }); - const { mutate: fetchAllMutate, isPending: fetchAllPending } = - useFetchAllChapters({ - mutation: { - onSuccess: () => toast.success("Chapter import queued successfully."), - }, - }); + // const { mutate: fetchAllMutate, isPending: fetchAllPending } = + // useFetchAllChapters({ + // mutation: { + // onSuccess: () => toast.success("Chapter import queued successfully."), + // }, + // }); - const isPending = fetchPending || fetchAllPending; + const isPending = fetchPending; const { expandedProviderIds, toggleProviderId } = useUIState(); useScrollPersistence(`manga-${mangaId}`); @@ -349,8 +349,8 @@ const Manga = () => { {mangaData.data?.providers.map((provider) => ( toggleProvider(provider.id)} + open={expandedProviderIds.includes(provider.id ?? -1)} + onOpenChange={() => toggleProvider(provider.id ?? -1)} > @@ -368,28 +368,28 @@ const Manga = () => { {provider.supportsChapterFetch && - provider.providerStatus === "ACTIVE" && ( + provider.active && (
+ {/**/} + {/* fetchAllMutate({*/} + {/* mangaProviderId: provider.id?? -1,*/} + {/* })*/} + {/* }*/} + {/* className="gap-2"*/} + {/*>*/} + {/* */} + {/* Fetch all from Provider*/} + {/**/} -
@@ -408,7 +408,7 @@ const Manga = () => {