feat: mirror repositories (#95)

* feat: mirror repositories

feat: mirror backup repositories

* chore: pr feedbacks
This commit is contained in:
Nico
2025-12-03 20:52:47 +01:00
committed by Nicolas Meienberger
parent 780fdae63e
commit 9120153375
9 changed files with 924 additions and 830 deletions

View File

@@ -753,7 +753,7 @@ export const updateScheduleNotificationsMutation = (options?: Partial<Options<Up
return mutationOptions;
};
export const getScheduleMirrorsQueryKey = (options: Options<GetScheduleMirrorsData>) => createQueryKey('getScheduleMirrors', options);
export const getScheduleMirrorsQueryKey = (options: Options<GetScheduleMirrorsData>) => createQueryKey("getScheduleMirrors", options);
/**
* Get mirror repository assignments for a backup schedule
@@ -788,7 +788,7 @@ export const updateScheduleMirrorsMutation = (options?: Partial<Options<UpdateSc
return mutationOptions;
};
export const getMirrorCompatibilityQueryKey = (options: Options<GetMirrorCompatibilityData>) => createQueryKey('getMirrorCompatibility', options);
export const getMirrorCompatibilityQueryKey = (options: Options<GetMirrorCompatibilityData>) => createQueryKey("getMirrorCompatibility", options);
/**
* Get mirror compatibility info for all repositories relative to a backup schedule's primary repository
@@ -806,7 +806,7 @@ export const getMirrorCompatibilityOptions = (options: Options<GetMirrorCompatib
queryKey: getMirrorCompatibilityQueryKey(options)
});
export const listNotificationDestinationsQueryKey = (options?: Options<ListNotificationDestinationsData>) => createQueryKey('listNotificationDestinations', options);
export const listNotificationDestinationsQueryKey = (options?: Options<ListNotificationDestinationsData>) => createQueryKey("listNotificationDestinations", options);
/**
* List all notification destinations

View File

@@ -329,6 +329,40 @@ export const updateScheduleMirrors = <ThrowOnError extends boolean = false>(opti
*/
export const getMirrorCompatibility = <ThrowOnError extends boolean = false>(options: Options<GetMirrorCompatibilityData, ThrowOnError>) => (options.client ?? client).get<GetMirrorCompatibilityResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/mirrors/compatibility', ...options });
/**
* Get mirror repository assignments for a backup schedule
*/
export const getScheduleMirrors = <ThrowOnError extends boolean = false>(options: Options<GetScheduleMirrorsData, ThrowOnError>) => {
return (options.client ?? client).get<GetScheduleMirrorsResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/mirrors',
...options
});
};
/**
* Update mirror repository assignments for a backup schedule
*/
export const updateScheduleMirrors = <ThrowOnError extends boolean = false>(options: Options<UpdateScheduleMirrorsData, ThrowOnError>) => {
return (options.client ?? client).put<UpdateScheduleMirrorsResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/mirrors',
...options,
headers: {
'Content-Type': 'application/json',
...options.headers
}
});
};
/**
* Get mirror compatibility info for all repositories relative to a backup schedule's primary repository
*/
export const getMirrorCompatibility = <ThrowOnError extends boolean = false>(options: Options<GetMirrorCompatibilityData, ThrowOnError>) => {
return (options.client ?? client).get<GetMirrorCompatibilityResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/mirrors/compatibility',
...options
});
};
/**
* List all notification destinations
*/