feat(snapshots): evolution API, tactic breakdown and dashboard trend chart [FASE-5.2]
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled

This commit is contained in:
2026-05-18 15:07:12 +02:00
parent 05b221a22d
commit 1249391ef0
2 changed files with 106 additions and 0 deletions

View File

@@ -12,10 +12,28 @@ export interface SnapshotSummary {
not_covered_count: number;
in_progress_count: number;
not_evaluated_count: number;
coverage_percentage?: number;
by_tactic?: Record<string, unknown>;
by_status?: Record<string, number>;
stale_count?: number;
never_tested_count?: number;
created_by: string | null;
created_at: string | null;
}
export interface CoverageEvolutionPoint {
date: string | null;
name: string | null;
org_score: number;
coverage_pct: number;
by_tactic: Record<string, unknown>;
by_status: Record<string, number>;
stale_count: number;
never_tested_count: number;
validated_count: number;
total_techniques: number;
}
export interface TechniqueState {
mitre_id: string;
technique_id: string;
@@ -76,6 +94,17 @@ export async function getSnapshot(snapshotId: string): Promise<SnapshotDetail> {
return data;
}
/** Coverage trend points for dashboard charts. */
export async function getCoverageEvolution(
months = 12,
): Promise<CoverageEvolutionPoint[]> {
const { data } = await client.get<CoverageEvolutionPoint[]>(
"/snapshots/evolution",
{ params: { months } },
);
return data;
}
/** Compare two snapshots. */
export async function compareSnapshots(
aId: string,