2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
/** @see {@link https://docs.joinmastodon.org/entities/NotificationPolicy} */
|
2024-10-13 15:25:30 -07:00
|
|
|
const notificationPolicySchema = v.object({
|
|
|
|
filter_not_following: v.boolean(),
|
|
|
|
filter_not_followers: v.boolean(),
|
|
|
|
filter_new_accounts: v.boolean(),
|
|
|
|
filter_private_mentions: v.boolean(),
|
|
|
|
summary: v.object({
|
2024-10-14 11:54:44 -07:00
|
|
|
pending_requests_count: v.pipe(v.number(), v.integer()),
|
|
|
|
pending_notifications_count: v.pipe(v.number(), v.integer()),
|
2024-08-28 04:43:23 -07:00
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type NotificationPolicy = v.InferOutput<typeof notificationPolicySchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { notificationPolicySchema, type NotificationPolicy };
|