import { type InsightsByTime, type InsightsSummary, type RestrictedInsightsByTime } from '@n8n/api-types'; import { LicenseState, Logger } from '@n8n/backend-common'; import type { User } from '@n8n/db'; import { InstanceSettings } from 'n8n-core'; import { WorkflowSharingService } from '../../workflows/workflow-sharing.service'; import { InsightsByPeriodRepository } from './database/repositories/insights-by-period.repository'; type InsightsDateRangeQuery = { user: User; startDate: Date; endDate: Date; projectId?: string; timeZone?: string; }; export declare class InsightsService { private readonly insightsByPeriodRepository; private readonly licenseState; private readonly instanceSettings; private readonly logger; private readonly workflowSharingService; constructor(insightsByPeriodRepository: InsightsByPeriodRepository, licenseState: LicenseState, instanceSettings: InstanceSettings, logger: Logger, workflowSharingService: WorkflowSharingService); private toggleCollectionService; init(): Promise; shutdown(): Promise; private resolveAccessFilter; getInsightsSummary({ user, startDate, endDate, projectId, timeZone, }: { user: User; projectId?: string; startDate: Date; endDate: Date; timeZone?: string; }): Promise; getInsightsByWorkflow({ user, skip, take, sortBy, projectId, startDate, endDate, timeZone, }: { user: User; skip?: number; take?: number; sortBy?: string; projectId?: string; startDate: Date; endDate: Date; timeZone?: string; }): Promise<{ count: number; data: { workflowId: string | null; workflowName: string; projectId: string | null; projectName: string; total: number; succeeded: number; failed: number; failureRate: number; runTime: number; averageRunTime: number; timeSaved: number; hasReadAccess: boolean; }[]; }>; getInsightsByTime({ user, startDate, endDate, projectId, timeZone, }: InsightsDateRangeQuery): Promise; getTimeSavedInsightsByTime({ user, startDate, endDate, projectId, timeZone, }: InsightsDateRangeQuery): Promise; private queryInsightsByTime; validateDateFiltersLicense({ startDate, endDate }: { startDate: Date; endDate: Date; }): void; private getDateFiltersGranularity; } export {};