bigbuffet-rw/packages/pl-api/lib/entities/backup.ts
marcin mikołajczak 036fa32cd3 Add pl-api to workspace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:43:23 +02:00

19 lines
545 B
TypeScript

import { z } from 'zod';
import { dateSchema, mimeSchema } from './utils';
import type { Resolve } from '../utils/types';
/** @see {@link https://docs.pleroma.social/backend/development/API/pleroma_api/#post-apiv1pleromabackups} */
const backupSchema = z.object({
id: z.coerce.string(),
contentType: mimeSchema,
file_size: z.number().catch(0),
inserted_at: dateSchema,
processed: z.boolean().catch(false),
url: z.string().catch(''),
});
type Backup = Resolve<z.infer<typeof backupSchema>>;
export { backupSchema, type Backup };