feat: add shared dashboard API contracts

This commit is contained in:
jjbrunton committed 2026-08-08 14:52:06 +01:00
1 parent 939cf408a0
commit 59c3a61a88
14 files changed
+648

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
import { z } from 'zod';
export const SentMessageSchema = z.strictObject({
id: z.number(),
postId: z.string().nullable(),
recipient: z.string(),
subject: z.string(),
message: z.string(),
sentAt: z.number(),
gotResponse: z.boolean(),
responseCheckedAt: z.number().nullable(),
strategyId: z.string().nullable(),
chatRoomId: z.string().nullable(),
subreddit: z.string().optional(),
postTitle: z.string().optional(),
postImageUrl: z.string().optional(),
postImageAnalysis: z.string().optional(),
});
export const MessagesResponseSchema = z.array(SentMessageSchema);
export const SuccessfulExampleSchema = z.strictObject({
id: z.number(),
sentMessageId: z.number().nullable(),
originalMessage: z.string(),
imageAnalysis: z.string().nullable(),
postTitle: z.string().nullable(),
responseSnippet: z.string().nullable(),
subreddit: z.string().nullable(),
createdAt: z.number(),
});
export const SuccessfulExamplesResponseSchema = z.array(SuccessfulExampleSchema);
export type SentMessage = z.infer<typeof SentMessageSchema>;
export type SuccessfulExample = z.infer<typeof SuccessfulExampleSchema>;