feat(frontend): audit log

This commit is contained in:
sam 2024-12-26 16:33:32 -05:00
parent 49e9eabea0
commit 53006ea313
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
11 changed files with 385 additions and 1 deletions

View file

@ -1,3 +1,6 @@
import type { Member } from "./member";
import type { PartialMember, PartialUser, User } from "./user";
export type CreateReportRequest = {
reason: ReportReason;
context: string | null;
@ -24,3 +27,35 @@ export enum ReportReason {
Advertisement = "ADVERTISEMENT",
CopyrightViolation = "COPYRIGHT_VIOLATION",
}
export type Report = {
id: string;
reporter: PartialUser;
target_user: PartialUser;
target_member?: PartialMember;
status: "OPEN" | "CLOSED";
reason: ReportReason;
context: string | null;
target_type: "USER" | "MEMBER";
snapshot: User | Member | null;
};
export type AuditLogEntry = {
id: string;
moderator: AuditLogEntity;
target_user?: AuditLogEntity;
target_member?: AuditLogEntity;
report_id?: string;
type: AuditLogEntryType;
reason: string | null;
cleared_fields?: string[];
};
export type AuditLogEntity = { id: string; username: string };
export enum AuditLogEntryType {
IgnoreReport = "IGNORE_REPORT",
WarnUser = "WARN_USER",
WarnUserAndClearProfile = "WARN_USER_AND_CLEAR_PROFILE",
SuspendUser = "SUSPEND_USER",
}