feat(repositories): healthchecks and doctor command

This commit is contained in:
Nicolas Meienberger
2025-11-08 10:11:07 +01:00
parent f5339d3708
commit 4dc239139f
14 changed files with 554 additions and 61 deletions

View File

@@ -56,6 +56,8 @@ import type {
ListSnapshotFilesResponses,
RestoreSnapshotData,
RestoreSnapshotResponses,
DoctorRepositoryData,
DoctorRepositoryResponses,
ListBackupSchedulesData,
ListBackupSchedulesResponses,
CreateBackupScheduleData,
@@ -408,6 +410,18 @@ export const restoreSnapshot = <ThrowOnError extends boolean = false>(
});
};
/**
* Run doctor operations on a repository to fix common issues (unlock, check, repair index). Use this when the repository is locked or has errors.
*/
export const doctorRepository = <ThrowOnError extends boolean = false>(
options: Options<DoctorRepositoryData, ThrowOnError>,
) => {
return (options.client ?? _heyApiClient).post<DoctorRepositoryResponses, unknown, ThrowOnError>({
url: "/api/v1/repositories/{name}/doctor",
...options,
});
};
/**
* List all backup schedules
*/