import { apiClient } from './client';
import type { MitreTactic, MitreTechnique } from './types';

export async function searchMitreTechniques(query: string): Promise<MitreTechnique[]> {
  const { data } = await apiClient.get<MitreTechnique[]>('/mitre/techniques', {
    params: { q: query },
  });
  return data;
}

export async function getMitreMatrix(): Promise<MitreTactic[]> {
  const { data } = await apiClient.get<MitreTactic[]>('/mitre/matrix');
  return data;
}
