mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
19 lines
429 B
TypeScript
19 lines
429 B
TypeScript
import { z } from 'zod';
|
|
|
|
const linkSchema = z.object({
|
|
rel: z.string().optional(),
|
|
type: z.string().optional(),
|
|
href: z.string().optional(),
|
|
template: z.string().optional(),
|
|
});
|
|
|
|
const webfingerSchema = z.object({
|
|
subject: z.string(),
|
|
aliases: z.array(z.string()).catch([]),
|
|
links: z.array(linkSchema),
|
|
});
|
|
|
|
type Webfinger = z.infer<typeof webfingerSchema>;
|
|
|
|
export { webfingerSchema };
|
|
export type { Webfinger };
|