32 lines
917 B
JavaScript
32 lines
917 B
JavaScript
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
|
|
};
|