import { z } from "zod";

export const AuditLogEntrySchema = z.object({
    id: z.number(),
    time: z.number(),
    server: z.string(),
    serverOwner: z.string().nullable(),
    actor: z.string(),
    actionType: z.enum(["JOIN", "LEAVE", "COMMAND", "SENSITIVE_COMMAND", "CHAT", "GUI_OPEN", "GUI_CLOSE", "GUI_CLICK"]),
    actionText: z.string(),
});

export const PagedAutidLogSchema = z.object({
    entries: z.array(AuditLogEntrySchema),
    rows: z.number(),
});

export type AuditLogEntry = z.infer<typeof AuditLogEntrySchema>;
export type PagedAuditLog = z.infer<typeof PagedAutidLogSchema>;
