Add FeedOrchestrator that coordinates fetch→parse→dedup→store pipeline: - FeedSource type for managing RSS/Atom feed configurations - Feed source CRUD operations in IStorage interface - Database schema migration for feed_sources table - Exponential backoff retry with configurable delays - Per-feed poll intervals with health tracking - Concurrency-limited parallel feed processing - ProcessResult and FeedHealth interfaces for status monitoring Files added: - orchestrator/orchestrator.ts - main orchestrator class - orchestrator/scheduler.ts - backoff calculation utilities - orchestrator/index.ts - module exports - orchestrator/orchestrator.test.ts - comprehensive test suite Files modified: - interfaces/feed.types.ts - add FeedSource type - interfaces/storage.interface.ts - extend with feed source methods - infrastructure/db/database.ts - add FeedSourceTable interface - infrastructure/db/schema.ts - add feed_sources table migration - modules/storage/storage.ts - implement feed source CRUD - modules/storage/storage.test.ts - add feed source tests
42 lines
992 B
TypeScript
42 lines
992 B
TypeScript
/**
|
|
* Kysely database type definitions.
|
|
* Defines the table schemas for type-safe queries.
|
|
*/
|
|
|
|
export interface FeedItemTable {
|
|
id: string;
|
|
source: string;
|
|
title: string;
|
|
url: string;
|
|
published_at: string; // ISO 8601 format
|
|
content: string | null;
|
|
summary: string | null;
|
|
created_at: string; // ISO 8601 format
|
|
}
|
|
|
|
export interface SeenIdTable {
|
|
id: string;
|
|
seen_at: string; // ISO 8601 format
|
|
}
|
|
|
|
export interface FeedSourceTable {
|
|
id: string;
|
|
url: string;
|
|
name: string | null;
|
|
format: 'rss' | 'atom';
|
|
poll_interval_ms: number;
|
|
is_active: number; // SQLite stores boolean as 0/1
|
|
last_fetched_at: string | null; // ISO 8601
|
|
last_success_at: string | null; // ISO 8601
|
|
consecutive_failures: number;
|
|
created_at: string; // ISO 8601
|
|
updated_at: string; // ISO 8601
|
|
}
|
|
|
|
// Database interface used by Kysely
|
|
export interface Database {
|
|
feed_items: FeedItemTable;
|
|
seen_ids: SeenIdTable;
|
|
feed_sources: FeedSourceTable;
|
|
}
|