bigbuffet-rw/packages/pl-api/lib/entities/notification-policy.ts
marcin mikołajczak 822e7e2287 pl-api: Add some newer Mastodon methods
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-28 00:10:25 +01:00

20 lines
790 B
TypeScript

import * as v from 'valibot';
const notificationPolicyRuleSchema = v.picklist(['accept', 'filter', 'drop']);
/** @see {@link https://docs.joinmastodon.org/entities/NotificationPolicy} */
const notificationPolicySchema = v.object({
for_not_following: notificationPolicyRuleSchema,
for_not_followers: notificationPolicyRuleSchema,
for_new_accounts: notificationPolicyRuleSchema,
for_private_mentions: notificationPolicyRuleSchema,
for_limited_accounts: notificationPolicyRuleSchema,
summary: v.object({
pending_requests_count: v.pipe(v.number(), v.integer()),
pending_notifications_count: v.pipe(v.number(), v.integer()),
}),
});
type NotificationPolicy = v.InferOutput<typeof notificationPolicySchema>;
export { notificationPolicySchema, type NotificationPolicy };