mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
refactor: rclone system capability
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
browseFilesystem,
|
||||
listRepositories,
|
||||
createRepository,
|
||||
listRcloneRemotes,
|
||||
deleteRepository,
|
||||
getRepository,
|
||||
listSnapshots,
|
||||
@@ -29,7 +30,6 @@ import {
|
||||
listSnapshotFiles,
|
||||
restoreSnapshot,
|
||||
doctorRepository,
|
||||
listRcloneRemotes,
|
||||
listBackupSchedules,
|
||||
createBackupSchedule,
|
||||
deleteBackupSchedule,
|
||||
@@ -75,6 +75,7 @@ import type {
|
||||
ListRepositoriesData,
|
||||
CreateRepositoryData,
|
||||
CreateRepositoryResponse,
|
||||
ListRcloneRemotesData,
|
||||
DeleteRepositoryData,
|
||||
DeleteRepositoryResponse,
|
||||
GetRepositoryData,
|
||||
@@ -85,7 +86,6 @@ import type {
|
||||
RestoreSnapshotResponse,
|
||||
DoctorRepositoryData,
|
||||
DoctorRepositoryResponse,
|
||||
ListRcloneRemotesData,
|
||||
ListBackupSchedulesData,
|
||||
CreateBackupScheduleData,
|
||||
CreateBackupScheduleResponse,
|
||||
@@ -739,6 +739,27 @@ export const createRepositoryMutation = (
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const listRcloneRemotesQueryKey = (options?: Options<ListRcloneRemotesData>) =>
|
||||
createQueryKey("listRcloneRemotes", options);
|
||||
|
||||
/**
|
||||
* List all configured rclone remotes on the host system
|
||||
*/
|
||||
export const listRcloneRemotesOptions = (options?: Options<ListRcloneRemotesData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listRcloneRemotes({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listRcloneRemotesQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete a repository
|
||||
*/
|
||||
@@ -920,27 +941,6 @@ export const doctorRepositoryMutation = (
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const listRcloneRemotesQueryKey = (options?: Options<ListRcloneRemotesData>) =>
|
||||
createQueryKey("listRcloneRemotes", options);
|
||||
|
||||
/**
|
||||
* List all configured rclone remotes on the host system
|
||||
*/
|
||||
export const listRcloneRemotesOptions = (options?: Options<ListRcloneRemotesData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listRcloneRemotes({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listRcloneRemotesQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const listBackupSchedulesQueryKey = (options?: Options<ListBackupSchedulesData>) =>
|
||||
createQueryKey("listBackupSchedules", options);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user