chore: default values in schemas
Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / checks (push) Has been cancelled
Release Workflow / e2e-tests (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled

This commit is contained in:
Nicolas Meienberger 2026-03-12 22:34:00 +01:00
parent 66f95dcd8e
commit bb7d650bcd
2 changed files with 8 additions and 4 deletions

View file

@ -30,13 +30,13 @@ export const resticBackupOutputSchema = resticBackupRunSummarySchema.extend({
});
export const resticBackupProgressMetricsSchema = z.object({
seconds_elapsed: z.number(),
seconds_elapsed: z.number().default(0),
seconds_remaining: z.number().default(0),
percent_done: z.number(),
total_files: z.number(),
files_done: z.number(),
files_done: z.number().default(0),
total_bytes: z.number(),
bytes_done: z.number(),
bytes_done: z.number().default(0),
current_files: z.array(z.string()).default([]),
});
@ -48,7 +48,7 @@ export const resticRestoreOutputSchema = z.object({
message_type: z.literal("summary"),
total_files: z.number().optional(),
files_restored: z.number(),
files_skipped: z.number(),
files_skipped: z.number().default(0),
total_bytes: z.number().optional(),
bytes_restored: z.number().optional(),
bytes_skipped: z.number().optional(),

View file

@ -32,6 +32,10 @@ export const normalizeAbsolutePath = (value?: string): string => {
return "/";
}
if (normalized.length > 1000) {
throw new Error("Normalized path is too long");
}
const withoutTrailingSlash = normalized.replace(/\/+$/, "");
if (!withoutTrailingSlash) {
return "/";