From cd7e6bbd43f1ded45e587992be75daee2d80c74a Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Mon, 4 Nov 2024 11:10:27 -0300 Subject: [PATCH] feat: create thumbnailSchema --- src/schemas/activitypub.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/schemas/activitypub.ts b/src/schemas/activitypub.ts index f14c994f..513457d9 100644 --- a/src/schemas/activitypub.ts +++ b/src/schemas/activitypub.ts @@ -154,6 +154,16 @@ const objectSchema = z.union([ ]), ); +/** https://docs.joinmastodon.org/entities/Instance/#thumbnail */ +const thumbnailSchema = z.object({ + url: z.string().url(), + blurhash: z.string().optional(), + versions: z.object({ + '@1x': z.string().url().optional(), + '@2x': z.string().url().optional(), + }).optional(), +}); + const createNoteSchema = z.object({ type: z.literal('Create'), id: apId, @@ -318,6 +328,7 @@ export type { Note, Object, Proxy, + thumbnailSchema, Update, Zap, };