/** * Audit action vocabulary, shared so the server writes and the client renders * the same strings. Values are stored in the database, so renaming one * rewrites history — add new actions instead. */ export const AUDIT_ACTIONS = [ 'space.update', 'space.transfer_ownership', 'channel.create', 'channel.update', 'channel.delete', 'member.kick', 'member.leave', 'member.ban', 'member.unban', 'role.create', 'role.update', 'role.delete', 'invite.create', 'message.delete', ] as const; export type AuditAction = (typeof AUDIT_ACTIONS)[number]; export interface AuditEventActor { id: string; username: string; displayName: string | null; avatar: string | null; } export interface AuditEvent { id: string; spaceId: string; action: AuditAction; actor: AuditEventActor | null; targetType: string | null; targetId: string | null; /** Shape depends on `action`; used for display only. */ metadata: Record | null; createdAt: number; } export const AUDIT_PAGE_SIZE = 50;