bigbuffet-rw/packages/pl-api/lib/entities/group-member.ts
marcin mikołajczak 2f7e149f75 pl-api: Mostly finish migration to valibot
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-16 01:08:56 +02:00

21 lines
435 B
TypeScript

import * as v from 'valibot';
import { accountSchema } from './account';
enum GroupRoles {
OWNER = 'owner',
ADMIN = 'admin',
USER = 'user'
}
type GroupRole =`${GroupRoles}`;
const groupMemberSchema = v.object({
id: v.string(),
account: accountSchema,
role: v.enum(GroupRoles),
});
type GroupMember = v.InferOutput<typeof groupMemberSchema>;
export { groupMemberSchema, type GroupMember, GroupRoles, type GroupRole };