Merge remote-tracking branch 'upstream/main' into config-export-feature

This commit is contained in:
Jakub Trávník 2025-12-17 17:41:55 +01:00
commit 6ad6044a76
4 changed files with 205 additions and 422 deletions

View file

@ -87,12 +87,10 @@ const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions
if (options?.query) { if (options?.query) {
params.query = options.query; params.query = options.query;
} }
return [ return [params];
params
];
}; };
export const getMeQueryKey = (options?: Options<GetMeData>) => createQueryKey("getMe", options); export const getMeQueryKey = (options?: Options<GetMeData>) => createQueryKey('getMe', options);
/** /**
* Get current authenticated user * Get current authenticated user
@ -110,7 +108,7 @@ export const getMeOptions = (options?: Options<GetMeData>) => queryOptions<GetMe
queryKey: getMeQueryKey(options) queryKey: getMeQueryKey(options)
}); });
export const getStatusQueryKey = (options?: Options<GetStatusData>) => createQueryKey("getStatus", options); export const getStatusQueryKey = (options?: Options<GetStatusData>) => createQueryKey('getStatus', options);
/** /**
* Get authentication system status * Get authentication system status
@ -145,7 +143,7 @@ export const changePasswordMutation = (options?: Partial<Options<ChangePasswordD
return mutationOptions; return mutationOptions;
}; };
export const listVolumesQueryKey = (options?: Options<ListVolumesData>) => createQueryKey("listVolumes", options); export const listVolumesQueryKey = (options?: Options<ListVolumesData>) => createQueryKey('listVolumes', options);
/** /**
* List all volumes * List all volumes
@ -214,7 +212,7 @@ export const deleteVolumeMutation = (options?: Partial<Options<DeleteVolumeData>
return mutationOptions; return mutationOptions;
}; };
export const getVolumeQueryKey = (options: Options<GetVolumeData>) => createQueryKey("getVolume", options); export const getVolumeQueryKey = (options: Options<GetVolumeData>) => createQueryKey('getVolume', options);
/** /**
* Get a volume by name * Get a volume by name
@ -300,7 +298,7 @@ export const healthCheckVolumeMutation = (options?: Partial<Options<HealthCheckV
return mutationOptions; return mutationOptions;
}; };
export const listFilesQueryKey = (options: Options<ListFilesData>) => createQueryKey("listFiles", options); export const listFilesQueryKey = (options: Options<ListFilesData>) => createQueryKey('listFiles', options);
/** /**
* List files in a volume directory * List files in a volume directory
@ -318,7 +316,7 @@ export const listFilesOptions = (options: Options<ListFilesData>) => queryOption
queryKey: listFilesQueryKey(options) queryKey: listFilesQueryKey(options)
}); });
export const browseFilesystemQueryKey = (options?: Options<BrowseFilesystemData>) => createQueryKey("browseFilesystem", options); export const browseFilesystemQueryKey = (options?: Options<BrowseFilesystemData>) => createQueryKey('browseFilesystem', options);
/** /**
* Browse directories on the host filesystem * Browse directories on the host filesystem
@ -336,7 +334,7 @@ export const browseFilesystemOptions = (options?: Options<BrowseFilesystemData>)
queryKey: browseFilesystemQueryKey(options) queryKey: browseFilesystemQueryKey(options)
}); });
export const listRepositoriesQueryKey = (options?: Options<ListRepositoriesData>) => createQueryKey("listRepositories", options); export const listRepositoriesQueryKey = (options?: Options<ListRepositoriesData>) => createQueryKey('listRepositories', options);
/** /**
* List all repositories * List all repositories
@ -371,7 +369,7 @@ export const createRepositoryMutation = (options?: Partial<Options<CreateReposit
return mutationOptions; return mutationOptions;
}; };
export const listRcloneRemotesQueryKey = (options?: Options<ListRcloneRemotesData>) => createQueryKey("listRcloneRemotes", options); export const listRcloneRemotesQueryKey = (options?: Options<ListRcloneRemotesData>) => createQueryKey('listRcloneRemotes', options);
/** /**
* List all configured rclone remotes on the host system * List all configured rclone remotes on the host system
@ -406,7 +404,7 @@ export const deleteRepositoryMutation = (options?: Partial<Options<DeleteReposit
return mutationOptions; return mutationOptions;
}; };
export const getRepositoryQueryKey = (options: Options<GetRepositoryData>) => createQueryKey("getRepository", options); export const getRepositoryQueryKey = (options: Options<GetRepositoryData>) => createQueryKey('getRepository', options);
/** /**
* Get a single repository by name * Get a single repository by name
@ -441,7 +439,7 @@ export const updateRepositoryMutation = (options?: Partial<Options<UpdateReposit
return mutationOptions; return mutationOptions;
}; };
export const listSnapshotsQueryKey = (options: Options<ListSnapshotsData>) => createQueryKey("listSnapshots", options); export const listSnapshotsQueryKey = (options: Options<ListSnapshotsData>) => createQueryKey('listSnapshots', options);
/** /**
* List all snapshots in a repository * List all snapshots in a repository
@ -476,7 +474,7 @@ export const deleteSnapshotMutation = (options?: Partial<Options<DeleteSnapshotD
return mutationOptions; return mutationOptions;
}; };
export const getSnapshotDetailsQueryKey = (options: Options<GetSnapshotDetailsData>) => createQueryKey("getSnapshotDetails", options); export const getSnapshotDetailsQueryKey = (options: Options<GetSnapshotDetailsData>) => createQueryKey('getSnapshotDetails', options);
/** /**
* Get details of a specific snapshot * Get details of a specific snapshot
@ -494,7 +492,7 @@ export const getSnapshotDetailsOptions = (options: Options<GetSnapshotDetailsDat
queryKey: getSnapshotDetailsQueryKey(options) queryKey: getSnapshotDetailsQueryKey(options)
}); });
export const listSnapshotFilesQueryKey = (options: Options<ListSnapshotFilesData>) => createQueryKey("listSnapshotFiles", options); export const listSnapshotFilesQueryKey = (options: Options<ListSnapshotFilesData>) => createQueryKey('listSnapshotFiles', options);
/** /**
* List files and directories in a snapshot * List files and directories in a snapshot
@ -546,7 +544,7 @@ export const doctorRepositoryMutation = (options?: Partial<Options<DoctorReposit
return mutationOptions; return mutationOptions;
}; };
export const listBackupSchedulesQueryKey = (options?: Options<ListBackupSchedulesData>) => createQueryKey("listBackupSchedules", options); export const listBackupSchedulesQueryKey = (options?: Options<ListBackupSchedulesData>) => createQueryKey('listBackupSchedules', options);
/** /**
* List all backup schedules * List all backup schedules
@ -598,7 +596,7 @@ export const deleteBackupScheduleMutation = (options?: Partial<Options<DeleteBac
return mutationOptions; return mutationOptions;
}; };
export const getBackupScheduleQueryKey = (options: Options<GetBackupScheduleData>) => createQueryKey("getBackupSchedule", options); export const getBackupScheduleQueryKey = (options: Options<GetBackupScheduleData>) => createQueryKey('getBackupSchedule', options);
/** /**
* Get a backup schedule by ID * Get a backup schedule by ID
@ -633,7 +631,7 @@ export const updateBackupScheduleMutation = (options?: Partial<Options<UpdateBac
return mutationOptions; return mutationOptions;
}; };
export const getBackupScheduleForVolumeQueryKey = (options: Options<GetBackupScheduleForVolumeData>) => createQueryKey("getBackupScheduleForVolume", options); export const getBackupScheduleForVolumeQueryKey = (options: Options<GetBackupScheduleForVolumeData>) => createQueryKey('getBackupScheduleForVolume', options);
/** /**
* Get a backup schedule for a specific volume * Get a backup schedule for a specific volume
@ -702,7 +700,7 @@ export const runForgetMutation = (options?: Partial<Options<RunForgetData>>): Us
return mutationOptions; return mutationOptions;
}; };
export const getScheduleNotificationsQueryKey = (options: Options<GetScheduleNotificationsData>) => createQueryKey("getScheduleNotifications", options); export const getScheduleNotificationsQueryKey = (options: Options<GetScheduleNotificationsData>) => createQueryKey('getScheduleNotifications', options);
/** /**
* Get notification assignments for a backup schedule * Get notification assignments for a backup schedule
@ -737,7 +735,7 @@ export const updateScheduleNotificationsMutation = (options?: Partial<Options<Up
return mutationOptions; 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 * Get mirror repository assignments for a backup schedule
@ -772,7 +770,7 @@ export const updateScheduleMirrorsMutation = (options?: Partial<Options<UpdateSc
return mutationOptions; 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 * Get mirror compatibility info for all repositories relative to a backup schedule's primary repository
@ -807,7 +805,7 @@ export const reorderBackupSchedulesMutation = (options?: Partial<Options<Reorder
return mutationOptions; return mutationOptions;
}; };
export const listNotificationDestinationsQueryKey = (options?: Options<ListNotificationDestinationsData>) => createQueryKey("listNotificationDestinations", options); export const listNotificationDestinationsQueryKey = (options?: Options<ListNotificationDestinationsData>) => createQueryKey('listNotificationDestinations', options);
/** /**
* List all notification destinations * List all notification destinations
@ -859,7 +857,7 @@ export const deleteNotificationDestinationMutation = (options?: Partial<Options<
return mutationOptions; return mutationOptions;
}; };
export const getNotificationDestinationQueryKey = (options: Options<GetNotificationDestinationData>) => createQueryKey("getNotificationDestination", options); export const getNotificationDestinationQueryKey = (options: Options<GetNotificationDestinationData>) => createQueryKey('getNotificationDestination', options);
/** /**
* Get a notification destination by ID * Get a notification destination by ID
@ -911,7 +909,7 @@ export const testNotificationDestinationMutation = (options?: Partial<Options<Te
return mutationOptions; return mutationOptions;
}; };
export const getSystemInfoQueryKey = (options?: Options<GetSystemInfoData>) => createQueryKey("getSystemInfo", options); export const getSystemInfoQueryKey = (options?: Options<GetSystemInfoData>) => createQueryKey('getSystemInfo', options);
/** /**
* Get system information including available capabilities * Get system information including available capabilities

View file

@ -13,6 +13,4 @@ import type { ClientOptions as ClientOptions2 } from './types.gen';
*/ */
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>; export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
export const client = createClient(createConfig<ClientOptions2>({ export const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'http://localhost:4096' }));
baseUrl: 'http://localhost:4096'
}));

