mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
refactor: change thumbnailSchema to schemas/mastodon.ts
This commit is contained in:
parent
f92c382da9
commit
ea24050a27
2 changed files with 13 additions and 11 deletions
|
|
@ -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 };
|
||||
Loading…
Add table
Reference in a new issue