feat: add shared dashboard API contracts
This commit is contained in:
1 parent
939cf408a0
commit
59c3a61a88
14 files changed
+648
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ActivityTypeSchema = z.union([
|
||||
z.literal('sent'),
|
||||
z.literal('skipped'),
|
||||
z.literal('response'),
|
||||
z.literal('error'),
|
||||
z.literal('info'),
|
||||
z.literal('debug'),
|
||||
]);
|
||||
|
||||
export const ActivityItemSchema = z.strictObject({
|
||||
timestamp: z.number(),
|
||||
type: ActivityTypeSchema,
|
||||
message: z.string(),
|
||||
recipient: z.string().optional(),
|
||||
imageUrl: z.string().optional(),
|
||||
});
|
||||
|
||||
export const ActivityResponseSchema = z.array(ActivityItemSchema);
|
||||
export type ActivityItem = z.infer<typeof ActivityItemSchema>;
|
||||
Reference in new issue
Block a user