mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-31 11:04:20 +01:00
refactor: change thumbnailSchema to schemas/mastodon.ts
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
13
src/schemas/mastodon.ts
Normal file
13
src/schemas/mastodon.ts
Normal file
@@ -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 };
|
||||
Reference in New Issue
Block a user