bigbuffet-rw/packages/pl-api/lib/entities/group-relationship.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

14 lines
420 B
TypeScript

import * as v from 'valibot';
import { GroupRoles } from './group-member';
const groupRelationshipSchema = v.object({
id: v.string(),
member: v.fallback(v.boolean(), false),
role: v.fallback(v.enum(GroupRoles), GroupRoles.USER),
requested: v.fallback(v.boolean(), false),
});
type GroupRelationship = v.InferOutput<typeof groupRelationshipSchema>;
export { groupRelationshipSchema, type GroupRelationship };