import client from "./client"; export interface SyncMitreResponse { message: string; status?: string; new?: number; updated?: number; } export interface IntelScanResponse { message: string; new_items: number; } export interface SchedulerJob { id: string; name: string; next_run_time: string | null; } export interface SchedulerStatusResponse { running: boolean; jobs: SchedulerJob[]; } /** Manually trigger MITRE ATT&CK sync. */ export async function triggerMitreSync(): Promise { const { data } = await client.post("/system/sync-mitre"); return data; } /** Manually trigger threat intelligence scan. */ export async function triggerIntelScan(): Promise { const { data } = await client.post("/system/run-intel-scan"); return data; } /** Get scheduler status. */ export async function getSchedulerStatus(): Promise { const { data } = await client.get("/system/scheduler-status"); return data; } // ── ATT&CK Evaluations ───────────────────────────────────────────── export interface EvaluationRound { name: string; display_name: string; eval_round: number; imported: boolean; imported_at: string | null; tests_created: number | null; techniques_covered: number | null; } export interface EvaluationRoundsResponse { rounds: EvaluationRound[]; api_reachable: boolean; api_error: string | null; } export interface EvaluationImportResult { message: string; created: number; skipped: number; techniques_covered: number; adversary: string; eval_round: number; } export interface NewRoundCheckResult { new_round_available: boolean; already_imported: boolean; latest_round: { name: string; display_name: string; eval_round: number } | null; error?: string; } /** List all public CrowdStrike evaluation rounds with import status. */ export async function listEvaluationRounds(): Promise { const { data } = await client.get("/system/attck-evaluations/rounds"); return data; } /** Import a specific evaluation round. */ export async function importEvaluationRound(payload: { adversary_name: string; adversary_display: string; eval_round: number; }): Promise { const { data } = await client.post("/system/attck-evaluations/import", payload); return data; } /** Import the latest available round automatically. */ export async function importLatestEvaluation(): Promise { const { data } = await client.post("/system/attck-evaluations/import-latest"); return data; } /** Check if a new round is available. */ export async function checkNewEvaluationRound(): Promise { const { data } = await client.get("/system/attck-evaluations/check-new"); return data; }