refactor: types dir import
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import { type RequestHandler } from "express";
|
import { type RequestHandler } from "express";
|
||||||
import { scrapeAnimeAboutInfo } from "../parsers/index.js";
|
import { scrapeAnimeAboutInfo } from "../parsers/index.js";
|
||||||
import { type AnimeAboutInfoQueryParams } from "../models/controllers/index.js";
|
import { type AnimeAboutInfoQueryParams } from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/info?id=${anime-id}
|
// /anime/info?id=${anime-id}
|
||||||
const getAnimeAboutInfo: RequestHandler<
|
const getAnimeAboutInfo: RequestHandler<
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import type { AnimeCategories } from "../models/anime.js";
|
import type { AnimeCategories } from "../types/anime.js";
|
||||||
import { scrapeAnimeCategory } from "../parsers/index.js";
|
import { scrapeAnimeCategory } from "../parsers/index.js";
|
||||||
import type {
|
import type {
|
||||||
CategoryAnimePathParams,
|
CategoryAnimePathParams,
|
||||||
CategoryAnimeQueryParams,
|
CategoryAnimeQueryParams,
|
||||||
} from "../models/controllers/index.js";
|
} from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/:category?page=${page}
|
// /anime/:category?page=${page}
|
||||||
const getAnimeCategory: RequestHandler<
|
const getAnimeCategory: RequestHandler<
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { type RequestHandler } from "express";
|
|||||||
import { type CheerioAPI, load } from "cheerio";
|
import { type CheerioAPI, load } from "cheerio";
|
||||||
import { scrapeAnimeEpisodeSources } from "../parsers/index.js";
|
import { scrapeAnimeEpisodeSources } from "../parsers/index.js";
|
||||||
import { USER_AGENT_HEADER, SRC_BASE_URL } from "../utils/constants.js";
|
import { USER_AGENT_HEADER, SRC_BASE_URL } from "../utils/constants.js";
|
||||||
import { type AnimeServers, Servers } from "../models/anime.js";
|
import { type AnimeServers, Servers } from "../types/anime.js";
|
||||||
import { type AnimeEpisodeSrcsQueryParams } from "../models/controllers/index.js";
|
import { type AnimeEpisodeSrcsQueryParams } from "../types/controllers/index.js";
|
||||||
|
|
||||||
type AnilistID = number | null;
|
type AnilistID = number | null;
|
||||||
type MalID = number | null;
|
type MalID = number | null;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import { type RequestHandler } from "express";
|
import { type RequestHandler } from "express";
|
||||||
import { scrapeAnimeEpisodes } from "../parsers/index.js";
|
import { scrapeAnimeEpisodes } from "../parsers/index.js";
|
||||||
import { type AnimeEpisodePathParams } from "../models/controllers/index.js";
|
import { type AnimeEpisodePathParams } from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/episodes/${anime-id}
|
// /anime/episodes/${anime-id}
|
||||||
const getAnimeEpisodes: RequestHandler<
|
const getAnimeEpisodes: RequestHandler<
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { scrapeGenreAnime } from "../parsers/index.js";
|
|||||||
import type {
|
import type {
|
||||||
GenreAnimePathParams,
|
GenreAnimePathParams,
|
||||||
GenreAnimeQueryParams,
|
GenreAnimeQueryParams,
|
||||||
} from "../models/controllers/index.js";
|
} from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/genre/${name}?page=${page}
|
// /anime/genre/${name}?page=${page}
|
||||||
const getGenreAnime: RequestHandler<
|
const getGenreAnime: RequestHandler<
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { scrapeProducerAnimes } from "../parsers/index.js";
|
|||||||
import type {
|
import type {
|
||||||
AnimeProducerPathParams,
|
AnimeProducerPathParams,
|
||||||
AnimeProducerQueryParams,
|
AnimeProducerQueryParams,
|
||||||
} from "../models/controllers/index.js";
|
} from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/producer/${name}?page=${page}
|
// /anime/producer/${name}?page=${page}
|
||||||
const getProducerAnimes: RequestHandler<
|
const getProducerAnimes: RequestHandler<
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import { type RequestHandler } from "express";
|
import { type RequestHandler } from "express";
|
||||||
import { scrapeAnimeSearch } from "../parsers/index.js";
|
import { scrapeAnimeSearch } from "../parsers/index.js";
|
||||||
import { type AnimeSearchQueryParams } from "../models/controllers/index.js";
|
import { type AnimeSearchQueryParams } from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/search?q=${query}&page=${page}
|
// /anime/search?q=${query}&page=${page}
|
||||||
const getAnimeSearch: RequestHandler<
|
const getAnimeSearch: RequestHandler<
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import { type RequestHandler } from "express";
|
import { type RequestHandler } from "express";
|
||||||
import { scrapeAnimeSearchSuggestion } from "../parsers/index.js";
|
import { scrapeAnimeSearchSuggestion } from "../parsers/index.js";
|
||||||
import { type AnimeSearchSuggestQueryParams } from "../models/controllers/index.js";
|
import { type AnimeSearchSuggestQueryParams } from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/search/suggest?q=${query}
|
// /anime/search/suggest?q=${query}
|
||||||
const getAnimeSearchSuggestion: RequestHandler<
|
const getAnimeSearchSuggestion: RequestHandler<
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import { type RequestHandler } from "express";
|
import { type RequestHandler } from "express";
|
||||||
import { scrapeEpisodeServers } from "../parsers/index.js";
|
import { scrapeEpisodeServers } from "../parsers/index.js";
|
||||||
import { type EpisodeServersQueryParams } from "../models/controllers/index.js";
|
import { type EpisodeServersQueryParams } from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/servers?episodeId=${id}
|
// /anime/servers?episodeId=${id}
|
||||||
const getEpisodeServers: RequestHandler<
|
const getEpisodeServers: RequestHandler<
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import { type RequestHandler } from "express";
|
import { type RequestHandler } from "express";
|
||||||
import { scrapeEstimatedSchedule } from "../parsers/index.js";
|
import { scrapeEstimatedSchedule } from "../parsers/index.js";
|
||||||
import { type EstimatedScheduleQueryParams } from "../models/controllers/index.js";
|
import { type EstimatedScheduleQueryParams } from "../types/controllers/index.js";
|
||||||
|
|
||||||
// /anime/schedule?date=${date}
|
// /anime/schedule?date=${date}
|
||||||
const getEstimatedSchedule: RequestHandler<
|
const getEstimatedSchedule: RequestHandler<
|
||||||
|
|||||||
Reference in New Issue
Block a user