fix: lint type import
This commit is contained in:
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { AuthServerService } from "@/lib/services/auth-server.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { UserData } from "@/lib/services/auth-server.service";
|
||||
import type { UserData } from "@/lib/services/auth-server.service";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { cookies } from "next/headers";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
import { AppErrorType } from "@/types/global";
|
||||
import type { AppErrorType } from "@/types/global";
|
||||
|
||||
export async function POST() {
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { AuthServerService, UserData } from "@/lib/services/auth-server.service";
|
||||
import type { UserData } from "@/lib/services/auth-server.service";
|
||||
import { AuthServerService } from "@/lib/services/auth-server.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { DebugService, RequestTiming } from "@/lib/services/debug.service";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import type { RequestTiming } from "@/lib/services/debug.service";
|
||||
import { DebugService } from "@/lib/services/debug.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { BookService } from "@/lib/services/book.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { BookService } from "@/lib/services/book.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { BookService } from "@/lib/services/book.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { KomgaBookWithPages } from "@/types/komga";
|
||||
import type { KomgaBookWithPages } from "@/types/komga";
|
||||
export async function GET(request: Request, { params }: { params: { bookId: string } }) {
|
||||
try {
|
||||
const data: KomgaBookWithPages = await BookService.getBook(params.bookId);
|
||||
|
||||
3
src/app/api/komga/cache/clear/route.ts
vendored
3
src/app/api/komga/cache/clear/route.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { getServerCacheService, ServerCacheService } from "@/lib/services/server-cache.service";
|
||||
import type { ServerCacheService } from "@/lib/services/server-cache.service";
|
||||
import { getServerCacheService } from "@/lib/services/server-cache.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
|
||||
7
src/app/api/komga/cache/mode/route.ts
vendored
7
src/app/api/komga/cache/mode/route.ts
vendored
@@ -1,8 +1,9 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import {
|
||||
import type {
|
||||
CacheMode,
|
||||
getServerCacheService,
|
||||
ServerCacheService,
|
||||
ServerCacheService} from "@/lib/services/server-cache.service";
|
||||
import {
|
||||
getServerCacheService
|
||||
} from "@/lib/services/server-cache.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { ConfigDBService } from "@/lib/services/config-db.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { KomgaConfig, KomgaConfigData } from "@/types/komga";
|
||||
import type { KomgaConfig, KomgaConfigData } from "@/types/komga";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { BookService } from "@/lib/services/book.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { BookService } from "@/lib/services/book.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { BookService } from "@/lib/services/book.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { SeriesService } from "@/lib/services/series.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { SeriesService } from "@/lib/services/series.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { LibraryService } from "@/lib/services/library.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { KomgaLibrary } from "@/types/komga";
|
||||
import type { KomgaLibrary } from "@/types/komga";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { SeriesService } from "@/lib/services/series.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaSeries } from "@/types/komga";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
||||
import { TestService } from "@/lib/services/test.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
import { KomgaLibrary } from "@/types/komga";
|
||||
import type { KomgaLibrary } from "@/types/komga";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { ConfigDBService } from "@/lib/services/config-db.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { TTLConfig } from "@/types/komga";
|
||||
import type { TTLConfig } from "@/types/komga";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
export async function GET() {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import type { NextRequest} from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { PreferencesService } from "@/lib/services/preferences.service";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { UserPreferences } from "@/types/preferences";
|
||||
import type { UserPreferences } from "@/types/preferences";
|
||||
import { getErrorMessage } from "@/utils/errors";
|
||||
|
||||
export async function GET() {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ClientBookWrapper } from "@/components/reader/ClientBookWrapper";
|
||||
import { BookSkeleton } from "@/components/skeletons/BookSkeleton";
|
||||
import { BookService } from "@/lib/services/book.service";
|
||||
import { withPageTiming } from "@/lib/hoc/withPageTiming";
|
||||
import { KomgaBookWithPages } from "@/types/komga";
|
||||
import type { KomgaBookWithPages } from "@/types/komga";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
@@ -5,9 +5,9 @@ import { revalidatePath } from "next/cache";
|
||||
import { RefreshButton } from "@/components/library/RefreshButton";
|
||||
import { withPageTiming } from "@/lib/hoc/withPageTiming";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { LibraryResponse } from "@/types/library";
|
||||
import { KomgaSeries, KomgaLibrary } from "@/types/komga";
|
||||
import { UserPreferences } from "@/types/preferences";
|
||||
import type { LibraryResponse } from "@/types/library";
|
||||
import type { KomgaSeries, KomgaLibrary } from "@/types/komga";
|
||||
import type { UserPreferences } from "@/types/preferences";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Metadata } from "next";
|
||||
import type { Metadata } from "next";
|
||||
import { LoginContent } from "./LoginContent";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import { Metadata } from "next";
|
||||
import type { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Page non trouvée - StripStream",
|
||||
|
||||
@@ -5,7 +5,7 @@ import { revalidatePath } from "next/cache";
|
||||
import { withPageTiming } from "@/lib/hoc/withPageTiming";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { HomeData } from "@/lib/services/home.service";
|
||||
import type { HomeData } from "@/lib/services/home.service";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
async function refreshHome() {
|
||||
|
||||
@@ -5,9 +5,9 @@ import { PreferencesService } from "@/lib/services/preferences.service";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { withPageTiming } from "@/lib/hoc/withPageTiming";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { LibraryResponse } from "@/types/library";
|
||||
import { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import { UserPreferences } from "@/types/preferences";
|
||||
import type { LibraryResponse } from "@/types/library";
|
||||
import type { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import type { UserPreferences } from "@/types/preferences";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { AppError } from "@/utils/errors";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ConfigDBService } from "@/lib/services/config-db.service";
|
||||
import { ClientSettings } from "@/components/settings/ClientSettings";
|
||||
import { Metadata } from "next";
|
||||
import { KomgaConfig, TTLConfig } from "@/types/komga";
|
||||
import type { Metadata } from "next";
|
||||
import type { KomgaConfig, TTLConfig } from "@/types/komga";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Préférences",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { authService } from "@/lib/services/auth.service";
|
||||
import { AppErrorType } from "@/types/global";
|
||||
import type { AppErrorType } from "@/types/global";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { authService } from "@/lib/services/auth.service";
|
||||
import { AppErrorType } from "@/types/global";
|
||||
import type { AppErrorType } from "@/types/global";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
RefreshCw,
|
||||
Globe,
|
||||
} from "lucide-react";
|
||||
import { CacheType } from "@/lib/services/base-api.service";
|
||||
import type { CacheType } from "@/lib/services/base-api.service";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface RequestTiming {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState, useCallback } from "react";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { SeriesCover } from "@/components/ui/series-cover";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
import { KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaSeries } from "@/types/komga";
|
||||
|
||||
interface OptimizedHeroSeries {
|
||||
id: string;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import { HeroSection } from "./HeroSection";
|
||||
import { MediaRow } from "./MediaRow";
|
||||
import { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import { RefreshButton } from "@/components/library/RefreshButton";
|
||||
import { History, Sparkles, Clock, LibraryBig, BookOpen } from "lucide-react";
|
||||
import { HomeData } from "@/lib/services/home.service";
|
||||
import type { HomeData } from "@/lib/services/home.service";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
interface HomeContentProps {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { ChevronLeft, ChevronRight } from "lucide-react";
|
||||
import { useRef, useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import { BookCover } from "../ui/book-cover";
|
||||
import { SeriesCover } from "../ui/series-cover";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { usePathname, useRouter } from "next/navigation";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { authService } from "@/lib/services/auth.service";
|
||||
import { useEffect, useState, useCallback } from "react";
|
||||
import { KomgaLibrary, KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaLibrary, KomgaSeries } from "@/types/komga";
|
||||
import { usePreferences } from "@/contexts/PreferencesContext";
|
||||
import { AppError } from "@/utils/errors";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Loader2, Filter } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaSeries } from "@/types/komga";
|
||||
import { SearchInput } from "./SearchInput";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaSeries } from "@/types/komga";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { SeriesCover } from "@/components/ui/series-cover";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { PropsWithChildren } from "react";
|
||||
import type { PropsWithChildren } from "react";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
import "@/i18n/i18n";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
"use client";
|
||||
|
||||
import { BookReaderProps } from "./types";
|
||||
import type { BookReaderProps } from "./types";
|
||||
import { useOrientation } from "./hooks/useOrientation";
|
||||
import { usePageNavigation } from "./hooks/usePageNavigation";
|
||||
import { usePageCache } from "./hooks/usePageCache";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
import { BookReader } from "./BookReader";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
import { BookReader } from "./BookReader";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ClientOfflineBookService } from "@/lib/services/client-offlinebook.service";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ControlButtonsProps } from "../types";
|
||||
import type { ControlButtonsProps } from "../types";
|
||||
import {
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NavigationBarProps } from "../types";
|
||||
import type { NavigationBarProps } from "../types";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Thumbnail } from "./Thumbnail";
|
||||
import { useThumbnails } from "../hooks/useThumbnails";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ThumbnailProps } from "../types";
|
||||
import type { ThumbnailProps } from "../types";
|
||||
import { ImageLoader } from "@/components/ui/image-loader";
|
||||
import { cn } from "@/lib/utils";
|
||||
import Image from "next/image";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useRef } from "react";
|
||||
import { PageCache } from "../types";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { PageCache } from "../types";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
|
||||
interface UsePageCacheProps {
|
||||
book: KomgaBook;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback, useEffect, useRef } from "react";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
import { ClientOfflineBookService } from "@/lib/services/client-offlinebook.service";
|
||||
|
||||
interface UsePageNavigationProps {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useCallback, useEffect } from "react";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
|
||||
interface UseThumbnailsProps {
|
||||
book: KomgaBook;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
|
||||
export interface PageCache {
|
||||
[pageNumber: number]: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
import { BookCover } from "@/components/ui/book-cover";
|
||||
import { useState, useEffect } from "react";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Loader2, Filter } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
interface PaginatedBookGridProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Book, BookOpen, BookMarked, Star, StarOff } from "lucide-react";
|
||||
import { KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaSeries } from "@/types/komga";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Button } from "../ui/button";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useToast } from "@/components/ui/use-toast";
|
||||
import { Trash2, Loader2 } from "lucide-react";
|
||||
import { CacheModeSwitch } from "@/components/settings/CacheModeSwitch";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { TTLConfigData } from "@/types/komga";
|
||||
import type { TTLConfigData } from "@/types/komga";
|
||||
|
||||
interface CacheSettingsProps {
|
||||
initialTTLConfig: TTLConfigData | null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { KomgaConfig, TTLConfigData } from "@/types/komga";
|
||||
import type { KomgaConfig, TTLConfigData } from "@/types/komga";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
import { DisplaySettings } from "./DisplaySettings";
|
||||
import { KomgaSettings } from "./KomgaSettings";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useState } from "react";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
import { useToast } from "@/components/ui/use-toast";
|
||||
import { Network, Loader2 } from "lucide-react";
|
||||
import { KomgaConfig } from "@/types/komga";
|
||||
import type { KomgaConfig } from "@/types/komga";
|
||||
|
||||
interface KomgaSettingsProps {
|
||||
initialConfig: KomgaConfig | null;
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
|
||||
import { CoverClient } from "./cover-client";
|
||||
import { ProgressBar } from "./progress-bar";
|
||||
import { BookCoverProps, getImageUrl } from "./cover-utils";
|
||||
import type { BookCoverProps} from "./cover-utils";
|
||||
import { getImageUrl } from "./cover-utils";
|
||||
import { ClientOfflineBookService } from "@/lib/services/client-offlinebook.service";
|
||||
import { MarkAsReadButton } from "./mark-as-read-button";
|
||||
import { MarkAsUnreadButton } from "./mark-as-unread-button";
|
||||
import { BookOfflineButton } from "./book-offline-button";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
import { formatDate } from "@/lib/utils";
|
||||
|
||||
// Fonction utilitaire pour obtenir les informations de statut de lecture
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useState, useEffect, useCallback } from "react";
|
||||
import { Download, Check, Loader2 } from "lucide-react";
|
||||
import { Button } from "./button";
|
||||
import { useToast } from "./use-toast";
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
|
||||
interface BookOfflineButtonProps {
|
||||
book: KomgaBook;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import type { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
|
||||
export interface BaseCoverProps {
|
||||
alt?: string;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
import { CoverClient } from "./cover-client";
|
||||
import { ProgressBar } from "./progress-bar";
|
||||
import { SeriesCoverProps, getImageUrl } from "./cover-utils";
|
||||
import type { SeriesCoverProps} from "./cover-utils";
|
||||
import { getImageUrl } from "./cover-utils";
|
||||
|
||||
export function SeriesCover({
|
||||
series,
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
import React, { createContext, useContext, useEffect, useState } from "react";
|
||||
import { ERROR_CODES } from "../constants/errorCodes";
|
||||
import { AppError } from "../utils/errors";
|
||||
import { UserPreferences, defaultPreferences } from "@/types/preferences";
|
||||
import type { UserPreferences} from "@/types/preferences";
|
||||
import { defaultPreferences } from "@/types/preferences";
|
||||
|
||||
interface PreferencesContextType {
|
||||
preferences: UserPreferences;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { AppErrorType } from "@/types/global";
|
||||
import type { AppErrorType } from "@/types/global";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
|
||||
class AuthService {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { AuthConfig } from "@/types/auth";
|
||||
import type { AuthConfig } from "@/types/auth";
|
||||
import { getServerCacheService } from "./server-cache.service";
|
||||
import { ConfigDBService } from "./config-db.service";
|
||||
import { DebugService } from "./debug.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
import { KomgaConfig } from "@/types/komga";
|
||||
import { ServerCacheService } from "./server-cache.service";
|
||||
import type { KomgaConfig } from "@/types/komga";
|
||||
import type { ServerCacheService } from "./server-cache.service";
|
||||
// Types de cache disponibles
|
||||
export type CacheType = "DEFAULT" | "HOME" | "LIBRARIES" | "SERIES" | "BOOKS" | "IMAGES";
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { BaseApiService } from "./base-api.service";
|
||||
import { KomgaBook, KomgaBookWithPages } from "@/types/komga";
|
||||
import { ImageService, ImageResponse } from "./image.service";
|
||||
import type { KomgaBook, KomgaBookWithPages } from "@/types/komga";
|
||||
import type { ImageResponse } from "./image.service";
|
||||
import { ImageService } from "./image.service";
|
||||
import { PreferencesService } from "./preferences.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KomgaBook } from "@/types/komga";
|
||||
import type { KomgaBook } from "@/types/komga";
|
||||
|
||||
export class ClientOfflineBookService {
|
||||
static setCurrentPage(book: KomgaBook, page: number) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { DebugService } from "./debug.service";
|
||||
import { AuthServerService } from "./auth-server.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
import { User, KomgaConfigData, TTLConfigData, KomgaConfig, TTLConfig } from "@/types/komga";
|
||||
import type { User, KomgaConfigData, TTLConfigData, KomgaConfig, TTLConfig } from "@/types/komga";
|
||||
|
||||
export class ConfigDBService {
|
||||
private static getCurrentUser(): User {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fs from "fs/promises";
|
||||
import path from "path";
|
||||
import { CacheType } from "./base-api.service";
|
||||
import type { CacheType } from "./base-api.service";
|
||||
import { AuthServerService } from "./auth-server.service";
|
||||
import { PreferencesService } from "./preferences.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { DebugService } from "./debug.service";
|
||||
import { AuthServerService } from "./auth-server.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
import { User } from "@/types/komga";
|
||||
import type { User } from "@/types/komga";
|
||||
|
||||
export class FavoriteService {
|
||||
private static readonly FAVORITES_CHANGE_EVENT = "favoritesChanged";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BaseApiService } from "./base-api.service";
|
||||
import { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import { LibraryResponse } from "@/types/library";
|
||||
import type { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import type { LibraryResponse } from "@/types/library";
|
||||
import { getServerCacheService } from "./server-cache.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { BaseApiService } from "./base-api.service";
|
||||
import { LibraryResponse } from "@/types/library";
|
||||
import { Series } from "@/types/series";
|
||||
import type { LibraryResponse } from "@/types/library";
|
||||
import type { Series } from "@/types/series";
|
||||
import { getServerCacheService } from "./server-cache.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
import { KomgaLibrary } from "@/types/komga";
|
||||
import type { KomgaLibrary } from "@/types/komga";
|
||||
|
||||
export class LibraryService extends BaseApiService {
|
||||
static async getLibraries(): Promise<KomgaLibrary[]> {
|
||||
|
||||
@@ -2,8 +2,9 @@ import { PreferencesModel } from "@/lib/models/preferences.model";
|
||||
import { AuthServerService } from "./auth-server.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
import { UserPreferences, defaultPreferences } from "@/types/preferences";
|
||||
import { User } from "@/types/komga";
|
||||
import type { UserPreferences} from "@/types/preferences";
|
||||
import { defaultPreferences } from "@/types/preferences";
|
||||
import type { User } from "@/types/komga";
|
||||
|
||||
export class PreferencesService {
|
||||
static getCurrentUser(): User {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { BaseApiService } from "./base-api.service";
|
||||
import { LibraryResponse } from "@/types/library";
|
||||
import { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import type { LibraryResponse } from "@/types/library";
|
||||
import type { KomgaBook, KomgaSeries } from "@/types/komga";
|
||||
import { BookService } from "./book.service";
|
||||
import { ImageService, ImageResponse } from "./image.service";
|
||||
import type { ImageResponse } from "./image.service";
|
||||
import { ImageService } from "./image.service";
|
||||
import { PreferencesService } from "./preferences.service";
|
||||
import { getServerCacheService } from "./server-cache.service";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
import { UserPreferences } from "@/types/preferences";
|
||||
import { ServerCacheService } from "./server-cache.service";
|
||||
import type { UserPreferences } from "@/types/preferences";
|
||||
import type { ServerCacheService } from "./server-cache.service";
|
||||
|
||||
export class SeriesService extends BaseApiService {
|
||||
static async getSeries(seriesId: string): Promise<KomgaSeries> {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { BaseApiService } from "./base-api.service";
|
||||
import { AuthConfig } from "@/types/auth";
|
||||
import type { AuthConfig } from "@/types/auth";
|
||||
import { ERROR_CODES } from "../../constants/errorCodes";
|
||||
import { AppError } from "../../utils/errors";
|
||||
import { KomgaLibrary } from "@/types/komga";
|
||||
import type { KomgaLibrary } from "@/types/komga";
|
||||
|
||||
export class TestService extends BaseApiService {
|
||||
static async testConnection(config: AuthConfig): Promise<{ libraries: KomgaLibrary[] }> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
import { ERROR_CODES } from "./constants/errorCodes";
|
||||
import { UserData } from "./lib/services/auth-server.service";
|
||||
import type { UserData } from "./lib/services/auth-server.service";
|
||||
import { getErrorMessage } from "./utils/errors";
|
||||
|
||||
// Routes qui ne nécessitent pas d'authentification
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KomgaUser } from "./komga";
|
||||
import type { KomgaUser } from "./komga";
|
||||
|
||||
export interface AuthConfig {
|
||||
serverUrl: string;
|
||||
|
||||
2
src/types/global.d.ts
vendored
2
src/types/global.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { ErrorCode } from "@/constants/errorCodes";
|
||||
import type { ErrorCode } from "@/constants/errorCodes";
|
||||
|
||||
export interface AppErrorType extends Error {
|
||||
code: ErrorCode;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ERROR_MESSAGES } from "../constants/errorMessages";
|
||||
import { ErrorCode } from "../constants/errorCodes";
|
||||
import type { ErrorCode } from "../constants/errorCodes";
|
||||
|
||||
export class AppError extends Error {
|
||||
constructor(
|
||||
|
||||
Reference in New Issue
Block a user