6.2
This commit is contained in:
1 parent
5b4c086c73
commit
db87655c87
58 files changed
+3184
-2128
No files matched your search
+25
-4
@@ -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[]> {
|
||||
|
||||
Reference in new issue
Block a user