import { apiClient, USE_MOCK } from "@/services/apiClient"; import * as mock from "@/services/mock/mockData"; import type { IngestFolderRequest, IngestFolderResponse, IngestionRun } from "@/services/types"; export async function ingestFolder(req: IngestFolderRequest): Promise { if (USE_MOCK) { await new Promise((r) => setTimeout(r, 600)); return { run_id: crypto.randomUUID(), discovered: 78, queued: 72, skipped_duplicates: 4, invalid_files: 2, }; } const { data } = await apiClient.post("/ingest/folder", req); return data; } export async function listRuns(): Promise { if (USE_MOCK) { await new Promise((r) => setTimeout(r, 220)); return mock.ingestionRuns; } const { data } = await apiClient.get("/ingest/runs"); return data; }