feat: restore to custom location (#78)

* feat: restore to custom location

* refactor: define overwrite mode in shared schema
This commit is contained in:
Nico
2025-11-29 16:53:44 +01:00
committed by GitHub
parent 58708cf35d
commit 3bf3b22b96
8 changed files with 157 additions and 33 deletions

View File

@@ -1,6 +1,12 @@
import { type } from "arktype";
import { describeRoute, resolver } from "hono-openapi";
import { COMPRESSION_MODES, REPOSITORY_BACKENDS, REPOSITORY_STATUS, repositoryConfigSchema } from "~/schemas/restic";
import {
COMPRESSION_MODES,
OVERWRITE_MODES,
REPOSITORY_BACKENDS,
REPOSITORY_STATUS,
repositoryConfigSchema,
} from "~/schemas/restic";
export const repositorySchema = type({
id: "string",
@@ -269,12 +275,16 @@ export const listSnapshotFilesDto = describeRoute({
/**
* Restore a snapshot
*/
export const overwriteModeSchema = type.valueOf(OVERWRITE_MODES);
export const restoreSnapshotBody = type({
snapshotId: "string",
include: "string[]?",
exclude: "string[]?",
excludeXattr: "string[]?",
delete: "boolean?",
targetPath: "string?",
overwrite: overwriteModeSchema.optional(),
});
export type RestoreSnapshotBody = typeof restoreSnapshotBody.infer;