feat: add functional authentication
This commit is contained in:
21
api/stores/event-store/events/auditor.ts
Normal file
21
api/stores/event-store/events/auditor.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import z from "zod";
|
||||
|
||||
export const AuditorSchema = z.object({
|
||||
auditor: z.union([
|
||||
z.object({
|
||||
type: z.literal("system"),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal("account"),
|
||||
accountId: z.string(),
|
||||
}),
|
||||
]),
|
||||
});
|
||||
|
||||
export const systemAuditor: Auditor = {
|
||||
auditor: {
|
||||
type: "system",
|
||||
},
|
||||
};
|
||||
|
||||
export type Auditor = z.infer<typeof AuditorSchema>;
|
||||
Reference in New Issue
Block a user