feat(editor): Add time range selector to Insights (#14877)

Co-authored-by: Guillaume Jacquart <jacquart.guillaume@gmail.com>
This commit is contained in:
Raúl Gómez Morales
2025-04-28 11:11:36 +02:00
committed by GitHub
parent 2d60e469f3
commit bfd85dd3c9
23 changed files with 481 additions and 189 deletions

View File

@@ -5,13 +5,20 @@ import type {
InsightsByTime,
InsightsByWorkflow,
ListInsightsWorkflowQueryDto,
InsightsDateRange,
} from '@n8n/api-types';
export const fetchInsightsSummary = async (context: IRestApiContext): Promise<InsightsSummary> =>
await makeRestApiRequest(context, 'GET', '/insights/summary');
export const fetchInsightsSummary = async (
context: IRestApiContext,
filter?: { dateRange: InsightsDateRange['key'] },
): Promise<InsightsSummary> =>
await makeRestApiRequest(context, 'GET', '/insights/summary', filter);
export const fetchInsightsByTime = async (context: IRestApiContext): Promise<InsightsByTime[]> =>
await makeRestApiRequest(context, 'GET', '/insights/by-time');
export const fetchInsightsByTime = async (
context: IRestApiContext,
filter?: { dateRange: InsightsDateRange['key'] },
): Promise<InsightsByTime[]> =>
await makeRestApiRequest(context, 'GET', '/insights/by-time', filter);
export const fetchInsightsByWorkflow = async (
context: IRestApiContext,