mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
3e22b89fa2
Summary: Adds machinery to support audit logging in the backend. Logging is currently implemented by streaming events to external HTTP endpoints. All flavors of Grist support a default "grist" payload format, and Grist Enterprise additionally supports an HEC-compatible payload format. Logging of all audit events will be added at a later date. Test Plan: Server tests. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D4331
32 lines
718 B
TypeScript
32 lines
718 B
TypeScript
export interface AuditEvent<Name extends AuditEventName> {
|
|
event: {
|
|
/** The event name. */
|
|
name: Name;
|
|
/** The user that triggered the event. */
|
|
user: AuditEventUser | null;
|
|
/** Additional event details. */
|
|
details: AuditEventDetails[Name] | null;
|
|
};
|
|
/** ISO 8601 timestamp of when the event was logged. */
|
|
timestamp: string;
|
|
}
|
|
|
|
export type AuditEventName =
|
|
| 'createDocument';
|
|
|
|
export interface AuditEventUser {
|
|
/** The user's id. */
|
|
id: number | null;
|
|
/** The user's email address. */
|
|
email: string | null;
|
|
/** The user's name. */
|
|
name: string | null;
|
|
}
|
|
|
|
export interface AuditEventDetails {
|
|
createDocument: {
|
|
/** The ID of the document. */
|
|
id: string;
|
|
};
|
|
}
|