This commit is contained in:
Vaica committed 2026-06-02 00:23:04 +08:00
1 parent 5b4c086c73
commit db87655c87
58 files changed
+3184 -2128

No files matched your search

+25 -4
View File
@@ -48,6 +48,23 @@ export interface LinkHealth {
error?: string;
}
export interface Article {
title: string;
link: string;
pubDate: string;
feedName: string;
siteUrl: string;
favicon: string;
author: string;
}
export interface HealthResult {
total: number;
alive: number;
dead: number;
results: FeedHealth[];
}
// ---- Feeds API ----
export async function getFeeds(): Promise<Feed[]> {
@@ -80,13 +97,17 @@ export async function deleteFeed(url: string): Promise<void> {
await rssFetch(`/api/feeds?${qs}`, { method: "DELETE" });
}
export async function getFeedsHealth(): Promise<{
total: number; alive: number; dead: number;
results: FeedHealth[];
}> {
export async function getFeedsHealth(): Promise<HealthResult> {
return rssFetch("/api/health");
}
// ---- Articles API ----
export async function getArticles(limit = 10): Promise<Article[]> {
const data = await rssFetch<{ articles: Article[] }>(`/api/articles?limit=${limit}`);
return data.articles || [];
}
// ---- Links API ----
export async function getLinks(all = false): Promise<Link[]> {