2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
import { dateSchema, mimeSchema } from './utils';
|
|
|
|
|
|
|
|
/** @see {@link https://docs.pleroma.social/backend/development/API/pleroma_api/#post-apiv1pleromabackups} */
|
2024-10-13 15:25:30 -07:00
|
|
|
const backupSchema = v.object({
|
2024-08-28 04:43:23 -07:00
|
|
|
id: z.coerce.string(),
|
|
|
|
contentType: mimeSchema,
|
2024-10-13 15:25:30 -07:00
|
|
|
file_size: v.fallback(v.number(), 0),
|
2024-08-28 04:43:23 -07:00
|
|
|
inserted_at: dateSchema,
|
2024-10-13 15:25:30 -07:00
|
|
|
processed: v.fallback(v.boolean(), false),
|
|
|
|
url: v.fallback(v.string(), ''),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type Backup = v.InferOutput<typeof backupSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { backupSchema, type Backup };
|