bigbuffet-rw/packages/pl-api/lib/entities/notification-request.ts
marcin mikołajczak a521c9044d make pl-api compile
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-16 17:03:27 +02:00

19 lines
627 B
TypeScript

import * as v from 'valibot';
import { datetimeSchema } from './utils';
import { accountSchema, statusSchema } from '.';
/** @see {@link https://docs.joinmastodon.org/entities/NotificationRequest} */
const notificationRequestSchema = v.object({
id: v.string(),
created_at: datetimeSchema,
updated_at: datetimeSchema,
account: accountSchema,
notifications_count: v.pipe(v.unknown(), v.transform(String)),
last_status: v.fallback(v.optional(statusSchema), undefined),
});
type NotificationRequest = v.InferOutput<typeof notificationRequestSchema>;
export { notificationRequestSchema, type NotificationRequest };