feat(plugins): mangabaka
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
06a59e1b5c
commit
ddd938935e
@@ -0,0 +1,46 @@
|
||||
import type { PluginContext } from "@sttracker/plugin-sdk/types";
|
||||
|
||||
export const BASE_URL = "https://api.mangabaka.org";
|
||||
/** The host builds the HttpClient; it should use this rate for this plugin. */
|
||||
export const RATE_PER_MINUTE = 150;
|
||||
|
||||
export interface ApiSource { id?: number | string | null }
|
||||
export interface ApiSeries {
|
||||
id: number;
|
||||
title: string;
|
||||
type?: string | null;
|
||||
state?: string | null;
|
||||
merged_with?: number | null;
|
||||
year?: number | null;
|
||||
source?: {
|
||||
anilist?: ApiSource | null;
|
||||
my_anime_list?: ApiSource | null;
|
||||
manga_updates?: ApiSource | null;
|
||||
kitsu?: ApiSource | null;
|
||||
} | null;
|
||||
}
|
||||
export interface ApiEntry {
|
||||
series_id: number;
|
||||
state?: string | null;
|
||||
rating?: number | null;
|
||||
progress_chapter?: number | null;
|
||||
progress_volume?: number | null;
|
||||
start_date?: string | null;
|
||||
finish_date?: string | null;
|
||||
note?: string | null;
|
||||
series?: ApiSeries | null;
|
||||
}
|
||||
export interface LibraryPage {
|
||||
data: ApiEntry[];
|
||||
pagination?: { page?: number; total_pages?: number } | null;
|
||||
}
|
||||
export interface ChangesPage {
|
||||
data: { type: "upsert" | "delete"; entry?: ApiEntry; series_id: number }[];
|
||||
next_cursor?: string | null;
|
||||
}
|
||||
|
||||
export function authHeaders(ctx: PluginContext): Record<string, string> {
|
||||
const token = ctx.config.token;
|
||||
if (typeof token !== "string" || token === "") throw new Error("mangabaka: token is not configured");
|
||||
return { "x-api-key": token };
|
||||
}
|
||||
Reference in New Issue
Block a user