2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
|
|
|
* @category Admin schemas
|
|
|
|
* @see {@link https://docs.joinmastodon.org/entities/Admin_Dimension/}
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const adminDimensionSchema = v.object({
|
|
|
|
key: v.string(),
|
|
|
|
data: v.object({
|
|
|
|
key: v.string(),
|
|
|
|
human_key: v.string(),
|
|
|
|
value: v.string(),
|
|
|
|
unit: v.fallback(v.optional(v.string()), undefined),
|
|
|
|
human_value: v.fallback(v.optional(v.string()), undefined),
|
2024-08-28 04:43:23 -07:00
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
2024-11-29 07:01:54 -08:00
|
|
|
* @category Admin entity types
|
2024-11-29 06:52:33 -08:00
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type AdminDimension = v.InferOutput<typeof adminDimensionSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export {
|
|
|
|
adminDimensionSchema,
|
|
|
|
type AdminDimension,
|
|
|
|
};
|