Merge remote-tracking branch 'origin/dev' into dev
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run

This commit is contained in:
Mike Cao 2025-11-12 16:40:50 -08:00
commit 97ebdc1bab
8 changed files with 67 additions and 70 deletions

View file

@ -61,7 +61,7 @@ function getDateStringSQL(data: any, unit: string = 'utc', timezone?: string) {
function getDateSQL(field: string, unit: string, timezone?: string) {
if (timezone) {
return `toDateTime(date_trunc('${unit}', ${field}, '${timezone}'), '${timezone}')`;
return `toDateTime(date_trunc('${unit}', ${field}, '${timezone}'))`;
}
return `toDateTime(date_trunc('${unit}', ${field}))`;
}

View file

@ -116,3 +116,23 @@ export interface PageResult<T> {
sortDescending?: boolean;
search?: string;
}
export interface RealtimeData {
countries: Record<string, number>;
events: any[];
pageviews: any[];
referrers: Record<string, number>;
timestamp: number;
series: {
views: any[];
visitors: any[];
};
totals: {
views: number;
visitors: number;
events: number;
countries: number;
};
urls: Record<string, number>;
visitors: any[];
}