Spaces:
Sleeping
Sleeping
File size: 749 Bytes
98fbc6d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import { z } from 'zod';
/**
* Backup API contract (admin-only) for /api/backup.
*
* The auto-backup settings body is normalised server-side by the backup
* service (parseAutoBackupBody), so this schema only pins the well-known toggle
* fields and stays permissive (passthrough) for the rest. Create/restore/delete
* carry no JSON body; their inputs are the :filename path param + the upload.
*/
export const autoBackupSettingsRequestSchema = z
.object({
enabled: z.boolean().optional(),
interval: z.string().optional(),
keep_days: z.union([z.string(), z.number()]).optional(),
time: z.string().optional(),
})
.passthrough();
export type AutoBackupSettingsRequest = z.infer<
typeof autoBackupSettingsRequestSchema
>;
|