/** * Canonical Dragon Ball / Shenron source registry. * * Keep every source origin and route builder here. Crawlers may consume a * source, but they must not duplicate an origin literal in their own module. */ export type DragonBallSourceId = | "shenronSite" | "shenronApi" | "shenronCdn" | "official" | "toei" | "jajanken" | "kanzenshuu" | "inlifeWayback" | "caramel" | "wikipediaJa" | "archive"; export interface DragonBallSource { id: DragonBallSourceId; origin: string; kind: "shenron" | "official" | "publisher" | "reference" | "archive"; } export const DRAGONBALL_SOURCES: Readonly> = { shenronSite: { id: "shenronSite", origin: "https://dragonballfr.com", kind: "shenron" }, shenronApi: { id: "shenronApi", origin: "https://bot.dragonballfr.com", kind: "shenron" }, shenronCdn: { id: "shenronCdn", origin: "https://cdn.dragonballfr.com", kind: "shenron" }, official: { id: "official", origin: "https://dragon-ball-official.com", kind: "official" }, toei: { id: "toei", origin: "https://lineup.toei-anim.co.jp", kind: "publisher" }, jajanken: { id: "jajanken", origin: "https://www.jajanken.net", kind: "reference" }, kanzenshuu: { id: "kanzenshuu", origin: "https://www.kanzenshuu.com", kind: "reference" }, inlifeWayback: { id: "inlifeWayback", origin: "https://web.archive.org", kind: "archive" }, caramel: { id: "caramel", origin: "https://www.caramel.co.jp", kind: "reference" }, wikipediaJa: { id: "wikipediaJa", origin: "https://ja.wikipedia.org", kind: "reference" }, archive: { id: "archive", origin: "https://archive.org", kind: "archive" }, }; export function dragonBallSourceUrl(source: DragonBallSourceId, path = "/"): string { return dragonBallUrlFromOrigin(DRAGONBALL_SOURCES[source].origin, path); } export function dragonBallUrlFromOrigin(origin: string, path = "/"): string { return new URL(path, origin).href; } export const DRAGONBALL_URLS = { officialNews: () => dragonBallSourceUrl("official", "/news/"), officialGoods: () => dragonBallSourceUrl("official", "/goods/"), officialComics: () => dragonBallSourceUrl("official", "/comics/"), officialSpecial: () => dragonBallSourceUrl("official", "/special/"), toeiEpisodes: (seriesSlug: string) => dragonBallSourceUrl("toei", `/ja/tv/${seriesSlug}/episode/`), toeiEpisode: (seriesSlug: string, episodeNumber: number) => dragonBallSourceUrl("toei", `/ja/tv/${seriesSlug}/episode/${episodeNumber}/`), jajankenStats: () => dragonBallSourceUrl("jajanken", "/sakuhins/QvL0By28NV"), kanzenshuuPressArchive: () => dragonBallSourceUrl("kanzenshuu", "/press-archive/"), kanzenshuuTranslations: () => dragonBallSourceUrl("kanzenshuu", "/translations/"), kanzenshuuFaqs: () => dragonBallSourceUrl("kanzenshuu", "/faqs/"), inlifeBiography: () => dragonBallSourceUrl("inlifeWayback", "/web/20240413025745/https://inlifeweb.com/reports/report_350.html"), caramelBiography: () => dragonBallSourceUrl("caramel", "/about/dragonball/"), wikipediaJaAkiraToriyama: () => dragonBallSourceUrl("wikipediaJa", "/w/api.php?action=query&prop=extracts&exintro=1&explaintext=1&titles=%E9%B3%A5%E5%B1%B1%E6%98%8E&format=json"), wikipediaJaAkiraToriyamaHtml: () => dragonBallSourceUrl("wikipediaJa", "/api/rest_v1/page/html/%E9%B3%A5%E5%B1%B1%E6%98%8E"), wikipediaJaAkiraToriyamaPage: () => dragonBallSourceUrl("wikipediaJa", "/wiki/%E9%B3%A5%E5%B1%B1%E6%98%8E"), shenronCharacter: (id: number = 1090) => dragonBallSourceUrl("shenronApi", `/api/public/wiki/characters/${id}`), shenronCharacterPage: (slug = "shenron") => dragonBallSourceUrl("shenronSite", `/wiki/personnages/${slug}`), shenronEpisodes: (limit: number, offset: number) => dragonBallSourceUrl("shenronApi", `/api/public/wiki/episodes?limit=${limit}&offset=${offset}`), shenronEpisode: (id: number) => dragonBallSourceUrl("shenronApi", `/api/public/wiki/episodes/${id}`), shenronMovies: (limit: number, offset: number) => dragonBallSourceUrl("shenronApi", `/api/public/wiki/movies?limit=${limit}&offset=${offset}`), shenronMovie: (slug: string) => dragonBallSourceUrl("shenronApi", `/api/public/wiki/movies/${slug}`), shenronEpisodePage: (id: number) => dragonBallSourceUrl("shenronSite", `/wiki/episodes/${id}`), shenronMoviePage: (slug: string) => dragonBallSourceUrl("shenronSite", `/wiki/films/${slug}`), archiveItem: (identifier: string) => dragonBallSourceUrl("archive", `/details/${encodeURIComponent(identifier)}`), archiveMetadata: (identifier: string) => dragonBallSourceUrl("archive", `/metadata/${encodeURIComponent(identifier)}`), } as const; /** Seed set for the complete, persistent BXC crawl queue. */ export const DRAGONBALL_EXHAUSTIVE_ROOTS = [ // Shenron's public API exposes the community catalogue directly. Keeping // these first-class seeds avoids depending on presentation-page links to // discover episodes, films, and their CDN media. dragonBallSourceUrl("shenronSite", "/wiki"), DRAGONBALL_URLS.shenronCharacter(1090), DRAGONBALL_URLS.shenronEpisodes(100, 0), DRAGONBALL_URLS.shenronMovies(100, 0), DRAGONBALL_URLS.officialNews(), DRAGONBALL_URLS.officialGoods(), DRAGONBALL_URLS.officialComics(), DRAGONBALL_URLS.officialSpecial(), DRAGONBALL_URLS.toeiEpisodes("dragon"), DRAGONBALL_URLS.toeiEpisodes("dragonz"), DRAGONBALL_URLS.toeiEpisodes("dragon_gt"), DRAGONBALL_URLS.toeiEpisodes("dragon_kai"), DRAGONBALL_URLS.toeiEpisodes("dragon_super"), dragonBallSourceUrl("toei", "/ja/search/list.php?type=search&val=%E3%83%89%E3%83%A9%E3%82%B4%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%AB"), DRAGONBALL_URLS.kanzenshuuPressArchive(), DRAGONBALL_URLS.kanzenshuuTranslations(), DRAGONBALL_URLS.kanzenshuuFaqs(), DRAGONBALL_URLS.jajankenStats(), DRAGONBALL_URLS.caramelBiography(), DRAGONBALL_URLS.inlifeBiography(), DRAGONBALL_URLS.wikipediaJaAkiraToriyamaHtml(), DRAGONBALL_URLS.archiveMetadata("drslump"), ] as const; export * from "./shenron-canon.ts";