@plutonhq/core-backend 0.0.1
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/CHANGELOG.md +3 -0
- package/LICENSE +202 -0
- package/README.md +1 -0
- package/dist/controllers/BackupController.d.ts +14 -0
- package/dist/controllers/BackupController.d.ts.map +1 -0
- package/dist/controllers/BackupController.js +1 -0
- package/dist/controllers/BackupController.js.map +1 -0
- package/dist/controllers/DeviceController.d.ts +14 -0
- package/dist/controllers/DeviceController.d.ts.map +1 -0
- package/dist/controllers/DeviceController.js +1 -0
- package/dist/controllers/DeviceController.js.map +1 -0
- package/dist/controllers/PlanController.d.ts +20 -0
- package/dist/controllers/PlanController.d.ts.map +1 -0
- package/dist/controllers/PlanController.js +1 -0
- package/dist/controllers/PlanController.js.map +1 -0
- package/dist/controllers/RestoreController.d.ts +15 -0
- package/dist/controllers/RestoreController.d.ts.map +1 -0
- package/dist/controllers/RestoreController.js +1 -0
- package/dist/controllers/RestoreController.js.map +1 -0
- package/dist/controllers/SettingsController.d.ts +13 -0
- package/dist/controllers/SettingsController.d.ts.map +1 -0
- package/dist/controllers/SettingsController.js +1 -0
- package/dist/controllers/SettingsController.js.map +1 -0
- package/dist/controllers/StorageController.d.ts +15 -0
- package/dist/controllers/StorageController.d.ts.map +1 -0
- package/dist/controllers/StorageController.js +1 -0
- package/dist/controllers/StorageController.js.map +1 -0
- package/dist/controllers/UserController.d.ts +7 -0
- package/dist/controllers/UserController.d.ts.map +1 -0
- package/dist/controllers/UserController.js +1 -0
- package/dist/controllers/UserController.js.map +1 -0
- package/dist/createApp.d.ts +5 -0
- package/dist/createApp.d.ts.map +1 -0
- package/dist/createApp.js +1 -0
- package/dist/createApp.js.map +1 -0
- package/dist/db/index.d.ts +1758 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +1 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrate.d.ts +2 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/migrate.js +1 -0
- package/dist/db/migrate.js.map +1 -0
- package/dist/db/schema/backups.d.ts +1702 -0
- package/dist/db/schema/backups.d.ts.map +1 -0
- package/dist/db/schema/backups.js +1 -0
- package/dist/db/schema/backups.js.map +1 -0
- package/dist/db/schema/devices.d.ts +1424 -0
- package/dist/db/schema/devices.d.ts.map +1 -0
- package/dist/db/schema/devices.js +1 -0
- package/dist/db/schema/devices.js.map +1 -0
- package/dist/db/schema/plans.d.ts +1280 -0
- package/dist/db/schema/plans.d.ts.map +1 -0
- package/dist/db/schema/plans.js +1 -0
- package/dist/db/schema/plans.js.map +1 -0
- package/dist/db/schema/restores.d.ts +1354 -0
- package/dist/db/schema/restores.d.ts.map +1 -0
- package/dist/db/schema/restores.js +1 -0
- package/dist/db/schema/restores.js.map +1 -0
- package/dist/db/schema/settings.d.ts +373 -0
- package/dist/db/schema/settings.d.ts.map +1 -0
- package/dist/db/schema/settings.js +1 -0
- package/dist/db/schema/settings.js.map +1 -0
- package/dist/db/schema/storages.d.ts +763 -0
- package/dist/db/schema/storages.d.ts.map +1 -0
- package/dist/db/schema/storages.js +1 -0
- package/dist/db/schema/storages.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/JobProcessor.d.ts +64 -0
- package/dist/jobs/JobProcessor.d.ts.map +1 -0
- package/dist/jobs/JobProcessor.js +1 -0
- package/dist/jobs/JobProcessor.js.map +1 -0
- package/dist/jobs/JobQueue.d.ts +62 -0
- package/dist/jobs/JobQueue.d.ts.map +1 -0
- package/dist/jobs/JobQueue.js +1 -0
- package/dist/jobs/JobQueue.js.map +1 -0
- package/dist/jobs/SystemTaskManager.d.ts +26 -0
- package/dist/jobs/SystemTaskManager.d.ts.map +1 -0
- package/dist/jobs/SystemTaskManager.js +1 -0
- package/dist/jobs/SystemTaskManager.js.map +1 -0
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +1 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/systemJobs.d.ts +3 -0
- package/dist/jobs/systemJobs.d.ts.map +1 -0
- package/dist/jobs/systemJobs.js +1 -0
- package/dist/jobs/systemJobs.js.map +1 -0
- package/dist/jobs/tasks/AbstractTask.d.ts +6 -0
- package/dist/jobs/tasks/AbstractTask.d.ts.map +1 -0
- package/dist/jobs/tasks/AbstractTask.js +1 -0
- package/dist/jobs/tasks/AbstractTask.js.map +1 -0
- package/dist/jobs/tasks/BackupTask.d.ts +10 -0
- package/dist/jobs/tasks/BackupTask.d.ts.map +1 -0
- package/dist/jobs/tasks/BackupTask.js +1 -0
- package/dist/jobs/tasks/BackupTask.js.map +1 -0
- package/dist/jobs/tasks/CleanDownloadsTask.d.ts +7 -0
- package/dist/jobs/tasks/CleanDownloadsTask.d.ts.map +1 -0
- package/dist/jobs/tasks/CleanDownloadsTask.js +1 -0
- package/dist/jobs/tasks/CleanDownloadsTask.js.map +1 -0
- package/dist/jobs/tasks/PruneDatabaseTask.d.ts +1 -0
- package/dist/jobs/tasks/PruneDatabaseTask.d.ts.map +1 -0
- package/dist/jobs/tasks/PruneDatabaseTask.js +1 -0
- package/dist/jobs/tasks/PruneDatabaseTask.js.map +1 -0
- package/dist/jobs/tasks/RestoreTask.d.ts +10 -0
- package/dist/jobs/tasks/RestoreTask.d.ts.map +1 -0
- package/dist/jobs/tasks/RestoreTask.js +1 -0
- package/dist/jobs/tasks/RestoreTask.js.map +1 -0
- package/dist/jobs/tasks/UpdateDevicesTask.d.ts +1 -0
- package/dist/jobs/tasks/UpdateDevicesTask.d.ts.map +1 -0
- package/dist/jobs/tasks/UpdateDevicesTask.js +1 -0
- package/dist/jobs/tasks/UpdateDevicesTask.js.map +1 -0
- package/dist/managers/BaseBackupManager.d.ts +93 -0
- package/dist/managers/BaseBackupManager.d.ts.map +1 -0
- package/dist/managers/BaseBackupManager.js +1 -0
- package/dist/managers/BaseBackupManager.js.map +1 -0
- package/dist/managers/BaseRestoreManager.d.ts +24 -0
- package/dist/managers/BaseRestoreManager.d.ts.map +1 -0
- package/dist/managers/BaseRestoreManager.js +1 -0
- package/dist/managers/BaseRestoreManager.js.map +1 -0
- package/dist/managers/BaseSnapshotManager.d.ts +36 -0
- package/dist/managers/BaseSnapshotManager.d.ts.map +1 -0
- package/dist/managers/BaseSnapshotManager.js +1 -0
- package/dist/managers/BaseSnapshotManager.js.map +1 -0
- package/dist/managers/BaseStorageManager.d.ts +16 -0
- package/dist/managers/BaseStorageManager.d.ts.map +1 -0
- package/dist/managers/BaseStorageManager.js +1 -0
- package/dist/managers/BaseStorageManager.js.map +1 -0
- package/dist/managers/BaseSystemManager.d.ts +86 -0
- package/dist/managers/BaseSystemManager.d.ts.map +1 -0
- package/dist/managers/BaseSystemManager.js +1 -0
- package/dist/managers/BaseSystemManager.js.map +1 -0
- package/dist/managers/CronManager.d.ts +35 -0
- package/dist/managers/CronManager.d.ts.map +1 -0
- package/dist/managers/CronManager.js +1 -0
- package/dist/managers/CronManager.js.map +1 -0
- package/dist/managers/ProcessManager.d.ts +9 -0
- package/dist/managers/ProcessManager.d.ts.map +1 -0
- package/dist/managers/ProcessManager.js +1 -0
- package/dist/managers/ProcessManager.js.map +1 -0
- package/dist/managers/ProgressManager.d.ts +85 -0
- package/dist/managers/ProgressManager.d.ts.map +1 -0
- package/dist/managers/ProgressManager.js +1 -0
- package/dist/managers/ProgressManager.js.map +1 -0
- package/dist/managers/RestoreStatsManager.d.ts +9 -0
- package/dist/managers/RestoreStatsManager.d.ts.map +1 -0
- package/dist/managers/RestoreStatsManager.js +1 -0
- package/dist/managers/RestoreStatsManager.js.map +1 -0
- package/dist/managers/SecurityKeyManager.d.ts +16 -0
- package/dist/managers/SecurityKeyManager.d.ts.map +1 -0
- package/dist/managers/SecurityKeyManager.js +1 -0
- package/dist/managers/SecurityKeyManager.js.map +1 -0
- package/dist/managers/handlers/BackupHandler.d.ts +124 -0
- package/dist/managers/handlers/BackupHandler.d.ts.map +1 -0
- package/dist/managers/handlers/BackupHandler.js +1 -0
- package/dist/managers/handlers/BackupHandler.js.map +1 -0
- package/dist/managers/handlers/DownloadHandler.d.ts +13 -0
- package/dist/managers/handlers/DownloadHandler.d.ts.map +1 -0
- package/dist/managers/handlers/DownloadHandler.js +1 -0
- package/dist/managers/handlers/DownloadHandler.js.map +1 -0
- package/dist/managers/handlers/PruneHandler.d.ts +11 -0
- package/dist/managers/handlers/PruneHandler.d.ts.map +1 -0
- package/dist/managers/handlers/PruneHandler.js +1 -0
- package/dist/managers/handlers/PruneHandler.js.map +1 -0
- package/dist/managers/handlers/RestoreHandler.d.ts +67 -0
- package/dist/managers/handlers/RestoreHandler.d.ts.map +1 -0
- package/dist/managers/handlers/RestoreHandler.js +1 -0
- package/dist/managers/handlers/RestoreHandler.js.map +1 -0
- package/dist/managers/index.d.ts +3 -0
- package/dist/managers/index.d.ts.map +1 -0
- package/dist/managers/index.js +1 -0
- package/dist/managers/index.js.map +1 -0
- package/dist/middlewares/authMiddleware.d.ts +4 -0
- package/dist/middlewares/authMiddleware.d.ts.map +1 -0
- package/dist/middlewares/authMiddleware.js +1 -0
- package/dist/middlewares/authMiddleware.js.map +1 -0
- package/dist/middlewares/errorHandlerMiddleware.d.ts +5 -0
- package/dist/middlewares/errorHandlerMiddleware.d.ts.map +1 -0
- package/dist/middlewares/errorHandlerMiddleware.js +1 -0
- package/dist/middlewares/errorHandlerMiddleware.js.map +1 -0
- package/dist/middlewares/versionMiddleware.d.ts +6 -0
- package/dist/middlewares/versionMiddleware.d.ts.map +1 -0
- package/dist/middlewares/versionMiddleware.js +1 -0
- package/dist/middlewares/versionMiddleware.js.map +1 -0
- package/dist/notifications/BackupNotification.d.ts +24 -0
- package/dist/notifications/BackupNotification.d.ts.map +1 -0
- package/dist/notifications/BackupNotification.js +1 -0
- package/dist/notifications/BackupNotification.js.map +1 -0
- package/dist/notifications/BaseNotification.d.ts +20 -0
- package/dist/notifications/BaseNotification.d.ts.map +1 -0
- package/dist/notifications/BaseNotification.js +1 -0
- package/dist/notifications/BaseNotification.js.map +1 -0
- package/dist/notifications/NotificationChannel.d.ts +8 -0
- package/dist/notifications/NotificationChannel.d.ts.map +1 -0
- package/dist/notifications/NotificationChannel.js +1 -0
- package/dist/notifications/NotificationChannel.js.map +1 -0
- package/dist/notifications/NotificationManager.d.ts +8 -0
- package/dist/notifications/NotificationManager.d.ts.map +1 -0
- package/dist/notifications/NotificationManager.js +1 -0
- package/dist/notifications/NotificationManager.js.map +1 -0
- package/dist/notifications/channels/NotificationChannelResolver.d.ts +10 -0
- package/dist/notifications/channels/NotificationChannelResolver.d.ts.map +1 -0
- package/dist/notifications/channels/NotificationChannelResolver.js +1 -0
- package/dist/notifications/channels/NotificationChannelResolver.js.map +1 -0
- package/dist/notifications/channels/SMTPChannel.d.ts +14 -0
- package/dist/notifications/channels/SMTPChannel.d.ts.map +1 -0
- package/dist/notifications/channels/SMTPChannel.js +1 -0
- package/dist/notifications/channels/SMTPChannel.js.map +1 -0
- package/dist/notifications/templates/email/backup/BackupFailedNotification.d.ts +22 -0
- package/dist/notifications/templates/email/backup/BackupFailedNotification.d.ts.map +1 -0
- package/dist/notifications/templates/email/backup/BackupFailedNotification.js +1 -0
- package/dist/notifications/templates/email/backup/BackupFailedNotification.js.map +1 -0
- package/dist/notifications/templates/email/backup/BackupStartedNotification.d.ts +20 -0
- package/dist/notifications/templates/email/backup/BackupStartedNotification.d.ts.map +1 -0
- package/dist/notifications/templates/email/backup/BackupStartedNotification.js +1 -0
- package/dist/notifications/templates/email/backup/BackupStartedNotification.js.map +1 -0
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.d.ts +21 -0
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.d.ts.map +1 -0
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.js +1 -0
- package/dist/notifications/templates/email/backup/BackupSuccessNotification.js.map +1 -0
- package/dist/notifications/templates/email/test-email/TestEmailNotification.d.ts +14 -0
- package/dist/notifications/templates/email/test-email/TestEmailNotification.d.ts.map +1 -0
- package/dist/notifications/templates/email/test-email/TestEmailNotification.js +1 -0
- package/dist/notifications/templates/email/test-email/TestEmailNotification.js.map +1 -0
- package/dist/routes/backups.d.ts +4 -0
- package/dist/routes/backups.d.ts.map +1 -0
- package/dist/routes/backups.js +1 -0
- package/dist/routes/backups.js.map +1 -0
- package/dist/routes/devices.d.ts +4 -0
- package/dist/routes/devices.d.ts.map +1 -0
- package/dist/routes/devices.js +1 -0
- package/dist/routes/devices.js.map +1 -0
- package/dist/routes/health.d.ts +3 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +1 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/index.d.ts +9 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/plans.d.ts +4 -0
- package/dist/routes/plans.d.ts.map +1 -0
- package/dist/routes/plans.js +1 -0
- package/dist/routes/plans.js.map +1 -0
- package/dist/routes/restores.d.ts +4 -0
- package/dist/routes/restores.d.ts.map +1 -0
- package/dist/routes/restores.js +1 -0
- package/dist/routes/restores.js.map +1 -0
- package/dist/routes/settings.d.ts +4 -0
- package/dist/routes/settings.d.ts.map +1 -0
- package/dist/routes/settings.js +1 -0
- package/dist/routes/settings.js.map +1 -0
- package/dist/routes/storages.d.ts +4 -0
- package/dist/routes/storages.d.ts.map +1 -0
- package/dist/routes/storages.js +1 -0
- package/dist/routes/storages.js.map +1 -0
- package/dist/routes/users.d.ts +4 -0
- package/dist/routes/users.d.ts.map +1 -0
- package/dist/routes/users.js +1 -0
- package/dist/routes/users.js.map +1 -0
- package/dist/services/BackupServices.d.ts +40 -0
- package/dist/services/BackupServices.d.ts.map +1 -0
- package/dist/services/BackupServices.js +1 -0
- package/dist/services/BackupServices.js.map +1 -0
- package/dist/services/ConfigService.d.ts +40 -0
- package/dist/services/ConfigService.d.ts.map +1 -0
- package/dist/services/ConfigService.js +1 -0
- package/dist/services/ConfigService.js.map +1 -0
- package/dist/services/DeviceService.d.ts +47 -0
- package/dist/services/DeviceService.d.ts.map +1 -0
- package/dist/services/DeviceService.js +1 -0
- package/dist/services/DeviceService.js.map +1 -0
- package/dist/services/PlanService.d.ts +71 -0
- package/dist/services/PlanService.d.ts.map +1 -0
- package/dist/services/PlanService.js +1 -0
- package/dist/services/PlanService.js.map +1 -0
- package/dist/services/RestoreService.d.ts +74 -0
- package/dist/services/RestoreService.d.ts.map +1 -0
- package/dist/services/RestoreService.js +1 -0
- package/dist/services/RestoreService.js.map +1 -0
- package/dist/services/SettingsService.d.ts +20 -0
- package/dist/services/SettingsService.d.ts.map +1 -0
- package/dist/services/SettingsService.js +1 -0
- package/dist/services/SettingsService.js.map +1 -0
- package/dist/services/StorageService.d.ts +34 -0
- package/dist/services/StorageService.d.ts.map +1 -0
- package/dist/services/StorageService.js +1 -0
- package/dist/services/StorageService.js.map +1 -0
- package/dist/services/events/BackupEventService.d.ts +32 -0
- package/dist/services/events/BackupEventService.d.ts.map +1 -0
- package/dist/services/events/BackupEventService.js +1 -0
- package/dist/services/events/BackupEventService.js.map +1 -0
- package/dist/services/events/RestoreEventService.d.ts +17 -0
- package/dist/services/events/RestoreEventService.d.ts.map +1 -0
- package/dist/services/events/RestoreEventService.js +1 -0
- package/dist/services/events/RestoreEventService.js.map +1 -0
- package/dist/services/listeners/BackupEventListener.d.ts +41 -0
- package/dist/services/listeners/BackupEventListener.d.ts.map +1 -0
- package/dist/services/listeners/BackupEventListener.js +1 -0
- package/dist/services/listeners/BackupEventListener.js.map +1 -0
- package/dist/services/listeners/DownloadEventListener.d.ts +12 -0
- package/dist/services/listeners/DownloadEventListener.d.ts.map +1 -0
- package/dist/services/listeners/DownloadEventListener.js +1 -0
- package/dist/services/listeners/DownloadEventListener.js.map +1 -0
- package/dist/services/listeners/RestoreEventListener.d.ts +19 -0
- package/dist/services/listeners/RestoreEventListener.d.ts.map +1 -0
- package/dist/services/listeners/RestoreEventListener.js +1 -0
- package/dist/services/listeners/RestoreEventListener.js.map +1 -0
- package/dist/stores/BackupStore.d.ts +16 -0
- package/dist/stores/BackupStore.d.ts.map +1 -0
- package/dist/stores/BackupStore.js +1 -0
- package/dist/stores/BackupStore.js.map +1 -0
- package/dist/stores/DeviceStore.d.ts +16 -0
- package/dist/stores/DeviceStore.d.ts.map +1 -0
- package/dist/stores/DeviceStore.js +1 -0
- package/dist/stores/DeviceStore.js.map +1 -0
- package/dist/stores/PlanStore.d.ts +42 -0
- package/dist/stores/PlanStore.d.ts.map +1 -0
- package/dist/stores/PlanStore.js +1 -0
- package/dist/stores/PlanStore.js.map +1 -0
- package/dist/stores/RestoreStore.d.ts +16 -0
- package/dist/stores/RestoreStore.d.ts.map +1 -0
- package/dist/stores/RestoreStore.js +1 -0
- package/dist/stores/RestoreStore.js.map +1 -0
- package/dist/stores/SettingsStore.d.ts +85 -0
- package/dist/stores/SettingsStore.d.ts.map +1 -0
- package/dist/stores/SettingsStore.js +1 -0
- package/dist/stores/SettingsStore.js.map +1 -0
- package/dist/stores/StorageStore.d.ts +16 -0
- package/dist/stores/StorageStore.d.ts.map +1 -0
- package/dist/stores/StorageStore.js +1 -0
- package/dist/stores/StorageStore.js.map +1 -0
- package/dist/strategies/backup/BackupStrategy.d.ts +55 -0
- package/dist/strategies/backup/BackupStrategy.d.ts.map +1 -0
- package/dist/strategies/backup/BackupStrategy.js +1 -0
- package/dist/strategies/backup/BackupStrategy.js.map +1 -0
- package/dist/strategies/backup/LocalStrategy.d.ts +57 -0
- package/dist/strategies/backup/LocalStrategy.d.ts.map +1 -0
- package/dist/strategies/backup/LocalStrategy.js +1 -0
- package/dist/strategies/backup/LocalStrategy.js.map +1 -0
- package/dist/strategies/backup/RemoteStrategy.d.ts +60 -0
- package/dist/strategies/backup/RemoteStrategy.d.ts.map +1 -0
- package/dist/strategies/backup/RemoteStrategy.js +1 -0
- package/dist/strategies/backup/RemoteStrategy.js.map +1 -0
- package/dist/strategies/backup/index.d.ts +4 -0
- package/dist/strategies/backup/index.d.ts.map +1 -0
- package/dist/strategies/backup/index.js +1 -0
- package/dist/strategies/backup/index.js.map +1 -0
- package/dist/strategies/restore/LocalStrategy.d.ts +27 -0
- package/dist/strategies/restore/LocalStrategy.d.ts.map +1 -0
- package/dist/strategies/restore/LocalStrategy.js +1 -0
- package/dist/strategies/restore/LocalStrategy.js.map +1 -0
- package/dist/strategies/restore/RemoteStrategy.d.ts +37 -0
- package/dist/strategies/restore/RemoteStrategy.d.ts.map +1 -0
- package/dist/strategies/restore/RemoteStrategy.js +1 -0
- package/dist/strategies/restore/RemoteStrategy.js.map +1 -0
- package/dist/strategies/restore/RestoreStrategy.d.ts +31 -0
- package/dist/strategies/restore/RestoreStrategy.d.ts.map +1 -0
- package/dist/strategies/restore/RestoreStrategy.js +1 -0
- package/dist/strategies/restore/RestoreStrategy.js.map +1 -0
- package/dist/strategies/restore/index.d.ts +4 -0
- package/dist/strategies/restore/index.d.ts.map +1 -0
- package/dist/strategies/restore/index.js +1 -0
- package/dist/strategies/restore/index.js.map +1 -0
- package/dist/strategies/snapshot/LocalStrategy.d.ts +35 -0
- package/dist/strategies/snapshot/LocalStrategy.d.ts.map +1 -0
- package/dist/strategies/snapshot/LocalStrategy.js +1 -0
- package/dist/strategies/snapshot/LocalStrategy.js.map +1 -0
- package/dist/strategies/snapshot/RemoteStrategy.d.ts +44 -0
- package/dist/strategies/snapshot/RemoteStrategy.d.ts.map +1 -0
- package/dist/strategies/snapshot/RemoteStrategy.js +1 -0
- package/dist/strategies/snapshot/RemoteStrategy.js.map +1 -0
- package/dist/strategies/snapshot/SnapshotStrategy.d.ts +47 -0
- package/dist/strategies/snapshot/SnapshotStrategy.d.ts.map +1 -0
- package/dist/strategies/snapshot/SnapshotStrategy.js +1 -0
- package/dist/strategies/snapshot/SnapshotStrategy.js.map +1 -0
- package/dist/strategies/snapshot/index.d.ts +4 -0
- package/dist/strategies/snapshot/index.d.ts.map +1 -0
- package/dist/strategies/snapshot/index.js +1 -0
- package/dist/strategies/snapshot/index.js.map +1 -0
- package/dist/strategies/system/LocalStrategy.d.ts +63 -0
- package/dist/strategies/system/LocalStrategy.d.ts.map +1 -0
- package/dist/strategies/system/LocalStrategy.js +1 -0
- package/dist/strategies/system/LocalStrategy.js.map +1 -0
- package/dist/strategies/system/RemoteStrategy.d.ts +67 -0
- package/dist/strategies/system/RemoteStrategy.d.ts.map +1 -0
- package/dist/strategies/system/RemoteStrategy.js +1 -0
- package/dist/strategies/system/RemoteStrategy.js.map +1 -0
- package/dist/strategies/system/SystemStrategy.d.ts +69 -0
- package/dist/strategies/system/SystemStrategy.d.ts.map +1 -0
- package/dist/strategies/system/SystemStrategy.js +1 -0
- package/dist/strategies/system/SystemStrategy.js.map +1 -0
- package/dist/strategies/system/index.d.ts +4 -0
- package/dist/strategies/system/index.d.ts.map +1 -0
- package/dist/strategies/system/index.js +1 -0
- package/dist/strategies/system/index.js.map +1 -0
- package/dist/types/backups.d.ts +68 -0
- package/dist/types/backups.d.ts.map +1 -0
- package/dist/types/backups.js +1 -0
- package/dist/types/backups.js.map +1 -0
- package/dist/types/devices.d.ts +205 -0
- package/dist/types/devices.d.ts.map +1 -0
- package/dist/types/devices.js +1 -0
- package/dist/types/devices.js.map +1 -0
- package/dist/types/events.d.ts +86 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +1 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/global.d.ts +8 -0
- package/dist/types/global.d.ts.map +1 -0
- package/dist/types/global.js +1 -0
- package/dist/types/global.js.map +1 -0
- package/dist/types/notifications.d.ts +19 -0
- package/dist/types/notifications.d.ts.map +1 -0
- package/dist/types/notifications.js +1 -0
- package/dist/types/notifications.js.map +1 -0
- package/dist/types/plans.d.ts +219 -0
- package/dist/types/plans.d.ts.map +1 -0
- package/dist/types/plans.js +1 -0
- package/dist/types/plans.js.map +1 -0
- package/dist/types/rclone.d.ts +10 -0
- package/dist/types/rclone.d.ts.map +1 -0
- package/dist/types/rclone.js +1 -0
- package/dist/types/rclone.js.map +1 -0
- package/dist/types/restic.d.ts +63 -0
- package/dist/types/restic.d.ts.map +1 -0
- package/dist/types/restic.js +1 -0
- package/dist/types/restic.js.map +1 -0
- package/dist/types/restores.d.ts +54 -0
- package/dist/types/restores.d.ts.map +1 -0
- package/dist/types/restores.js +1 -0
- package/dist/types/restores.js.map +1 -0
- package/dist/types/settings.d.ts +87 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +1 -0
- package/dist/types/settings.js.map +1 -0
- package/dist/types/source.d.ts +72 -0
- package/dist/types/source.d.ts.map +1 -0
- package/dist/types/source.js +1 -0
- package/dist/types/source.js.map +1 -0
- package/dist/types/strategy.d.ts +7 -0
- package/dist/types/strategy.d.ts.map +1 -0
- package/dist/types/strategy.js +1 -0
- package/dist/types/strategy.js.map +1 -0
- package/dist/utils/AppError.d.ts +37 -0
- package/dist/utils/AppError.d.ts.map +1 -0
- package/dist/utils/AppError.js +1 -0
- package/dist/utils/AppError.js.map +1 -0
- package/dist/utils/AppPaths.d.ts +36 -0
- package/dist/utils/AppPaths.d.ts.map +1 -0
- package/dist/utils/AppPaths.js +1 -0
- package/dist/utils/AppPaths.js.map +1 -0
- package/dist/utils/asyncHandler.d.ts +4 -0
- package/dist/utils/asyncHandler.d.ts.map +1 -0
- package/dist/utils/asyncHandler.js +1 -0
- package/dist/utils/asyncHandler.js.map +1 -0
- package/dist/utils/binaryPathResolver.d.ts +10 -0
- package/dist/utils/binaryPathResolver.d.ts.map +1 -0
- package/dist/utils/binaryPathResolver.js +1 -0
- package/dist/utils/binaryPathResolver.js.map +1 -0
- package/dist/utils/copyFiles.d.ts +12 -0
- package/dist/utils/copyFiles.d.ts.map +1 -0
- package/dist/utils/copyFiles.js +1 -0
- package/dist/utils/copyFiles.js.map +1 -0
- package/dist/utils/docker.d.ts +32 -0
- package/dist/utils/docker.d.ts.map +1 -0
- package/dist/utils/docker.js +1 -0
- package/dist/utils/docker.js.map +1 -0
- package/dist/utils/executeUserScript.d.ts +15 -0
- package/dist/utils/executeUserScript.d.ts.map +1 -0
- package/dist/utils/executeUserScript.js +1 -0
- package/dist/utils/executeUserScript.js.map +1 -0
- package/dist/utils/formatter.d.ts +39 -0
- package/dist/utils/formatter.d.ts.map +1 -0
- package/dist/utils/formatter.js +1 -0
- package/dist/utils/formatter.js.map +1 -0
- package/dist/utils/getBackupSourceFiles.d.ts +7 -0
- package/dist/utils/getBackupSourceFiles.d.ts.map +1 -0
- package/dist/utils/getBackupSourceFiles.js +1 -0
- package/dist/utils/getBackupSourceFiles.js.map +1 -0
- package/dist/utils/helpers.d.ts +35 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +1 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/initSetup.d.ts +4 -0
- package/dist/utils/initSetup.d.ts.map +1 -0
- package/dist/utils/initSetup.js +1 -0
- package/dist/utils/initSetup.js.map +1 -0
- package/dist/utils/intervalToCron.d.ts +24 -0
- package/dist/utils/intervalToCron.d.ts.map +1 -0
- package/dist/utils/intervalToCron.js +1 -0
- package/dist/utils/intervalToCron.js.map +1 -0
- package/dist/utils/logger.d.ts +43 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +1 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/providers/_features.d.ts +648 -0
- package/dist/utils/providers/_features.d.ts.map +1 -0
- package/dist/utils/providers/_features.js +1 -0
- package/dist/utils/providers/_features.js.map +1 -0
- package/dist/utils/providers/_s3Options.d.ts +19 -0
- package/dist/utils/providers/_s3Options.d.ts.map +1 -0
- package/dist/utils/providers/_s3Options.js +1 -0
- package/dist/utils/providers/_s3Options.js.map +1 -0
- package/dist/utils/providers/arvan.d.ts +28 -0
- package/dist/utils/providers/arvan.d.ts.map +1 -0
- package/dist/utils/providers/arvan.js +1 -0
- package/dist/utils/providers/arvan.js.map +1 -0
- package/dist/utils/providers/azureblob.d.ts +30 -0
- package/dist/utils/providers/azureblob.d.ts.map +1 -0
- package/dist/utils/providers/azureblob.js +1 -0
- package/dist/utils/providers/azureblob.js.map +1 -0
- package/dist/utils/providers/azurefiles.d.ts +19 -0
- package/dist/utils/providers/azurefiles.d.ts.map +1 -0
- package/dist/utils/providers/azurefiles.js +1 -0
- package/dist/utils/providers/azurefiles.js.map +1 -0
- package/dist/utils/providers/b2.d.ts +30 -0
- package/dist/utils/providers/b2.d.ts.map +1 -0
- package/dist/utils/providers/b2.js +1 -0
- package/dist/utils/providers/b2.js.map +1 -0
- package/dist/utils/providers/boxCom.d.ts +30 -0
- package/dist/utils/providers/boxCom.d.ts.map +1 -0
- package/dist/utils/providers/boxCom.js +1 -0
- package/dist/utils/providers/boxCom.js.map +1 -0
- package/dist/utils/providers/ceph.d.ts +28 -0
- package/dist/utils/providers/ceph.d.ts.map +1 -0
- package/dist/utils/providers/ceph.js +1 -0
- package/dist/utils/providers/ceph.js.map +1 -0
- package/dist/utils/providers/dreamobjects.d.ts +44 -0
- package/dist/utils/providers/dreamobjects.d.ts.map +1 -0
- package/dist/utils/providers/dreamobjects.js +1 -0
- package/dist/utils/providers/dreamobjects.js.map +1 -0
- package/dist/utils/providers/dropbox.d.ts +39 -0
- package/dist/utils/providers/dropbox.d.ts.map +1 -0
- package/dist/utils/providers/dropbox.js +1 -0
- package/dist/utils/providers/dropbox.js.map +1 -0
- package/dist/utils/providers/fichier.d.ts +30 -0
- package/dist/utils/providers/fichier.d.ts.map +1 -0
- package/dist/utils/providers/fichier.js +1 -0
- package/dist/utils/providers/fichier.js.map +1 -0
- package/dist/utils/providers/filesCom.d.ts +21 -0
- package/dist/utils/providers/filesCom.d.ts.map +1 -0
- package/dist/utils/providers/filesCom.js +1 -0
- package/dist/utils/providers/filesCom.js.map +1 -0
- package/dist/utils/providers/ftp.d.ts +39 -0
- package/dist/utils/providers/ftp.d.ts.map +1 -0
- package/dist/utils/providers/ftp.js +1 -0
- package/dist/utils/providers/ftp.js.map +1 -0
- package/dist/utils/providers/gcs.d.ts +39 -0
- package/dist/utils/providers/gcs.d.ts.map +1 -0
- package/dist/utils/providers/gcs.js +1 -0
- package/dist/utils/providers/gcs.js.map +1 -0
- package/dist/utils/providers/gdrive.d.ts +39 -0
- package/dist/utils/providers/gdrive.d.ts.map +1 -0
- package/dist/utils/providers/gdrive.js +1 -0
- package/dist/utils/providers/gdrive.js.map +1 -0
- package/dist/utils/providers/gofile.d.ts +21 -0
- package/dist/utils/providers/gofile.d.ts.map +1 -0
- package/dist/utils/providers/gofile.js +1 -0
- package/dist/utils/providers/gofile.js.map +1 -0
- package/dist/utils/providers/gphotos.d.ts +39 -0
- package/dist/utils/providers/gphotos.d.ts.map +1 -0
- package/dist/utils/providers/gphotos.js +1 -0
- package/dist/utils/providers/gphotos.js.map +1 -0
- package/dist/utils/providers/hdfs.d.ts +21 -0
- package/dist/utils/providers/hdfs.d.ts.map +1 -0
- package/dist/utils/providers/hdfs.js +1 -0
- package/dist/utils/providers/hdfs.js.map +1 -0
- package/dist/utils/providers/hidrive.d.ts +39 -0
- package/dist/utils/providers/hidrive.d.ts.map +1 -0
- package/dist/utils/providers/hidrive.js +1 -0
- package/dist/utils/providers/hidrive.js.map +1 -0
- package/dist/utils/providers/http.d.ts +30 -0
- package/dist/utils/providers/http.d.ts.map +1 -0
- package/dist/utils/providers/http.js +1 -0
- package/dist/utils/providers/http.js.map +1 -0
- package/dist/utils/providers/ibmcos.d.ts +58 -0
- package/dist/utils/providers/ibmcos.d.ts.map +1 -0
- package/dist/utils/providers/ibmcos.js +1 -0
- package/dist/utils/providers/ibmcos.js.map +1 -0
- package/dist/utils/providers/idrive.d.ts +28 -0
- package/dist/utils/providers/idrive.d.ts.map +1 -0
- package/dist/utils/providers/idrive.js +1 -0
- package/dist/utils/providers/idrive.js.map +1 -0
- package/dist/utils/providers/internetarchive.d.ts +30 -0
- package/dist/utils/providers/internetarchive.d.ts.map +1 -0
- package/dist/utils/providers/internetarchive.js +1 -0
- package/dist/utils/providers/internetarchive.js.map +1 -0
- package/dist/utils/providers/ionos.d.ts +44 -0
- package/dist/utils/providers/ionos.d.ts.map +1 -0
- package/dist/utils/providers/ionos.js +1 -0
- package/dist/utils/providers/ionos.js.map +1 -0
- package/dist/utils/providers/jottacloud.d.ts +39 -0
- package/dist/utils/providers/jottacloud.d.ts.map +1 -0
- package/dist/utils/providers/jottacloud.js +1 -0
- package/dist/utils/providers/jottacloud.js.map +1 -0
- package/dist/utils/providers/koofr.d.ts +46 -0
- package/dist/utils/providers/koofr.d.ts.map +1 -0
- package/dist/utils/providers/koofr.js +1 -0
- package/dist/utils/providers/koofr.js.map +1 -0
- package/dist/utils/providers/leviia.d.ts +28 -0
- package/dist/utils/providers/leviia.d.ts.map +1 -0
- package/dist/utils/providers/leviia.js +1 -0
- package/dist/utils/providers/leviia.js.map +1 -0
- package/dist/utils/providers/liara.d.ts +28 -0
- package/dist/utils/providers/liara.d.ts.map +1 -0
- package/dist/utils/providers/liara.js +1 -0
- package/dist/utils/providers/liara.js.map +1 -0
- package/dist/utils/providers/linkbox.d.ts +21 -0
- package/dist/utils/providers/linkbox.d.ts.map +1 -0
- package/dist/utils/providers/linkbox.js +1 -0
- package/dist/utils/providers/linkbox.js.map +1 -0
- package/dist/utils/providers/linode.d.ts +44 -0
- package/dist/utils/providers/linode.d.ts.map +1 -0
- package/dist/utils/providers/linode.js +1 -0
- package/dist/utils/providers/linode.js.map +1 -0
- package/dist/utils/providers/local.d.ts +11 -0
- package/dist/utils/providers/local.d.ts.map +1 -0
- package/dist/utils/providers/local.js +1 -0
- package/dist/utils/providers/local.js.map +1 -0
- package/dist/utils/providers/lyvecloud.d.ts +44 -0
- package/dist/utils/providers/lyvecloud.d.ts.map +1 -0
- package/dist/utils/providers/lyvecloud.js +1 -0
- package/dist/utils/providers/lyvecloud.js.map +1 -0
- package/dist/utils/providers/magalu.d.ts +44 -0
- package/dist/utils/providers/magalu.d.ts.map +1 -0
- package/dist/utils/providers/magalu.js +1 -0
- package/dist/utils/providers/magalu.js.map +1 -0
- package/dist/utils/providers/mailru.d.ts +30 -0
- package/dist/utils/providers/mailru.d.ts.map +1 -0
- package/dist/utils/providers/mailru.js +1 -0
- package/dist/utils/providers/mailru.js.map +1 -0
- package/dist/utils/providers/mega.d.ts +30 -0
- package/dist/utils/providers/mega.d.ts.map +1 -0
- package/dist/utils/providers/mega.js +1 -0
- package/dist/utils/providers/mega.js.map +1 -0
- package/dist/utils/providers/minio.d.ts +28 -0
- package/dist/utils/providers/minio.d.ts.map +1 -0
- package/dist/utils/providers/minio.js +1 -0
- package/dist/utils/providers/minio.js.map +1 -0
- package/dist/utils/providers/netstorage.d.ts +21 -0
- package/dist/utils/providers/netstorage.d.ts.map +1 -0
- package/dist/utils/providers/netstorage.js +1 -0
- package/dist/utils/providers/netstorage.js.map +1 -0
- package/dist/utils/providers/obs.d.ts +44 -0
- package/dist/utils/providers/obs.d.ts.map +1 -0
- package/dist/utils/providers/obs.js +1 -0
- package/dist/utils/providers/obs.js.map +1 -0
- package/dist/utils/providers/onedrive.d.ts +46 -0
- package/dist/utils/providers/onedrive.d.ts.map +1 -0
- package/dist/utils/providers/onedrive.js +1 -0
- package/dist/utils/providers/onedrive.js.map +1 -0
- package/dist/utils/providers/opendrive.d.ts +21 -0
- package/dist/utils/providers/opendrive.d.ts.map +1 -0
- package/dist/utils/providers/opendrive.js +1 -0
- package/dist/utils/providers/opendrive.js.map +1 -0
- package/dist/utils/providers/oracle.d.ts +30 -0
- package/dist/utils/providers/oracle.d.ts.map +1 -0
- package/dist/utils/providers/oracle.js +1 -0
- package/dist/utils/providers/oracle.js.map +1 -0
- package/dist/utils/providers/oss.d.ts +58 -0
- package/dist/utils/providers/oss.d.ts.map +1 -0
- package/dist/utils/providers/oss.js +1 -0
- package/dist/utils/providers/oss.js.map +1 -0
- package/dist/utils/providers/outscale.d.ts +44 -0
- package/dist/utils/providers/outscale.d.ts.map +1 -0
- package/dist/utils/providers/outscale.js +1 -0
- package/dist/utils/providers/outscale.js.map +1 -0
- package/dist/utils/providers/pcloud.d.ts +30 -0
- package/dist/utils/providers/pcloud.d.ts.map +1 -0
- package/dist/utils/providers/pcloud.js +1 -0
- package/dist/utils/providers/pcloud.js.map +1 -0
- package/dist/utils/providers/petabox.d.ts +28 -0
- package/dist/utils/providers/petabox.d.ts.map +1 -0
- package/dist/utils/providers/petabox.js +1 -0
- package/dist/utils/providers/petabox.js.map +1 -0
- package/dist/utils/providers/pikpak.d.ts +30 -0
- package/dist/utils/providers/pikpak.d.ts.map +1 -0
- package/dist/utils/providers/pikpak.js +1 -0
- package/dist/utils/providers/pikpak.js.map +1 -0
- package/dist/utils/providers/pixeldrain.d.ts +21 -0
- package/dist/utils/providers/pixeldrain.d.ts.map +1 -0
- package/dist/utils/providers/pixeldrain.js +1 -0
- package/dist/utils/providers/pixeldrain.js.map +1 -0
- package/dist/utils/providers/premiumizeme.d.ts +30 -0
- package/dist/utils/providers/premiumizeme.d.ts.map +1 -0
- package/dist/utils/providers/premiumizeme.js +1 -0
- package/dist/utils/providers/premiumizeme.js.map +1 -0
- package/dist/utils/providers/protondrive.d.ts +30 -0
- package/dist/utils/providers/protondrive.d.ts.map +1 -0
- package/dist/utils/providers/protondrive.js +1 -0
- package/dist/utils/providers/protondrive.js.map +1 -0
- package/dist/utils/providers/putio.d.ts +30 -0
- package/dist/utils/providers/putio.d.ts.map +1 -0
- package/dist/utils/providers/putio.js +1 -0
- package/dist/utils/providers/putio.js.map +1 -0
- package/dist/utils/providers/qingstor.d.ts +30 -0
- package/dist/utils/providers/qingstor.d.ts.map +1 -0
- package/dist/utils/providers/qingstor.js +1 -0
- package/dist/utils/providers/qingstor.js.map +1 -0
- package/dist/utils/providers/qiniu.d.ts +58 -0
- package/dist/utils/providers/qiniu.d.ts.map +1 -0
- package/dist/utils/providers/qiniu.js +1 -0
- package/dist/utils/providers/qiniu.js.map +1 -0
- package/dist/utils/providers/quatrix.d.ts +30 -0
- package/dist/utils/providers/quatrix.d.ts.map +1 -0
- package/dist/utils/providers/quatrix.js +1 -0
- package/dist/utils/providers/quatrix.js.map +1 -0
- package/dist/utils/providers/r2.d.ts +28 -0
- package/dist/utils/providers/r2.d.ts.map +1 -0
- package/dist/utils/providers/r2.js +1 -0
- package/dist/utils/providers/r2.js.map +1 -0
- package/dist/utils/providers/rackcorp.d.ts +58 -0
- package/dist/utils/providers/rackcorp.d.ts.map +1 -0
- package/dist/utils/providers/rackcorp.js +1 -0
- package/dist/utils/providers/rackcorp.js.map +1 -0
- package/dist/utils/providers/rclone.d.ts +28 -0
- package/dist/utils/providers/rclone.d.ts.map +1 -0
- package/dist/utils/providers/rclone.js +1 -0
- package/dist/utils/providers/rclone.js.map +1 -0
- package/dist/utils/providers/s3.d.ts +51 -0
- package/dist/utils/providers/s3.d.ts.map +1 -0
- package/dist/utils/providers/s3.js +1 -0
- package/dist/utils/providers/s3.js.map +1 -0
- package/dist/utils/providers/scaleway.d.ts +58 -0
- package/dist/utils/providers/scaleway.d.ts.map +1 -0
- package/dist/utils/providers/scaleway.js +1 -0
- package/dist/utils/providers/scaleway.js.map +1 -0
- package/dist/utils/providers/seafile.d.ts +39 -0
- package/dist/utils/providers/seafile.d.ts.map +1 -0
- package/dist/utils/providers/seafile.js +1 -0
- package/dist/utils/providers/seafile.js.map +1 -0
- package/dist/utils/providers/seaweedfs.d.ts +28 -0
- package/dist/utils/providers/seaweedfs.d.ts.map +1 -0
- package/dist/utils/providers/seaweedfs.js +1 -0
- package/dist/utils/providers/seaweedfs.js.map +1 -0
- package/dist/utils/providers/selectel.d.ts +28 -0
- package/dist/utils/providers/selectel.d.ts.map +1 -0
- package/dist/utils/providers/selectel.js +1 -0
- package/dist/utils/providers/selectel.js.map +1 -0
- package/dist/utils/providers/sftp.d.ts +30 -0
- package/dist/utils/providers/sftp.d.ts.map +1 -0
- package/dist/utils/providers/sftp.js +1 -0
- package/dist/utils/providers/sftp.js.map +1 -0
- package/dist/utils/providers/sharefile.d.ts +30 -0
- package/dist/utils/providers/sharefile.d.ts.map +1 -0
- package/dist/utils/providers/sharefile.js +1 -0
- package/dist/utils/providers/sharefile.js.map +1 -0
- package/dist/utils/providers/sia.d.ts +21 -0
- package/dist/utils/providers/sia.d.ts.map +1 -0
- package/dist/utils/providers/sia.js +1 -0
- package/dist/utils/providers/sia.js.map +1 -0
- package/dist/utils/providers/smb.d.ts +30 -0
- package/dist/utils/providers/smb.d.ts.map +1 -0
- package/dist/utils/providers/smb.js +1 -0
- package/dist/utils/providers/smb.js.map +1 -0
- package/dist/utils/providers/spaces.d.ts +44 -0
- package/dist/utils/providers/spaces.d.ts.map +1 -0
- package/dist/utils/providers/spaces.js +1 -0
- package/dist/utils/providers/spaces.js.map +1 -0
- package/dist/utils/providers/storj.d.ts +36 -0
- package/dist/utils/providers/storj.d.ts.map +1 -0
- package/dist/utils/providers/storj.js +1 -0
- package/dist/utils/providers/storj.js.map +1 -0
- package/dist/utils/providers/sugarsync.d.ts +30 -0
- package/dist/utils/providers/sugarsync.d.ts.map +1 -0
- package/dist/utils/providers/sugarsync.js +1 -0
- package/dist/utils/providers/sugarsync.js.map +1 -0
- package/dist/utils/providers/swift.d.ts +46 -0
- package/dist/utils/providers/swift.d.ts.map +1 -0
- package/dist/utils/providers/swift.js +1 -0
- package/dist/utils/providers/swift.js.map +1 -0
- package/dist/utils/providers/synologyc2.d.ts +44 -0
- package/dist/utils/providers/synologyc2.d.ts.map +1 -0
- package/dist/utils/providers/synologyc2.js +1 -0
- package/dist/utils/providers/synologyc2.js.map +1 -0
- package/dist/utils/providers/tencent.d.ts +28 -0
- package/dist/utils/providers/tencent.d.ts.map +1 -0
- package/dist/utils/providers/tencent.js +1 -0
- package/dist/utils/providers/tencent.js.map +1 -0
- package/dist/utils/providers/ulozto.d.ts +21 -0
- package/dist/utils/providers/ulozto.d.ts.map +1 -0
- package/dist/utils/providers/ulozto.js +1 -0
- package/dist/utils/providers/ulozto.js.map +1 -0
- package/dist/utils/providers/wasabi.d.ts +58 -0
- package/dist/utils/providers/wasabi.d.ts.map +1 -0
- package/dist/utils/providers/wasabi.js +1 -0
- package/dist/utils/providers/wasabi.js.map +1 -0
- package/dist/utils/providers/webdav.d.ts +19 -0
- package/dist/utils/providers/webdav.d.ts.map +1 -0
- package/dist/utils/providers/webdav.js +1 -0
- package/dist/utils/providers/webdav.js.map +1 -0
- package/dist/utils/providers/yandex.d.ts +39 -0
- package/dist/utils/providers/yandex.d.ts.map +1 -0
- package/dist/utils/providers/yandex.js +1 -0
- package/dist/utils/providers/yandex.js.map +1 -0
- package/dist/utils/providers/zoho.d.ts +30 -0
- package/dist/utils/providers/zoho.d.ts.map +1 -0
- package/dist/utils/providers/zoho.js +1 -0
- package/dist/utils/providers/zoho.js.map +1 -0
- package/dist/utils/providers.d.ts +37 -0
- package/dist/utils/providers.d.ts.map +1 -0
- package/dist/utils/providers.js +1 -0
- package/dist/utils/providers.js.map +1 -0
- package/dist/utils/rclone/helpers.d.ts +6 -0
- package/dist/utils/rclone/helpers.d.ts.map +1 -0
- package/dist/utils/rclone/helpers.js +1 -0
- package/dist/utils/rclone/helpers.js.map +1 -0
- package/dist/utils/rclone/parsers.d.ts +5 -0
- package/dist/utils/rclone/parsers.d.ts.map +1 -0
- package/dist/utils/rclone/parsers.js +1 -0
- package/dist/utils/rclone/parsers.js.map +1 -0
- package/dist/utils/rclone/rclone.d.ts +2 -0
- package/dist/utils/rclone/rclone.d.ts.map +1 -0
- package/dist/utils/rclone/rclone.js +1 -0
- package/dist/utils/rclone/rclone.js.map +1 -0
- package/dist/utils/restic/helpers.d.ts +4 -0
- package/dist/utils/restic/helpers.d.ts.map +1 -0
- package/dist/utils/restic/helpers.js +1 -0
- package/dist/utils/restic/helpers.js.map +1 -0
- package/dist/utils/restic/restic.d.ts +15 -0
- package/dist/utils/restic/restic.d.ts.map +1 -0
- package/dist/utils/restic/restic.js +1 -0
- package/dist/utils/restic/restic.js.map +1 -0
- package/dist/utils/runCommand.d.ts +23 -0
- package/dist/utils/runCommand.d.ts.map +1 -0
- package/dist/utils/runCommand.js +1 -0
- package/dist/utils/runCommand.js.map +1 -0
- package/dist/utils/sanitizeStoragePath.d.ts +9 -0
- package/dist/utils/sanitizeStoragePath.d.ts.map +1 -0
- package/dist/utils/sanitizeStoragePath.js +1 -0
- package/dist/utils/sanitizeStoragePath.js.map +1 -0
- package/dist/utils/versions.d.ts +17 -0
- package/dist/utils/versions.d.ts.map +1 -0
- package/dist/utils/versions.js +1 -0
- package/dist/utils/versions.js.map +1 -0
- package/package.json +106 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This Pluton Core Backend Package is used to extend the Pluton Pro Edition.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import { BackupService } from '../services/BackupServices';
|
|
3
|
+
export declare class BackupController {
|
|
4
|
+
protected backupService: BackupService;
|
|
5
|
+
constructor(backupService: BackupService);
|
|
6
|
+
getBackupDownload(req: Request, res: Response): Promise<void>;
|
|
7
|
+
generateBackupDownload(req: Request, res: Response): Promise<void>;
|
|
8
|
+
getSnapshotFiles(req: Request, res: Response): Promise<void>;
|
|
9
|
+
cancelBackupDownload(req: Request, res: Response): Promise<void>;
|
|
10
|
+
deleteBackup(req: Request, res: Response): Promise<void>;
|
|
11
|
+
getBackupProgress(req: Request, res: Response): Promise<void>;
|
|
12
|
+
cancelBackup(req: Request, res: Response): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=BackupController.d.ts.map
|
|
@@ -0,0 +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;IA8B7D,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBlE,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB5D,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;CAwB9D"}
|
|
@@ -0,0 +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;res.setHeader("Content-Type","application/x-tar"),res.setHeader("Content-Disposition",`attachment; filename=${fileName}`),res.setHeader("Transfer-Encoding","chunked"),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"})}}
|
|
@@ -0,0 +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;YAErB,GAAG,CAAC;QACL,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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AC,WAAW,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,oCAAoC;aAC7D,CAAC,CAAC;YACH,OAAO;QACR,CAAC;IACF,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAY,EAAE,GAAa;QAC7C,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACzC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,uBAAuB;aAC9B,CAAC,CAAC;YACH,OAAO;QACR,CAAC;QACD,IAAI,CAAC;YACJ,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,YAAY,CACzD,GAAG,CAAC,KAAK,CAAC,MAAgB,EAC1B,GAAG,CAAC,MAAM,CAAC,EAAE,CACb,CAAC;YACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACnC,OAAO;QACR,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,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,KAAK,CAAC,OAAO,IAAI,eAAe;aACvC,CAAC,CAAC;YACH,OAAO;QACR,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import { DeviceService } from '../services/DeviceService';
|
|
3
|
+
export declare class DeviceController {
|
|
4
|
+
protected deviceService: DeviceService;
|
|
5
|
+
constructor(deviceService: DeviceService);
|
|
6
|
+
getDevices(req: Request, res: Response): Promise<void>;
|
|
7
|
+
getDevice(req: Request, res: Response): Promise<void>;
|
|
8
|
+
updateDevice(req: Request, res: Response): Promise<void>;
|
|
9
|
+
getMetrics(req: Request, res: Response): Promise<void>;
|
|
10
|
+
getBrowsePath(req: Request, res: Response): Promise<void>;
|
|
11
|
+
updateRestic(req: Request, res: Response): Promise<void>;
|
|
12
|
+
updateRclone(req: Request, res: Response): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=DeviceController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceController.d.ts","sourceRoot":"","sources":["../../src/controllers/DeviceController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,qBAAa,gBAAgB;IAChB,SAAS,CAAC,aAAa,EAAE,aAAa;gBAA5B,aAAa,EAAE,aAAa;IAE5C,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAYtD,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCrD,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BxD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBtD,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzD,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBxD,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class DeviceController{deviceService;constructor(deviceService){this.deviceService=deviceService}async getDevices(req,res){try{const devicesRes=await this.deviceService.getDevices();res.json({success:!0,result:devicesRes})}catch(error){res.status(500).json({success:!1,error:"Failed to fetch devices"})}}async getDevice(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Device ID is required"});const metrics="true"===req.query.metrics,deviceRes=await this.deviceService.getDevice(req.params.id,metrics);if(!deviceRes.device)return void res.status(404).json({success:!1,error:"Device not found"});res.status(200).json({success:!0,result:deviceRes})}catch(error){const notFound=error?.message.includes("not found");return void res.status(notFound?404:500).json({success:!1,error:"Failed to fetch device"})}}async updateDevice(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Device ID is required"});const{name:name,settings:settings,tags:tags}=req.body,deviceRes=await this.deviceService.updateDevice(req.params.id,{name:name,settings:settings,tags:tags});return void res.json({success:!0,result:deviceRes})}catch(error){return void res.status(500).json({success:!1,error:error?.message||"Failed to update device"})}}async getMetrics(req,res){if(req.params.id)try{const response=await this.deviceService.getMetrics(req.params.id);res.json({success:!0,result:response})}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to fetch system metrics"})}else res.status(400).json({success:!1,error:"Device ID is missing"})}async getBrowsePath(req,res){if(req.params.id)try{const requestedPath=req.query.path?decodeURIComponent(req.query.path):"",response=await this.deviceService.getBrowsePath(req.params.id,requestedPath);res.json(response)}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to read directory contents"})}else res.status(400).json({success:!1,error:"Device ID is missing"})}async updateRestic(req,res){if(req.params.id&&req.query.version)try{const response=await this.deviceService.updateRestic(req.params.id,req.query.version);res.json({success:!0,result:response})}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to update restic"})}else res.status(400).json({success:!1,error:"Device ID and Restic version is required"})}async updateRclone(req,res){if(req.params.id&&req.query.version)try{const updatedVersion=await this.deviceService.updateRclone(req.params.id,req.query.version);res.json({success:!0,result:updatedVersion})}catch(error){res.status(500).json({success:!1,error:error?.message||"Failed to update rclone"})}else res.status(400).json({success:!1,error:"Device ID and Rclone version is required"})}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceController.js","sourceRoot":"","sources":["../../src/controllers/DeviceController.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,gBAAgB;IACN;IAAtB,YAAsB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEtD,KAAK,CAAC,UAAU,CAAC,GAAY,EAAE,GAAa;QAC3C,IAAI,CAAC;YACJ,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;YACzD,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,yBAAyB;aAChC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAY,EAAE,GAAa;QAC1C,IAAI,CAAC;YACJ,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACpB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACpB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,uBAAuB;iBAC9B,CAAC,CAAC;gBACH,OAAO;YACR,CAAC;YACD,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC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|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import { PlanService } from '../services/PlanService';
|
|
3
|
+
export declare class PlanController {
|
|
4
|
+
protected planService: PlanService;
|
|
5
|
+
constructor(planService: PlanService);
|
|
6
|
+
getPlans(req: Request, res: Response): Promise<void>;
|
|
7
|
+
getPlan(req: Request, res: Response): Promise<void>;
|
|
8
|
+
checkActiveBackups(req: Request, res: Response): Promise<void>;
|
|
9
|
+
createPlan(req: Request, res: Response): Promise<void>;
|
|
10
|
+
updatePlan(req: Request, res: Response): Promise<void>;
|
|
11
|
+
deletePlan(req: Request, res: Response): Promise<void>;
|
|
12
|
+
performBackup(req: Request, res: Response): Promise<void>;
|
|
13
|
+
pauseBackup(req: Request, res: Response): Promise<void>;
|
|
14
|
+
resumeBackup(req: Request, res: Response): Promise<void>;
|
|
15
|
+
pruneBackup(req: Request, res: Response): Promise<void>;
|
|
16
|
+
unlockRepo(req: Request, res: Response): Promise<void>;
|
|
17
|
+
getLogs(req: Request, res: Response): Promise<void>;
|
|
18
|
+
downloadLogs(req: Request, res: Response): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=PlanController.d.ts.map
|
|
@@ -0,0 +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,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB9D,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,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,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"}
|
|
@@ -0,0 +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 checkActiveBackups(req,res){if(req.params.id)try{const hasActiveBackup=await this.planService.checkActiveBackups(req.params.id);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.params.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}`})}}}
|
|
@@ -0,0 +1 @@
|
|
|
1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AAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import { RestoreService } from '../services/RestoreService';
|
|
3
|
+
export declare class RestoreController {
|
|
4
|
+
protected restoreService: RestoreService;
|
|
5
|
+
constructor(restoreService: RestoreService);
|
|
6
|
+
listRestores(req: Request, res: Response): Promise<void>;
|
|
7
|
+
getRestore(req: Request, res: Response): Promise<void>;
|
|
8
|
+
getRestoreStats(req: Request, res: Response): Promise<void>;
|
|
9
|
+
deleteRestore(req: Request, res: Response): Promise<void>;
|
|
10
|
+
performDryRestore(req: Request, res: Response): Promise<void>;
|
|
11
|
+
performRestore(req: Request, res: Response): Promise<void>;
|
|
12
|
+
getRestoreProgress(req: Request, res: Response): Promise<void>;
|
|
13
|
+
cancelRestore(req: Request, res: Response): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=RestoreController.d.ts.map
|
|
@@ -0,0 +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;AAY5D,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;IAiBtD,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;IAazD,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B7D,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B1D,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"}
|
|
@@ -0,0 +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{req.params.id||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{req.params.id||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 restore plan"})}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"})}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RestoreController.js","sourceRoot":"","sources":["../../src/controllers/RestoreController.ts"],"names":[],"mappings":"AAaA,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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AAO,KAAU,EAAE,CAAC;YACrB,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import { SettingsService } from '../services/SettingsService';
|
|
3
|
+
export declare class SettingsController {
|
|
4
|
+
protected settingsService: SettingsService;
|
|
5
|
+
constructor(settingsService: SettingsService);
|
|
6
|
+
getMainSettings(req: Request, res: Response): Promise<void>;
|
|
7
|
+
getSettings(req: Request, res: Response): Promise<void>;
|
|
8
|
+
updateSettings(req: Request, res: Response): Promise<void>;
|
|
9
|
+
validateIntegration(req: Request, res: Response): Promise<void>;
|
|
10
|
+
getAppLogs(req: Request, res: Response): Promise<void>;
|
|
11
|
+
downloadAppLogs(req: Request, res: Response): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=SettingsController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsController.d.ts","sourceRoot":"","sources":["../../src/controllers/SettingsController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,qBAAa,kBAAkB;IAClB,SAAS,CAAC,eAAe,EAAE,eAAe;gBAAhC,eAAe,EAAE,eAAe;IAEhD,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB3D,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBvD,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B1D,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC/D,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBtD,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CA6BjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class SettingsController{settingsService;constructor(settingsService){this.settingsService=settingsService}async getMainSettings(req,res){try{const appSettings=await this.settingsService.getMainSettings();return void res.status(appSettings?200:404).json({success:!0,result:appSettings})}catch(error){res.status(500).json({success:!1,error:"couldn't Retrieve App settings."})}}async getSettings(req,res){if(req.params.id)try{const appSettings=await this.settingsService.getSettings(parseInt(req.params.id,10));res.status(appSettings?200:404).json({success:!0,result:appSettings})}catch(error){res.status(500).json({success:!1,error:"couldn't Retrieve settings for the given ID."})}else res.status(400).json({success:!1,error:"Settings ID is required"})}async updateSettings(req,res){if(!req.params.id||!req.body.settings)return void res.status(400).json({success:!1,error:"Settings ID or Settings Data Missing"});const appSettings=req.body.settings;try{const updatedSettings=await this.settingsService.updateSettings(parseInt(req.params.id,10),appSettings);return void res.status(updatedSettings?200:404).json({success:!0,result:updatedSettings})}catch(error){return void res.status(500).json({success:!1,error:error instanceof Error?error.message:"Failed to update settings"})}}async validateIntegration(req,res){if(!(req.body.settingsID&&req.body.type&&req.body.settings&&req.body.test))return void res.status(400).json({success:!1,error:"Integration Payload Missing."});const appSettings=req.body.settings,integrationType=req.body.type;try{return await this.settingsService.validateIntegration(parseInt(req.body.settingsID,10),integrationType,req.body.test,appSettings),void res.status(200).json({success:!0,result:"Email Sent Successfully"})}catch(error){return void res.status(500).json({success:!1,error:error instanceof Error?error.message:`Failed to send test email using ${integrationType}.`})}}async getAppLogs(req,res){try{if(!req.params.id)return void res.status(400).json({success:!1,error:"Settings ID is required"});const logs=await this.settingsService.getAppLogs(parseInt(req.params.id,10));return void res.status(200).json({success:!0,result:logs})}catch(error){return void res.status(500).json({success:!1,error:"Failed to get logs: "+error.message})}}async downloadAppLogs(req,res){if(req.params.id)try{const logFileStream=await this.settingsService.getAppLogsFile();return res.setHeader("Content-Type","text/plain"),res.setHeader("Content-Disposition",'attachment; filename="app.log"'),void logFileStream.pipe(res)}catch(error){return void res.status(500).json({success:!1,error:`Failed to download logs: ${error.message}`})}else res.status(400).json({success:!1,error:"Settings ID is required"})}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsController.js","sourceRoot":"","sources":["../../src/controllers/SettingsController.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,kBAAkB;IACR;IAAtB,YAAsB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAE1D,KAAK,CAAC,eAAe,CAAC,GAAY,EAAE,GAAa;QAChD,IAAI,CAAC;YACJ,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC;YACjE,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACxC,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,WAAW;aACnB,CAAC,CAAC;YACH,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;aACxC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,KAAK,CAAC,WAAW,C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,CAAC,OAAO;aAC7C,CAAC,CAAC;YACH,OAAO;QACR,CAAC;IACF,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,GAAY,EAAE,GAAa;QAChD,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,yBAAyB;aAChC,CAAC,CAAC;YACH,OAAO;QACR,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,CAAC;YAElE,gCAAgC;YAChC,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;YAC5C,GAAG,CAAC,SAAS,CAAC,qBAAqB,EAAE,gCAAgC,CAAC,CAAC;YAEvE,2CAA2C;YAC3C,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAExB,gEAAgE;YAChE,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,4BAA4B,KAAK,CAAC,OAAO,EAAE;aAClD,CAAC,CAAC;YACH,OAAO;QACR,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import { StorageService } from '../services/StorageService';
|
|
3
|
+
export declare class StorageController {
|
|
4
|
+
protected storageService: StorageService;
|
|
5
|
+
constructor(storageService: StorageService);
|
|
6
|
+
listStorages(req: Request, res: Response): Promise<void>;
|
|
7
|
+
listAvailableStorageTypes(req: Request, res: Response): Promise<void>;
|
|
8
|
+
getStorage(req: Request, res: Response): Promise<void>;
|
|
9
|
+
createStorage(req: Request, res: Response): Promise<void>;
|
|
10
|
+
updateStorage(req: Request, res: Response): Promise<void>;
|
|
11
|
+
deleteStorage(req: Request, res: Response): Promise<void>;
|
|
12
|
+
verifyStorage(req: Request, res: Response): Promise<void>;
|
|
13
|
+
authorizeStorage(req: Request, res: Response): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=StorageController.d.ts.map
|
|
@@ -0,0 +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;IAkBzD,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"}
|
|
@@ -0,0 +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:"Failed to delete storage"})}}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"})}}}
|
|
@@ -0,0 +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,IAAI,CAAC;YACJ,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;YAC5D,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;QAClD,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,yBAAyB,CAAC,GAAY,EAAE,GAAa;QAC1D,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,wBAAwB,EAAE,CAAC;YACpE,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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CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACtE,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,gBAAgB,CAAC,GAAY,EAAE,GAAa;QACjD,IAAI,CAAC;YACJ,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;gBAC5E,OAAO;YACR,CAAC;YACD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAc,CAAC,CAAC;YAC5F,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAC,CAAC;QAChF,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
export declare class UserController {
|
|
3
|
+
validateUser(req: Request, res: Response): Promise<void>;
|
|
4
|
+
loginUser(req: Request, res: Response): Promise<void>;
|
|
5
|
+
logoutUser(req: Request, res: Response): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=UserController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserController.d.ts","sourceRoot":"","sources":["../../src/controllers/UserController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG5C,qBAAa,cAAc;IACpB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxD,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BrD,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAW5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{configService}from"../services/ConfigService";import jwt from"jsonwebtoken";export class UserController{async validateUser(req,res){res.status(200).json({success:!0})}async loginUser(req,res){const{username:username,password:password}=req.body;if(!username||!password)return void res.status(401).json({error:"Username & Password Missing"});const theUserName=configService.config.USER_NAME;if(username===theUserName&&password===configService.config.USER_PASSWORD){const token=jwt.sign({user:theUserName},configService.config.SECRET),sessionDuration=configService.config.SESSION_DURATION||7;return res.cookie("token",token,{httpOnly:!0,sameSite:"lax",maxAge:24*sessionDuration*60*60*1e3}),void res.status(200).json({success:!0,error:null})}const error=username!==theUserName?"Incorrect Username":"Incorrect Password";res.status(401).json({success:!1,error:error})}async logoutUser(req,res){res.clearCookie("token",{httpOnly:!0,sameSite:"lax"}),res.status(200).json({success:!0,message:"Logged out successfully"})}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserController.js","sourceRoot":"","sources":["../../src/controllers/UserController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE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,OAAO;QACR,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC;QACrF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAChD,OAAO;IACR,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,GAAY,EAAE,GAAa;QAC3C,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE;YACxB,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,KAAK;SACf,CAAC,CAAC;QAEH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACpB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,yBAAyB;SAClC,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApp.d.ts","sourceRoot":"","sources":["../src/createApp.ts"],"names":[],"mappings":"AAEA,OAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AA8ChD,wBAAsB,SAAS,IAAI,OAAO,CAAC;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC,CAwI3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import path from"path";import{fileURLToPath}from"url";import express from"express";import cors from"cors";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{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{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,null),backupService=new BackupService(localBackupAgent,localPlanAgent,planStore,backupStore,restoreStore,storageStore,null),restoreService=new RestoreService(localRestoreAgent,planStore,backupStore,restoreStore,storageStore,null),deviceService=new DeviceService(localSystemAgent,deviceStore,planStore,storageStore,null),storageService=new StorageService(localStorageAgent,localSystemAgent,storageStore,planStore,null),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,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 __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:500,standardHeaders:!0,legacyHeaders:!1});return app.use("/api/",apiLimiter),app.use("/api/user",createUserRouter(userController)),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("*",(req,res)=>{res.sendFile(path.join(publicPath,"index.html"))}),systemTaskManager.initialize(),jobProcessor.registerTasks({backupManager:localPlanAgent,restoreManager:localRestoreAgent}),jobProcessor.start(),{app:app}}
|
|
@@ -0,0 +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;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,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