34 lines
915 B
TypeScript
34 lines
915 B
TypeScript
import { z } from 'zod';
|
|
import { RedditAccountOwnerSchema } from './session.js';
|
|
|
|
export const AttentionKindSchema = z.enum([
|
|
'human-required',
|
|
'boundary',
|
|
'failed-delivery',
|
|
'account-login-required',
|
|
'account-suspended',
|
|
'runtime-failed',
|
|
'invitation-cooldown',
|
|
'account-unestablished',
|
|
]);
|
|
|
|
export const AttentionItemSchema = z.strictObject({
|
|
id: z.string(),
|
|
kind: AttentionKindSchema,
|
|
severity: z.enum(['warning', 'critical']),
|
|
title: z.string(),
|
|
detail: z.string(),
|
|
occurredAt: z.number(),
|
|
owner: RedditAccountOwnerSchema.optional(),
|
|
conversationId: z.string().optional(),
|
|
username: z.string().optional(),
|
|
});
|
|
|
|
export const AttentionResponseSchema = z.strictObject({
|
|
generatedAt: z.number(),
|
|
items: z.array(AttentionItemSchema),
|
|
});
|
|
|
|
export type AttentionItem = z.infer<typeof AttentionItemSchema>;
|
|
export type AttentionResponse = z.infer<typeof AttentionResponseSchema>;
|