Spaces:
Sleeping

api / src /interfaces /repository /IAnalyticsRepository.ts
Amal Jose
added files
4e83772
Raw History Blame Contribute Delete
889 Bytes
import { BufferAnalytics } from "@/models/Analytics.js";
export interface QueryOptions {
range?: number;
rangeUnit?: string;
interval?: number;
intervalUnit?: string;
limit?: number;
}
export interface IAnalyticsRepository {
insertBatch(data: BufferAnalytics[]): Promise<void>;
insertSingle(data: BufferAnalytics): Promise<void>;
clearProjectAnalytics(projectId: string): Promise<void>;
getBandwidth(projectId: string, queryOptions: QueryOptions): Promise<unknown[]>;
getOverview(projectId: string, queryOptions: QueryOptions): Promise<unknown[]>;
getRealtime(projectId: string, queryOptions: QueryOptions): Promise<unknown[]>;
getTopPages(projectId: string, queryOptions: QueryOptions): Promise<unknown[]>;
getOsStats(projectId: string, queryOptions: QueryOptions): Promise<unknown[]>;
getBrowserStats(projectId: string, queryOptions: QueryOptions): Promise<unknown[]>;
}