export interface DatabaseRow { id: string; url: string; s3Key: string | null; firstSeen: Date; lastSeen: Date; status: string; host: string; datePublished: Date | null; weekPartition: string; priceWithVat: number | null; priceCurrency: string | null; hasPhone: boolean; lastPriceChange: Date | null; revision: number; } export interface CountResult { count: string; } export declare class DatabaseManager { private pool; private isClosing; constructor(databaseUrl: string); close(): Promise; /** * Test database connection */ testConnection(retries?: number, retryDelay?: number): Promise; /** * Execute raw query (for tests only) */ executeRaw(sql: string, params?: unknown[]): Promise; /** * Get table name based on scraper name */ getTableName(scraperName: string): string; /** * Check if table exists */ tableExists(tableName: string): Promise; /** * Create table based on scraper name if it doesn't exist */ createTableIfNotExists(tableName: string, retries?: number, retryDelay?: number): Promise; /** * Insert a new listing record */ insertListing(tableName: string, data: { id: string; url: string; s3Key: string; firstSeen: Date; lastSeen: Date; status: string; host: string; datePublished: Date | null; weekPartition: string; priceWithVat: number | null; priceCurrency: string | null; hasPhone: boolean; lastPriceChange: Date | null; revision: number; }): Promise; /** * Find a listing by ID */ findById(tableName: string, id: string): Promise; /** * Update a listing record */ updateListing(tableName: string, id: string, data: { s3Key: string; lastSeen: Date; status: string; weekPartition: string; priceWithVat: number | null; priceCurrency: string | null; hasPhone: boolean; lastPriceChange: Date | null; }): Promise; /** * Update lastSeen and weekPartition only */ updateLastSeen(tableName: string, id: string, lastSeen: Date, weekPartition: string): Promise; /** * Update phone information for a listing */ updatePhoneInfo(tableName: string, id: string, hasPhone: boolean): Promise; /** * List recent listings with pagination and optional date filtering */ listRecent(tableName: string, options: { limit: number; offset: number; fromISO?: string; toISO?: string; }): Promise<{ items: DatabaseRow[]; totalCount: number; }>; /** * List listings by host with pagination and optional date filtering */ listByHost(tableName: string, host: string, options: { limit: number; offset: number; fromISO?: string; toISO?: string; }): Promise<{ items: DatabaseRow[]; totalCount: number; }>; /** * List all listings with pagination and optional filtering */ list(tableName: string, options: { limit: number; offset: number; host?: string; fromISO?: string; toISO?: string; }): Promise<{ items: DatabaseRow[]; totalCount: number; }>; /** * Count listings matching optional filters */ count(tableName: string, filters?: { host?: string; fromISO?: string; toISO?: string; }): Promise; /** * Delete a listing by ID */ deleteById(tableName: string, id: string): Promise; /** * List active listings older than specified days */ listActiveListingsOlderThan(tableName: string, options: { olderThanDays: number; activeThresholdDays: number; lastSeenNotOlderThanDays?: number; limit: number; offset: number; host?: string; }): Promise<{ items: DatabaseRow[]; totalCount: number; }>; /** * Count active listings older than specified days */ countActiveListingsOlderThan(tableName: string, options: { olderThanDays: number; activeThresholdDays: number; lastSeenNotOlderThanDays?: number; host?: string; }): Promise; /** * List active listings without phone numbers within a specific time range */ listListingsWithoutPhoneInRange(tableName: string, options: { olderThanDays?: number; activeThresholdDays: number; lastSeenNotOlderThanDays?: number; limit: number; offset: number; host?: string; }): Promise<{ items: DatabaseRow[]; totalCount: number; }>; /** * Count active listings without phone numbers within a specific time range */ countListingsWithoutPhoneInRange(tableName: string, options: { olderThanDays?: number; activeThresholdDays: number; lastSeenNotOlderThanDays?: number; host?: string; }): Promise; } //# sourceMappingURL=database.d.ts.map