feat: premium tier features — auto-backup scheduling, resource alerting, bundled workflows, one-click revert, notification manager

This commit is contained in:
Hermes
2026-05-27 23:39:46 -07:00
parent 6ce0a18f98
commit 11823a1466
19 changed files with 3686 additions and 407 deletions
+24 -1
View File
@@ -20,6 +20,14 @@ class BackupManager extends EventEmitter {
this.history = this.loadHistory();
this.scheduledJobs = new Map();
this.running = false;
this.notificationManager = null;
}
/**
* Set the notification manager for sending backup notifications
*/
setNotificationManager(nm) {
this.notificationManager = nm;
}
/**
@@ -177,6 +185,14 @@ class BackupManager extends EventEmitter {
}
this.emit('backup-complete', historyEntry);
// Send notification if manager is configured
if (this.notificationManager) {
this.notificationManager.sendBackupComplete(historyEntry).catch(err => {
console.error('[BackupManager] Failed to send backup-complete notification:', err.message);
});
}
console.log(`[BackupManager] Backup ${name} completed in ${duration}ms`);
return historyEntry;
@@ -193,7 +209,14 @@ class BackupManager extends EventEmitter {
this.addToHistory(historyEntry);
this.emit('backup-failed', historyEntry);
// Send notification if manager is configured
if (this.notificationManager) {
this.notificationManager.sendBackupFailed(historyEntry).catch(err => {
console.error('[BackupManager] Failed to send backup-failed notification:', err.message);
});
}
throw error;
}
}