mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(audit): extensible event type system with shared constants
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
export const CORE_AUDIT_EVENTS = [
|
||||
"LOGIN_SUCCESS",
|
||||
"LOGIN_FAILED",
|
||||
"LOGOUT",
|
||||
"PASSWORD_CHANGED",
|
||||
"PASSWORD_RESET",
|
||||
"USER_CREATED",
|
||||
"USER_DELETED",
|
||||
"USER_UPDATED",
|
||||
"FILE_UPLOADED",
|
||||
"FILE_DELETED",
|
||||
"API_KEY_CREATED",
|
||||
"API_KEY_DELETED",
|
||||
"ROLE_CREATED",
|
||||
"ROLE_UPDATED",
|
||||
"ROLE_DELETED",
|
||||
"SETTINGS_UPDATED",
|
||||
"OIDC_LOGIN_SUCCESS",
|
||||
"OIDC_USER_CREATED",
|
||||
"OIDC_USER_LINKED",
|
||||
"OIDC_LOGIN_FAILED",
|
||||
"TOOL_EXECUTED",
|
||||
"BATCH_EXECUTED",
|
||||
"PIPELINE_EXECUTED",
|
||||
] as const;
|
||||
|
||||
export type CoreAuditEvent = (typeof CORE_AUDIT_EVENTS)[number];
|
||||
|
||||
export const ALL_AUDIT_EVENTS = [...CORE_AUDIT_EVENTS] as string[];
|
||||
|
||||
export function registerAuditEvents(events: string[]) {
|
||||
for (const e of events) {
|
||||
if (!ALL_AUDIT_EVENTS.includes(e)) {
|
||||
ALL_AUDIT_EVENTS.push(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
export * from "./analytics/consent.js";
|
||||
export * from "./analytics/events.js";
|
||||
export * from "./analytics/types.js";
|
||||
export * from "./audit-events.js";
|
||||
export * from "./constants.js";
|
||||
export * from "./features.js";
|
||||
export * from "./i18n/index.js";
|
||||
|
||||
Reference in New Issue
Block a user