environments/review-zod-poll-43mlmz/deployments/3321
Alex Gleason 2023-05-03 13:40:30 -05:00
rodzic d4ed442a7e
commit f48edfba45
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ export { groupRelationshipSchema, type GroupRelationship } from './group-relatio
export { groupTagSchema, type GroupTag } from './group-tag';
export { pollSchema, type Poll, type PollOption } from './poll';
export { relationshipSchema, type Relationship } from './relationship';
export { tagSchema, type Tag } from './tag';
// Soapbox
export { adSchema, type Ad } from './soapbox/ad';

Wyświetl plik

@ -0,0 +1,18 @@
import { z } from 'zod';
const historySchema = z.object({
accounts: z.coerce.number(),
uses: z.coerce.number(),
});
/** // https://docs.joinmastodon.org/entities/tag */
const tagSchema = z.object({
name: z.string().min(1),
url: z.string().url().catch(''),
history: z.array(historySchema).nullable().catch(null),
following: z.boolean().catch(false),
});
type Tag = z.infer<typeof tagSchema>;
export { tagSchema, type Tag };