bigbuffet-rw/packages/pl-api/lib/entities/backup.ts
mkljczk 29cd637a6b pl-fe: migrate backups to tanstack query
Signed-off-by: mkljczk <git@mkljczk.pl>
2024-12-05 11:34:58 +01:00

23 lines
608 B
TypeScript

import * as v from 'valibot';
import { datetimeSchema, mimeSchema } from './utils';
/**
* @category Schemas
* @see {@link https://docs.pleroma.social/backend/development/API/pleroma_api/#post-apiv1pleromabackups}
*/
const backupSchema = v.object({
id: v.pipe(v.unknown(), v.transform(String)),
content_type: mimeSchema,
file_size: v.fallback(v.number(), 0),
inserted_at: datetimeSchema,
processed: v.fallback(v.boolean(), false),
url: v.fallback(v.string(), ''),
});
/**
* @category Entity types
*/
type Backup = v.InferOutput<typeof backupSchema>;
export { backupSchema, type Backup };