Files
cameleer-server/ui/src/api/schema.d.ts

257 lines
5.3 KiB
TypeScript
Raw Normal View History

/**
* Types matching the cameleer3 server REST API (validated against live OpenAPI spec).
* Generated from: GET /api/v1/api-docs
*/
export interface paths {
'/auth/login': {
post: {
requestBody: {
content: {
'application/json': {
username: string;
password: string;
};
};
};
responses: {
200: {
content: {
'application/json': {
accessToken: string;
refreshToken: string;
};
};
};
401: { content: { 'application/json': { message: string } } };
};
};
};
'/auth/refresh': {
post: {
requestBody: {
content: {
'application/json': {
refreshToken: string;
};
};
};
responses: {
200: {
content: {
'application/json': {
accessToken: string;
refreshToken: string;
};
};
};
401: { content: { 'application/json': { message: string } } };
};
};
};
'/search/executions': {
post: {
requestBody: {
content: {
'application/json': SearchRequest;
};
};
responses: {
200: {
content: {
'application/json': SearchResponse;
};
};
};
};
};
'/executions/{executionId}': {
get: {
parameters: {
path: { executionId: string };
};
responses: {
200: {
content: {
'application/json': ExecutionDetail;
};
};
404: { content: { 'application/json': { message: string } } };
};
};
};
'/executions/{executionId}/processors/{index}/snapshot': {
get: {
parameters: {
path: { executionId: string; index: number };
};
responses: {
200: {
content: {
'application/json': ProcessorSnapshot;
};
};
404: { content: { 'application/json': { message: string } } };
};
};
};
'/search/stats': {
get: {
parameters: {
query: {
from: string;
to?: string;
};
};
responses: {
200: {
content: {
'application/json': ExecutionStats;
};
};
};
};
};
'/search/stats/timeseries': {
get: {
parameters: {
query: {
from: string;
to?: string;
buckets?: number;
};
};
responses: {
200: {
content: {
'application/json': StatsTimeseries;
};
};
};
};
};
'/agents': {
get: {
parameters: {
query?: { status?: string };
};
responses: {
200: {
content: {
'application/json': AgentInstance[];
};
};
};
};
};
}
export interface SearchRequest {
status?: string | null;
timeFrom?: string | null;
timeTo?: string | null;
durationMin?: number | null;
durationMax?: number | null;
correlationId?: string | null;
text?: string | null;
textInBody?: string | null;
textInHeaders?: string | null;
textInErrors?: string | null;
routeId?: string | null;
agentId?: string | null;
processorType?: string | null;
offset?: number;
limit?: number;
}
export interface SearchResponse {
data: ExecutionSummary[];
total: number;
offset: number;
limit: number;
}
export interface ExecutionSummary {
executionId: string;
routeId: string;
agentId: string;
status: string;
startTime: string;
endTime: string | null;
durationMs: number;
correlationId: string | null;
errorMessage: string | null;
diagramContentHash: string | null;
}
export interface ExecutionDetail {
executionId: string;
routeId: string;
agentId: string;
status: string;
startTime: string;
endTime: string | null;
durationMs: number;
correlationId: string | null;
exchangeId: string | null;
errorMessage: string | null;
errorStackTrace: string | null;
diagramContentHash: string | null;
processors: ProcessorNode[];
}
export interface ProcessorNode {
processorId: string;
processorType: string;
status: string;
startTime: string;
endTime: string | null;
durationMs: number;
diagramNodeId: string | null;
errorMessage: string | null;
errorStackTrace: string | null;
children: ProcessorNode[];
}
/** Processor snapshot is a flat key-value map (Map<String, String> in Java) */
export type ProcessorSnapshot = Record<string, string>;
export interface ExecutionStats {
totalCount: number;
failedCount: number;
avgDurationMs: number;
p99LatencyMs: number;
activeCount: number;
totalToday: number;
prevTotalCount: number;
prevFailedCount: number;
prevAvgDurationMs: number;
prevP99LatencyMs: number;
}
export interface StatsTimeseries {
buckets: TimeseriesBucket[];
}
export interface TimeseriesBucket {
time: string;
totalCount: number;
failedCount: number;
avgDurationMs: number;
p99DurationMs: number;
activeCount: number;
}
export interface AgentInstance {
id: string;
name: string;
group: string;
version: string;
routeIds: string[];
capabilities: Record<string, boolean>;
state: 'LIVE' | 'STALE' | 'DEAD';
registeredAt: string;
lastHeartbeat: string;
staleTransitionTime: string | null;
}