feat: Admin Area System: Database Backup/Restore and Danger Zone 1.00

This commit is contained in:
OpenVelo Agent
2026-07-23 12:49:35 +00:00
parent 470ddd30c3
commit 4a52e46e2c
5 changed files with 290 additions and 32 deletions
@@ -108,13 +108,20 @@ export class AdminSystemController {
400,
);
}
if (!body.stagingId) {
throw new ApiError(
ERROR_CODES.SYSTEM_RESTORE_STAGE_EXPIRED,
'Restore stage missing or expired',
400,
);
}
await this.tokens.consume({
userId,
operation: 'restore-backup',
token: body.token,
stagingId: body.stagingId,
});
const result = await this.restore.commitRestore(body.stagingId ?? '');
const result = await this.restore.commitRestore(body.stagingId);
void result;
await this.auth.revokeAllRefreshSessions(userId);
return { ok: true, operation: 'restore-backup' };