Fix lint/type issues

This commit is contained in:
Tuan Dang
2024-02-19 15:04:42 -08:00
parent 2336a7265b
commit 72d4490ee7
7 changed files with 21 additions and 17 deletions
@@ -15,7 +15,7 @@ export type TListProjectAuditLogDTO = {
export type TCreateAuditLogDTO = {
event: Event;
actor: UserActor | IdentityActor | ServiceActor;
actor: UserActor | IdentityActor | ServiceActor | ScimClientActor;
orgId?: string;
projectId?: string;
} & BaseAuthData;
@@ -105,6 +105,8 @@ interface IdentityActorMetadata {
name: string;
}
interface ScimClientActorMetadata {}
export interface UserActor {
type: ActorType.USER;
metadata: UserActorMetadata;
@@ -122,6 +124,7 @@ export interface IdentityActor {
export interface ScimClientActor {
type: ActorType.SCIM_CLIENT;
metadata: ScimClientActorMetadata;
}
export type Actor = UserActor | ServiceActor | IdentityActor | ScimClientActor;
+2 -1
View File
@@ -65,7 +65,8 @@ export const injectAuditLogInfo = fp(async (server: FastifyZodProvider) => {
};
} else if (req.auth.actor === ActorType.SCIM_CLIENT) {
payload.actor = {
type: ActorType.SCIM_CLIENT
type: ActorType.SCIM_CLIENT,
metadata: {}
};
} else {
throw new BadRequestError({ message: "Missing logic for other actor" });