2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-30 10:28:12 -07:00
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
|
|
|
* @category Directory schemas
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const directoryStatisticsPeriodSchema = v.object({
|
2024-10-14 15:07:22 -07:00
|
|
|
period: v.pipe(v.string(), v.isoDate()),
|
2024-10-14 13:50:34 -07:00
|
|
|
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),
|
2024-08-30 10:28:12 -07:00
|
|
|
});
|
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
2024-11-29 07:01:54 -08:00
|
|
|
* @category Directory entity types
|
2024-11-29 06:52:33 -08:00
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type DirectoryStatisticsPeriod = v.InferOutput<typeof directoryStatisticsPeriodSchema>;
|
2024-08-30 10:28:12 -07:00
|
|
|
|
|
|
|
export { directoryStatisticsPeriodSchema, type DirectoryStatisticsPeriod };
|