From ea24050a27b9c1b2239622ea5ff91b5690716cca Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 5 Nov 2024 09:02:27 -0300 Subject: [PATCH] refactor: change thumbnailSchema to schemas/mastodon.ts --- src/schemas/activitypub.ts | 11 ----------- src/schemas/mastodon.ts | 13 +++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 src/schemas/mastodon.ts diff --git a/src/schemas/activitypub.ts b/src/schemas/activitypub.ts index 513457d9..f14c994f 100644 --- a/src/schemas/activitypub.ts +++ b/src/schemas/activitypub.ts @@ -154,16 +154,6 @@ 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, @@ -328,7 +318,6 @@ export type { Note, Object, Proxy, - thumbnailSchema, Update, Zap, }; diff --git a/src/schemas/mastodon.ts b/src/schemas/mastodon.ts new file mode 100644 index 00000000..bedd1aad --- /dev/null +++ b/src/schemas/mastodon.ts @@ -0,0 +1,13 @@ +import { z } from 'zod'; + +/** 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(), +}); + +export { thumbnailSchema };