feat: download recovery file restic password

This commit is contained in:
Nicolas Meienberger
2025-11-08 17:52:43 +01:00
parent b289920720
commit b5ba03da3d
23 changed files with 957 additions and 27 deletions

View File

@@ -76,6 +76,9 @@ import type {
RunBackupNowResponses,
GetSystemInfoData,
GetSystemInfoResponses,
DownloadResticPasswordData,
DownloadResticPasswordResponses,
DownloadResticPasswordErrors,
} from "./types.gen";
import { client as _heyApiClient } from "./client.gen";
@@ -541,3 +544,23 @@ export const getSystemInfo = <ThrowOnError extends boolean = false>(
...options,
});
};
/**
* Download the Restic password file for backup recovery. Requires password re-authentication.
*/
export const downloadResticPassword = <ThrowOnError extends boolean = false>(
options?: Options<DownloadResticPasswordData, ThrowOnError>,
) => {
return (options?.client ?? _heyApiClient).post<
DownloadResticPasswordResponses,
DownloadResticPasswordErrors,
ThrowOnError
>({
url: "/api/v1/system/restic-password",
...options,
headers: {
"Content-Type": "application/json",
...options?.headers,
},
});
};