fix: convert Response wrapper interfaces to direct array types
Backend APIs return arrays directly, not { data, total } wrappers.
Changed 21 interface declarations to type aliases matching actual
API response format.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
10e0b0ce29
commit
146d271dc3
|
|
@ -34,10 +34,7 @@ interface HookFormData {
|
||||||
description: string;
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface HooksResponse {
|
type HooksResponse = HookScript[];
|
||||||
data: HookScript[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Constants
|
// Constants
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,7 @@ interface SkillFormData {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SkillsResponse {
|
type SkillsResponse = Skill[];
|
||||||
data: Skill[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Constants
|
// Constants
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,7 @@ interface AuditLog {
|
||||||
detail: Record<string, unknown>;
|
detail: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AuditLogsResponse {
|
type AuditLogsResponse = AuditLog[];
|
||||||
data: AuditLog[];
|
|
||||||
total: number;
|
|
||||||
page: number;
|
|
||||||
pageSize: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Filters {
|
interface Filters {
|
||||||
dateFrom: string;
|
dateFrom: string;
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,9 @@ interface SessionEvent {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SessionsResponse {
|
type SessionsResponse = AgentSession[];
|
||||||
data: AgentSession[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SessionEventsResponse {
|
type SessionEventsResponse = SessionEvent[];
|
||||||
data: SessionEvent[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Filters {
|
interface Filters {
|
||||||
dateFrom: string;
|
dateFrom: string;
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,7 @@ interface AlertEvent {
|
||||||
resolvedAt?: string;
|
resolvedAt?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AlertEventsResponse {
|
type AlertEventsResponse = AlertEvent[];
|
||||||
data: AlertEvent[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AlertRuleFormData {
|
interface AlertRuleFormData {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,7 @@ interface AlertRuleFormData {
|
||||||
targetServers: string;
|
targetServers: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AlertRulesResponse {
|
type AlertRulesResponse = AlertRule[];
|
||||||
data: AlertRule[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Constants
|
// Constants
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,7 @@ interface HealthCheckResult {
|
||||||
message?: string;
|
message?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface HealthChecksResponse {
|
type HealthChecksResponse = HealthCheckResult[];
|
||||||
data: HealthCheckResult[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
type StatusFilter = 'all' | 'healthy' | 'degraded' | 'down';
|
type StatusFilter = 'all' | 'healthy' | 'degraded' | 'down';
|
||||||
type RefreshInterval = 0 | 10 | 30 | 60;
|
type RefreshInterval = 0 | 10 | 30 | 60;
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,9 @@ interface ServerMetric {
|
||||||
lastCheckedAt: string;
|
lastCheckedAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MetricsOverviewResponse {
|
type MetricsOverviewResponse = MetricsOverview;
|
||||||
data: MetricsOverview;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ServerMetricsResponse {
|
type ServerMetricsResponse = ServerMetric[];
|
||||||
data: ServerMetric[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
type EnvironmentFilter = 'all' | 'dev' | 'staging' | 'prod';
|
type EnvironmentFilter = 'all' | 'dev' | 'staging' | 'prod';
|
||||||
type StatusFilter = 'all' | 'online' | 'offline';
|
type StatusFilter = 'all' | 'online' | 'offline';
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,7 @@ interface Credential {
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CredentialsResponse {
|
type CredentialsResponse = Credential[];
|
||||||
data: Credential[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CredentialFormData {
|
interface CredentialFormData {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,7 @@ interface PermissionMatrixEntry {
|
||||||
granted: boolean;
|
granted: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PermissionsResponse {
|
type PermissionsResponse = Permission[];
|
||||||
data: Permission[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MatrixResponse {
|
interface MatrixResponse {
|
||||||
roles: Role[];
|
roles: Role[];
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,7 @@ interface RiskRuleFormData {
|
||||||
description: string;
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RiskRulesResponse {
|
type RiskRulesResponse = RiskRule[];
|
||||||
data: RiskRule[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Role = 'admin' | 'operator' | 'viewer' | 'readonly';
|
type Role = 'admin' | 'operator' | 'viewer' | 'readonly';
|
||||||
type Permission =
|
type Permission =
|
||||||
|
|
|
||||||
|
|
@ -29,18 +29,11 @@ interface Role {
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RolesResponse {
|
type RolesResponse = Role[];
|
||||||
data: Role[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RolePermissionsResponse {
|
type RolePermissionsResponse = Permission[];
|
||||||
data: Permission[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PermissionsListResponse {
|
type PermissionsListResponse = Permission[];
|
||||||
data: Permission[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RoleFormData {
|
interface RoleFormData {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,9 @@ interface RecentCommand {
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface HealthChecksResponse {
|
type HealthChecksResponse = HealthCheck[];
|
||||||
data: HealthCheck[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RecentCommandsResponse {
|
type RecentCommandsResponse = RecentCommand[];
|
||||||
data: RecentCommand[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Status badge
|
// Status badge
|
||||||
|
|
|
||||||
|
|
@ -32,15 +32,9 @@ interface Server {
|
||||||
environment: string;
|
environment: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ClustersResponse {
|
type ClustersResponse = Cluster[];
|
||||||
data: Cluster[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ServersResponse {
|
type ServersResponse = Server[];
|
||||||
data: Server[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ClusterFormData {
|
interface ClusterFormData {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,7 @@ interface SessionEvent {
|
||||||
content: string;
|
content: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SessionEventsResponse {
|
type SessionEventsResponse = SessionEvent[];
|
||||||
data: SessionEvent[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SessionTask {
|
interface SessionTask {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -43,9 +41,7 @@ interface SessionTask {
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SessionTasksResponse {
|
type SessionTasksResponse = SessionTask[];
|
||||||
data: SessionTask[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Constants
|
// Constants
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,7 @@ interface StandingOrderStats {
|
||||||
lastFailureAt?: string;
|
lastFailureAt?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ExecutionsResponse {
|
type ExecutionsResponse = StandingOrderExecution[];
|
||||||
data: StandingOrderExecution[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,7 @@ interface TenantMember {
|
||||||
joinedAt: string;
|
joinedAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TenantMembersResponse {
|
type TenantMembersResponse = TenantMember[];
|
||||||
data: TenantMember[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TenantInvite {
|
interface TenantInvite {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,7 @@ interface Server {
|
||||||
environment: string;
|
environment: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ServersResponse {
|
type ServersResponse = Server[];
|
||||||
data: Server[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TerminalLine {
|
interface TerminalLine {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,7 @@ interface ActivityEntry {
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ActivityResponse {
|
type ActivityResponse = ActivityEntry[];
|
||||||
data: ActivityEntry[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EditFormData {
|
interface EditFormData {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,7 @@ interface User {
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UsersResponse {
|
type UsersResponse = User[];
|
||||||
data: User[];
|
|
||||||
total: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface UserFormData {
|
interface UserFormData {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue