feat(snapshots): list files in snapshots api

This commit is contained in:
Nicolas Meienberger
2025-10-30 18:58:57 +01:00
parent ed73ca73fb
commit b80a187108
8 changed files with 251 additions and 2 deletions

View File

@@ -50,6 +50,8 @@ import type {
GetRepositoryResponses,
ListSnapshotsData,
ListSnapshotsResponses,
ListSnapshotFilesData,
ListSnapshotFilesResponses,
ListBackupSchedulesData,
ListBackupSchedulesResponses,
CreateBackupScheduleData,
@@ -348,6 +350,18 @@ export const listSnapshots = <ThrowOnError extends boolean = false>(
});
};
/**
* List files and directories in a snapshot
*/
export const listSnapshotFiles = <ThrowOnError extends boolean = false>(
options: Options<ListSnapshotFilesData, ThrowOnError>,
) => {
return (options.client ?? _heyApiClient).get<ListSnapshotFilesResponses, unknown, ThrowOnError>({
url: "/api/v1/repositories/{name}/snapshots/{snapshotId}/files",
...options,
});
};
/**
* List all backup schedules
*/