bigbuffet-rw/packages/pl-api/lib/entities/admin/cohort.ts
marcin mikołajczak 036fa32cd3 Add pl-api to workspace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:43:23 +02:00

19 lines
471 B
TypeScript

import { z } from 'zod';
/** @see {@link https://docs.joinmastodon.org/entities/Admin_Cohort/} */
const adminCohortSchema = z.object({
period: z.string().datetime({ offset: true }),
frequency: z.enum(['day', 'month']),
data: z.array(z.object({
date: z.string().datetime({ offset: true }),
rate: z.number(),
value: z.number().int(),
})),
});
type AdminCohort = z.infer<typeof adminCohortSchema>;
export {
adminCohortSchema,
type AdminCohort,
};