@plutonhq/core-backend 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/BackupController.d.ts +1 -0
- package/dist/controllers/BackupController.d.ts.map +1 -1
- package/dist/controllers/BackupController.js +1 -1
- package/dist/controllers/BackupController.js.map +1 -1
- package/dist/controllers/PlanController.d.ts +1 -0
- package/dist/controllers/PlanController.d.ts.map +1 -1
- package/dist/controllers/PlanController.js +1 -1
- package/dist/controllers/PlanController.js.map +1 -1
- package/dist/controllers/RestoreController.d.ts.map +1 -1
- package/dist/controllers/RestoreController.js +1 -1
- package/dist/controllers/RestoreController.js.map +1 -1
- package/dist/controllers/StorageController.d.ts.map +1 -1
- package/dist/controllers/StorageController.js +1 -1
- package/dist/controllers/StorageController.js.map +1 -1
- package/dist/createApp.d.ts.map +1 -1
- package/dist/createApp.js +1 -1
- package/dist/createApp.js.map +1 -1
- package/dist/db/index.d.ts +19 -0
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/schema/backups.d.ts +77 -1
- package/dist/db/schema/backups.d.ts.map +1 -1
- package/dist/db/schema/backups.js +1 -1
- package/dist/db/schema/backups.js.map +1 -1
- package/dist/jobs/JobProcessor.d.ts.map +1 -1
- package/dist/jobs/JobProcessor.js +1 -1
- package/dist/jobs/JobProcessor.js.map +1 -1
- package/dist/jobs/tasks/ReplicationRetryTask.d.ts +10 -0
- package/dist/jobs/tasks/ReplicationRetryTask.d.ts.map +1 -0
- package/dist/jobs/tasks/ReplicationRetryTask.js +1 -0
- package/dist/jobs/tasks/ReplicationRetryTask.js.map +1 -0
- package/dist/managers/BaseBackupManager.d.ts +31 -2
- package/dist/managers/BaseBackupManager.d.ts.map +1 -1
- package/dist/managers/BaseBackupManager.js +1 -1
- package/dist/managers/BaseBackupManager.js.map +1 -1
- package/dist/managers/BaseSnapshotManager.d.ts +21 -4
- package/dist/managers/BaseSnapshotManager.d.ts.map +1 -1
- package/dist/managers/BaseSnapshotManager.js +1 -1
- package/dist/managers/BaseSnapshotManager.js.map +1 -1
- package/dist/managers/ProgressManager.d.ts +28 -0
- package/dist/managers/ProgressManager.d.ts.map +1 -1
- package/dist/managers/ProgressManager.js +1 -1
- package/dist/managers/ProgressManager.js.map +1 -1
- package/dist/managers/handlers/BackupHandler.d.ts +8 -0
- package/dist/managers/handlers/BackupHandler.d.ts.map +1 -1
- package/dist/managers/handlers/BackupHandler.js +1 -1
- package/dist/managers/handlers/BackupHandler.js.map +1 -1
- package/dist/managers/handlers/DownloadHandler.d.ts.map +1 -1
- package/dist/managers/handlers/DownloadHandler.js +1 -1
- package/dist/managers/handlers/DownloadHandler.js.map +1 -1
- package/dist/managers/handlers/ReplicationHandler.d.ts +34 -0
- package/dist/managers/handlers/ReplicationHandler.d.ts.map +1 -0
- package/dist/managers/handlers/ReplicationHandler.js +1 -0
- package/dist/managers/handlers/ReplicationHandler.js.map +1 -0
- package/dist/managers/handlers/ReplicationOrchestrator.d.ts +50 -0
- package/dist/managers/handlers/ReplicationOrchestrator.d.ts.map +1 -0
- package/dist/managers/handlers/ReplicationOrchestrator.js +1 -0
- package/dist/managers/handlers/ReplicationOrchestrator.js.map +1 -0
- package/dist/middlewares/versionMiddleware.d.ts.map +1 -1
- package/dist/middlewares/versionMiddleware.js +1 -1
- package/dist/middlewares/versionMiddleware.js.map +1 -1
- package/dist/notifications/BackupNotification.d.ts +6 -3
- package/dist/notifications/BackupNotification.d.ts.map +1 -1
- package/dist/notifications/BackupNotification.js +1 -1
- package/dist/notifications/BackupNotification.js.map +1 -1
- package/dist/notifications/channels/NotificationChannelResolver.d.ts.map +1 -1
- package/dist/notifications/channels/NotificationChannelResolver.js.map +1 -1
- package/dist/notifications/templates/email/backup/BackupFailedNotification.d.ts.map +1 -1
- package/dist/notifications/templates/email/backup/BackupFailedNotification.ejs +9 -4
- package/dist/notifications/templates/email/backup/BackupFailedNotification.js +1 -1
- package/dist/notifications/templates/email/backup/BackupFailedNotification.js.map +1 -1
- package/dist/notifications/templates/email/backup/BackupStartedNotification.d.ts.map +1 -1
- package/dist/notifications/templates/email/backup/BackupStartedNotification.ejs +9 -4
- package/dist/notifications/templates/email/backup/BackupStartedNotification.js +1 -1
- package/dist/notifications/templates/email/backup/BackupStartedNotification.js.map +1 -1
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.d.ts +2 -1
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.d.ts.map +1 -1
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.ejs +52 -4
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.js +1 -1
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.js.map +1 -1
- package/dist/notifications/templates/email/backup/ReplicationFailedNotification.d.ts +24 -0
- package/dist/notifications/templates/email/backup/ReplicationFailedNotification.d.ts.map +1 -0
- package/dist/notifications/templates/email/backup/ReplicationFailedNotification.ejs +105 -0
- package/dist/notifications/templates/email/backup/ReplicationFailedNotification.js +1 -0
- package/dist/notifications/templates/email/backup/ReplicationFailedNotification.js.map +1 -0
- package/dist/routes/backups.d.ts.map +1 -1
- package/dist/routes/backups.js +1 -1
- package/dist/routes/backups.js.map +1 -1
- package/dist/routes/plans.d.ts.map +1 -1
- package/dist/routes/plans.js +1 -1
- package/dist/routes/plans.js.map +1 -1
- package/dist/services/BackupServices.d.ts +14 -5
- package/dist/services/BackupServices.d.ts.map +1 -1
- package/dist/services/BackupServices.js +1 -1
- package/dist/services/BackupServices.js.map +1 -1
- package/dist/services/DeviceService.d.ts +6 -0
- package/dist/services/DeviceService.d.ts.map +1 -1
- package/dist/services/DeviceService.js +1 -1
- package/dist/services/DeviceService.js.map +1 -1
- package/dist/services/PlanService.d.ts +12 -0
- package/dist/services/PlanService.d.ts.map +1 -1
- package/dist/services/PlanService.js +1 -1
- package/dist/services/PlanService.js.map +1 -1
- package/dist/services/RestoreService.d.ts +2 -2
- package/dist/services/RestoreService.d.ts.map +1 -1
- package/dist/services/RestoreService.js +1 -1
- package/dist/services/RestoreService.js.map +1 -1
- package/dist/services/StorageService.d.ts.map +1 -1
- package/dist/services/StorageService.js +1 -1
- package/dist/services/StorageService.js.map +1 -1
- package/dist/services/events/BackupEventService.d.ts +11 -0
- package/dist/services/events/BackupEventService.d.ts.map +1 -1
- package/dist/services/events/BackupEventService.js +1 -1
- package/dist/services/events/BackupEventService.js.map +1 -1
- package/dist/services/events/ReplicationEventService.d.ts +33 -0
- package/dist/services/events/ReplicationEventService.d.ts.map +1 -0
- package/dist/services/events/ReplicationEventService.js +1 -0
- package/dist/services/events/ReplicationEventService.js.map +1 -0
- package/dist/services/listeners/BackupEventListener.d.ts +3 -1
- package/dist/services/listeners/BackupEventListener.d.ts.map +1 -1
- package/dist/services/listeners/BackupEventListener.js +1 -1
- package/dist/services/listeners/BackupEventListener.js.map +1 -1
- package/dist/services/listeners/ReplicationEventListener.d.ts +30 -0
- package/dist/services/listeners/ReplicationEventListener.d.ts.map +1 -0
- package/dist/services/listeners/ReplicationEventListener.js +1 -0
- package/dist/services/listeners/ReplicationEventListener.js.map +1 -0
- package/dist/stores/BackupStore.d.ts +8 -0
- package/dist/stores/BackupStore.d.ts.map +1 -1
- package/dist/stores/BackupStore.js +1 -1
- package/dist/stores/BackupStore.js.map +1 -1
- package/dist/stores/DeviceStore.d.ts +6 -0
- package/dist/stores/DeviceStore.d.ts.map +1 -1
- package/dist/stores/DeviceStore.js +1 -1
- package/dist/stores/DeviceStore.js.map +1 -1
- package/dist/stores/PlanStore.d.ts +3 -1
- package/dist/stores/PlanStore.d.ts.map +1 -1
- package/dist/stores/PlanStore.js +1 -1
- package/dist/stores/PlanStore.js.map +1 -1
- package/dist/stores/StorageStore.d.ts +10 -0
- package/dist/stores/StorageStore.d.ts.map +1 -1
- package/dist/stores/StorageStore.js +1 -1
- package/dist/stores/StorageStore.js.map +1 -1
- package/dist/strategies/backup/BackupStrategy.d.ts +20 -2
- package/dist/strategies/backup/BackupStrategy.d.ts.map +1 -1
- package/dist/strategies/backup/LocalStrategy.d.ts +20 -2
- package/dist/strategies/backup/LocalStrategy.d.ts.map +1 -1
- package/dist/strategies/backup/LocalStrategy.js +1 -1
- package/dist/strategies/backup/LocalStrategy.js.map +1 -1
- package/dist/strategies/backup/RemoteStrategy.d.ts +9 -2
- package/dist/strategies/backup/RemoteStrategy.d.ts.map +1 -1
- package/dist/strategies/backup/RemoteStrategy.js +1 -1
- package/dist/strategies/backup/RemoteStrategy.js.map +1 -1
- package/dist/strategies/snapshot/LocalStrategy.d.ts +20 -4
- package/dist/strategies/snapshot/LocalStrategy.d.ts.map +1 -1
- package/dist/strategies/snapshot/LocalStrategy.js +1 -1
- package/dist/strategies/snapshot/LocalStrategy.js.map +1 -1
- package/dist/strategies/snapshot/RemoteStrategy.d.ts +4 -1
- package/dist/strategies/snapshot/RemoteStrategy.d.ts.map +1 -1
- package/dist/strategies/snapshot/RemoteStrategy.js +1 -1
- package/dist/strategies/snapshot/RemoteStrategy.js.map +1 -1
- package/dist/strategies/snapshot/SnapshotStrategy.d.ts +20 -4
- package/dist/strategies/snapshot/SnapshotStrategy.d.ts.map +1 -1
- package/dist/types/backups.d.ts +24 -0
- package/dist/types/backups.d.ts.map +1 -1
- package/dist/types/events.d.ts +110 -0
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/plans.d.ts +23 -2
- package/dist/types/plans.d.ts.map +1 -1
- package/dist/types/restores.d.ts +2 -0
- package/dist/types/restores.d.ts.map +1 -1
- package/dist/utils/restic/restic.d.ts.map +1 -1
- package/dist/utils/restic/restic.js +1 -1
- package/dist/utils/restic/restic.js.map +1 -1
- package/dist/utils/sanitizeStoragePath.d.ts +5 -1
- package/dist/utils/sanitizeStoragePath.d.ts.map +1 -1
- package/dist/utils/sanitizeStoragePath.js +1 -1
- package/dist/utils/sanitizeStoragePath.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,5 +11,6 @@ export declare class BackupController {
|
|
|
11
11
|
getBackupProgress(req: Request, res: Response): Promise<void>;
|
|
12
12
|
cancelBackup(req: Request, res: Response): Promise<void>;
|
|
13
13
|
updateBackup(req: Request, res: Response): Promise<void>;
|
|
14
|
+
retryFailedReplications(req: Request, res: Response): Promise<void>;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=BackupController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackupController.d.ts","sourceRoot":"","sources":["../../src/controllers/BackupController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,qBAAa,gBAAgB;IAChB,SAAS,CAAC,aAAa,EAAE,aAAa;gBAA5B,aAAa,EAAE,aAAa;IAE5C,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B7D,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"BackupController.d.ts","sourceRoot":"","sources":["../../src/controllers/BackupController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,qBAAa,gBAAgB;IAChB,SAAS,CAAC,aAAa,EAAE,aAAa;gBAA5B,aAAa,EAAE,aAAa;IAE5C,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B7D,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBlE,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB5D,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBhE,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBxD,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB7D,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBxD,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BxD,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAqBzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class BackupController{backupService;constructor(backupService){this.backupService=backupService}async getBackupDownload(req,res){if(req.params.id)try{const downloadResult=await this.backupService.getBackupDownload(req.params.id),{fileName:fileName,fileStream:fileStream}=downloadResult;return res.setHeader("Content-Type","application/x-tar"),res.setHeader("Content-Disposition",`attachment; filename=${fileName}`),res.setHeader("Transfer-Encoding","chunked"),void fileStream.pipe(res)}catch(error){res.status(500).json({success:!1,error:"Failed to get Downloaded file. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async generateBackupDownload(req,res){if(req.params.id)try{const downloadResult=await this.backupService.generateBackupDownload(req.params.id);res.status(200).json({success:!0,result:downloadResult})}catch(error){res.status(500).json({success:!1,error:"Failed to generate Download Link. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async getSnapshotFiles(req,res){if(req.params.id)try{const snapshotFiles=await this.backupService.getSnapshotFiles(req.params.id);res.status(200).json({success:!0,result:snapshotFiles})}catch(error){res.status(500).json({success:!1,error:"Failed to get Snapshot Files. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async cancelBackupDownload(req,res){if(req.params.id)try{const downloadResult=await this.backupService.cancelBackupDownload(req.query.planId,req.params.id);res.status(200).json({success:!0,result:downloadResult})}catch(error){res.status(500).json({success:!1,error:"Failed to cancel Download Generation. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async deleteBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Backup ID is required"});const removeSnapshot=!0;await this.backupService.deleteBackup(req.params.id,removeSnapshot),res.status(200).json({success:!0,result:"Removed"})}catch(error){return void res.status(500).json({success:!1,error:error?.message||"Failed to delete backup"})}}async getBackupProgress(req,res){if(req.params.id&&req.query.sourceId&&req.query.sourceType)try{const progressRes=await this.backupService.getBackupProgress(req.params.id);res.status(200).json(progressRes)}catch(error){return void res.status(500).json({success:!1,error:error?.message||"Failed to retrieve Backup Progress"})}else res.status(400).json({success:!1,error:"Backup ID or Device ID is required"})}async cancelBackup(req,res){if(req.params.id&&req.query.planId)try{const cancelResult=await this.backupService.cancelBackup(req.query.planId,req.params.id);return void res.status(200).json(cancelResult)}catch(error){return void res.status(500).json({success:!1,error:error.message||"Unknown Error"})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async updateBackup(req,res){if(req.params.id)if(req.body&&0!==Object.keys(req.body).length)try{const updatedBackup=await this.backupService.updateBackup(req.params.id,req.body);res.status(200).json({success:!0,result:updatedBackup})}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to update backup"})}else res.status(400).json({success:!1,error:"Update data is required"});else res.status(400).json({success:!1,error:"Backup ID is required"})}}
|
|
1
|
+
export class BackupController{backupService;constructor(backupService){this.backupService=backupService}async getBackupDownload(req,res){if(req.params.id)try{const downloadResult=await this.backupService.getBackupDownload(req.params.id),{fileName:fileName,fileStream:fileStream}=downloadResult;return res.setHeader("Content-Type","application/x-tar"),res.setHeader("Content-Disposition",`attachment; filename=${fileName}`),res.setHeader("Transfer-Encoding","chunked"),void fileStream.pipe(res)}catch(error){res.status(500).json({success:!1,error:"Failed to get Downloaded file. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async generateBackupDownload(req,res){if(req.params.id)try{const replicationId=req.query.replicationId,downloadResult=await this.backupService.generateBackupDownload(req.params.id,replicationId);res.status(200).json({success:!0,result:downloadResult})}catch(error){res.status(500).json({success:!1,error:"Failed to generate Download Link. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async getSnapshotFiles(req,res){if(req.params.id)try{const replicationId=req.query.replicationId,snapshotFiles=await this.backupService.getSnapshotFiles(req.params.id,replicationId);res.status(200).json({success:!0,result:snapshotFiles})}catch(error){res.status(500).json({success:!1,error:"Failed to get Snapshot Files. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async cancelBackupDownload(req,res){if(req.params.id)try{const downloadResult=await this.backupService.cancelBackupDownload(req.query.planId,req.params.id);res.status(200).json({success:!0,result:downloadResult})}catch(error){res.status(500).json({success:!1,error:"Failed to cancel Download Generation. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async deleteBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Backup ID is required"});const removeSnapshot=!0;await this.backupService.deleteBackup(req.params.id,removeSnapshot),res.status(200).json({success:!0,result:"Removed"})}catch(error){return void res.status(500).json({success:!1,error:error?.message||"Failed to delete backup"})}}async getBackupProgress(req,res){if(req.params.id&&req.query.sourceId&&req.query.sourceType)try{const progressRes=await this.backupService.getBackupProgress(req.params.id);res.status(200).json(progressRes)}catch(error){return void res.status(500).json({success:!1,error:error?.message||"Failed to retrieve Backup Progress"})}else res.status(400).json({success:!1,error:"Backup ID or Device ID is required"})}async cancelBackup(req,res){if(req.params.id&&req.query.planId)try{const cancelResult=await this.backupService.cancelBackup(req.query.planId,req.params.id);return void res.status(200).json(cancelResult)}catch(error){return void res.status(500).json({success:!1,error:error.message||"Unknown Error"})}else res.status(400).json({success:!1,error:"Backup ID is required"})}async updateBackup(req,res){if(req.params.id)if(req.body&&0!==Object.keys(req.body).length)try{const updatedBackup=await this.backupService.updateBackup(req.params.id,req.body);res.status(200).json({success:!0,result:updatedBackup})}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to update backup"})}else res.status(400).json({success:!1,error:"Update data is required"});else res.status(400).json({success:!1,error:"Backup ID is required"})}async retryFailedReplications(req,res){if(req.params.id)try{const result=await this.backupService.retryFailedReplications(req.params.id,req.query.replicationId);res.status(200).json({success:!0,result:result})}catch(error){res.status(error.statusCode||500).json({success:!1,error:error?.message||"Failed to retry replications"})}else res.status(400).json({success:!1,error:"Backup ID is required"})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackupController.js","sourceRoot":"","sources":["../../src/controllers/BackupController.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,gBAAgB;IACN;IAAtB,YAAsB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEtD,KAAK,CAAC,iBAAiB,CAAC,GAAY,EAAE,GAAa;QAClD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACpB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,uBAAuB;aAC9B,CAAC,CAAC;YACH,OAAO;QACR,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACjF,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC;YAEhD,4BAA4B;YAC5B,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;YACnD,GAAG,CAAC,SAAS,CAAC,qBAAqB,EAAE,wBAAwB,QAAQ,EAAE,CAAC,CAAC;YACzE,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;YAE9C,uCAAuC;YACvC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrB,OAAO;QACR,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,iCAAiC,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;aAChE,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,GAAY,EAAE,GAAa;QACvD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACpB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,uBAAuB;aAC9B,CAAC,CAAC;YACH,OAAO;QACR,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"BackupController.js","sourceRoot":"","sources":["../../src/controllers/BackupController.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,gBAAgB;IACN;IAAtB,YAAsB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEtD,KAAK,CAAC,iBAAiB,CAAC,GAAY,EAAE,GAAa;QAClD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACpB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,uBAAuB;aAC9B,CAAC,CAAC;YACH,OAAO;QACR,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,cAAc,GAA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|
@@ -14,6 +14,7 @@ export declare class PlanController {
|
|
|
14
14
|
resumeBackup(req: Request, res: Response): Promise<void>;
|
|
15
15
|
pruneBackup(req: Request, res: Response): Promise<void>;
|
|
16
16
|
unlockRepo(req: Request, res: Response): Promise<void>;
|
|
17
|
+
deleteReplicationStorage(req: Request, res: Response): Promise<void>;
|
|
17
18
|
getLogs(req: Request, res: Response): Promise<void>;
|
|
18
19
|
downloadLogs(req: Request, res: Response): Promise<void>;
|
|
19
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanController.d.ts","sourceRoot":"","sources":["../../src/controllers/PlanController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,qBAAa,cAAc;IACd,SAAS,CAAC,WAAW,EAAE,WAAW;gBAAxB,WAAW,EAAE,WAAW;IAExC,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBpD,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBnD,2BAA2B,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBvE,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCtD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCtD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBtD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAA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,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCtD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCtD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBtD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzD,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBvD,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBxD,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBvD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBtD,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCpE,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBnD,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class PlanController{planService;constructor(planService){this.planService=planService}async getPlans(req,res){try{const allPlans=await this.planService.getAllPlans();res.status(200).json({success:!0,result:allPlans||[]})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:"Internal Server Error. Details: "+(appError?.message||"Unknown Error")})}}async getPlan(req,res){if(req.params.id)try{const thePlan=await this.planService.getPlan(req.params.id,!0);res.status(200).json({success:!0,result:thePlan})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Internal Server Error"})}else res.status(400).json({success:!1,error:"Plan ID is required"})}async checkActiveBackupsOrRestore(req,res){if(req.params.id)try{const type="restore"===req.query.type?"restore":"backup",hasActiveBackup=await this.planService.checkActiveBackupsOrRestore(req.params.id,type);res.status(200).json({success:!0,result:hasActiveBackup})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:"Internal Server Error. Details: "+(appError?.message||"Unknown Error")})}else res.status(400).json({success:!1,error:"Plan ID is required"})}async createPlan(req,res){const planPayload=req.body;try{if(!(planPayload&&planPayload.settings&&planPayload.settings.interval&&planPayload.storage.id&&planPayload.sourceType&&planPayload.sourceConfig))return void res.status(400).json({success:!1,error:"Required fields missing: interval, storage Id, sourceId, sourceType, sourceConfig"});const plan=await this.planService.createPlan(planPayload);res.status(201).json({success:!0,result:plan})}catch(error){const appError=error;return void res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to create plan"})}}async updatePlan(req,res){const planPayload=req.body.plan;try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required."});if(!planPayload)return void res.status(400).json({success:!1,error:"Payload Missing."});const updatedPlan=await this.planService.updatePlan(req.params.id,planPayload);res.status(200).json({success:!0,result:updatedPlan})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to update plan"})}}async deletePlan(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const removeRemoteData=!!req.query.removeData;await this.planService.deletePlan(req.params.id,removeRemoteData),res.status(200).json({success:!0,message:"Plan deleted successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to delete plan"})}}async performBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});await this.planService.performBackup(req.params.id),res.status(200).json({success:!0,message:"Backup initiated successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to initiate backup"})}}async pauseBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});await this.planService.pauseBackup(req.params.id),res.status(200).json({success:!0,message:"Backup paused successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to pause backup"})}}async resumeBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});await this.planService.resumeBackup(req.params.id),res.status(200).json({success:!0,message:"Backup resumed successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to pause backup"})}}async pruneBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const pruneResult=await this.planService.pruneBackups(req.params.id);res.status(200).json({success:!0,message:pruneResult||"Backup pruned successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to prune backups"})}}async unlockRepo(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const result=await this.planService.unlockRepo(req.params.id);res.status(result.success?200:500).json(result)}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to unlock repository"})}}async getLogs(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const logs=await this.planService.getPlanLogs(req.params.id);res.status(200).json({success:!0,logs:logs})}catch(error){const appError=error;return void res.status(appError.statusCode||500).json({success:!1,error:"Failed to get logs: "+appError.message})}}async downloadLogs(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const fileStream=await this.planService.downloadPlanLogs(req.params.id);res.setHeader("Content-Type","text/plain"),res.setHeader("Content-Disposition",'attachment; filename="plan.log"'),fileStream.pipe(res)}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:`Failed to download logs: ${appError.message}`})}}}
|
|
1
|
+
export class PlanController{planService;constructor(planService){this.planService=planService}async getPlans(req,res){try{const allPlans=await this.planService.getAllPlans();res.status(200).json({success:!0,result:allPlans||[]})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:"Internal Server Error. Details: "+(appError?.message||"Unknown Error")})}}async getPlan(req,res){if(req.params.id)try{const thePlan=await this.planService.getPlan(req.params.id,!0);res.status(200).json({success:!0,result:thePlan})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Internal Server Error"})}else res.status(400).json({success:!1,error:"Plan ID is required"})}async checkActiveBackupsOrRestore(req,res){if(req.params.id)try{const type="restore"===req.query.type?"restore":"backup",hasActiveBackup=await this.planService.checkActiveBackupsOrRestore(req.params.id,type);res.status(200).json({success:!0,result:hasActiveBackup})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:"Internal Server Error. Details: "+(appError?.message||"Unknown Error")})}else res.status(400).json({success:!1,error:"Plan ID is required"})}async createPlan(req,res){const planPayload=req.body;try{if(!(planPayload&&planPayload.settings&&planPayload.settings.interval&&planPayload.storage.id&&planPayload.sourceType&&planPayload.sourceConfig))return void res.status(400).json({success:!1,error:"Required fields missing: interval, storage Id, sourceId, sourceType, sourceConfig"});const plan=await this.planService.createPlan(planPayload);res.status(201).json({success:!0,result:plan})}catch(error){const appError=error;return void res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to create plan"})}}async updatePlan(req,res){const planPayload=req.body.plan;try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required."});if(!planPayload)return void res.status(400).json({success:!1,error:"Payload Missing."});const updatedPlan=await this.planService.updatePlan(req.params.id,planPayload);res.status(200).json({success:!0,result:updatedPlan})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to update plan"})}}async deletePlan(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const removeRemoteData=!!req.query.removeData;await this.planService.deletePlan(req.params.id,removeRemoteData),res.status(200).json({success:!0,message:"Plan deleted successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to delete plan"})}}async performBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});await this.planService.performBackup(req.params.id),res.status(200).json({success:!0,message:"Backup initiated successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError?.message||"Failed to initiate backup"})}}async pauseBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});await this.planService.pauseBackup(req.params.id),res.status(200).json({success:!0,message:"Backup paused successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to pause backup"})}}async resumeBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});await this.planService.resumeBackup(req.params.id),res.status(200).json({success:!0,message:"Backup resumed successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to pause backup"})}}async pruneBackup(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const pruneResult=await this.planService.pruneBackups(req.params.id);res.status(200).json({success:!0,message:pruneResult||"Backup pruned successfully"})}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to prune backups"})}}async unlockRepo(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const result=await this.planService.unlockRepo(req.params.id);res.status(result.success?200:500).json(result)}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to unlock repository"})}}async deleteReplicationStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const{storageID:storageID,storagePath:storagePath,removeData:removeData,replicationId:replicationId}=req.body;if(!storageID||!storagePath)return void res.status(400).json({success:!1,error:"storageID and storagePath are required"});const result=await this.planService.deleteReplicationStorage(req.params.id,storageID,storagePath,!0===removeData,replicationId);res.status(200).json(result)}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:appError.message||"Failed to remove replication storage"})}}async getLogs(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const logs=await this.planService.getPlanLogs(req.params.id);res.status(200).json({success:!0,logs:logs})}catch(error){const appError=error;return void res.status(appError.statusCode||500).json({success:!1,error:"Failed to get logs: "+appError.message})}}async downloadLogs(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Plan ID is required"});const fileStream=await this.planService.downloadPlanLogs(req.params.id);res.setHeader("Content-Type","text/plain"),res.setHeader("Content-Disposition",'attachment; filename="plan.log"'),fileStream.pipe(res)}catch(error){const appError=error;res.status(appError.statusCode||500).json({success:!1,error:`Failed to download logs: ${appError.message}`})}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanController.js","sourceRoot":"","sources":["../../src/controllers/PlanController.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,cAAc;IACJ;IAAtB,YAAsB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAElD,KAAK,CAAC,QAAQ,CAAC,GAAY,EAAE,GAAa;QACzC,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YACtD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,QAAQ,IAAI,EAAE;aACtB,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAG,KAAiB,CAAC;YACnC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;gBAC3C,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,kCAAkC,GAAG,CAAC,QAAQ,EAAE,OAAO,IAAI,eAAe,CAAC;aAClF,CAAC,CAAC;QACJ,CAAC;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AAI,CAAC;oBACpB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,qBAAqB;iBAC5B,CAAC,CAAC;gBACH,OAAO;YACR,CAAC;YAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC1E,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;YAC5C,GAAG,CAAC,SAAS,CAAC,qBAAqB,EAAE,iCAAiC,CAAC,CAAC;YACxE,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAG,KAAiB,CAAC;YACnC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;gBAC3C,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,4BAA4B,QAAQ,CAAC,OAAO,EAAE;aACrD,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestoreController.d.ts","sourceRoot":"","sources":["../../src/controllers/RestoreController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"RestoreController.d.ts","sourceRoot":"","sources":["../../src/controllers/RestoreController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAc5D,qBAAa,iBAAiB;IACjB,SAAS,CAAC,cAAc,EAAE,cAAc;gBAA9B,cAAc,EAAE,cAAc;IAE9C,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IASxD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtD,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB3D,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAczD,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC7D,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC1D,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB9D,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class RestoreController{restoreService;constructor(restoreService){this.restoreService=restoreService}async listRestores(req,res){try{const result=await this.restoreService.getAllRestores();res.json({success:!0,result:result})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch restores"})}}async getRestore(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Restore ID is required"});const restore=await this.restoreService.getRestore(req.params.id);if(!restore)return void res.status(404).json({success:!1,error:"Restore not found"});res.json({success:!0,result:restore})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch restore"})}}async getRestoreStats(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Restore ID is required"});const statsRes=await this.restoreService.getRestoreStats(req.params.id);statsRes.success?res.json({success:!0,result:statsRes.result}):res.status(404).json({success:!1,error:"string"==typeof statsRes.result?statsRes.result:"Restore stats not found"})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch restore stats"})}}async deleteRestore(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Restore ID is required"});await this.restoreService.deleteRestore(req.params.id),res.json({success:!0})}catch(error){res.status(500).json({success:!1,error:"Failed to delete restore"})}}async performDryRestore(req,res){const restorePayload=req.body;if(restorePayload&&restorePayload.backupId&&restorePayload.planId)try{const restoreResult=await this.restoreService.dryRestoreBackup(restorePayload.backupId,{target:restorePayload.target,overwrite:restorePayload.overwrite,includes:restorePayload.includes||[],excludes:restorePayload.excludes||[],delete:restorePayload.delete||!1});res.status(200).json({success:!0,result:restoreResult})}catch(error){res.status(500).json({success:!1,error:"Failed to perform dry restore. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Required fields missing: backupId, planId"})}async performRestore(req,res){const restorePayload=req.body;if(restorePayload&&restorePayload.backupId&&restorePayload.planId)try{const restoreResult=await this.restoreService.restoreBackup(restorePayload.backupId,{target:restorePayload.target,overwrite:restorePayload.overwrite,includes:restorePayload.includes||[],excludes:restorePayload.excludes||[],delete:restorePayload.delete||!1});res.status(200).json({success:!0,result:restoreResult})}catch(error){res.status(500).json({success:!1,error:"Failed to restore backup"})}else res.status(400).json({success:!1,error:"Required fields missing: Backup or Plan Id."})}async getRestoreProgress(req,res){if(req.params.id&&req.query.sourceId&&req.query.sourceType&&req.query.planId)try{const progressRes=await this.restoreService.getRestoreProgress(req.params.id);res.status(200).json(progressRes)}catch(error){res.status(500).json({success:!1,error:"Failed to retrieve Backup Progress"})}else res.status(400).json({success:!1,error:"Backup, Device or Plan ID is missing"})}async cancelRestore(req,res){if(req.params.id)try{const cancelResult=await this.restoreService.cancelRestore(req.params.id);return void res.status(200).json(cancelResult)}catch(error){res.status(500).json({success:!1,error:"Failed to cancel Download Generation. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID or Restore ID is required"})}}
|
|
1
|
+
export class RestoreController{restoreService;constructor(restoreService){this.restoreService=restoreService}async listRestores(req,res){try{const result=await this.restoreService.getAllRestores();res.json({success:!0,result:result})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch restores"})}}async getRestore(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Restore ID is required"});const restore=await this.restoreService.getRestore(req.params.id);if(!restore)return void res.status(404).json({success:!1,error:"Restore not found"});res.json({success:!0,result:restore})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch restore"})}}async getRestoreStats(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Restore ID is required"});const statsRes=await this.restoreService.getRestoreStats(req.params.id);statsRes.success?res.json({success:!0,result:statsRes.result}):res.status(404).json({success:!1,error:"string"==typeof statsRes.result?statsRes.result:"Restore stats not found"})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch restore stats"})}}async deleteRestore(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Restore ID is required"});await this.restoreService.deleteRestore(req.params.id),res.json({success:!0})}catch(error){res.status(500).json({success:!1,error:"Failed to delete restore"})}}async performDryRestore(req,res){const restorePayload=req.body;if(restorePayload&&restorePayload.backupId&&restorePayload.planId)try{const restoreResult=await this.restoreService.dryRestoreBackup(restorePayload.backupId,{target:restorePayload.target,overwrite:restorePayload.overwrite,includes:restorePayload.includes||[],excludes:restorePayload.excludes||[],delete:restorePayload.delete||!1,storageId:restorePayload.storageId||void 0,replicationId:restorePayload.replicationId||void 0});res.status(200).json({success:!0,result:restoreResult})}catch(error){res.status(500).json({success:!1,error:"Failed to perform dry restore. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Required fields missing: backupId, planId"})}async performRestore(req,res){const restorePayload=req.body;if(restorePayload&&restorePayload.backupId&&restorePayload.planId)try{const restoreResult=await this.restoreService.restoreBackup(restorePayload.backupId,{target:restorePayload.target,overwrite:restorePayload.overwrite,includes:restorePayload.includes||[],excludes:restorePayload.excludes||[],delete:restorePayload.delete||!1,storageId:restorePayload.storageId||void 0,replicationId:restorePayload.replicationId||void 0});res.status(200).json({success:!0,result:restoreResult})}catch(error){res.status(500).json({success:!1,error:"Failed to restore backup"})}else res.status(400).json({success:!1,error:"Required fields missing: Backup or Plan Id."})}async getRestoreProgress(req,res){if(req.params.id&&req.query.sourceId&&req.query.sourceType&&req.query.planId)try{const progressRes=await this.restoreService.getRestoreProgress(req.params.id);res.status(200).json(progressRes)}catch(error){res.status(500).json({success:!1,error:"Failed to retrieve Backup Progress"})}else res.status(400).json({success:!1,error:"Backup, Device or Plan ID is missing"})}async cancelRestore(req,res){if(req.params.id)try{const cancelResult=await this.restoreService.cancelRestore(req.params.id);return void res.status(200).json(cancelResult)}catch(error){res.status(500).json({success:!1,error:"Failed to cancel Download Generation. "+(error.message||"")})}else res.status(400).json({success:!1,error:"Backup ID or Restore ID is required"})}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestoreController.js","sourceRoot":"","sources":["../../src/controllers/RestoreController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RestoreController.js","sourceRoot":"","sources":["../../src/controllers/RestoreController.ts"],"names":[],"mappings":"AAeA,MAAM,OAAO,iBAAiB;IACP;IAAtB,YAAsB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAExD,KAAK,CAAC,YAAY,CAAC,GAAY,EAAE,GAAa;QAC7C,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;YAC1D,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;QAC7E,CAAC;IACF,CAAC;IAED,KAAK,CAAC,UAAU,CAA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B,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;YACpD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,wCAAwC,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;aACvE,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageController.d.ts","sourceRoot":"","sources":["../../src/controllers/StorageController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,qBAAa,iBAAiB;IACjB,SAAS,CAAC,cAAc,EAAE,cAAc;gBAA9B,cAAc,EAAE,cAAc;IAE9C,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IASxD,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IASrE,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBtD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAezD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"StorageController.d.ts","sourceRoot":"","sources":["../../src/controllers/StorageController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,qBAAa,iBAAiB;IACjB,SAAS,CAAC,cAAc,EAAE,cAAc;gBAA9B,cAAc,EAAE,cAAc;IAE9C,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IASxD,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IASrE,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBtD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAezD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBzD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAczD,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAYlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{StorageLogger}from"../utils/logger";export class StorageController{storageService;constructor(storageService){this.storageService=storageService}async listStorages(req,res){try{const allStorages=await this.storageService.getStorages();res.json({success:!0,result:allStorages})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch storages"})}}async listAvailableStorageTypes(req,res){try{const result=await this.storageService.getAvailableStorageTypes();res.json({success:!0,result:result})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch available storages"})}}async getStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Storage ID is required"});const storage=await this.storageService.getStorage(req.params.id);res.json({success:!0,result:storage})}catch(error){const notFound=error?.message.includes("not found");res.status(notFound?404:500).json({success:!1,error:error?.message||"Failed to fetch storage"})}}async createStorage(req,res){try{if(!(req.body.name&&req.body.type&&req.body.settings&&req.body.credentials))return void res.status(400).json({success:!1,error:"Name, type, credentials and settings are required"});const newStorage=await this.storageService.createStorage(req.body);res.status(201).json({success:!0,result:newStorage})}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to create storage"})}}async updateStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Storage ID is required"});const result=await this.storageService.updateStorage(req.params.id,req.body);res.json({success:!0,result:result})}catch(error){StorageLogger.error(`Error updating storage #${req.params.id}. Reason : ${error?.message.toString()||"Unknown Error"}`),res.status(500).json({success:!1,error:"Failed to update storage"})}}async deleteStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Storage ID is required"});await this.storageService.deleteStorage(req.params.id),res.json({success:!0})}catch(error){StorageLogger.error(`Error deleting storage #${req.params.id}. Reason : ${error?.message.toString()||"Unknown Error"}`),res.status(500).json({success:!1,error
|
|
1
|
+
import{StorageLogger}from"../utils/logger";export class StorageController{storageService;constructor(storageService){this.storageService=storageService}async listStorages(req,res){try{const allStorages=await this.storageService.getStorages();res.json({success:!0,result:allStorages})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch storages"})}}async listAvailableStorageTypes(req,res){try{const result=await this.storageService.getAvailableStorageTypes();res.json({success:!0,result:result})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch available storages"})}}async getStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Storage ID is required"});const storage=await this.storageService.getStorage(req.params.id);res.json({success:!0,result:storage})}catch(error){const notFound=error?.message.includes("not found");res.status(notFound?404:500).json({success:!1,error:error?.message||"Failed to fetch storage"})}}async createStorage(req,res){try{if(!(req.body.name&&req.body.type&&req.body.settings&&req.body.credentials))return void res.status(400).json({success:!1,error:"Name, type, credentials and settings are required"});const newStorage=await this.storageService.createStorage(req.body);res.status(201).json({success:!0,result:newStorage})}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to create storage"})}}async updateStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Storage ID is required"});const result=await this.storageService.updateStorage(req.params.id,req.body);res.json({success:!0,result:result})}catch(error){StorageLogger.error(`Error updating storage #${req.params.id}. Reason : ${error?.message.toString()||"Unknown Error"}`),res.status(500).json({success:!1,error:"Failed to update storage"})}}async deleteStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Storage ID is required"});await this.storageService.deleteStorage(req.params.id),res.json({success:!0})}catch(error){StorageLogger.error(`Error deleting storage #${req.params.id}. Reason : ${error?.message.toString()||"Unknown Error"}`),res.status(500).json({success:!1,error:`Failed to delete storage. Reason : ${error?.message.toString()||"Unknown Error"}`})}}async verifyStorage(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Storage ID is required"});const result=await this.storageService.verifyStorage(req.params.id);res.json({success:!0,result:result})}catch(error){res.status(500).json({success:!1,error:"Failed to verify storage"})}}async authorizeStorage(req,res){try{if(!req.query.type)return void res.status(400).json({success:!1,error:"Storage type is required"});const rcloneAuthResp=await this.storageService.authorizeStorage(req.query.type);res.status(200).json({success:!0,result:rcloneAuthResp})}catch(error){res.status(500).json({success:!1,error:"Failed to authorize storage"})}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageController.js","sourceRoot":"","sources":["../../src/controllers/StorageController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,OAAO,iBAAiB;IACP;IAAtB,YAAsB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAExD,KAAK,CAAC,YAAY,CAAC,GAAY,EAAE,GAAa;QAC7C,IAA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d.ts","sourceRoot":"","sources":["../src/createApp.ts"],"names":[],"mappings":"AAEA,OAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"createApp.d.ts","sourceRoot":"","sources":["../src/createApp.ts"],"names":[],"mappings":"AAEA,OAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAmDhD,wBAAsB,SAAS,IAAI,OAAO,CAAC;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC,CAyL3D"}
|
package/dist/createApp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import path from"path";import{fileURLToPath}from"url";import express from"express";import cors from"cors";import helmet from"helmet";import rateLimit from"express-rate-limit";import{db}from"./db";import{createPlanRouter}from"./routes/plans";import{createDeviceRouter}from"./routes/devices";import{createStorageRouter}from"./routes/storages";import{createRestoreRouter}from"./routes/restores";import{createUserRouter}from"./routes/users";import{createSettingsRouter}from"./routes/settings";import{createHealthRouter}from"./routes/health";import{createSetupRouter}from"./routes/setup";import{PlanController}from"./controllers/PlanController";import{DeviceController}from"./controllers/DeviceController";import{StorageController}from"./controllers/StorageController";import{RestoreController}from"./controllers/RestoreController";import{UserController}from"./controllers/UserController";import{SettingsController}from"./controllers/SettingsController";import{SetupController}from"./controllers/SetupController";import{createBackupRouter}from"./routes/backups";import{BackupController}from"./controllers/BackupController";import versionMiddleware from"./middlewares/versionMiddleware";import{PlanStore}from"./stores/PlanStore";import{BackupStore}from"./stores/BackupStore";import{PlanService}from"./services/PlanService";import{RestoreStore}from"./stores/RestoreStore";import{SettingsStore}from"./stores/SettingsStore";import{StorageStore}from"./stores/StorageStore";import{DeviceStore}from"./stores/DeviceStore";import{BaseBackupManager}from"./managers";import{BackupEventListener}from"./services/listeners/BackupEventListener";import{BackupService}from"./services/BackupServices";import{BaseSnapshotManager}from"./managers/BaseSnapshotManager";import{RestoreService}from"./services/RestoreService";import{RestoreEventListener}from"./services/listeners/RestoreEventListener";import{DownloadEventListener}from"./services/listeners/DownloadEventListener";import{DeviceService}from"./services/DeviceService";import{BaseSystemManager}from"./managers/BaseSystemManager";import{BaseStorageManager}from"./managers/BaseStorageManager";import{StorageService}from"./services/StorageService";import{SettingsService}from"./services/SettingsService";import{systemTaskManager}from"./jobs/SystemTaskManager";import{jobProcessor}from"./jobs/JobProcessor";import{initializeLogger}from"./utils/logger";import{configService}from"./services/ConfigService";import{BaseRestoreManager}from"./managers/BaseRestoreManager";export async function createApp(){initializeLogger();const planStore=new PlanStore(db),backupStore=new BackupStore(db),storageStore=new StorageStore(db),deviceStore=new DeviceStore(db),restoreStore=new RestoreStore(db),settingsStore=new SettingsStore(db),localPlanAgent=new BaseBackupManager,localBackupAgent=new BaseSnapshotManager,localRestoreAgent=new BaseRestoreManager,localSystemAgent=new BaseSystemManager,localStorageAgent=new BaseStorageManager;new BackupEventListener(localPlanAgent,planStore,backupStore),new RestoreEventListener(localRestoreAgent,planStore,backupStore,restoreStore),new DownloadEventListener(localBackupAgent,backupStore);const planService=new PlanService(localPlanAgent,planStore,backupStore,storageStore,deviceStore,restoreStore),backupService=new BackupService(localBackupAgent,localPlanAgent,planStore,backupStore,restoreStore,storageStore),restoreService=new RestoreService(localRestoreAgent,planStore,backupStore,restoreStore,storageStore),deviceService=new DeviceService(localSystemAgent,deviceStore,planStore,storageStore),storageService=new StorageService(localStorageAgent,localSystemAgent,storageStore,planStore),settingsService=new SettingsService(settingsStore),planController=new PlanController(planService),backupController=new BackupController(backupService),restoreController=new RestoreController(restoreService),deviceController=new DeviceController(deviceService),storageController=new StorageController(storageService),settingsController=new SettingsController(settingsService),userController=new UserController,setupController=new SetupController,app=express();app.use(cors({origin:[process.env.APP_URL,configService.config.APP_URL||"http://mypluton.com"],credentials:!0,methods:["GET","POST","PUT","DELETE","OPTIONS"],exposedHeaders:["X-App-Version","X-Server-OS"]})),app.use(versionMiddleware),app.use(express.json());const appUrl=configService.config.APP_URL||"http://localhost",serverPort=configService.config.SERVER_PORT,isDev=configService.isDevelopment(),connectSrc=["'self'",appUrl,(req,_res)=>{const host=req.headers.host;if(host){return`${"https"===req.headers["x-forwarded-proto"]?"https":"http"}://${host}`}return`http://localhost:${serverPort}`}];isDev&&connectSrc.push(`http://localhost:${serverPort}`,`http://127.0.0.1:${serverPort}`),app.use(helmet({contentSecurityPolicy:{directives:{defaultSrc:["'self'"],scriptSrc:["'self'","'unsafe-inline'"],styleSrc:["'self'","'unsafe-inline'"],imgSrc:["'self'","data:","blob:"],fontSrc:["'self'","data:"],connectSrc:connectSrc,frameAncestors:["'none'"],baseUri:["'self'"],formAction:["'self'"],upgradeInsecureRequests:isDev?null:[]}},hsts:!1}));const __filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename),publicPath=path.join(__dirname,"..","public");app.use(express.static(publicPath));const apiLimiter=rateLimit({windowMs:9e5,max:1e3,standardHeaders:!0,legacyHeaders:!1});app.use("/api/",apiLimiter);const setupLimiter=rateLimit({windowMs:9e5,max:10,standardHeaders:!0,legacyHeaders:!1}),authLimiter=rateLimit({windowMs:9e5,max:10});return app.use("/api/setup",setupLimiter,createSetupRouter(setupController)),app.use("/api/user",createUserRouter(userController,authLimiter)),app.use("/api/plans",createPlanRouter(planController)),app.use("/api/backups",createBackupRouter(backupController)),app.use("/api/devices",createDeviceRouter(deviceController)),app.use("/api/storages",createStorageRouter(storageController)),app.use("/api/restores",createRestoreRouter(restoreController)),app.use("/api/settings",createSettingsRouter(settingsController)),app.use("/api/health",createHealthRouter()),app.get("{*path}",(req,res)=>{res.sendFile(path.join(publicPath,"index.html"))}),systemTaskManager.initialize(),jobProcessor.registerTasks({backupManager:localPlanAgent,restoreManager:localRestoreAgent}),jobProcessor.start(),{app:app}}
|
|
1
|
+
import path from"path";import{fileURLToPath}from"url";import express from"express";import cors from"cors";import helmet from"helmet";import rateLimit from"express-rate-limit";import{db}from"./db";import{createPlanRouter}from"./routes/plans";import{createDeviceRouter}from"./routes/devices";import{createStorageRouter}from"./routes/storages";import{createRestoreRouter}from"./routes/restores";import{createUserRouter}from"./routes/users";import{createSettingsRouter}from"./routes/settings";import{createHealthRouter}from"./routes/health";import{createSetupRouter}from"./routes/setup";import{PlanController}from"./controllers/PlanController";import{DeviceController}from"./controllers/DeviceController";import{StorageController}from"./controllers/StorageController";import{RestoreController}from"./controllers/RestoreController";import{UserController}from"./controllers/UserController";import{SettingsController}from"./controllers/SettingsController";import{SetupController}from"./controllers/SetupController";import{createBackupRouter}from"./routes/backups";import{BackupController}from"./controllers/BackupController";import versionMiddleware from"./middlewares/versionMiddleware";import{PlanStore}from"./stores/PlanStore";import{BackupStore}from"./stores/BackupStore";import{PlanService}from"./services/PlanService";import{RestoreStore}from"./stores/RestoreStore";import{SettingsStore}from"./stores/SettingsStore";import{StorageStore}from"./stores/StorageStore";import{DeviceStore}from"./stores/DeviceStore";import{BaseBackupManager}from"./managers";import{BackupEventListener}from"./services/listeners/BackupEventListener";import{ReplicationEventListener}from"./services/listeners/ReplicationEventListener";import{BackupService}from"./services/BackupServices";import{BaseSnapshotManager}from"./managers/BaseSnapshotManager";import{RestoreService}from"./services/RestoreService";import{RestoreEventListener}from"./services/listeners/RestoreEventListener";import{DownloadEventListener}from"./services/listeners/DownloadEventListener";import{DeviceService}from"./services/DeviceService";import{BaseSystemManager}from"./managers/BaseSystemManager";import{BaseStorageManager}from"./managers/BaseStorageManager";import{StorageService}from"./services/StorageService";import{SettingsService}from"./services/SettingsService";import{systemTaskManager}from"./jobs/SystemTaskManager";import{jobProcessor}from"./jobs/JobProcessor";import{initializeLogger}from"./utils/logger";import{configService}from"./services/ConfigService";import{BaseRestoreManager}from"./managers/BaseRestoreManager";export async function createApp(){initializeLogger();const planStore=new PlanStore(db),backupStore=new BackupStore(db),storageStore=new StorageStore(db),deviceStore=new DeviceStore(db),restoreStore=new RestoreStore(db),settingsStore=new SettingsStore(db),localPlanAgent=new BaseBackupManager,localBackupAgent=new BaseSnapshotManager,localRestoreAgent=new BaseRestoreManager,localSystemAgent=new BaseSystemManager,localStorageAgent=new BaseStorageManager;new BackupEventListener(localPlanAgent,planStore,backupStore),new ReplicationEventListener(localPlanAgent,planStore,backupStore,storageStore),new RestoreEventListener(localRestoreAgent,planStore,backupStore,restoreStore),new DownloadEventListener(localBackupAgent,backupStore);const planService=new PlanService(localPlanAgent,planStore,backupStore,storageStore,deviceStore,restoreStore),backupService=new BackupService(localBackupAgent,localPlanAgent,planStore,backupStore,restoreStore,storageStore),restoreService=new RestoreService(localRestoreAgent,planStore,backupStore,restoreStore,storageStore),deviceService=new DeviceService(localSystemAgent,deviceStore,planStore,storageStore),storageService=new StorageService(localStorageAgent,localSystemAgent,storageStore,planStore),settingsService=new SettingsService(settingsStore),planController=new PlanController(planService),backupController=new BackupController(backupService),restoreController=new RestoreController(restoreService),deviceController=new DeviceController(deviceService),storageController=new StorageController(storageService),settingsController=new SettingsController(settingsService),userController=new UserController,setupController=new SetupController,app=express();app.use(cors({origin:[process.env.APP_URL,configService.config.APP_URL||"http://mypluton.com"],credentials:!0,methods:["GET","POST","PUT","DELETE","OPTIONS"],exposedHeaders:["X-App-Version","X-Server-OS","X-Install-Type","X-Setup-Pending"]})),app.use(versionMiddleware),app.use(express.json());const appUrl=configService.config.APP_URL||"http://localhost",serverPort=configService.config.SERVER_PORT,isDev=configService.isDevelopment(),connectSrc=["'self'",appUrl,(req,_res)=>{const host=req.headers.host;if(host){return`${"https"===req.headers["x-forwarded-proto"]?"https":"http"}://${host}`}return`http://localhost:${serverPort}`}];isDev&&connectSrc.push(`http://localhost:${serverPort}`,`http://127.0.0.1:${serverPort}`),app.use(helmet({contentSecurityPolicy:{directives:{defaultSrc:["'self'"],scriptSrc:["'self'","'unsafe-inline'"],styleSrc:["'self'","'unsafe-inline'"],imgSrc:["'self'","data:","blob:"],fontSrc:["'self'","data:"],connectSrc:connectSrc,frameAncestors:["'none'"],baseUri:["'self'"],formAction:["'self'"],upgradeInsecureRequests:isDev?null:[]}},hsts:!1}));const __filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename),publicPath=path.join(__dirname,"..","public");app.use(express.static(publicPath));const apiLimiter=rateLimit({windowMs:9e5,max:1e3,standardHeaders:!0,legacyHeaders:!1});app.use("/api/",apiLimiter);const setupLimiter=rateLimit({windowMs:9e5,max:10,standardHeaders:!0,legacyHeaders:!1}),authLimiter=rateLimit({windowMs:9e5,max:10});return app.use("/api/setup",setupLimiter,createSetupRouter(setupController)),app.use("/api/user",createUserRouter(userController,authLimiter)),app.use("/api/plans",createPlanRouter(planController)),app.use("/api/backups",createBackupRouter(backupController)),app.use("/api/devices",createDeviceRouter(deviceController)),app.use("/api/storages",createStorageRouter(storageController)),app.use("/api/restores",createRestoreRouter(restoreController)),app.use("/api/settings",createSettingsRouter(settingsController)),app.use("/api/health",createHealthRouter()),app.get("{*path}",(req,res)=>{res.sendFile(path.join(publicPath,"index.html"))}),systemTaskManager.initialize(),jobProcessor.registerTasks({backupManager:localPlanAgent,restoreManager:localRestoreAgent}),jobProcessor.start(),{app:app}}
|
package/dist/createApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApp.js","sourceRoot":"","sources":["../src/createApp.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,OAAyB,MAAM,SAAS,CAAC;AAEhD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mB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ACnD,CAAC,CAAC,CAAC;IAEH,8BAA8B;IAC9B,iBAAiB,CAAC,UAAU,EAAE,CAAC;IAE/B,6BAA6B;IAC7B,YAAY,CAAC,aAAa,CAAC;QAC1B,aAAa,EAAE,cAAc;QAC7B,cAAc,EAAE,iBAAiB;KACjC,CAAC,CAAC;IAEH,YAAY,CAAC,KAAK,EAAE,CAAC;IAErB,OAAO,EAAE,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
package/dist/db/index.d.ts
CHANGED
|
@@ -1706,6 +1706,25 @@ export declare const db: import("drizzle-orm/better-sqlite3").BetterSQLite3Datab
|
|
|
1706
1706
|
}, {}, {
|
|
1707
1707
|
$type: import("../types/backups").BackupCompletionStats;
|
|
1708
1708
|
}>;
|
|
1709
|
+
mirrors: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
1710
|
+
name: "mirrors";
|
|
1711
|
+
tableName: "backups";
|
|
1712
|
+
dataType: "json";
|
|
1713
|
+
columnType: "SQLiteTextJson";
|
|
1714
|
+
data: import("../types/backups").BackupMirror[];
|
|
1715
|
+
driverParam: string;
|
|
1716
|
+
notNull: false;
|
|
1717
|
+
hasDefault: false;
|
|
1718
|
+
isPrimaryKey: false;
|
|
1719
|
+
isAutoincrement: false;
|
|
1720
|
+
hasRuntimeDefault: false;
|
|
1721
|
+
enumValues: undefined;
|
|
1722
|
+
baseColumn: never;
|
|
1723
|
+
identity: undefined;
|
|
1724
|
+
generated: undefined;
|
|
1725
|
+
}, {}, {
|
|
1726
|
+
$type: import("../types/backups").BackupMirror[];
|
|
1727
|
+
}>;
|
|
1709
1728
|
};
|
|
1710
1729
|
dialect: "sqlite";
|
|
1711
1730
|
}>;
|
package/dist/db/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AActC,eAAO,MAAM,EAAE
|
|
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ats, BackupTaskStats } from '../../types/backups';
|
|
1
|
+
import { BackupCompletionStats, BackupDownload, BackupMirror, BackupProgressStats, BackupTaskStats } from '../../types/backups';
|
|
2
2
|
import { PlanSource } from '../../types/plans';
|
|
3
3
|
import { SourceTypes } from '../../types/source';
|
|
4
4
|
export declare const backups: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
@@ -463,6 +463,25 @@ export declare const backups: import("drizzle-orm/sqlite-core").SQLiteTableWithC
|
|
|
463
463
|
}, {}, {
|
|
464
464
|
$type: BackupCompletionStats;
|
|
465
465
|
}>;
|
|
466
|
+
mirrors: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
467
|
+
name: "mirrors";
|
|
468
|
+
tableName: "backups";
|
|
469
|
+
dataType: "json";
|
|
470
|
+
columnType: "SQLiteTextJson";
|
|
471
|
+
data: BackupMirror[];
|
|
472
|
+
driverParam: string;
|
|
473
|
+
notNull: false;
|
|
474
|
+
hasDefault: false;
|
|
475
|
+
isPrimaryKey: false;
|
|
476
|
+
isAutoincrement: false;
|
|
477
|
+
hasRuntimeDefault: false;
|
|
478
|
+
enumValues: undefined;
|
|
479
|
+
baseColumn: never;
|
|
480
|
+
identity: undefined;
|
|
481
|
+
generated: undefined;
|
|
482
|
+
}, {}, {
|
|
483
|
+
$type: BackupMirror[];
|
|
484
|
+
}>;
|
|
466
485
|
};
|
|
467
486
|
dialect: "sqlite";
|
|
468
487
|
}>;
|
|
@@ -927,6 +946,25 @@ export declare const backupInsertSchema: import("drizzle-zod").BuildSchema<"inse
|
|
|
927
946
|
}, {}, {
|
|
928
947
|
$type: BackupCompletionStats;
|
|
929
948
|
}>;
|
|
949
|
+
mirrors: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
950
|
+
name: "mirrors";
|
|
951
|
+
tableName: "backups";
|
|
952
|
+
dataType: "json";
|
|
953
|
+
columnType: "SQLiteTextJson";
|
|
954
|
+
data: BackupMirror[];
|
|
955
|
+
driverParam: string;
|
|
956
|
+
notNull: false;
|
|
957
|
+
hasDefault: false;
|
|
958
|
+
isPrimaryKey: false;
|
|
959
|
+
isAutoincrement: false;
|
|
960
|
+
hasRuntimeDefault: false;
|
|
961
|
+
enumValues: undefined;
|
|
962
|
+
baseColumn: never;
|
|
963
|
+
identity: undefined;
|
|
964
|
+
generated: undefined;
|
|
965
|
+
}, {}, {
|
|
966
|
+
$type: BackupMirror[];
|
|
967
|
+
}>;
|
|
930
968
|
}, undefined, undefined>;
|
|
931
969
|
export declare const backupUpdateSchema: import("drizzle-zod").BuildSchema<"update", {
|
|
932
970
|
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
@@ -1387,6 +1425,25 @@ export declare const backupUpdateSchema: import("drizzle-zod").BuildSchema<"upda
|
|
|
1387
1425
|
}, {}, {
|
|
1388
1426
|
$type: BackupCompletionStats;
|
|
1389
1427
|
}>;
|
|
1428
|
+
mirrors: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
1429
|
+
name: "mirrors";
|
|
1430
|
+
tableName: "backups";
|
|
1431
|
+
dataType: "json";
|
|
1432
|
+
columnType: "SQLiteTextJson";
|
|
1433
|
+
data: BackupMirror[];
|
|
1434
|
+
driverParam: string;
|
|
1435
|
+
notNull: false;
|
|
1436
|
+
hasDefault: false;
|
|
1437
|
+
isPrimaryKey: false;
|
|
1438
|
+
isAutoincrement: false;
|
|
1439
|
+
hasRuntimeDefault: false;
|
|
1440
|
+
enumValues: undefined;
|
|
1441
|
+
baseColumn: never;
|
|
1442
|
+
identity: undefined;
|
|
1443
|
+
generated: undefined;
|
|
1444
|
+
}, {}, {
|
|
1445
|
+
$type: BackupMirror[];
|
|
1446
|
+
}>;
|
|
1390
1447
|
}, undefined, undefined>;
|
|
1391
1448
|
export declare const backupSelectSchema: import("drizzle-zod").BuildSchema<"select", {
|
|
1392
1449
|
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
@@ -1847,6 +1904,25 @@ export declare const backupSelectSchema: import("drizzle-zod").BuildSchema<"sele
|
|
|
1847
1904
|
}, {}, {
|
|
1848
1905
|
$type: BackupCompletionStats;
|
|
1849
1906
|
}>;
|
|
1907
|
+
mirrors: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
1908
|
+
name: "mirrors";
|
|
1909
|
+
tableName: "backups";
|
|
1910
|
+
dataType: "json";
|
|
1911
|
+
columnType: "SQLiteTextJson";
|
|
1912
|
+
data: BackupMirror[];
|
|
1913
|
+
driverParam: string;
|
|
1914
|
+
notNull: false;
|
|
1915
|
+
hasDefault: false;
|
|
1916
|
+
isPrimaryKey: false;
|
|
1917
|
+
isAutoincrement: false;
|
|
1918
|
+
hasRuntimeDefault: false;
|
|
1919
|
+
enumValues: undefined;
|
|
1920
|
+
baseColumn: never;
|
|
1921
|
+
identity: undefined;
|
|
1922
|
+
generated: undefined;
|
|
1923
|
+
}, {}, {
|
|
1924
|
+
$type: BackupMirror[];
|
|
1925
|
+
}>;
|
|
1850
1926
|
}, undefined, undefined>;
|
|
1851
1927
|
export declare const backupRelations: import("drizzle-orm").Relations<"backups", {
|
|
1852
1928
|
plan: import("drizzle-orm").One<"plans", false>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backups.d.ts","sourceRoot":"","sources":["../../../src/db/schema/backups.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"backups.d.ts","sourceRoot":"","sources":["../../../src/db/schema/backups.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAA8B,CAAC;AAC9D,eAAO,MAAM,eAAe;;EAKzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sql}from"drizzle-orm/sql";import{sqliteTable,text,integer}from"drizzle-orm/sqlite-core";import{createInsertSchema,createSelectSchema,createUpdateSchema}from"drizzle-zod";import{storages}from"./storages";import{plans}from"./plans";import{relations}from"drizzle-orm";export const backups=sqliteTable("backups",{id:text("id").notNull().primaryKey(),title:text("title"),description:text("description"),createdAt:integer("created_at",{mode:"timestamp"}).notNull().default(sql`(unixepoch())`),updatedAt:integer("updated_at",{mode:"timestamp"}),started:integer("started_at",{mode:"timestamp"}),ended:integer("ended_at",{mode:"timestamp"}),inProgress:integer("in_progress",{mode:"boolean"}),success:integer("success",{mode:"boolean"}),active:integer("active",{mode:"boolean"}).default(!0),status:text("status"),errorMsg:text("error_msg"),planId:text("plan_id").references(()=>plans.id),storageId:text("storage_id").references(()=>storages.id),storagePath:text("storage_path"),sourceId:text("source_id").notNull(),method:text("method").notNull(),sourceType:text("source_type").$type().notNull().default("device"),sourceConfig:text("source_config",{mode:"json"}).$type(),encryption:integer("encryption",{mode:"boolean"}).default(!0),compression:integer("compression",{mode:"boolean"}).default(!1),download:text("download",{mode:"json"}).$type(),taskStats:text("task_stats",{mode:"json"}).$type(),progressStats:text("progress_stats",{mode:"json"}).$type(),completionStats:text("completion_stats",{mode:"json"}).$type()});export const backupInsertSchema=createInsertSchema(backups);export const backupUpdateSchema=createUpdateSchema(backups);export const backupSelectSchema=createSelectSchema(backups);export const backupRelations=relations(backups,({one:one})=>({plan:one(plans,{fields:[backups.planId],references:[plans.id]})}));
|
|
1
|
+
import{sql}from"drizzle-orm/sql";import{sqliteTable,text,integer}from"drizzle-orm/sqlite-core";import{createInsertSchema,createSelectSchema,createUpdateSchema}from"drizzle-zod";import{storages}from"./storages";import{plans}from"./plans";import{relations}from"drizzle-orm";export const backups=sqliteTable("backups",{id:text("id").notNull().primaryKey(),title:text("title"),description:text("description"),createdAt:integer("created_at",{mode:"timestamp"}).notNull().default(sql`(unixepoch())`),updatedAt:integer("updated_at",{mode:"timestamp"}),started:integer("started_at",{mode:"timestamp"}),ended:integer("ended_at",{mode:"timestamp"}),inProgress:integer("in_progress",{mode:"boolean"}),success:integer("success",{mode:"boolean"}),active:integer("active",{mode:"boolean"}).default(!0),status:text("status"),errorMsg:text("error_msg"),planId:text("plan_id").references(()=>plans.id),storageId:text("storage_id").references(()=>storages.id),storagePath:text("storage_path"),sourceId:text("source_id").notNull(),method:text("method").notNull(),sourceType:text("source_type").$type().notNull().default("device"),sourceConfig:text("source_config",{mode:"json"}).$type(),encryption:integer("encryption",{mode:"boolean"}).default(!0),compression:integer("compression",{mode:"boolean"}).default(!1),download:text("download",{mode:"json"}).$type(),taskStats:text("task_stats",{mode:"json"}).$type(),progressStats:text("progress_stats",{mode:"json"}).$type(),completionStats:text("completion_stats",{mode:"json"}).$type(),mirrors:text("mirrors",{mode:"json"}).$type()});export const backupInsertSchema=createInsertSchema(backups);export const backupUpdateSchema=createUpdateSchema(backups);export const backupSelectSchema=createSelectSchema(backups);export const backupRelations=relations(backups,({one:one})=>({plan:one(plans,{fields:[backups.planId],references:[plans.id]})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backups.js","sourceRoot":"","sources":["../../../src/db/schema/backups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAmB,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,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I,IAAI,IAAI,IAAI;IAQnB;;;OAGG;YACW,YAAY;CAiG1B;AAED,eAAO,MAAM,YAAY,cAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EventEmitter}from"events";import{jobQueue}from"./JobQueue";import{logger}from"../utils/logger";import{CleanDownloadsTask}from"./tasks/CleanDownloadsTask";import{BackupTask}from"./tasks/BackupTask";import{configService}from"../services/ConfigService";import{RestoreTask}from"./tasks/RestoreTask";class JobProcessor extends EventEmitter{static instance;isRunning=!1;intervalId=null;tasks=new Map;activeBackupJobs=0;constructor(){super()}static getInstance(){return JobProcessor.instance||(JobProcessor.instance=new JobProcessor),JobProcessor.instance}registerTasks(dependencies){const tasksToRegister=[new CleanDownloadsTask];dependencies.backupManager&&tasksToRegister.push(new BackupTask(dependencies.backupManager)),dependencies.restoreManager&&tasksToRegister.push(new RestoreTask(dependencies.restoreManager));for(const task of tasksToRegister)this.tasks.set(task.name,task)}addTask(task){this.tasks.has(task.name)&&logger.warn({module:"JobProcessor",task:task.name},"A task with this name is already registered. It will be overwritten."),this.tasks.set(task.name,task)}start(interval=5e3){this.intervalId?logger.warn({module:"JobProcessor"},"Job processor is already running."):0!==this.tasks.size?(logger.info({module:"JobProcessor"},"Starting job processor."),this.intervalId=setInterval(()=>this.processQueue(),interval)):logger.warn({module:"JobProcessor"},"No tasks registered. Job processor will not start.")}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null,logger.info({module:"JobProcessor"},"Stopped job processor."))}async processQueue(){if(this.isRunning)return;const job=jobQueue.getNext();if(!job)return;if("Backup"===job.name&&this.activeBackupJobs>=configService.config.MAX_CONCURRENT_BACKUPS)return void jobQueue.requeueAtFront(job);const now=Date.now();if(job.lastAttempt&&now-job.lastAttempt<job.retryDelay){const timeLeft=Math.round((job.retryDelay-(now-job.lastAttempt))/1e3);return logger.info({module:"JobProcessor"},`Delaying retry for job '${job.name}'. Next attempt in ~${timeLeft}s.`),void jobQueue.reQueue(job)}this.isRunning=!0,"Backup"===job.name&&this.activeBackupJobs++,logger.info({module:"JobProcessor"},`Processing job: ${job.name}. Active backups: ${this.activeBackupJobs}`);const task=this.tasks.get(job.name);if(!task)return logger.error({module:"JobProcessor"},`No task registered for job name: ${job.name}`),jobQueue.failJob(job),this.isRunning=!1,void("Backup"===job.name&&this.activeBackupJobs--);try{await task.run(job),jobQueue.completeJob()}catch(error){const errorMessage=error instanceof Error?error.message:String(error);if(errorMessage.startsWith("BACKUP_CANCELLED:")||errorMessage.startsWith("RESTORE_CANCELLED:"))return logger.info({module:"JobProcessor",job:job.name},"Job was cancelled by user"),void jobQueue.completeJob();logger.error({module:"JobProcessor",job:job.name,error:error.message},`Job failed during execution. Attempt ${job.attempts+1} of ${job.maxAttempts}.`);jobQueue.failJob(job)&&(logger.error({module:"JobProcessor",job:job.name},`Job has permanently failed after ${job.maxAttempts} attempts.`),this.emit(`${job.name.toLowerCase()}_failed`,{...job.payload,error:error.message||"Unknown error after multiple retries."}))}finally{this.isRunning=!1,"Backup"===job.name&&this.activeBackupJobs--}}}export const jobProcessor=JobProcessor.getInstance();
|
|
1
|
+
import{EventEmitter}from"events";import{jobQueue}from"./JobQueue";import{logger}from"../utils/logger";import{CleanDownloadsTask}from"./tasks/CleanDownloadsTask";import{BackupTask}from"./tasks/BackupTask";import{configService}from"../services/ConfigService";import{RestoreTask}from"./tasks/RestoreTask";import{ReplicationRetryTask}from"./tasks/ReplicationRetryTask";class JobProcessor extends EventEmitter{static instance;isRunning=!1;intervalId=null;tasks=new Map;activeBackupJobs=0;constructor(){super()}static getInstance(){return JobProcessor.instance||(JobProcessor.instance=new JobProcessor),JobProcessor.instance}registerTasks(dependencies){const tasksToRegister=[new CleanDownloadsTask];dependencies.backupManager&&(tasksToRegister.push(new BackupTask(dependencies.backupManager)),tasksToRegister.push(new ReplicationRetryTask(dependencies.backupManager))),dependencies.restoreManager&&tasksToRegister.push(new RestoreTask(dependencies.restoreManager));for(const task of tasksToRegister)this.tasks.set(task.name,task)}addTask(task){this.tasks.has(task.name)&&logger.warn({module:"JobProcessor",task:task.name},"A task with this name is already registered. It will be overwritten."),this.tasks.set(task.name,task)}start(interval=5e3){this.intervalId?logger.warn({module:"JobProcessor"},"Job processor is already running."):0!==this.tasks.size?(logger.info({module:"JobProcessor"},"Starting job processor."),this.intervalId=setInterval(()=>this.processQueue(),interval)):logger.warn({module:"JobProcessor"},"No tasks registered. Job processor will not start.")}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null,logger.info({module:"JobProcessor"},"Stopped job processor."))}async processQueue(){if(this.isRunning)return;const job=jobQueue.getNext();if(!job)return;if("Backup"===job.name&&this.activeBackupJobs>=configService.config.MAX_CONCURRENT_BACKUPS)return void jobQueue.requeueAtFront(job);const now=Date.now();if(job.lastAttempt&&now-job.lastAttempt<job.retryDelay){const timeLeft=Math.round((job.retryDelay-(now-job.lastAttempt))/1e3);return logger.info({module:"JobProcessor"},`Delaying retry for job '${job.name}'. Next attempt in ~${timeLeft}s.`),void jobQueue.reQueue(job)}this.isRunning=!0,"Backup"===job.name&&this.activeBackupJobs++,logger.info({module:"JobProcessor"},`Processing job: ${job.name}. Active backups: ${this.activeBackupJobs}`);const task=this.tasks.get(job.name);if(!task)return logger.error({module:"JobProcessor"},`No task registered for job name: ${job.name}`),jobQueue.failJob(job),this.isRunning=!1,void("Backup"===job.name&&this.activeBackupJobs--);try{await task.run(job),jobQueue.completeJob()}catch(error){const errorMessage=error instanceof Error?error.message:String(error);if(errorMessage.startsWith("BACKUP_CANCELLED:")||errorMessage.startsWith("RESTORE_CANCELLED:"))return logger.info({module:"JobProcessor",job:job.name},"Job was cancelled by user"),void jobQueue.completeJob();logger.error({module:"JobProcessor",job:job.name,error:error.message},`Job failed during execution. Attempt ${job.attempts+1} of ${job.maxAttempts}.`);jobQueue.failJob(job)&&(logger.error({module:"JobProcessor",job:job.name},`Job has permanently failed after ${job.maxAttempts} attempts.`),this.emit(`${job.name.toLowerCase()}_failed`,{...job.payload,error:error.message||"Unknown error after multiple retries."}))}finally{this.isRunning=!1,"Backup"===job.name&&this.activeBackupJobs--}}}export const jobProcessor=JobProcessor.getInstance();
|