diff --git a/app/client/api-client/@tanstack/react-query.gen.ts b/app/client/api-client/@tanstack/react-query.gen.ts index 88863b10..fb1c8367 100644 --- a/app/client/api-client/@tanstack/react-query.gen.ts +++ b/app/client/api-client/@tanstack/react-query.gen.ts @@ -87,12 +87,10 @@ const createQueryKey = (id: string, options?: TOptions if (options?.query) { params.query = options.query; } - return [ - params - ]; + return [params]; }; -export const getMeQueryKey = (options?: Options) => createQueryKey("getMe", options); +export const getMeQueryKey = (options?: Options) => createQueryKey('getMe', options); /** * Get current authenticated user @@ -110,7 +108,7 @@ export const getMeOptions = (options?: Options) => queryOptions) => createQueryKey("getStatus", options); +export const getStatusQueryKey = (options?: Options) => createQueryKey('getStatus', options); /** * Get authentication system status @@ -145,7 +143,7 @@ export const changePasswordMutation = (options?: Partial) => createQueryKey("listVolumes", options); +export const listVolumesQueryKey = (options?: Options) => createQueryKey('listVolumes', options); /** * List all volumes @@ -214,7 +212,7 @@ export const deleteVolumeMutation = (options?: Partial return mutationOptions; }; -export const getVolumeQueryKey = (options: Options) => createQueryKey("getVolume", options); +export const getVolumeQueryKey = (options: Options) => createQueryKey('getVolume', options); /** * Get a volume by name @@ -300,7 +298,7 @@ export const healthCheckVolumeMutation = (options?: Partial) => createQueryKey("listFiles", options); +export const listFilesQueryKey = (options: Options) => createQueryKey('listFiles', options); /** * List files in a volume directory @@ -318,7 +316,7 @@ export const listFilesOptions = (options: Options) => queryOption queryKey: listFilesQueryKey(options) }); -export const browseFilesystemQueryKey = (options?: Options) => createQueryKey("browseFilesystem", options); +export const browseFilesystemQueryKey = (options?: Options) => createQueryKey('browseFilesystem', options); /** * Browse directories on the host filesystem @@ -336,7 +334,7 @@ export const browseFilesystemOptions = (options?: Options) queryKey: browseFilesystemQueryKey(options) }); -export const listRepositoriesQueryKey = (options?: Options) => createQueryKey("listRepositories", options); +export const listRepositoriesQueryKey = (options?: Options) => createQueryKey('listRepositories', options); /** * List all repositories @@ -371,7 +369,7 @@ export const createRepositoryMutation = (options?: Partial) => createQueryKey("listRcloneRemotes", options); +export const listRcloneRemotesQueryKey = (options?: Options) => createQueryKey('listRcloneRemotes', options); /** * List all configured rclone remotes on the host system @@ -406,7 +404,7 @@ export const deleteRepositoryMutation = (options?: Partial) => createQueryKey("getRepository", options); +export const getRepositoryQueryKey = (options: Options) => createQueryKey('getRepository', options); /** * Get a single repository by name @@ -441,7 +439,7 @@ export const updateRepositoryMutation = (options?: Partial) => createQueryKey("listSnapshots", options); +export const listSnapshotsQueryKey = (options: Options) => createQueryKey('listSnapshots', options); /** * List all snapshots in a repository @@ -476,7 +474,7 @@ export const deleteSnapshotMutation = (options?: Partial) => createQueryKey("getSnapshotDetails", options); +export const getSnapshotDetailsQueryKey = (options: Options) => createQueryKey('getSnapshotDetails', options); /** * Get details of a specific snapshot @@ -494,7 +492,7 @@ export const getSnapshotDetailsOptions = (options: Options) => createQueryKey("listSnapshotFiles", options); +export const listSnapshotFilesQueryKey = (options: Options) => createQueryKey('listSnapshotFiles', options); /** * List files and directories in a snapshot @@ -546,7 +544,7 @@ export const doctorRepositoryMutation = (options?: Partial) => createQueryKey("listBackupSchedules", options); +export const listBackupSchedulesQueryKey = (options?: Options) => createQueryKey('listBackupSchedules', options); /** * List all backup schedules @@ -598,7 +596,7 @@ export const deleteBackupScheduleMutation = (options?: Partial) => createQueryKey("getBackupSchedule", options); +export const getBackupScheduleQueryKey = (options: Options) => createQueryKey('getBackupSchedule', options); /** * Get a backup schedule by ID @@ -633,7 +631,7 @@ export const updateBackupScheduleMutation = (options?: Partial) => createQueryKey("getBackupScheduleForVolume", options); +export const getBackupScheduleForVolumeQueryKey = (options: Options) => createQueryKey('getBackupScheduleForVolume', options); /** * Get a backup schedule for a specific volume @@ -702,7 +700,7 @@ export const runForgetMutation = (options?: Partial>): Us return mutationOptions; }; -export const getScheduleNotificationsQueryKey = (options: Options) => createQueryKey("getScheduleNotifications", options); +export const getScheduleNotificationsQueryKey = (options: Options) => createQueryKey('getScheduleNotifications', options); /** * Get notification assignments for a backup schedule @@ -737,7 +735,7 @@ export const updateScheduleNotificationsMutation = (options?: Partial) => createQueryKey("getScheduleMirrors", options); +export const getScheduleMirrorsQueryKey = (options: Options) => createQueryKey('getScheduleMirrors', options); /** * Get mirror repository assignments for a backup schedule @@ -772,7 +770,7 @@ export const updateScheduleMirrorsMutation = (options?: Partial) => createQueryKey("getMirrorCompatibility", options); +export const getMirrorCompatibilityQueryKey = (options: Options) => createQueryKey('getMirrorCompatibility', options); /** * Get mirror compatibility info for all repositories relative to a backup schedule's primary repository @@ -807,7 +805,7 @@ export const reorderBackupSchedulesMutation = (options?: Partial) => createQueryKey("listNotificationDestinations", options); +export const listNotificationDestinationsQueryKey = (options?: Options) => createQueryKey('listNotificationDestinations', options); /** * List all notification destinations @@ -859,7 +857,7 @@ export const deleteNotificationDestinationMutation = (options?: Partial) => createQueryKey("getNotificationDestination", options); +export const getNotificationDestinationQueryKey = (options: Options) => createQueryKey('getNotificationDestination', options); /** * Get a notification destination by ID @@ -911,7 +909,7 @@ export const testNotificationDestinationMutation = (options?: Partial) => createQueryKey("getSystemInfo", options); +export const getSystemInfoQueryKey = (options?: Options) => createQueryKey('getSystemInfo', options); /** * Get system information including available capabilities diff --git a/app/client/api-client/client.gen.ts b/app/client/api-client/client.gen.ts index d648343f..a31c7b49 100644 --- a/app/client/api-client/client.gen.ts +++ b/app/client/api-client/client.gen.ts @@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; */ export type CreateClientConfig = (override?: Config) => Config & T>; -export const client = createClient(createConfig({ - baseUrl: 'http://localhost:4096' -})); +export const client = createClient(createConfig({ baseUrl: 'http://localhost:4096' })); diff --git a/app/client/api-client/sdk.gen.ts b/app/client/api-client/sdk.gen.ts index a682452f..58fecf40 100644 --- a/app/client/api-client/sdk.gen.ts +++ b/app/client/api-client/sdk.gen.ts @@ -21,601 +21,390 @@ export type Options(options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/auth/register', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const register = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/auth/register', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * Login with username and password */ -export const login = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/auth/login', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const login = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/auth/login', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * Logout current user */ -export const logout = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/auth/logout', - ...options - }); -}; +export const logout = (options?: Options) => (options?.client ?? client).post({ url: '/api/v1/auth/logout', ...options }); /** * Get current authenticated user */ -export const getMe = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/auth/me', - ...options - }); -}; +export const getMe = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/auth/me', ...options }); /** * Get authentication system status */ -export const getStatus = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/auth/status', - ...options - }); -}; +export const getStatus = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/auth/status', ...options }); /** * Change current user password */ -export const changePassword = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/auth/change-password', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const changePassword = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/auth/change-password', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * List all volumes */ -export const listVolumes = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/volumes', - ...options - }); -}; +export const listVolumes = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/volumes', ...options }); /** * Create a new volume */ -export const createVolume = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/volumes', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const createVolume = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/volumes', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * Test connection to backend */ -export const testConnection = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/volumes/test-connection', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const testConnection = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/volumes/test-connection', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * Delete a volume */ -export const deleteVolume = (options: Options) => { - return (options.client ?? client).delete({ - url: '/api/v1/volumes/{name}', - ...options - }); -}; +export const deleteVolume = (options: Options) => (options.client ?? client).delete({ url: '/api/v1/volumes/{name}', ...options }); /** * Get a volume by name */ -export const getVolume = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/volumes/{name}', - ...options - }); -}; +export const getVolume = (options: Options) => (options.client ?? client).get({ url: '/api/v1/volumes/{name}', ...options }); /** * Update a volume's configuration */ -export const updateVolume = (options: Options) => { - return (options.client ?? client).put({ - url: '/api/v1/volumes/{name}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); -}; +export const updateVolume = (options: Options) => (options.client ?? client).put({ + url: '/api/v1/volumes/{name}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Mount a volume */ -export const mountVolume = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/volumes/{name}/mount', - ...options - }); -}; +export const mountVolume = (options: Options) => (options.client ?? client).post({ url: '/api/v1/volumes/{name}/mount', ...options }); /** * Unmount a volume */ -export const unmountVolume = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/volumes/{name}/unmount', - ...options - }); -}; +export const unmountVolume = (options: Options) => (options.client ?? client).post({ url: '/api/v1/volumes/{name}/unmount', ...options }); /** * Perform a health check on a volume */ -export const healthCheckVolume = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/volumes/{name}/health-check', - ...options - }); -}; +export const healthCheckVolume = (options: Options) => (options.client ?? client).post({ url: '/api/v1/volumes/{name}/health-check', ...options }); /** * List files in a volume directory */ -export const listFiles = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/volumes/{name}/files', - ...options - }); -}; +export const listFiles = (options: Options) => (options.client ?? client).get({ url: '/api/v1/volumes/{name}/files', ...options }); /** * Browse directories on the host filesystem */ -export const browseFilesystem = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/volumes/filesystem/browse', - ...options - }); -}; +export const browseFilesystem = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/volumes/filesystem/browse', ...options }); /** * List all repositories */ -export const listRepositories = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/repositories', - ...options - }); -}; +export const listRepositories = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/repositories', ...options }); /** * Create a new restic repository */ -export const createRepository = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/repositories', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const createRepository = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/repositories', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * List all configured rclone remotes on the host system */ -export const listRcloneRemotes = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/repositories/rclone-remotes', - ...options - }); -}; +export const listRcloneRemotes = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/repositories/rclone-remotes', ...options }); /** * Delete a repository */ -export const deleteRepository = (options: Options) => { - return (options.client ?? client).delete({ - url: '/api/v1/repositories/{name}', - ...options - }); -}; +export const deleteRepository = (options: Options) => (options.client ?? client).delete({ url: '/api/v1/repositories/{name}', ...options }); /** * Get a single repository by name */ -export const getRepository = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/repositories/{name}', - ...options - }); -}; +export const getRepository = (options: Options) => (options.client ?? client).get({ url: '/api/v1/repositories/{name}', ...options }); /** * Update a repository's name or settings */ -export const updateRepository = (options: Options) => { - return (options.client ?? client).patch({ - url: '/api/v1/repositories/{name}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); -}; +export const updateRepository = (options: Options) => (options.client ?? client).patch({ + url: '/api/v1/repositories/{name}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List all snapshots in a repository */ -export const listSnapshots = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/repositories/{name}/snapshots', - ...options - }); -}; +export const listSnapshots = (options: Options) => (options.client ?? client).get({ url: '/api/v1/repositories/{name}/snapshots', ...options }); /** * Delete a specific snapshot from a repository */ -export const deleteSnapshot = (options: Options) => { - return (options.client ?? client).delete({ - url: '/api/v1/repositories/{name}/snapshots/{snapshotId}', - ...options - }); -}; +export const deleteSnapshot = (options: Options) => (options.client ?? client).delete({ url: '/api/v1/repositories/{name}/snapshots/{snapshotId}', ...options }); /** * Get details of a specific snapshot */ -export const getSnapshotDetails = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/repositories/{name}/snapshots/{snapshotId}', - ...options - }); -}; +export const getSnapshotDetails = (options: Options) => (options.client ?? client).get({ url: '/api/v1/repositories/{name}/snapshots/{snapshotId}', ...options }); /** * List files and directories in a snapshot */ -export const listSnapshotFiles = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/repositories/{name}/snapshots/{snapshotId}/files', - ...options - }); -}; +export const listSnapshotFiles = (options: Options) => (options.client ?? client).get({ url: '/api/v1/repositories/{name}/snapshots/{snapshotId}/files', ...options }); /** * Restore a snapshot to a target path on the filesystem */ -export const restoreSnapshot = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/repositories/{name}/restore', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); -}; +export const restoreSnapshot = (options: Options) => (options.client ?? client).post({ + url: '/api/v1/repositories/{name}/restore', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * 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 = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/repositories/{name}/doctor', - ...options - }); -}; +export const doctorRepository = (options: Options) => (options.client ?? client).post({ url: '/api/v1/repositories/{name}/doctor', ...options }); /** * List all backup schedules */ -export const listBackupSchedules = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/backups', - ...options - }); -}; +export const listBackupSchedules = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/backups', ...options }); /** * Create a new backup schedule for a volume */ -export const createBackupSchedule = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/backups', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const createBackupSchedule = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/backups', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * Delete a backup schedule */ -export const deleteBackupSchedule = (options: Options) => { - return (options.client ?? client).delete({ - url: '/api/v1/backups/{scheduleId}', - ...options - }); -}; +export const deleteBackupSchedule = (options: Options) => (options.client ?? client).delete({ url: '/api/v1/backups/{scheduleId}', ...options }); /** * Get a backup schedule by ID */ -export const getBackupSchedule = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/backups/{scheduleId}', - ...options - }); -}; +export const getBackupSchedule = (options: Options) => (options.client ?? client).get({ url: '/api/v1/backups/{scheduleId}', ...options }); /** * Update a backup schedule */ -export const updateBackupSchedule = (options: Options) => { - return (options.client ?? client).patch({ - url: '/api/v1/backups/{scheduleId}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); -}; +export const updateBackupSchedule = (options: Options) => (options.client ?? client).patch({ + url: '/api/v1/backups/{scheduleId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get a backup schedule for a specific volume */ -export const getBackupScheduleForVolume = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/backups/volume/{volumeId}', - ...options - }); -}; +export const getBackupScheduleForVolume = (options: Options) => (options.client ?? client).get({ url: '/api/v1/backups/volume/{volumeId}', ...options }); /** * Trigger a backup immediately for a schedule */ -export const runBackupNow = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/backups/{scheduleId}/run', - ...options - }); -}; +export const runBackupNow = (options: Options) => (options.client ?? client).post({ url: '/api/v1/backups/{scheduleId}/run', ...options }); /** * Stop a backup that is currently in progress */ -export const stopBackup = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/backups/{scheduleId}/stop', - ...options - }); -}; +export const stopBackup = (options: Options) => (options.client ?? client).post({ url: '/api/v1/backups/{scheduleId}/stop', ...options }); /** * Manually apply retention policy to clean up old snapshots */ -export const runForget = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/backups/{scheduleId}/forget', - ...options - }); -}; +export const runForget = (options: Options) => (options.client ?? client).post({ url: '/api/v1/backups/{scheduleId}/forget', ...options }); /** * Get notification assignments for a backup schedule */ -export const getScheduleNotifications = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/backups/{scheduleId}/notifications', - ...options - }); -}; +export const getScheduleNotifications = (options: Options) => (options.client ?? client).get({ url: '/api/v1/backups/{scheduleId}/notifications', ...options }); /** * Update notification assignments for a backup schedule */ -export const updateScheduleNotifications = (options: Options) => { - return (options.client ?? client).put({ - url: '/api/v1/backups/{scheduleId}/notifications', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); -}; +export const updateScheduleNotifications = (options: Options) => (options.client ?? client).put({ + url: '/api/v1/backups/{scheduleId}/notifications', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get mirror repository assignments for a backup schedule */ -export const getScheduleMirrors = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/backups/{scheduleId}/mirrors', - ...options - }); -}; +export const getScheduleMirrors = (options: Options) => (options.client ?? client).get({ url: '/api/v1/backups/{scheduleId}/mirrors', ...options }); /** * Update mirror repository assignments for a backup schedule */ -export const updateScheduleMirrors = (options: Options) => { - return (options.client ?? client).put({ - url: '/api/v1/backups/{scheduleId}/mirrors', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); -}; +export const updateScheduleMirrors = (options: Options) => (options.client ?? client).put({ + 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 = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/backups/{scheduleId}/mirrors/compatibility', - ...options - }); -}; +export const getMirrorCompatibility = (options: Options) => (options.client ?? client).get({ url: '/api/v1/backups/{scheduleId}/mirrors/compatibility', ...options }); /** * Reorder backup schedules by providing an array of schedule IDs in the desired order */ -export const reorderBackupSchedules = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/backups/reorder', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const reorderBackupSchedules = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/backups/reorder', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * List all notification destinations */ -export const listNotificationDestinations = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/notifications/destinations', - ...options - }); -}; +export const listNotificationDestinations = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/notifications/destinations', ...options }); /** * Create a new notification destination */ -export const createNotificationDestination = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/notifications/destinations', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const createNotificationDestination = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/notifications/destinations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * Delete a notification destination */ -export const deleteNotificationDestination = (options: Options) => { - return (options.client ?? client).delete({ - url: '/api/v1/notifications/destinations/{id}', - ...options - }); -}; +export const deleteNotificationDestination = (options: Options) => (options.client ?? client).delete({ url: '/api/v1/notifications/destinations/{id}', ...options }); /** * Get a notification destination by ID */ -export const getNotificationDestination = (options: Options) => { - return (options.client ?? client).get({ - url: '/api/v1/notifications/destinations/{id}', - ...options - }); -}; +export const getNotificationDestination = (options: Options) => (options.client ?? client).get({ url: '/api/v1/notifications/destinations/{id}', ...options }); /** * Update a notification destination */ -export const updateNotificationDestination = (options: Options) => { - return (options.client ?? client).patch({ - url: '/api/v1/notifications/destinations/{id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); -}; +export const updateNotificationDestination = (options: Options) => (options.client ?? client).patch({ + url: '/api/v1/notifications/destinations/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Test a notification destination by sending a test message */ -export const testNotificationDestination = (options: Options) => { - return (options.client ?? client).post({ - url: '/api/v1/notifications/destinations/{id}/test', - ...options - }); -}; +export const testNotificationDestination = (options: Options) => (options.client ?? client).post({ url: '/api/v1/notifications/destinations/{id}/test', ...options }); /** * Get system information including available capabilities */ -export const getSystemInfo = (options?: Options) => { - return (options?.client ?? client).get({ - url: '/api/v1/system/info', - ...options - }); -}; +export const getSystemInfo = (options?: Options) => (options?.client ?? client).get({ url: '/api/v1/system/info', ...options }); /** * Download the Restic password file for backup recovery. Requires password re-authentication. */ -export const downloadResticPassword = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/system/restic-password', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const downloadResticPassword = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/system/restic-password', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); /** * Export full configuration including all volumes, repositories, backup schedules, and notifications */ -export const exportFullConfig = (options?: Options) => { - return (options?.client ?? client).post({ - url: '/api/v1/config/export', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); -}; +export const exportFullConfig = (options?: Options) => (options?.client ?? client).post({ + url: '/api/v1/config/export', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); diff --git a/app/server/index.ts b/app/server/index.ts index 669d84f4..5e573375 100644 --- a/app/server/index.ts +++ b/app/server/index.ts @@ -14,15 +14,14 @@ import { volumeController } from "./modules/volumes/volume.controller"; import { backupScheduleController } from "./modules/backups/backups.controller"; import { eventsController } from "./modules/events/events.controller"; import { notificationsController } from "./modules/notifications/notifications.controller"; +import { configExportController } from "./modules/lifecycle/config-export.controller"; import { handleServiceError } from "./utils/errors"; import { logger } from "./utils/logger"; import { shutdown } from "./modules/lifecycle/shutdown"; import { REQUIRED_MIGRATIONS } from "./core/constants"; import { validateRequiredMigrations } from "./modules/lifecycle/checkpoint"; -import { configExportController } from "./modules/lifecycle/config-export.controller"; import { config } from "./core/config"; - export const generalDescriptor = (app: Hono) => openAPIRouteHandler(app, { documentation: { @@ -57,9 +56,8 @@ const app = new Hono() .route("/api/v1/backups", backupScheduleController) .route("/api/v1/notifications", notificationsController) .route("/api/v1/system", systemController) - .route("/api/v1/events", eventsController) - .route("/api/v1/config", configExportController); - + .route("/api/v1/config", configExportController) + .route("/api/v1/events", eventsController); app.get("/api/v1/openapi.json", generalDescriptor(app)); app.get("/api/v1/docs", scalarDescriptor);