2024-05-14 09:00:05 +02:00
|
|
|
import { types } from "mime-types";
|
|
|
|
|
import { z } from "zod";
|
|
|
|
|
|
2024-05-14 21:08:46 +02:00
|
|
|
export const ContentFormatSchema = z.record(
|
2024-05-14 09:00:05 +02:00
|
|
|
z.enum(Object.values(types) as [string, ...string[]]),
|
|
|
|
|
z.object({
|
|
|
|
|
content: z.string(),
|
2024-07-16 20:01:07 +02:00
|
|
|
description: z.string().optional().nullable(),
|
|
|
|
|
size: z.number().int().nonnegative().optional().nullable(),
|
|
|
|
|
hash: z.record(z.string(), z.string()).optional().nullable(),
|
|
|
|
|
blurhash: z.string().optional().nullable(),
|
|
|
|
|
fps: z.number().int().nonnegative().optional().nullable(),
|
|
|
|
|
width: z.number().int().nonnegative().optional().nullable(),
|
|
|
|
|
height: z.number().int().nonnegative().optional().nullable(),
|
|
|
|
|
duration: z.number().nonnegative().optional().nullable(),
|
2024-05-14 09:00:05 +02:00
|
|
|
}),
|
|
|
|
|
);
|