beps/event-auditor: format + switch to 0011

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-08-21 00:14:47 +02:00
parent f51d611d0c
commit 55cca917c3
@@ -115,12 +115,16 @@ export type AuditEventFailureStatus<E = ErrorLike> = {
errors: E[];
};
export type AuditEventStatus = AuditEventSuccessStatus | AuditEventFailureStatus | undefined;
export type AuditEventStatus =
| AuditEventSuccessStatus
| AuditEventFailureStatus
| undefined;
```
#### EventAuditor Interface
This interface defines the functionalities of an `EventAuditor` class. This class provides methods for:
- Extracting the actor ID from an Express request (if available).
- Creating detailed audit event information based on provided options.
- Logging an audit event with a specific level (info, debug, warn, or error).
@@ -139,7 +143,7 @@ export type AuditEventOptions = AuditEventStatus & {
metadata?: JsonValue;
response?: AuditResponse;
request?: Request;
} & ({ actorId: string; } | { credentials: BackstageCredentials } | undefined);
} & ({ actorId: string } | { credentials: BackstageCredentials } | undefined);
export type AuditEvent = {
actor: ActorDetails;