bigbuffet-rw/packages/pl-api/lib/entities/directory/statistics-period.ts
marcin mikołajczak b29b488d7e pl-api: moar blind search and replace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-15 00:07:22 +02:00

12 lines
562 B
TypeScript

import * as v from 'valibot';
const directoryStatisticsPeriodSchema = v.object({
period: v.pipe(v.string(), v.isoDate()),
server_count: v.fallback(v.nullable(v.pipe(v.unknown(), v.transform(Number))), null),
user_count: v.fallback(v.nullable(v.pipe(v.unknown(), v.transform(Number))), null),
active_user_count: v.fallback(v.nullable(v.pipe(v.unknown(), v.transform(Number))), null),
});
type DirectoryStatisticsPeriod = v.InferOutput<typeof directoryStatisticsPeriodSchema>;
export { directoryStatisticsPeriodSchema, type DirectoryStatisticsPeriod };