bigbuffet-rw/packages/pl-api/lib/entities/group-member.ts
marcin mikołajczak a6bc160caa pl-api: Do some blind search and replace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-14 00:25:30 +02:00

21 lines
441 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: z.nativeEnum(GroupRoles),
});
type GroupMember = v.InferOutput<typeof groupMemberSchema>;
export { groupMemberSchema, type GroupMember, GroupRoles, type GroupRole };