/** * Pure data-mapping helpers for dashboard overview and chart queries. * * These functions transform raw database rows into the shapes * expected by the dashboard API. No I/O — just mapping and math. */ /** * Build the overview metrics response from raw aggregated data. * Pure function — no database access. */ interface OverviewInput { total: number; stats: Record | null | undefined; range: string; slowestEndpoints: Record[]; queryStats: Record | null | undefined; recentErrors: Record[]; } export declare function buildOverviewResult(input: OverviewInput): Record; /** * Map raw top events rows to the widget shape. */ export declare function mapTopEvents(raw: Record[] | null | undefined): { eventName: string; count: number; }[]; /** * Aggregate email status rows into sent/queued/failed counts. */ export declare function mapEmailActivity(raw: Record[] | null | undefined): { sent: number; queued: number; failed: number; }; /** * Map log level rows to the breakdown shape. */ export declare function mapLogLevelBreakdown(raw: Record[] | null | undefined): { error: number; warn: number; info: number; debug: number; }; /** * Map status distribution row to the widget shape. */ export declare function mapStatusDistribution(row: Record | null | undefined): { '2xx': number; '3xx': number; '4xx': number; '5xx': number; }; /** * Map slowest query rows to the widget shape. */ export declare function mapSlowestQueries(raw: Record[] | null | undefined): { sqlNormalized: string; avgDuration: number; count: number; }[]; /** * Aggregate per-minute metrics into larger buckets for 24h/7d ranges. * For 1h/6h, rows are returned as-is. */ export declare function aggregateChartBuckets(rows: Record[], range: string): Record[]; export {};