/** * digestPreferences.ts * * CRUD for the `digest_preferences` Postgres table via Supabase PostgREST. * Stores each user's digest opt-in state and last-sent timestamp. * * Table: scripts/digest-preferences.sql */ export interface DigestPreference { user_id: string; email: string; enabled: boolean; last_sent_at: string | null; created_at: string; } export declare function getDigestPreference(supabaseUrl: string, serviceRoleKey: string, userId: string): Promise; export declare function listEnabledPreferences(supabaseUrl: string, serviceRoleKey: string): Promise; /** * Upsert a preference row. On insert, sets enabled=true and records email. * On update, only changes the fields provided. */ export declare function upsertDigestPreference(supabaseUrl: string, serviceRoleKey: string, pref: Pick & Partial): Promise; export declare function updateDigestEnabled(supabaseUrl: string, serviceRoleKey: string, userId: string, enabled: boolean): Promise; export declare function markDigestSent(supabaseUrl: string, serviceRoleKey: string, userId: string, sentAt: string): Promise; //# sourceMappingURL=digestPreferences.d.ts.map