This commit is contained in:
seb
2026-10-14 00:47:36 +02:00
parent c0600ecb3b
commit 2dd6533481
13 changed files with 1371 additions and 8 deletions

31
src/api/backup.js Normal file
View File

@@ -0,0 +1,31 @@
import { http } from './http.js';
/**
* Backup API for listing backups, checking service status, and triggering manual backups.
*/
export const backup = {
/**
* GET /api/backup
* Returns: 200 { status: BackupStatus, backups: { counts, hourly, daily, monthly } }
*/
// #region GET /api/backup — getStatus
// MARK: calls GET /api/backup from ./api/index.js
getStatus() {
return http('/api/backup');
},
// #endregion
/**
* POST /api/backup/run
* Triggers a manual backup run.
* Returns: 200 { success: bool, id: str, timestamp: str, promotedDaily: bool, promotedMonthly: bool, totalSizeBytes: int, pruneResult: { hourlyPruned: int, dailyPruned: int }, manifest: object }
*/
// #region POST /api/backup/run — run
// MARK: calls POST /api/backup/run from ./api/index.js
run() {
return http('/api/backup/run', {
method: 'POST',
});
},
// #endregion
};