2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
import { dateSchema } from './utils';
|
|
|
|
|
|
|
|
import { accountSchema, statusSchema } from '.';
|
|
|
|
|
|
|
|
/** @see {@link https://docs.joinmastodon.org/entities/NotificationRequest} */
|
2024-10-13 15:25:30 -07:00
|
|
|
const notificationRequestSchema = v.object({
|
|
|
|
id: v.string(),
|
2024-08-28 04:43:23 -07:00
|
|
|
created_at: dateSchema,
|
|
|
|
updated_at: dateSchema,
|
|
|
|
account: accountSchema,
|
|
|
|
notifications_count: z.coerce.string(),
|
2024-10-14 11:54:44 -07:00
|
|
|
last_status: v.fallback(v.optional(statusSchema), undefined),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type NotificationRequest = v.InferOutput<typeof notificationRequestSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { notificationRequestSchema, type NotificationRequest };
|