2023-03-10 10:42:49 -08:00
|
|
|
import z from 'zod';
|
|
|
|
|
2023-03-28 08:52:41 -07:00
|
|
|
import { GroupRoles } from './group-member';
|
|
|
|
|
2023-03-10 10:42:49 -08:00
|
|
|
const groupRelationshipSchema = z.object({
|
|
|
|
id: z.string(),
|
|
|
|
member: z.boolean().catch(false),
|
|
|
|
requested: z.boolean().catch(false),
|
2023-03-28 08:52:41 -07:00
|
|
|
role: z.nativeEnum(GroupRoles).catch(GroupRoles.USER),
|
2023-03-15 11:53:17 -07:00
|
|
|
blocked_by: z.boolean().catch(false),
|
|
|
|
notifying: z.boolean().nullable().catch(null),
|
2023-03-29 10:21:43 -07:00
|
|
|
pending_requests: z.boolean().catch(false),
|
2023-03-10 10:42:49 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
type GroupRelationship = z.infer<typeof groupRelationshipSchema>;
|
|
|
|
|
|
|
|
export { groupRelationshipSchema, GroupRelationship };
|