pleroma/packages/pl-api/lib/entities/admin/cohort.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

19 lines
482 B
TypeScript

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