View file

@ -21,601 +21,390 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
/** /**
* Register a new user * Register a new user
*/ */
export const register = <ThrowOnError extends boolean = false>(options?: Options<RegisterData, ThrowOnError>) => { export const register = <ThrowOnError extends boolean = false>(options?: Options<RegisterData, ThrowOnError>) => (options?.client ?? client).post<RegisterResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<RegisterResponses, unknown, ThrowOnError>({ url: '/api/v1/auth/register',
url: '/api/v1/auth/register', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* Login with username and password * Login with username and password
*/ */
export const login = <ThrowOnError extends boolean = false>(options?: Options<LoginData, ThrowOnError>) => { export const login = <ThrowOnError extends boolean = false>(options?: Options<LoginData, ThrowOnError>) => (options?.client ?? client).post<LoginResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<LoginResponses, unknown, ThrowOnError>({ url: '/api/v1/auth/login',
url: '/api/v1/auth/login', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* Logout current user * Logout current user
*/ */
export const logout = <ThrowOnError extends boolean = false>(options?: Options<LogoutData, ThrowOnError>) => { export const logout = <ThrowOnError extends boolean = false>(options?: Options<LogoutData, ThrowOnError>) => (options?.client ?? client).post<LogoutResponses, unknown, ThrowOnError>({ url: '/api/v1/auth/logout', ...options });
return (options?.client ?? client).post<LogoutResponses, unknown, ThrowOnError>({
url: '/api/v1/auth/logout',
...options
});
};
/** /**
* Get current authenticated user * Get current authenticated user
*/ */
export const getMe = <ThrowOnError extends boolean = false>(options?: Options<GetMeData, ThrowOnError>) => { export const getMe = <ThrowOnError extends boolean = false>(options?: Options<GetMeData, ThrowOnError>) => (options?.client ?? client).get<GetMeResponses, unknown, ThrowOnError>({ url: '/api/v1/auth/me', ...options });
return (options?.client ?? client).get<GetMeResponses, unknown, ThrowOnError>({
url: '/api/v1/auth/me',
...options
});
};
/** /**
* Get authentication system status * Get authentication system status
*/ */
export const getStatus = <ThrowOnError extends boolean = false>(options?: Options<GetStatusData, ThrowOnError>) => { export const getStatus = <ThrowOnError extends boolean = false>(options?: Options<GetStatusData, ThrowOnError>) => (options?.client ?? client).get<GetStatusResponses, unknown, ThrowOnError>({ url: '/api/v1/auth/status', ...options });
return (options?.client ?? client).get<GetStatusResponses, unknown, ThrowOnError>({
url: '/api/v1/auth/status',
...options
});
};
/** /**
* Change current user password * Change current user password
*/ */
export const changePassword = <ThrowOnError extends boolean = false>(options?: Options<ChangePasswordData, ThrowOnError>) => { export const changePassword = <ThrowOnError extends boolean = false>(options?: Options<ChangePasswordData, ThrowOnError>) => (options?.client ?? client).post<ChangePasswordResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<ChangePasswordResponses, unknown, ThrowOnError>({ url: '/api/v1/auth/change-password',
url: '/api/v1/auth/change-password', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* List all volumes * List all volumes
*/ */
export const listVolumes = <ThrowOnError extends boolean = false>(options?: Options<ListVolumesData, ThrowOnError>) => { export const listVolumes = <ThrowOnError extends boolean = false>(options?: Options<ListVolumesData, ThrowOnError>) => (options?.client ?? client).get<ListVolumesResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes', ...options });
return (options?.client ?? client).get<ListVolumesResponses, unknown, ThrowOnError>({
url: '/api/v1/volumes',
...options
});
};
/** /**
* Create a new volume * Create a new volume
*/ */
export const createVolume = <ThrowOnError extends boolean = false>(options?: Options<CreateVolumeData, ThrowOnError>) => { export const createVolume = <ThrowOnError extends boolean = false>(options?: Options<CreateVolumeData, ThrowOnError>) => (options?.client ?? client).post<CreateVolumeResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<CreateVolumeResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes',
url: '/api/v1/volumes', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* Test connection to backend * Test connection to backend
*/ */
export const testConnection = <ThrowOnError extends boolean = false>(options?: Options<TestConnectionData, ThrowOnError>) => { export const testConnection = <ThrowOnError extends boolean = false>(options?: Options<TestConnectionData, ThrowOnError>) => (options?.client ?? client).post<TestConnectionResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<TestConnectionResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes/test-connection',
url: '/api/v1/volumes/test-connection', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* Delete a volume * Delete a volume
*/ */
export const deleteVolume = <ThrowOnError extends boolean = false>(options: Options<DeleteVolumeData, ThrowOnError>) => { export const deleteVolume = <ThrowOnError extends boolean = false>(options: Options<DeleteVolumeData, ThrowOnError>) => (options.client ?? client).delete<DeleteVolumeResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes/{name}', ...options });
return (options.client ?? client).delete<DeleteVolumeResponses, unknown, ThrowOnError>({
url: '/api/v1/volumes/{name}',
...options
});
};
/** /**
* Get a volume by name * Get a volume by name
*/ */
export const getVolume = <ThrowOnError extends boolean = false>(options: Options<GetVolumeData, ThrowOnError>) => { export const getVolume = <ThrowOnError extends boolean = false>(options: Options<GetVolumeData, ThrowOnError>) => (options.client ?? client).get<GetVolumeResponses, GetVolumeErrors, ThrowOnError>({ url: '/api/v1/volumes/{name}', ...options });
return (options.client ?? client).get<GetVolumeResponses, GetVolumeErrors, ThrowOnError>({
url: '/api/v1/volumes/{name}',
...options
});
};
/** /**
* Update a volume's configuration * Update a volume's configuration
*/ */
export const updateVolume = <ThrowOnError extends boolean = false>(options: Options<UpdateVolumeData, ThrowOnError>) => { export const updateVolume = <ThrowOnError extends boolean = false>(options: Options<UpdateVolumeData, ThrowOnError>) => (options.client ?? client).put<UpdateVolumeResponses, UpdateVolumeErrors, ThrowOnError>({
return (options.client ?? client).put<UpdateVolumeResponses, UpdateVolumeErrors, ThrowOnError>({ url: '/api/v1/volumes/{name}',
url: '/api/v1/volumes/{name}', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options.headers
...options.headers }
} });
});
};
/** /**
* Mount a volume * Mount a volume
*/ */
export const mountVolume = <ThrowOnError extends boolean = false>(options: Options<MountVolumeData, ThrowOnError>) => { export const mountVolume = <ThrowOnError extends boolean = false>(options: Options<MountVolumeData, ThrowOnError>) => (options.client ?? client).post<MountVolumeResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes/{name}/mount', ...options });
return (options.client ?? client).post<MountVolumeResponses, unknown, ThrowOnError>({
url: '/api/v1/volumes/{name}/mount',
...options
});
};
/** /**
* Unmount a volume * Unmount a volume
*/ */
export const unmountVolume = <ThrowOnError extends boolean = false>(options: Options<UnmountVolumeData, ThrowOnError>) => { export const unmountVolume = <ThrowOnError extends boolean = false>(options: Options<UnmountVolumeData, ThrowOnError>) => (options.client ?? client).post<UnmountVolumeResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes/{name}/unmount', ...options });
return (options.client ?? client).post<UnmountVolumeResponses, unknown, ThrowOnError>({
url: '/api/v1/volumes/{name}/unmount',
...options
});
};
/** /**
* Perform a health check on a volume * Perform a health check on a volume
*/ */
export const healthCheckVolume = <ThrowOnError extends boolean = false>(options: Options<HealthCheckVolumeData, ThrowOnError>) => { export const healthCheckVolume = <ThrowOnError extends boolean = false>(options: Options<HealthCheckVolumeData, ThrowOnError>) => (options.client ?? client).post<HealthCheckVolumeResponses, HealthCheckVolumeErrors, ThrowOnError>({ url: '/api/v1/volumes/{name}/health-check', ...options });
return (options.client ?? client).post<HealthCheckVolumeResponses, HealthCheckVolumeErrors, ThrowOnError>({
url: '/api/v1/volumes/{name}/health-check',
...options
});
};
/** /**
* List files in a volume directory * List files in a volume directory
*/ */
export const listFiles = <ThrowOnError extends boolean = false>(options: Options<ListFilesData, ThrowOnError>) => { export const listFiles = <ThrowOnError extends boolean = false>(options: Options<ListFilesData, ThrowOnError>) => (options.client ?? client).get<ListFilesResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes/{name}/files', ...options });
return (options.client ?? client).get<ListFilesResponses, unknown, ThrowOnError>({
url: '/api/v1/volumes/{name}/files',
...options
});
};
/** /**
* Browse directories on the host filesystem * Browse directories on the host filesystem
*/ */
export const browseFilesystem = <ThrowOnError extends boolean = false>(options?: Options<BrowseFilesystemData, ThrowOnError>) => { export const browseFilesystem = <ThrowOnError extends boolean = false>(options?: Options<BrowseFilesystemData, ThrowOnError>) => (options?.client ?? client).get<BrowseFilesystemResponses, unknown, ThrowOnError>({ url: '/api/v1/volumes/filesystem/browse', ...options });
return (options?.client ?? client).get<BrowseFilesystemResponses, unknown, ThrowOnError>({
url: '/api/v1/volumes/filesystem/browse',
...options
});
};
/** /**
* List all repositories * List all repositories
*/ */
export const listRepositories = <ThrowOnError extends boolean = false>(options?: Options<ListRepositoriesData, ThrowOnError>) => { export const listRepositories = <ThrowOnError extends boolean = false>(options?: Options<ListRepositoriesData, ThrowOnError>) => (options?.client ?? client).get<ListRepositoriesResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories', ...options });
return (options?.client ?? client).get<ListRepositoriesResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories',
...options
});
};
/** /**
* Create a new restic repository * Create a new restic repository
*/ */
export const createRepository = <ThrowOnError extends boolean = false>(options?: Options<CreateRepositoryData, ThrowOnError>) => { export const createRepository = <ThrowOnError extends boolean = false>(options?: Options<CreateRepositoryData, ThrowOnError>) => (options?.client ?? client).post<CreateRepositoryResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<CreateRepositoryResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories',
url: '/api/v1/repositories', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* List all configured rclone remotes on the host system * List all configured rclone remotes on the host system
*/ */
export const listRcloneRemotes = <ThrowOnError extends boolean = false>(options?: Options<ListRcloneRemotesData, ThrowOnError>) => { export const listRcloneRemotes = <ThrowOnError extends boolean = false>(options?: Options<ListRcloneRemotesData, ThrowOnError>) => (options?.client ?? client).get<ListRcloneRemotesResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/rclone-remotes', ...options });
return (options?.client ?? client).get<ListRcloneRemotesResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/rclone-remotes',
...options
});
};
/** /**
* Delete a repository * Delete a repository
*/ */
export const deleteRepository = <ThrowOnError extends boolean = false>(options: Options<DeleteRepositoryData, ThrowOnError>) => { export const deleteRepository = <ThrowOnError extends boolean = false>(options: Options<DeleteRepositoryData, ThrowOnError>) => (options.client ?? client).delete<DeleteRepositoryResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}', ...options });
return (options.client ?? client).delete<DeleteRepositoryResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/{name}',
...options
});
};
/** /**
* Get a single repository by name * Get a single repository by name
*/ */
export const getRepository = <ThrowOnError extends boolean = false>(options: Options<GetRepositoryData, ThrowOnError>) => { export const getRepository = <ThrowOnError extends boolean = false>(options: Options<GetRepositoryData, ThrowOnError>) => (options.client ?? client).get<GetRepositoryResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}', ...options });
return (options.client ?? client).get<GetRepositoryResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/{name}',
...options
});
};
/** /**
* Update a repository's name or settings * Update a repository's name or settings
*/ */
export const updateRepository = <ThrowOnError extends boolean = false>(options: Options<UpdateRepositoryData, ThrowOnError>) => { export const updateRepository = <ThrowOnError extends boolean = false>(options: Options<UpdateRepositoryData, ThrowOnError>) => (options.client ?? client).patch<UpdateRepositoryResponses, UpdateRepositoryErrors, ThrowOnError>({
return (options.client ?? client).patch<UpdateRepositoryResponses, UpdateRepositoryErrors, ThrowOnError>({ url: '/api/v1/repositories/{name}',
url: '/api/v1/repositories/{name}', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options.headers
...options.headers }
} });
});
};
/** /**
* List all snapshots in a repository * List all snapshots in a repository
*/ */
export const listSnapshots = <ThrowOnError extends boolean = false>(options: Options<ListSnapshotsData, ThrowOnError>) => { export const listSnapshots = <ThrowOnError extends boolean = false>(options: Options<ListSnapshotsData, ThrowOnError>) => (options.client ?? client).get<ListSnapshotsResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}/snapshots', ...options });
return (options.client ?? client).get<ListSnapshotsResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/{name}/snapshots',
...options
});
};
/** /**
* Delete a specific snapshot from a repository * Delete a specific snapshot from a repository
*/ */
export const deleteSnapshot = <ThrowOnError extends boolean = false>(options: Options<DeleteSnapshotData, ThrowOnError>) => { export const deleteSnapshot = <ThrowOnError extends boolean = false>(options: Options<DeleteSnapshotData, ThrowOnError>) => (options.client ?? client).delete<DeleteSnapshotResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}/snapshots/{snapshotId}', ...options });
return (options.client ?? client).delete<DeleteSnapshotResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/{name}/snapshots/{snapshotId}',
...options
});
};
/** /**
* Get details of a specific snapshot * Get details of a specific snapshot
*/ */
export const getSnapshotDetails = <ThrowOnError extends boolean = false>(options: Options<GetSnapshotDetailsData, ThrowOnError>) => { export const getSnapshotDetails = <ThrowOnError extends boolean = false>(options: Options<GetSnapshotDetailsData, ThrowOnError>) => (options.client ?? client).get<GetSnapshotDetailsResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}/snapshots/{snapshotId}', ...options });
return (options.client ?? client).get<GetSnapshotDetailsResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/{name}/snapshots/{snapshotId}',
...options
});
};
/** /**
* List files and directories in a snapshot * List files and directories in a snapshot
*/ */
export const listSnapshotFiles = <ThrowOnError extends boolean = false>(options: Options<ListSnapshotFilesData, ThrowOnError>) => { export const listSnapshotFiles = <ThrowOnError extends boolean = false>(options: Options<ListSnapshotFilesData, ThrowOnError>) => (options.client ?? client).get<ListSnapshotFilesResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}/snapshots/{snapshotId}/files', ...options });
return (options.client ?? client).get<ListSnapshotFilesResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/{name}/snapshots/{snapshotId}/files',
...options
});
};
/** /**
* Restore a snapshot to a target path on the filesystem * Restore a snapshot to a target path on the filesystem
*/ */
export const restoreSnapshot = <ThrowOnError extends boolean = false>(options: Options<RestoreSnapshotData, ThrowOnError>) => { export const restoreSnapshot = <ThrowOnError extends boolean = false>(options: Options<RestoreSnapshotData, ThrowOnError>) => (options.client ?? client).post<RestoreSnapshotResponses, unknown, ThrowOnError>({
return (options.client ?? client).post<RestoreSnapshotResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}/restore',
url: '/api/v1/repositories/{name}/restore', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options.headers
...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. * 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 = <ThrowOnError extends boolean = false>(options: Options<DoctorRepositoryData, ThrowOnError>) => { export const doctorRepository = <ThrowOnError extends boolean = false>(options: Options<DoctorRepositoryData, ThrowOnError>) => (options.client ?? client).post<DoctorRepositoryResponses, unknown, ThrowOnError>({ url: '/api/v1/repositories/{name}/doctor', ...options });
return (options.client ?? client).post<DoctorRepositoryResponses, unknown, ThrowOnError>({
url: '/api/v1/repositories/{name}/doctor',
...options
});
};
/** /**
* List all backup schedules * List all backup schedules
*/ */
export const listBackupSchedules = <ThrowOnError extends boolean = false>(options?: Options<ListBackupSchedulesData, ThrowOnError>) => { export const listBackupSchedules = <ThrowOnError extends boolean = false>(options?: Options<ListBackupSchedulesData, ThrowOnError>) => (options?.client ?? client).get<ListBackupSchedulesResponses, unknown, ThrowOnError>({ url: '/api/v1/backups', ...options });
return (options?.client ?? client).get<ListBackupSchedulesResponses, unknown, ThrowOnError>({
url: '/api/v1/backups',
...options
});
};
/** /**
* Create a new backup schedule for a volume * Create a new backup schedule for a volume
*/ */
export const createBackupSchedule = <ThrowOnError extends boolean = false>(options?: Options<CreateBackupScheduleData, ThrowOnError>) => { export const createBackupSchedule = <ThrowOnError extends boolean = false>(options?: Options<CreateBackupScheduleData, ThrowOnError>) => (options?.client ?? client).post<CreateBackupScheduleResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<CreateBackupScheduleResponses, unknown, ThrowOnError>({ url: '/api/v1/backups',
url: '/api/v1/backups', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* Delete a backup schedule * Delete a backup schedule
*/ */
export const deleteBackupSchedule = <ThrowOnError extends boolean = false>(options: Options<DeleteBackupScheduleData, ThrowOnError>) => { export const deleteBackupSchedule = <ThrowOnError extends boolean = false>(options: Options<DeleteBackupScheduleData, ThrowOnError>) => (options.client ?? client).delete<DeleteBackupScheduleResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}', ...options });
return (options.client ?? client).delete<DeleteBackupScheduleResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}',
...options
});
};
/** /**
* Get a backup schedule by ID * Get a backup schedule by ID
*/ */
export const getBackupSchedule = <ThrowOnError extends boolean = false>(options: Options<GetBackupScheduleData, ThrowOnError>) => { export const getBackupSchedule = <ThrowOnError extends boolean = false>(options: Options<GetBackupScheduleData, ThrowOnError>) => (options.client ?? client).get<GetBackupScheduleResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}', ...options });
return (options.client ?? client).get<GetBackupScheduleResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}',
...options
});
};
/** /**
* Update a backup schedule * Update a backup schedule
*/ */
export const updateBackupSchedule = <ThrowOnError extends boolean = false>(options: Options<UpdateBackupScheduleData, ThrowOnError>) => { export const updateBackupSchedule = <ThrowOnError extends boolean = false>(options: Options<UpdateBackupScheduleData, ThrowOnError>) => (options.client ?? client).patch<UpdateBackupScheduleResponses, unknown, ThrowOnError>({
return (options.client ?? client).patch<UpdateBackupScheduleResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}',
url: '/api/v1/backups/{scheduleId}', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options.headers
...options.headers }
} });
});
};
/** /**
* Get a backup schedule for a specific volume * Get a backup schedule for a specific volume
*/ */
export const getBackupScheduleForVolume = <ThrowOnError extends boolean = false>(options: Options<GetBackupScheduleForVolumeData, ThrowOnError>) => { export const getBackupScheduleForVolume = <ThrowOnError extends boolean = false>(options: Options<GetBackupScheduleForVolumeData, ThrowOnError>) => (options.client ?? client).get<GetBackupScheduleForVolumeResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/volume/{volumeId}', ...options });
return (options.client ?? client).get<GetBackupScheduleForVolumeResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/volume/{volumeId}',
...options
});
};
/** /**
* Trigger a backup immediately for a schedule * Trigger a backup immediately for a schedule
*/ */
export const runBackupNow = <ThrowOnError extends boolean = false>(options: Options<RunBackupNowData, ThrowOnError>) => { export const runBackupNow = <ThrowOnError extends boolean = false>(options: Options<RunBackupNowData, ThrowOnError>) => (options.client ?? client).post<RunBackupNowResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/run', ...options });
return (options.client ?? client).post<RunBackupNowResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/run',
...options
});
};
/** /**
* Stop a backup that is currently in progress * Stop a backup that is currently in progress
*/ */
export const stopBackup = <ThrowOnError extends boolean = false>(options: Options<StopBackupData, ThrowOnError>) => { export const stopBackup = <ThrowOnError extends boolean = false>(options: Options<StopBackupData, ThrowOnError>) => (options.client ?? client).post<StopBackupResponses, StopBackupErrors, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/stop', ...options });
return (options.client ?? client).post<StopBackupResponses, StopBackupErrors, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/stop',
...options
});
};
/** /**
* Manually apply retention policy to clean up old snapshots * Manually apply retention policy to clean up old snapshots
*/ */
export const runForget = <ThrowOnError extends boolean = false>(options: Options<RunForgetData, ThrowOnError>) => { export const runForget = <ThrowOnError extends boolean = false>(options: Options<RunForgetData, ThrowOnError>) => (options.client ?? client).post<RunForgetResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/forget', ...options });
return (options.client ?? client).post<RunForgetResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/forget',
...options
});
};
/** /**
* Get notification assignments for a backup schedule * Get notification assignments for a backup schedule
*/ */
export const getScheduleNotifications = <ThrowOnError extends boolean = false>(options: Options<GetScheduleNotificationsData, ThrowOnError>) => { export const getScheduleNotifications = <ThrowOnError extends boolean = false>(options: Options<GetScheduleNotificationsData, ThrowOnError>) => (options.client ?? client).get<GetScheduleNotificationsResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/notifications', ...options });
return (options.client ?? client).get<GetScheduleNotificationsResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/notifications',
...options
});
};
/** /**
* Update notification assignments for a backup schedule * Update notification assignments for a backup schedule
*/ */
export const updateScheduleNotifications = <ThrowOnError extends boolean = false>(options: Options<UpdateScheduleNotificationsData, ThrowOnError>) => { export const updateScheduleNotifications = <ThrowOnError extends boolean = false>(options: Options<UpdateScheduleNotificationsData, ThrowOnError>) => (options.client ?? client).put<UpdateScheduleNotificationsResponses, unknown, ThrowOnError>({
return (options.client ?? client).put<UpdateScheduleNotificationsResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/notifications',
url: '/api/v1/backups/{scheduleId}/notifications', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options.headers
...options.headers }
} });
});
};
/** /**
* Get mirror repository assignments for a backup schedule * Get mirror repository assignments for a backup schedule
*/ */
export const getScheduleMirrors = <ThrowOnError extends boolean = false>(options: Options<GetScheduleMirrorsData, ThrowOnError>) => { export const getScheduleMirrors = <ThrowOnError extends boolean = false>(options: Options<GetScheduleMirrorsData, ThrowOnError>) => (options.client ?? client).get<GetScheduleMirrorsResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/mirrors', ...options });
return (options.client ?? client).get<GetScheduleMirrorsResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/mirrors',
...options
});
};
/** /**
* Update mirror repository assignments for a backup schedule * Update mirror repository assignments for a backup schedule
*/ */
export const updateScheduleMirrors = <ThrowOnError extends boolean = false>(options: Options<UpdateScheduleMirrorsData, ThrowOnError>) => { export const updateScheduleMirrors = <ThrowOnError extends boolean = false>(options: Options<UpdateScheduleMirrorsData, ThrowOnError>) => (options.client ?? client).put<UpdateScheduleMirrorsResponses, unknown, ThrowOnError>({
return (options.client ?? client).put<UpdateScheduleMirrorsResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/{scheduleId}/mirrors',
url: '/api/v1/backups/{scheduleId}/mirrors', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options.headers
...options.headers }
} });
});
};
/** /**
* Get mirror compatibility info for all repositories relative to a backup schedule's primary repository * 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>) => { 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 });
return (options.client ?? client).get<GetMirrorCompatibilityResponses, unknown, ThrowOnError>({
url: '/api/v1/backups/{scheduleId}/mirrors/compatibility',
...options
});
};
/** /**
* Reorder backup schedules by providing an array of schedule IDs in the desired order * Reorder backup schedules by providing an array of schedule IDs in the desired order
*/ */
export const reorderBackupSchedules = <ThrowOnError extends boolean = false>(options?: Options<ReorderBackupSchedulesData, ThrowOnError>) => { export const reorderBackupSchedules = <ThrowOnError extends boolean = false>(options?: Options<ReorderBackupSchedulesData, ThrowOnError>) => (options?.client ?? client).post<ReorderBackupSchedulesResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<ReorderBackupSchedulesResponses, unknown, ThrowOnError>({ url: '/api/v1/backups/reorder',
url: '/api/v1/backups/reorder', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* List all notification destinations * List all notification destinations
*/ */
export const listNotificationDestinations = <ThrowOnError extends boolean = false>(options?: Options<ListNotificationDestinationsData, ThrowOnError>) => { export const listNotificationDestinations = <ThrowOnError extends boolean = false>(options?: Options<ListNotificationDestinationsData, ThrowOnError>) => (options?.client ?? client).get<ListNotificationDestinationsResponses, unknown, ThrowOnError>({ url: '/api/v1/notifications/destinations', ...options });
return (options?.client ?? client).get<ListNotificationDestinationsResponses, unknown, ThrowOnError>({
url: '/api/v1/notifications/destinations',
...options
});
};
/** /**
* Create a new notification destination * Create a new notification destination
*/ */
export const createNotificationDestination = <ThrowOnError extends boolean = false>(options?: Options<CreateNotificationDestinationData, ThrowOnError>) => { export const createNotificationDestination = <ThrowOnError extends boolean = false>(options?: Options<CreateNotificationDestinationData, ThrowOnError>) => (options?.client ?? client).post<CreateNotificationDestinationResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<CreateNotificationDestinationResponses, unknown, ThrowOnError>({ url: '/api/v1/notifications/destinations',
url: '/api/v1/notifications/destinations', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* Delete a notification destination * Delete a notification destination
*/ */
export const deleteNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<DeleteNotificationDestinationData, ThrowOnError>) => { export const deleteNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<DeleteNotificationDestinationData, ThrowOnError>) => (options.client ?? client).delete<DeleteNotificationDestinationResponses, DeleteNotificationDestinationErrors, ThrowOnError>({ url: '/api/v1/notifications/destinations/{id}', ...options });
return (options.client ?? client).delete<DeleteNotificationDestinationResponses, DeleteNotificationDestinationErrors, ThrowOnError>({
url: '/api/v1/notifications/destinations/{id}',
...options
});
};
/** /**
* Get a notification destination by ID * Get a notification destination by ID
*/ */
export const getNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<GetNotificationDestinationData, ThrowOnError>) => { export const getNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<GetNotificationDestinationData, ThrowOnError>) => (options.client ?? client).get<GetNotificationDestinationResponses, GetNotificationDestinationErrors, ThrowOnError>({ url: '/api/v1/notifications/destinations/{id}', ...options });
return (options.client ?? client).get<GetNotificationDestinationResponses, GetNotificationDestinationErrors, ThrowOnError>({
url: '/api/v1/notifications/destinations/{id}',
...options
});
};
/** /**
* Update a notification destination * Update a notification destination
*/ */
export const updateNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<UpdateNotificationDestinationData, ThrowOnError>) => { export const updateNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<UpdateNotificationDestinationData, ThrowOnError>) => (options.client ?? client).patch<UpdateNotificationDestinationResponses, UpdateNotificationDestinationErrors, ThrowOnError>({
return (options.client ?? client).patch<UpdateNotificationDestinationResponses, UpdateNotificationDestinationErrors, ThrowOnError>({ url: '/api/v1/notifications/destinations/{id}',
url: '/api/v1/notifications/destinations/{id}', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options.headers
...options.headers }
} });
});
};
/** /**
* Test a notification destination by sending a test message * Test a notification destination by sending a test message
*/ */
export const testNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<TestNotificationDestinationData, ThrowOnError>) => { export const testNotificationDestination = <ThrowOnError extends boolean = false>(options: Options<TestNotificationDestinationData, ThrowOnError>) => (options.client ?? client).post<TestNotificationDestinationResponses, TestNotificationDestinationErrors, ThrowOnError>({ url: '/api/v1/notifications/destinations/{id}/test', ...options });
return (options.client ?? client).post<TestNotificationDestinationResponses, TestNotificationDestinationErrors, ThrowOnError>({
url: '/api/v1/notifications/destinations/{id}/test',
...options
});
};
/** /**
* Get system information including available capabilities * Get system information including available capabilities
*/ */
export const getSystemInfo = <ThrowOnError extends boolean = false>(options?: Options<GetSystemInfoData, ThrowOnError>) => { export const getSystemInfo = <ThrowOnError extends boolean = false>(options?: Options<GetSystemInfoData, ThrowOnError>) => (options?.client ?? client).get<GetSystemInfoResponses, unknown, ThrowOnError>({ url: '/api/v1/system/info', ...options });
return (options?.client ?? client).get<GetSystemInfoResponses, unknown, ThrowOnError>({
url: '/api/v1/system/info',
...options
});
};
/** /**
* Download the Restic password file for backup recovery. Requires password re-authentication. * Download the Restic password file for backup recovery. Requires password re-authentication.
*/ */
export const downloadResticPassword = <ThrowOnError extends boolean = false>(options?: Options<DownloadResticPasswordData, ThrowOnError>) => { export const downloadResticPassword = <ThrowOnError extends boolean = false>(options?: Options<DownloadResticPasswordData, ThrowOnError>) => (options?.client ?? client).post<DownloadResticPasswordResponses, unknown, ThrowOnError>({
return (options?.client ?? client).post<DownloadResticPasswordResponses, unknown, ThrowOnError>({ url: '/api/v1/system/restic-password',
url: '/api/v1/system/restic-password', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};
/** /**
* Export full configuration including all volumes, repositories, backup schedules, and notifications * Export full configuration including all volumes, repositories, backup schedules, and notifications
*/ */
export const exportFullConfig = <ThrowOnError extends boolean = false>(options?: Options<ExportFullConfigData, ThrowOnError>) => { export const exportFullConfig = <ThrowOnError extends boolean = false>(options?: Options<ExportFullConfigData, ThrowOnError>) => (options?.client ?? client).post<ExportFullConfigResponses, ExportFullConfigErrors, ThrowOnError>({
return (options?.client ?? client).post<ExportFullConfigResponses, ExportFullConfigErrors, ThrowOnError>({ url: '/api/v1/config/export',
url: '/api/v1/config/export', ...options,
...options, headers: {
headers: { 'Content-Type': 'application/json',
'Content-Type': 'application/json', ...options?.headers
...options?.headers }
} });
});
};

View file

@ -14,15 +14,14 @@ import { volumeController } from "./modules/volumes/volume.controller";
import { backupScheduleController } from "./modules/backups/backups.controller"; import { backupScheduleController } from "./modules/backups/backups.controller";
import { eventsController } from "./modules/events/events.controller"; import { eventsController } from "./modules/events/events.controller";
import { notificationsController } from "./modules/notifications/notifications.controller"; import { notificationsController } from "./modules/notifications/notifications.controller";
import { configExportController } from "./modules/lifecycle/config-export.controller";
import { handleServiceError } from "./utils/errors"; import { handleServiceError } from "./utils/errors";
import { logger } from "./utils/logger"; import { logger } from "./utils/logger";
import { shutdown } from "./modules/lifecycle/shutdown"; import { shutdown } from "./modules/lifecycle/shutdown";
import { REQUIRED_MIGRATIONS } from "./core/constants"; import { REQUIRED_MIGRATIONS } from "./core/constants";
import { validateRequiredMigrations } from "./modules/lifecycle/checkpoint"; import { validateRequiredMigrations } from "./modules/lifecycle/checkpoint";
import { configExportController } from "./modules/lifecycle/config-export.controller";
import { config } from "./core/config"; import { config } from "./core/config";
export const generalDescriptor = (app: Hono) => export const generalDescriptor = (app: Hono) =>
openAPIRouteHandler(app, { openAPIRouteHandler(app, {
documentation: { documentation: {
@ -57,9 +56,8 @@ const app = new Hono()
.route("/api/v1/backups", backupScheduleController) .route("/api/v1/backups", backupScheduleController)
.route("/api/v1/notifications", notificationsController) .route("/api/v1/notifications", notificationsController)
.route("/api/v1/system", systemController) .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/openapi.json", generalDescriptor(app));
app.get("/api/v1/docs", scalarDescriptor); app.get("/api/v1/docs", scalarDescriptor);