pulse/interfaces/feed.types.ts
Edo Limburg c79eb6d76d Add CLI entry point, RSS content extraction, and image support
Features:
- Add CLI with commands: start, add, remove, list, fetch, status, items
- Auto-detect RSS format when adding feeds
- Auto-run database migrations on startup
- Extract full HTML content from RSS description field (NOS-style feeds)
- Extract image URLs from RSS enclosure tags
- Display images in terminal output with emoji
- Include imageUrl in JSON formatter output

Database:
- Add image_url column to feed_items table
- Update storage layer to persist imageUrl field

Tests:
- Add 10 CLI integration tests
- Add 3 RSS parser tests for image/content extraction
- Add 2 storage tests for imageUrl persistence

Dependencies:
- Add commander for CLI framework

All 144 tests passing
2026-05-05 23:05:30 +02:00

49 lines
1.1 KiB
TypeScript

export interface FeedItem {
id: string;
source: string;
title: string;
url: string;
publishedAt: Date;
content?: string;
summary?: string;
imageUrl?: string;
}
export interface FetchInput {
url: string;
expectedFormat: "rss" | "atom";
}
export interface FetchError {
source: string;
reason: string;
code: "NETWORK" | "TIMEOUT" | "PARSE" | "UNKNOWN";
}
export interface FeedResponse {
source: string;
body: string;
contentType: string;
statusCode: number;
}
export interface FetchResult {
responses: FeedResponse[];
errors: FetchError[];
fetchedAt: Date;
}
export interface FeedSource {
id: string; // Hash of URL
url: string; // Feed URL
name: string | null; // Display name
format: 'rss' | 'atom'; // Expected format
pollIntervalMs: number; // How often to check
isActive: boolean; // Whether to poll
lastFetchedAt: Date | null; // Last attempt timestamp
lastSuccessAt: Date | null; // Last successful fetch
consecutiveFailures: number; // Error streak counter
createdAt: Date;
updatedAt: Date;
}