Files
LegacyHUB/frontend/src/services/ingestion.ts
Vadim Malanov 7f72171572 chore: bootstrap repository with governance docs
Initialize git, add Apache-2.0 LICENSE, .gitattributes (LF line
endings), AGENTS.md (entry points, stack, discovery order, baseline
checks), RUNBOOK.md (dev boot, prod deploy with overlay, ingestion,
failures, rollback, scaling notes), .env.prod.example with rotated
credential placeholders, and dev-only warnings on .env.example.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:41:50 +03:00

28 lines
878 B
TypeScript

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<IngestFolderResponse> {
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<IngestFolderResponse>("/ingest/folder", req);
return data;
}
export async function listRuns(): Promise<IngestionRun[]> {
if (USE_MOCK) {
await new Promise((r) => setTimeout(r, 220));
return mock.ingestionRuns;
}
const { data } = await apiClient.get<IngestionRun[]>("/ingest/runs");
return data;
}