Initial commit

This commit is contained in:
Dom
2026-03-05 01:20:15 +01:00
commit c0c50e56f0
364 changed files with 62207 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
import axios from 'axios'
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8001/api'
const client = axios.create({
baseURL: API_BASE_URL,
headers: {
'Content-Type': 'application/json'
}
})
export const api = {
// ETL endpoints
etl: {
run: (data) => client.post('/etl/run', data),
getJob: (jobId) => client.get(`/etl/jobs/${jobId}`),
listJobs: () => client.get('/etl/jobs'),
extract: (sourceTable, batchSize) =>
client.post('/etl/extract', null, { params: { source_table: sourceTable, batch_size: batchSize } }),
transform: (targetTable) =>
client.post('/etl/transform', null, { params: { target_table: targetTable } }),
load: (targetTable) =>
client.post('/etl/load', null, { params: { target_table: targetTable } })
},
// Schema endpoints
schema: {
create: (schemaType) => client.post('/schema/create', { schema_type: schemaType }),
validate: () => client.get('/schema/validate'),
info: () => client.get('/schema/info')
},
// Stats endpoints
stats: {
etl: (limit) => client.get('/stats/etl', { params: { limit } }),
dataQuality: () => client.get('/stats/data-quality'),
summary: () => client.get('/stats/summary')
},
// Validation endpoints
validation: {
run: (tableName) => client.post('/validation/run', null, { params: { table_name: tableName } }),
unmappedCodes: (limit) => client.get('/validation/unmapped-codes', { params: { limit } })
},
// Logs endpoints
logs: {
get: (lines, level) => client.get('/logs/', { params: { lines, level } }),
errors: (limit) => client.get('/logs/errors', { params: { limit } })
}
}
export default client