This commit is contained in:
Tomas Dvorak
2025-11-11 10:29:30 +01:00
parent d5b4faea61
commit 8762bde4bf
139 changed files with 7240 additions and 2870 deletions
+72
View File
@@ -0,0 +1,72 @@
import api from './api';
export interface ErrorEvent {
id: number;
origin: string;
language?: string;
severity?: string;
message: string;
stack?: string;
component?: string;
file?: string;
line?: number;
column?: number;
url?: string;
method?: string;
status?: number;
request_id?: string;
user_id?: number;
session_token?: string;
tags?: Record<string, any> | null;
context?: Record<string, any> | null;
env?: string;
version?: string;
hostname?: string;
occurred_at: string;
created_at: string;
}
export interface ErrorListResponse {
items: ErrorEvent[];
total: number;
}
export async function getErrors(params?: {
origin?: string;
severity?: string;
method?: string;
status?: string | number;
search?: string;
from?: string; // ISO
to?: string; // ISO
page?: number;
limit?: number;
}): Promise<ErrorListResponse> {
const res = await api.get('/admin/errors', { params });
return res.data as ErrorListResponse;
}
export async function getError(id: number): Promise<ErrorEvent> {
const res = await api.get(`/admin/errors/${id}`);
return res.data as ErrorEvent;
}
export async function getExternalErrors(params?: {
origin?: string;
severity?: string;
method?: string;
status?: string | number;
search?: string;
from?: string; // ISO
to?: string; // ISO
page?: number;
limit?: number;
}): Promise<ErrorListResponse> {
const res = await api.get('/admin/errors/external', { params });
return res.data as ErrorListResponse;
}
export async function getExternalError(id: number): Promise<ErrorEvent> {
const res = await api.get(`/admin/errors/external/${id}`);
return res.data as ErrorEvent;
}