Initial Commit

This commit is contained in:
2026-05-20 11:52:18 -04:00
commit ed0f93036d
703 changed files with 81299 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
const BASE = '/api'
export async function apiFetch(path, options = {}) {
const res = await fetch(`${BASE}${path}`, {
headers: { 'Content-Type': 'application/json', ...options.headers },
...options,
})
if (!res.ok) {
const text = await res.text().catch(() => res.statusText)
throw new Error(text || res.statusText)
}
return res.json()
}
export const getStats = () => apiFetch('/stats')
export const getTests = (params = {}) => {
const qs = new URLSearchParams(
Object.entries(params).filter(([, v]) => v !== '' && v !== undefined && v !== null)
).toString()
return apiFetch(`/tests${qs ? `?${qs}` : ''}`)
}
export const getConfig = () => apiFetch('/config')
export const saveConfig = (body) => apiFetch('/config', { method: 'POST', body: JSON.stringify(body) })
export const browse = (path) => apiFetch(`/browse${path ? `?path=${encodeURIComponent(path)}` : ''}`)