2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-10-16 08:03:27 -07:00
|
|
|
import { datetimeSchema } from '../utils';
|
|
|
|
|
2024-11-29 07:01:54 -08:00
|
|
|
/**
|
|
|
|
* @category Admin schemas
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const adminDomainSchema = v.object({
|
|
|
|
domain: v.fallback(v.string(), ''),
|
2024-10-14 13:50:34 -07:00
|
|
|
id: v.pipe(v.unknown(), v.transform(String)),
|
2024-10-13 15:25:30 -07:00
|
|
|
public: v.fallback(v.boolean(), false),
|
|
|
|
resolves: v.fallback(v.boolean(), false),
|
2024-10-16 08:03:27 -07:00
|
|
|
last_checked_at: v.fallback(v.nullable(datetimeSchema), null),
|
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 AdminDomain = v.InferOutput<typeof adminDomainSchema>
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { adminDomainSchema, type AdminDomain };
|