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,15 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ErrorResponseSchema = z.strictObject({
|
||||
error: z.string(),
|
||||
detail: z.unknown().optional(),
|
||||
});
|
||||
|
||||
export const SuccessResponseSchema = z.strictObject({ success: z.literal(true) });
|
||||
export const RejectedActionResponseSchema = z.strictObject({
|
||||
success: z.literal(false),
|
||||
reason: z.string(),
|
||||
});
|
||||
|
||||
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
||||
export type SuccessResponse = z.infer<typeof SuccessResponseSchema>;
|
||||
Reference in new issue
Block a user