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
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:
parent
66f95dcd8e
commit
bb7d650bcd
2 changed files with 8 additions and 4 deletions
|
|
@ -30,13 +30,13 @@ export const resticBackupOutputSchema = resticBackupRunSummarySchema.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
export const resticBackupProgressMetricsSchema = z.object({
|
export const resticBackupProgressMetricsSchema = z.object({
|
||||||
seconds_elapsed: z.number(),
|
seconds_elapsed: z.number().default(0),
|
||||||
seconds_remaining: z.number().default(0),
|
seconds_remaining: z.number().default(0),
|
||||||
percent_done: z.number(),
|
percent_done: z.number(),
|
||||||
total_files: z.number(),
|
total_files: z.number(),
|
||||||
files_done: z.number(),
|
files_done: z.number().default(0),
|
||||||
total_bytes: z.number(),
|
total_bytes: z.number(),
|
||||||
bytes_done: z.number(),
|
bytes_done: z.number().default(0),
|
||||||
current_files: z.array(z.string()).default([]),
|
current_files: z.array(z.string()).default([]),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ export const resticRestoreOutputSchema = z.object({
|
||||||
message_type: z.literal("summary"),
|
message_type: z.literal("summary"),
|
||||||
total_files: z.number().optional(),
|
total_files: z.number().optional(),
|
||||||
files_restored: z.number(),
|
files_restored: z.number(),
|
||||||
files_skipped: z.number(),
|
files_skipped: z.number().default(0),
|
||||||
total_bytes: z.number().optional(),
|
total_bytes: z.number().optional(),
|
||||||
bytes_restored: z.number().optional(),
|
bytes_restored: z.number().optional(),
|
||||||
bytes_skipped: z.number().optional(),
|
bytes_skipped: z.number().optional(),
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ export const normalizeAbsolutePath = (value?: string): string => {
|
||||||
return "/";
|
return "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (normalized.length > 1000) {
|
||||||
|
throw new Error("Normalized path is too long");
|
||||||
|
}
|
||||||
|
|
||||||
const withoutTrailingSlash = normalized.replace(/\/+$/, "");
|
const withoutTrailingSlash = normalized.replace(/\/+$/, "");
|
||||||
if (!withoutTrailingSlash) {
|
if (!withoutTrailingSlash) {
|
||||||
return "/";
|
return "/";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue