@futo-org/backups-orchestrator-ui 1.11.4 → 1.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fetch-client.d.ts +50 -50
- package/dist/fetch-client.js +50 -50
- package/dist/providers.js +5 -1
- package/dist/services/backend.service.js +3 -3
- package/dist/services/config.service.js +3 -3
- package/dist/services/filesystem.service.js +1 -1
- package/dist/services/immich.integration.service.js +4 -4
- package/dist/services/integrations.service.js +5 -5
- package/dist/services/job.service.js +4 -4
- package/dist/services/onboarding.service.js +8 -8
- package/dist/services/repository.service.js +15 -13
- package/dist/services/schedule.service.js +8 -8
- package/dist/services/session.service.js +2 -2
- package/dist/services/snapshot.service.js +8 -8
- package/dist/services/supportMode.service.js +3 -3
- package/package.json +2 -2
package/dist/fetch-client.d.ts
CHANGED
|
@@ -377,210 +377,210 @@ export type SupportModeUpdateRequestDto = {
|
|
|
377
377
|
/**
|
|
378
378
|
* Connect a FUTO Backups account
|
|
379
379
|
*/
|
|
380
|
-
export declare function
|
|
380
|
+
export declare function futoBackupsConnectDeviceFlow(opts?: Oazapfts.RequestOpts): Promise<DeviceFlowEventDto>;
|
|
381
381
|
/**
|
|
382
382
|
* Sign in with FUTO Backups account
|
|
383
383
|
*/
|
|
384
|
-
export declare function
|
|
384
|
+
export declare function futoBackupsSessionDeviceFlow(opts?: Oazapfts.RequestOpts): Promise<DeviceFlowEventDto>;
|
|
385
385
|
/**
|
|
386
386
|
* Create session
|
|
387
387
|
*/
|
|
388
|
-
export declare function
|
|
388
|
+
export declare function futoBackupsCreateSession(createSessionRequestDto: CreateSessionRequestDto, opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
389
389
|
/**
|
|
390
390
|
* Create a ticket
|
|
391
391
|
*/
|
|
392
|
-
export declare function
|
|
392
|
+
export declare function futoBackupsCreateTicket(ticketCreateRequestDto: TicketCreateRequestDto, opts?: Oazapfts.RequestOpts): Promise<TicketCreateResponseDto>;
|
|
393
393
|
/**
|
|
394
394
|
* List backends
|
|
395
395
|
*/
|
|
396
|
-
export declare function
|
|
396
|
+
export declare function futoBackupsGetBackends(opts?: Oazapfts.RequestOpts): Promise<BackendsResponseDto>;
|
|
397
397
|
/**
|
|
398
398
|
* Create a local backend
|
|
399
399
|
*/
|
|
400
|
-
export declare function
|
|
400
|
+
export declare function futoBackupsCreateLocalBackend(createLocalBackendRequestDto: CreateLocalBackendRequestDto, opts?: Oazapfts.RequestOpts): Promise<BackendResponseDto>;
|
|
401
401
|
/**
|
|
402
402
|
* Get backups orchestrator configuration
|
|
403
403
|
*/
|
|
404
|
-
export declare function
|
|
404
|
+
export declare function futoBackupsGetConfig(opts?: Oazapfts.RequestOpts): Promise<ConfigResponseDto>;
|
|
405
405
|
/**
|
|
406
406
|
* Update backups orchestrator configuration
|
|
407
407
|
*/
|
|
408
|
-
export declare function
|
|
408
|
+
export declare function futoBackupsUpdateConfig(configUpdateRequestDto: ConfigUpdateRequestDto, opts?: Oazapfts.RequestOpts): Promise<ConfigResponseDto>;
|
|
409
409
|
/**
|
|
410
410
|
* Reset the backups orchestrator
|
|
411
411
|
*/
|
|
412
|
-
export declare function
|
|
412
|
+
export declare function futoBackupsResetOrchestrator(opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
413
413
|
/**
|
|
414
414
|
* List files
|
|
415
415
|
*/
|
|
416
|
-
export declare function
|
|
416
|
+
export declare function futoBackupsGetFileListing({ path }?: {
|
|
417
417
|
path?: string;
|
|
418
418
|
}, opts?: Oazapfts.RequestOpts): Promise<FilesystemListingResponseDto>;
|
|
419
419
|
/**
|
|
420
420
|
* Get backup integrations
|
|
421
421
|
*/
|
|
422
|
-
export declare function
|
|
422
|
+
export declare function futoBackupsGetIntegrations(opts?: Oazapfts.RequestOpts): Promise<IntegrationsResponseDto>;
|
|
423
423
|
/**
|
|
424
424
|
* Get Immich backup status
|
|
425
425
|
*/
|
|
426
|
-
export declare function
|
|
426
|
+
export declare function futoBackupsGetImmichBackupStatus(opts?: Oazapfts.RequestOpts): Promise<ImmichBackupStatusDto>;
|
|
427
427
|
/**
|
|
428
428
|
* Configure the Immich backup integration
|
|
429
429
|
*/
|
|
430
|
-
export declare function
|
|
430
|
+
export declare function futoBackupsConfigureImmichIntegration(configureImmichIntegrationRequestDto: ConfigureImmichIntegrationRequestDto, opts?: Oazapfts.RequestOpts): Promise<ConfigureImmichIntegrationResponseDto>;
|
|
431
431
|
/**
|
|
432
432
|
* Ignore the Immich database dump warning
|
|
433
433
|
*/
|
|
434
|
-
export declare function
|
|
434
|
+
export declare function futoBackupsIgnoreImmichDatabaseDumpWarning(opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
435
435
|
/**
|
|
436
436
|
* Configure Immich database dumps
|
|
437
437
|
*/
|
|
438
|
-
export declare function
|
|
438
|
+
export declare function futoBackupsConfigureImmichDatabaseDump(configureImmichDatabaseDumpRequestDto: ConfigureImmichDatabaseDumpRequestDto, opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
439
439
|
/**
|
|
440
440
|
* Roll Immich back to a snapshot
|
|
441
441
|
*/
|
|
442
|
-
export declare function
|
|
442
|
+
export declare function futoBackupsStartImmichRollback(immichRollbackRequestDto: ImmichRollbackRequestDto, opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
443
443
|
/**
|
|
444
444
|
* List jobs
|
|
445
445
|
*/
|
|
446
|
-
export declare function
|
|
446
|
+
export declare function futoBackupsGetJobs(repositoryId: string, opts?: Oazapfts.RequestOpts): Promise<JobListResponseDto>;
|
|
447
447
|
/**
|
|
448
448
|
* Get a job
|
|
449
449
|
*/
|
|
450
|
-
export declare function
|
|
450
|
+
export declare function futoBackupsGetJob(id: string, opts?: Oazapfts.RequestOpts): Promise<JobDto>;
|
|
451
451
|
/**
|
|
452
452
|
* Cancel a job
|
|
453
453
|
*/
|
|
454
|
-
export declare function
|
|
454
|
+
export declare function futoBackupsCancelJob(id: string, opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
455
455
|
/**
|
|
456
456
|
* Download a job log
|
|
457
457
|
*/
|
|
458
|
-
export declare function
|
|
458
|
+
export declare function futoBackupsDownloadJobLog(id: string, opts?: Oazapfts.RequestOpts): Promise<Blob>;
|
|
459
459
|
/**
|
|
460
460
|
* Download a job support log
|
|
461
461
|
*/
|
|
462
|
-
export declare function
|
|
462
|
+
export declare function futoBackupsDownloadJobSupportLog(id: string, opts?: Oazapfts.RequestOpts): Promise<Blob>;
|
|
463
463
|
/**
|
|
464
464
|
* Get backup onboarding status
|
|
465
465
|
*/
|
|
466
|
-
export declare function
|
|
466
|
+
export declare function futoBackupsOnboardingStatus(opts?: Oazapfts.RequestOpts): Promise<OnboardingStatusResponseDto>;
|
|
467
467
|
/**
|
|
468
468
|
* Get the backup recovery key
|
|
469
469
|
*/
|
|
470
|
-
export declare function
|
|
470
|
+
export declare function futoBackupsCurrentRecoveryKey(opts?: Oazapfts.RequestOpts): Promise<CurrentRecoveryKeyResponse>;
|
|
471
471
|
/**
|
|
472
472
|
* Import a backup recovery key
|
|
473
473
|
*/
|
|
474
|
-
export declare function
|
|
474
|
+
export declare function futoBackupsImportRecoveryKey(importRecoveryKeyRequest: ImportRecoveryKeyRequest, opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
475
475
|
/**
|
|
476
476
|
* Confirm the backup recovery key
|
|
477
477
|
*/
|
|
478
|
-
export declare function
|
|
478
|
+
export declare function futoBackupsConfirmRecoveryKey(opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
479
479
|
/**
|
|
480
480
|
* Skip optional backup onboarding
|
|
481
481
|
*/
|
|
482
|
-
export declare function
|
|
482
|
+
export declare function futoBackupsSkipOnboardingExtraConfig(opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
483
483
|
/**
|
|
484
484
|
* Enable FUTO Backups telemetry
|
|
485
485
|
*/
|
|
486
|
-
export declare function
|
|
486
|
+
export declare function futoBackupsEnableTelemetry(opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
487
487
|
/**
|
|
488
488
|
* Report a startup error
|
|
489
489
|
*/
|
|
490
|
-
export declare function
|
|
490
|
+
export declare function futoBackupsReportError(opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
491
491
|
/**
|
|
492
492
|
* Create a new backup
|
|
493
493
|
*/
|
|
494
|
-
export declare function
|
|
494
|
+
export declare function futoBackupsCreateRepository(repositoryCreateRequestDto: RepositoryCreateRequestDto, { backend }?: {
|
|
495
495
|
backend?: string;
|
|
496
496
|
}, opts?: Oazapfts.RequestOpts): Promise<RepositoryCreateResponseDto>;
|
|
497
497
|
/**
|
|
498
498
|
* List backups
|
|
499
499
|
*/
|
|
500
|
-
export declare function
|
|
500
|
+
export declare function futoBackupsGetRepositories(opts?: Oazapfts.RequestOpts): Promise<RepositoryListResponseDto>;
|
|
501
501
|
/**
|
|
502
502
|
* List remote backups
|
|
503
503
|
*/
|
|
504
|
-
export declare function
|
|
504
|
+
export declare function futoBackupsInspectRepositories({ backend }?: {
|
|
505
505
|
backend?: string;
|
|
506
506
|
}, opts?: Oazapfts.RequestOpts): Promise<RepositoryInspectResponseDto>;
|
|
507
507
|
/**
|
|
508
508
|
* Update a backup
|
|
509
509
|
*/
|
|
510
|
-
export declare function
|
|
510
|
+
export declare function futoBackupsUpdateRepository(id: string, repositoryUpdateRequestDto: RepositoryUpdateRequestDto, { backend }?: {
|
|
511
511
|
backend?: string;
|
|
512
512
|
}, opts?: Oazapfts.RequestOpts): Promise<RepositoryUpdateResponseDto>;
|
|
513
513
|
/**
|
|
514
514
|
* Remove a backup
|
|
515
515
|
*/
|
|
516
|
-
export declare function
|
|
516
|
+
export declare function futoBackupsDeleteRepository(id: string, opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
517
517
|
/**
|
|
518
518
|
* Start a backup
|
|
519
519
|
*/
|
|
520
|
-
export declare function
|
|
520
|
+
export declare function futoBackupsCreateBackup(id: string, opts?: Oazapfts.RequestOpts): Promise<JobResponseDto>;
|
|
521
521
|
/**
|
|
522
522
|
* Sync a remote deletion
|
|
523
523
|
*/
|
|
524
|
-
export declare function
|
|
524
|
+
export declare function futoBackupsSyncRepositoryDeletion(id: string, opts?: Oazapfts.RequestOpts): Promise<RepositorySyncDeletionResponseDto>;
|
|
525
525
|
/**
|
|
526
526
|
* Check a repository import
|
|
527
527
|
*/
|
|
528
|
-
export declare function
|
|
528
|
+
export declare function futoBackupsCheckImportRepository(id: string, backend: string, opts?: Oazapfts.RequestOpts): Promise<RepositoryCheckImportResponseDto>;
|
|
529
529
|
/**
|
|
530
530
|
* Import a repository
|
|
531
531
|
*/
|
|
532
|
-
export declare function
|
|
532
|
+
export declare function futoBackupsImportRepository(id: string, backend: string, opts?: Oazapfts.RequestOpts): Promise<RepositoryCreateResponseDto>;
|
|
533
533
|
/**
|
|
534
534
|
* Change the primary backend
|
|
535
535
|
*/
|
|
536
|
-
export declare function
|
|
536
|
+
export declare function futoBackupsReconfigureRepositoryPrimaryBackend(id: string, repositoryPrimaryBackendReconfigureRequestDto: RepositoryPrimaryBackendReconfigureRequestDto, opts?: Oazapfts.RequestOpts): Promise<RepositoryCreateResponseDto>;
|
|
537
537
|
/**
|
|
538
538
|
* List snapshots
|
|
539
539
|
*/
|
|
540
|
-
export declare function
|
|
540
|
+
export declare function futoBackupsGetSnapshots(id: string, opts?: Oazapfts.RequestOpts): Promise<ListSnapshotsResponseDto>;
|
|
541
541
|
/**
|
|
542
542
|
* Prune a repository
|
|
543
543
|
*/
|
|
544
|
-
export declare function
|
|
544
|
+
export declare function futoBackupsPruneRepository(id: string, opts?: Oazapfts.RequestOpts): Promise<JobResponseDto>;
|
|
545
545
|
/**
|
|
546
546
|
* Restore a snapshot
|
|
547
547
|
*/
|
|
548
|
-
export declare function
|
|
548
|
+
export declare function futoBackupsRestoreSnapshot(id: string, snapshot: string, repositorySnapshotRestoreRequestDto: RepositorySnapshotRestoreRequestDto, opts?: Oazapfts.RequestOpts): Promise<JobResponseDto>;
|
|
549
549
|
/**
|
|
550
550
|
* Delete a snapshot
|
|
551
551
|
*/
|
|
552
|
-
export declare function
|
|
552
|
+
export declare function futoBackupsForgetSnapshot(id: string, snapshot: string, opts?: Oazapfts.RequestOpts): Promise<ListSnapshotsResponseDto>;
|
|
553
553
|
/**
|
|
554
554
|
* Restore from snapshot
|
|
555
555
|
*/
|
|
556
|
-
export declare function
|
|
556
|
+
export declare function futoBackupsRestoreFromPoint(id: string, snapshot: string, backend: string, repositorySnapshotRestoreFromPointRequestDto: RepositorySnapshotRestoreFromPointRequestDto, opts?: Oazapfts.RequestOpts): Promise<JobResponseDto>;
|
|
557
557
|
/**
|
|
558
558
|
* List snapshot files
|
|
559
559
|
*/
|
|
560
|
-
export declare function
|
|
560
|
+
export declare function futoBackupsGetSnapshotListing(id: string, snapshot: string, { path }?: {
|
|
561
561
|
path?: string;
|
|
562
562
|
}, opts?: Oazapfts.RequestOpts): Promise<FilesystemListingResponseDto>;
|
|
563
563
|
/**
|
|
564
564
|
* Create a schedule
|
|
565
565
|
*/
|
|
566
|
-
export declare function
|
|
566
|
+
export declare function futoBackupsCreateSchedule(scheduleCreateRequestDto: ScheduleCreateRequestDto, opts?: Oazapfts.RequestOpts): Promise<ScheduleCreateResponseDto>;
|
|
567
567
|
/**
|
|
568
568
|
* List schedules
|
|
569
569
|
*/
|
|
570
|
-
export declare function
|
|
570
|
+
export declare function futoBackupsGetSchedules(opts?: Oazapfts.RequestOpts): Promise<ScheduleListResponseDto>;
|
|
571
571
|
/**
|
|
572
572
|
* Update a schedule
|
|
573
573
|
*/
|
|
574
|
-
export declare function
|
|
574
|
+
export declare function futoBackupsUpdateSchedule(id: string, scheduleUpdateRequestDto: ScheduleUpdateRequestDto, opts?: Oazapfts.RequestOpts): Promise<ScheduleUpdateResponseDto>;
|
|
575
575
|
/**
|
|
576
576
|
* Delete a schedule
|
|
577
577
|
*/
|
|
578
|
-
export declare function
|
|
578
|
+
export declare function futoBackupsRemoveSchedule(id: string, opts?: Oazapfts.RequestOpts): Promise<never>;
|
|
579
579
|
/**
|
|
580
580
|
* Get support mode
|
|
581
581
|
*/
|
|
582
|
-
export declare function
|
|
582
|
+
export declare function futoBackupsGetSupportMode(opts?: Oazapfts.RequestOpts): Promise<SupportModeResponseDto>;
|
|
583
583
|
/**
|
|
584
584
|
* Update support mode
|
|
585
585
|
*/
|
|
586
|
-
export declare function
|
|
586
|
+
export declare function futoBackupsUpdateSupportMode(supportModeUpdateRequestDto: SupportModeUpdateRequestDto, opts?: Oazapfts.RequestOpts): Promise<SupportModeResponseDto>;
|
package/dist/fetch-client.js
CHANGED
|
@@ -15,7 +15,7 @@ export const servers = {};
|
|
|
15
15
|
/**
|
|
16
16
|
* Connect a FUTO Backups account
|
|
17
17
|
*/
|
|
18
|
-
export function
|
|
18
|
+
export function futoBackupsConnectDeviceFlow(opts) {
|
|
19
19
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/auth/oidc/device", {
|
|
20
20
|
...opts
|
|
21
21
|
}));
|
|
@@ -23,7 +23,7 @@ export function connectDeviceFlow(opts) {
|
|
|
23
23
|
/**
|
|
24
24
|
* Sign in with FUTO Backups account
|
|
25
25
|
*/
|
|
26
|
-
export function
|
|
26
|
+
export function futoBackupsSessionDeviceFlow(opts) {
|
|
27
27
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/auth/session/device", {
|
|
28
28
|
...opts
|
|
29
29
|
}));
|
|
@@ -31,7 +31,7 @@ export function sessionDeviceFlow(opts) {
|
|
|
31
31
|
/**
|
|
32
32
|
* Create session
|
|
33
33
|
*/
|
|
34
|
-
export function
|
|
34
|
+
export function futoBackupsCreateSession(createSessionRequestDto, opts) {
|
|
35
35
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/auth/session", oazapfts.json({
|
|
36
36
|
...opts,
|
|
37
37
|
method: "POST",
|
|
@@ -41,7 +41,7 @@ export function createSession(createSessionRequestDto, opts) {
|
|
|
41
41
|
/**
|
|
42
42
|
* Create a ticket
|
|
43
43
|
*/
|
|
44
|
-
export function
|
|
44
|
+
export function futoBackupsCreateTicket(ticketCreateRequestDto, opts) {
|
|
45
45
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/auth/ticket", oazapfts.json({
|
|
46
46
|
...opts,
|
|
47
47
|
method: "POST",
|
|
@@ -51,7 +51,7 @@ export function createTicket(ticketCreateRequestDto, opts) {
|
|
|
51
51
|
/**
|
|
52
52
|
* List backends
|
|
53
53
|
*/
|
|
54
|
-
export function
|
|
54
|
+
export function futoBackupsGetBackends(opts) {
|
|
55
55
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/backend", {
|
|
56
56
|
...opts
|
|
57
57
|
}));
|
|
@@ -59,7 +59,7 @@ export function getBackends(opts) {
|
|
|
59
59
|
/**
|
|
60
60
|
* Create a local backend
|
|
61
61
|
*/
|
|
62
|
-
export function
|
|
62
|
+
export function futoBackupsCreateLocalBackend(createLocalBackendRequestDto, opts) {
|
|
63
63
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/backend/local", oazapfts.json({
|
|
64
64
|
...opts,
|
|
65
65
|
method: "POST",
|
|
@@ -69,7 +69,7 @@ export function createLocalBackend(createLocalBackendRequestDto, opts) {
|
|
|
69
69
|
/**
|
|
70
70
|
* Get backups orchestrator configuration
|
|
71
71
|
*/
|
|
72
|
-
export function
|
|
72
|
+
export function futoBackupsGetConfig(opts) {
|
|
73
73
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/config", {
|
|
74
74
|
...opts
|
|
75
75
|
}));
|
|
@@ -77,7 +77,7 @@ export function getConfig(opts) {
|
|
|
77
77
|
/**
|
|
78
78
|
* Update backups orchestrator configuration
|
|
79
79
|
*/
|
|
80
|
-
export function
|
|
80
|
+
export function futoBackupsUpdateConfig(configUpdateRequestDto, opts) {
|
|
81
81
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/config", oazapfts.json({
|
|
82
82
|
...opts,
|
|
83
83
|
method: "PUT",
|
|
@@ -87,7 +87,7 @@ export function updateConfig(configUpdateRequestDto, opts) {
|
|
|
87
87
|
/**
|
|
88
88
|
* Reset the backups orchestrator
|
|
89
89
|
*/
|
|
90
|
-
export function
|
|
90
|
+
export function futoBackupsResetOrchestrator(opts) {
|
|
91
91
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/debug/reset", {
|
|
92
92
|
...opts,
|
|
93
93
|
method: "POST"
|
|
@@ -96,7 +96,7 @@ export function resetOrchestrator(opts) {
|
|
|
96
96
|
/**
|
|
97
97
|
* List files
|
|
98
98
|
*/
|
|
99
|
-
export function
|
|
99
|
+
export function futoBackupsGetFileListing({ path } = {}, opts) {
|
|
100
100
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/fs${QS.query(QS.explode({
|
|
101
101
|
path
|
|
102
102
|
}))}`, {
|
|
@@ -106,7 +106,7 @@ export function getFileListing({ path } = {}, opts) {
|
|
|
106
106
|
/**
|
|
107
107
|
* Get backup integrations
|
|
108
108
|
*/
|
|
109
|
-
export function
|
|
109
|
+
export function futoBackupsGetIntegrations(opts) {
|
|
110
110
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/integrations", {
|
|
111
111
|
...opts
|
|
112
112
|
}));
|
|
@@ -114,7 +114,7 @@ export function getIntegrations(opts) {
|
|
|
114
114
|
/**
|
|
115
115
|
* Get Immich backup status
|
|
116
116
|
*/
|
|
117
|
-
export function
|
|
117
|
+
export function futoBackupsGetImmichBackupStatus(opts) {
|
|
118
118
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/integrations/immich/status", {
|
|
119
119
|
...opts
|
|
120
120
|
}));
|
|
@@ -122,7 +122,7 @@ export function getImmichBackupStatus(opts) {
|
|
|
122
122
|
/**
|
|
123
123
|
* Configure the Immich backup integration
|
|
124
124
|
*/
|
|
125
|
-
export function
|
|
125
|
+
export function futoBackupsConfigureImmichIntegration(configureImmichIntegrationRequestDto, opts) {
|
|
126
126
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/integrations/immich", oazapfts.json({
|
|
127
127
|
...opts,
|
|
128
128
|
method: "POST",
|
|
@@ -132,7 +132,7 @@ export function configureImmichIntegration(configureImmichIntegrationRequestDto,
|
|
|
132
132
|
/**
|
|
133
133
|
* Ignore the Immich database dump warning
|
|
134
134
|
*/
|
|
135
|
-
export function
|
|
135
|
+
export function futoBackupsIgnoreImmichDatabaseDumpWarning(opts) {
|
|
136
136
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/integrations/immich/database-dump/ignore-warning", {
|
|
137
137
|
...opts,
|
|
138
138
|
method: "POST"
|
|
@@ -141,7 +141,7 @@ export function ignoreImmichDatabaseDumpWarning(opts) {
|
|
|
141
141
|
/**
|
|
142
142
|
* Configure Immich database dumps
|
|
143
143
|
*/
|
|
144
|
-
export function
|
|
144
|
+
export function futoBackupsConfigureImmichDatabaseDump(configureImmichDatabaseDumpRequestDto, opts) {
|
|
145
145
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/integrations/immich/database-dump", oazapfts.json({
|
|
146
146
|
...opts,
|
|
147
147
|
method: "POST",
|
|
@@ -151,7 +151,7 @@ export function configureImmichDatabaseDump(configureImmichDatabaseDumpRequestDt
|
|
|
151
151
|
/**
|
|
152
152
|
* Roll Immich back to a snapshot
|
|
153
153
|
*/
|
|
154
|
-
export function
|
|
154
|
+
export function futoBackupsStartImmichRollback(immichRollbackRequestDto, opts) {
|
|
155
155
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/integrations/immich/rollback", oazapfts.json({
|
|
156
156
|
...opts,
|
|
157
157
|
method: "POST",
|
|
@@ -161,7 +161,7 @@ export function startImmichRollback(immichRollbackRequestDto, opts) {
|
|
|
161
161
|
/**
|
|
162
162
|
* List jobs
|
|
163
163
|
*/
|
|
164
|
-
export function
|
|
164
|
+
export function futoBackupsGetJobs(repositoryId, opts) {
|
|
165
165
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/jobs${QS.query(QS.explode({
|
|
166
166
|
repositoryId
|
|
167
167
|
}))}`, {
|
|
@@ -171,7 +171,7 @@ export function getJobs(repositoryId, opts) {
|
|
|
171
171
|
/**
|
|
172
172
|
* Get a job
|
|
173
173
|
*/
|
|
174
|
-
export function
|
|
174
|
+
export function futoBackupsGetJob(id, opts) {
|
|
175
175
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/jobs/${encodeURIComponent(id)}`, {
|
|
176
176
|
...opts
|
|
177
177
|
}));
|
|
@@ -179,7 +179,7 @@ export function getJob(id, opts) {
|
|
|
179
179
|
/**
|
|
180
180
|
* Cancel a job
|
|
181
181
|
*/
|
|
182
|
-
export function
|
|
182
|
+
export function futoBackupsCancelJob(id, opts) {
|
|
183
183
|
return oazapfts.ok(oazapfts.fetchText(`/api/futo-backups/jobs/${encodeURIComponent(id)}`, {
|
|
184
184
|
...opts,
|
|
185
185
|
method: "DELETE"
|
|
@@ -188,7 +188,7 @@ export function cancelJob(id, opts) {
|
|
|
188
188
|
/**
|
|
189
189
|
* Download a job log
|
|
190
190
|
*/
|
|
191
|
-
export function
|
|
191
|
+
export function futoBackupsDownloadJobLog(id, opts) {
|
|
192
192
|
return oazapfts.ok(oazapfts.fetchBlob(`/api/futo-backups/jobs/${encodeURIComponent(id)}/download`, {
|
|
193
193
|
...opts
|
|
194
194
|
}));
|
|
@@ -196,7 +196,7 @@ export function downloadJobLog(id, opts) {
|
|
|
196
196
|
/**
|
|
197
197
|
* Download a job support log
|
|
198
198
|
*/
|
|
199
|
-
export function
|
|
199
|
+
export function futoBackupsDownloadJobSupportLog(id, opts) {
|
|
200
200
|
return oazapfts.ok(oazapfts.fetchBlob(`/api/futo-backups/jobs/${encodeURIComponent(id)}/support-log/download`, {
|
|
201
201
|
...opts
|
|
202
202
|
}));
|
|
@@ -204,7 +204,7 @@ export function downloadJobSupportLog(id, opts) {
|
|
|
204
204
|
/**
|
|
205
205
|
* Get backup onboarding status
|
|
206
206
|
*/
|
|
207
|
-
export function
|
|
207
|
+
export function futoBackupsOnboardingStatus(opts) {
|
|
208
208
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/onboarding", {
|
|
209
209
|
...opts
|
|
210
210
|
}));
|
|
@@ -212,7 +212,7 @@ export function onboardingStatus(opts) {
|
|
|
212
212
|
/**
|
|
213
213
|
* Get the backup recovery key
|
|
214
214
|
*/
|
|
215
|
-
export function
|
|
215
|
+
export function futoBackupsCurrentRecoveryKey(opts) {
|
|
216
216
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/onboarding/recovery-key", {
|
|
217
217
|
...opts
|
|
218
218
|
}));
|
|
@@ -220,7 +220,7 @@ export function currentRecoveryKey(opts) {
|
|
|
220
220
|
/**
|
|
221
221
|
* Import a backup recovery key
|
|
222
222
|
*/
|
|
223
|
-
export function
|
|
223
|
+
export function futoBackupsImportRecoveryKey(importRecoveryKeyRequest, opts) {
|
|
224
224
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/onboarding/recovery-key", oazapfts.json({
|
|
225
225
|
...opts,
|
|
226
226
|
method: "PUT",
|
|
@@ -230,7 +230,7 @@ export function importRecoveryKey(importRecoveryKeyRequest, opts) {
|
|
|
230
230
|
/**
|
|
231
231
|
* Confirm the backup recovery key
|
|
232
232
|
*/
|
|
233
|
-
export function
|
|
233
|
+
export function futoBackupsConfirmRecoveryKey(opts) {
|
|
234
234
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/onboarding/recovery-key", {
|
|
235
235
|
...opts,
|
|
236
236
|
method: "POST"
|
|
@@ -239,7 +239,7 @@ export function confirmRecoveryKey(opts) {
|
|
|
239
239
|
/**
|
|
240
240
|
* Skip optional backup onboarding
|
|
241
241
|
*/
|
|
242
|
-
export function
|
|
242
|
+
export function futoBackupsSkipOnboardingExtraConfig(opts) {
|
|
243
243
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/onboarding/skip", {
|
|
244
244
|
...opts,
|
|
245
245
|
method: "POST"
|
|
@@ -248,7 +248,7 @@ export function skipOnboardingExtraConfig(opts) {
|
|
|
248
248
|
/**
|
|
249
249
|
* Enable FUTO Backups telemetry
|
|
250
250
|
*/
|
|
251
|
-
export function
|
|
251
|
+
export function futoBackupsEnableTelemetry(opts) {
|
|
252
252
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/onboarding/telemetry", {
|
|
253
253
|
...opts,
|
|
254
254
|
method: "POST"
|
|
@@ -257,7 +257,7 @@ export function enableTelemetry(opts) {
|
|
|
257
257
|
/**
|
|
258
258
|
* Report a startup error
|
|
259
259
|
*/
|
|
260
|
-
export function
|
|
260
|
+
export function futoBackupsReportError(opts) {
|
|
261
261
|
return oazapfts.ok(oazapfts.fetchText("/api/futo-backups/onboarding/report-error", {
|
|
262
262
|
...opts,
|
|
263
263
|
method: "POST"
|
|
@@ -266,7 +266,7 @@ export function reportError(opts) {
|
|
|
266
266
|
/**
|
|
267
267
|
* Create a new backup
|
|
268
268
|
*/
|
|
269
|
-
export function
|
|
269
|
+
export function futoBackupsCreateRepository(repositoryCreateRequestDto, { backend } = {}, opts) {
|
|
270
270
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository${QS.query(QS.explode({
|
|
271
271
|
backend
|
|
272
272
|
}))}`, oazapfts.json({
|
|
@@ -278,7 +278,7 @@ export function createRepository(repositoryCreateRequestDto, { backend } = {}, o
|
|
|
278
278
|
/**
|
|
279
279
|
* List backups
|
|
280
280
|
*/
|
|
281
|
-
export function
|
|
281
|
+
export function futoBackupsGetRepositories(opts) {
|
|
282
282
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/repository", {
|
|
283
283
|
...opts
|
|
284
284
|
}));
|
|
@@ -286,7 +286,7 @@ export function getRepositories(opts) {
|
|
|
286
286
|
/**
|
|
287
287
|
* List remote backups
|
|
288
288
|
*/
|
|
289
|
-
export function
|
|
289
|
+
export function futoBackupsInspectRepositories({ backend } = {}, opts) {
|
|
290
290
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/inspect${QS.query(QS.explode({
|
|
291
291
|
backend
|
|
292
292
|
}))}`, {
|
|
@@ -296,7 +296,7 @@ export function inspectRepositories({ backend } = {}, opts) {
|
|
|
296
296
|
/**
|
|
297
297
|
* Update a backup
|
|
298
298
|
*/
|
|
299
|
-
export function
|
|
299
|
+
export function futoBackupsUpdateRepository(id, repositoryUpdateRequestDto, { backend } = {}, opts) {
|
|
300
300
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}${QS.query(QS.explode({
|
|
301
301
|
backend
|
|
302
302
|
}))}`, oazapfts.json({
|
|
@@ -308,7 +308,7 @@ export function updateRepository(id, repositoryUpdateRequestDto, { backend } = {
|
|
|
308
308
|
/**
|
|
309
309
|
* Remove a backup
|
|
310
310
|
*/
|
|
311
|
-
export function
|
|
311
|
+
export function futoBackupsDeleteRepository(id, opts) {
|
|
312
312
|
return oazapfts.ok(oazapfts.fetchText(`/api/futo-backups/repository/${encodeURIComponent(id)}`, {
|
|
313
313
|
...opts,
|
|
314
314
|
method: "DELETE"
|
|
@@ -317,7 +317,7 @@ export function deleteRepository(id, opts) {
|
|
|
317
317
|
/**
|
|
318
318
|
* Start a backup
|
|
319
319
|
*/
|
|
320
|
-
export function
|
|
320
|
+
export function futoBackupsCreateBackup(id, opts) {
|
|
321
321
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}`, {
|
|
322
322
|
...opts,
|
|
323
323
|
method: "POST"
|
|
@@ -326,7 +326,7 @@ export function createBackup(id, opts) {
|
|
|
326
326
|
/**
|
|
327
327
|
* Sync a remote deletion
|
|
328
328
|
*/
|
|
329
|
-
export function
|
|
329
|
+
export function futoBackupsSyncRepositoryDeletion(id, opts) {
|
|
330
330
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/sync-deletion`, {
|
|
331
331
|
...opts,
|
|
332
332
|
method: "POST"
|
|
@@ -335,7 +335,7 @@ export function syncRepositoryDeletion(id, opts) {
|
|
|
335
335
|
/**
|
|
336
336
|
* Check a repository import
|
|
337
337
|
*/
|
|
338
|
-
export function
|
|
338
|
+
export function futoBackupsCheckImportRepository(id, backend, opts) {
|
|
339
339
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/import${QS.query(QS.explode({
|
|
340
340
|
backend
|
|
341
341
|
}))}`, {
|
|
@@ -345,7 +345,7 @@ export function checkImportRepository(id, backend, opts) {
|
|
|
345
345
|
/**
|
|
346
346
|
* Import a repository
|
|
347
347
|
*/
|
|
348
|
-
export function
|
|
348
|
+
export function futoBackupsImportRepository(id, backend, opts) {
|
|
349
349
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/import${QS.query(QS.explode({
|
|
350
350
|
backend
|
|
351
351
|
}))}`, {
|
|
@@ -356,7 +356,7 @@ export function importRepository(id, backend, opts) {
|
|
|
356
356
|
/**
|
|
357
357
|
* Change the primary backend
|
|
358
358
|
*/
|
|
359
|
-
export function
|
|
359
|
+
export function futoBackupsReconfigureRepositoryPrimaryBackend(id, repositoryPrimaryBackendReconfigureRequestDto, opts) {
|
|
360
360
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/backend`, oazapfts.json({
|
|
361
361
|
...opts,
|
|
362
362
|
method: "PUT",
|
|
@@ -366,7 +366,7 @@ export function reconfigureRepositoryPrimaryBackend(id, repositoryPrimaryBackend
|
|
|
366
366
|
/**
|
|
367
367
|
* List snapshots
|
|
368
368
|
*/
|
|
369
|
-
export function
|
|
369
|
+
export function futoBackupsGetSnapshots(id, opts) {
|
|
370
370
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/snapshots`, {
|
|
371
371
|
...opts
|
|
372
372
|
}));
|
|
@@ -374,7 +374,7 @@ export function getSnapshots(id, opts) {
|
|
|
374
374
|
/**
|
|
375
375
|
* Prune a repository
|
|
376
376
|
*/
|
|
377
|
-
export function
|
|
377
|
+
export function futoBackupsPruneRepository(id, opts) {
|
|
378
378
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/snapshots/prune`, {
|
|
379
379
|
...opts,
|
|
380
380
|
method: "POST"
|
|
@@ -383,7 +383,7 @@ export function pruneRepository(id, opts) {
|
|
|
383
383
|
/**
|
|
384
384
|
* Restore a snapshot
|
|
385
385
|
*/
|
|
386
|
-
export function
|
|
386
|
+
export function futoBackupsRestoreSnapshot(id, snapshot, repositorySnapshotRestoreRequestDto, opts) {
|
|
387
387
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}`, oazapfts.json({
|
|
388
388
|
...opts,
|
|
389
389
|
method: "POST",
|
|
@@ -393,7 +393,7 @@ export function restoreSnapshot(id, snapshot, repositorySnapshotRestoreRequestDt
|
|
|
393
393
|
/**
|
|
394
394
|
* Delete a snapshot
|
|
395
395
|
*/
|
|
396
|
-
export function
|
|
396
|
+
export function futoBackupsForgetSnapshot(id, snapshot, opts) {
|
|
397
397
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}`, {
|
|
398
398
|
...opts,
|
|
399
399
|
method: "DELETE"
|
|
@@ -402,7 +402,7 @@ export function forgetSnapshot(id, snapshot, opts) {
|
|
|
402
402
|
/**
|
|
403
403
|
* Restore from snapshot
|
|
404
404
|
*/
|
|
405
|
-
export function
|
|
405
|
+
export function futoBackupsRestoreFromPoint(id, snapshot, backend, repositorySnapshotRestoreFromPointRequestDto, opts) {
|
|
406
406
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}/restore-from-point${QS.query(QS.explode({
|
|
407
407
|
backend
|
|
408
408
|
}))}`, oazapfts.json({
|
|
@@ -414,7 +414,7 @@ export function restoreFromPoint(id, snapshot, backend, repositorySnapshotRestor
|
|
|
414
414
|
/**
|
|
415
415
|
* List snapshot files
|
|
416
416
|
*/
|
|
417
|
-
export function
|
|
417
|
+
export function futoBackupsGetSnapshotListing(id, snapshot, { path } = {}, opts) {
|
|
418
418
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/repository/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshot)}/listing${QS.query(QS.explode({
|
|
419
419
|
path
|
|
420
420
|
}))}`, {
|
|
@@ -424,7 +424,7 @@ export function getSnapshotListing(id, snapshot, { path } = {}, opts) {
|
|
|
424
424
|
/**
|
|
425
425
|
* Create a schedule
|
|
426
426
|
*/
|
|
427
|
-
export function
|
|
427
|
+
export function futoBackupsCreateSchedule(scheduleCreateRequestDto, opts) {
|
|
428
428
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/schedule", oazapfts.json({
|
|
429
429
|
...opts,
|
|
430
430
|
method: "POST",
|
|
@@ -434,7 +434,7 @@ export function createSchedule(scheduleCreateRequestDto, opts) {
|
|
|
434
434
|
/**
|
|
435
435
|
* List schedules
|
|
436
436
|
*/
|
|
437
|
-
export function
|
|
437
|
+
export function futoBackupsGetSchedules(opts) {
|
|
438
438
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/schedule", {
|
|
439
439
|
...opts
|
|
440
440
|
}));
|
|
@@ -442,7 +442,7 @@ export function getSchedules(opts) {
|
|
|
442
442
|
/**
|
|
443
443
|
* Update a schedule
|
|
444
444
|
*/
|
|
445
|
-
export function
|
|
445
|
+
export function futoBackupsUpdateSchedule(id, scheduleUpdateRequestDto, opts) {
|
|
446
446
|
return oazapfts.ok(oazapfts.fetchJson(`/api/futo-backups/schedule/${encodeURIComponent(id)}`, oazapfts.json({
|
|
447
447
|
...opts,
|
|
448
448
|
method: "PATCH",
|
|
@@ -452,7 +452,7 @@ export function updateSchedule(id, scheduleUpdateRequestDto, opts) {
|
|
|
452
452
|
/**
|
|
453
453
|
* Delete a schedule
|
|
454
454
|
*/
|
|
455
|
-
export function
|
|
455
|
+
export function futoBackupsRemoveSchedule(id, opts) {
|
|
456
456
|
return oazapfts.ok(oazapfts.fetchText(`/api/futo-backups/schedule/${encodeURIComponent(id)}`, {
|
|
457
457
|
...opts,
|
|
458
458
|
method: "DELETE"
|
|
@@ -461,7 +461,7 @@ export function removeSchedule(id, opts) {
|
|
|
461
461
|
/**
|
|
462
462
|
* Get support mode
|
|
463
463
|
*/
|
|
464
|
-
export function
|
|
464
|
+
export function futoBackupsGetSupportMode(opts) {
|
|
465
465
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/support-mode", {
|
|
466
466
|
...opts
|
|
467
467
|
}));
|
|
@@ -469,7 +469,7 @@ export function getSupportMode(opts) {
|
|
|
469
469
|
/**
|
|
470
470
|
* Update support mode
|
|
471
471
|
*/
|
|
472
|
-
export function
|
|
472
|
+
export function futoBackupsUpdateSupportMode(supportModeUpdateRequestDto, opts) {
|
|
473
473
|
return oazapfts.ok(oazapfts.fetchJson("/api/futo-backups/support-mode", oazapfts.json({
|
|
474
474
|
...opts,
|
|
475
475
|
method: "PUT",
|
package/dist/providers.js
CHANGED
|
@@ -5,6 +5,10 @@ const clients = {
|
|
|
5
5
|
orchestrator: orchestrationApiClient,
|
|
6
6
|
customer: yuccaApiClient,
|
|
7
7
|
};
|
|
8
|
+
const repositoryListers = {
|
|
9
|
+
orchestrator: () => orchestrationApiClient.futoBackupsGetRepositories(),
|
|
10
|
+
customer: () => yuccaApiClient.getRepositories(),
|
|
11
|
+
};
|
|
8
12
|
const KEY = '__yucca_provider__';
|
|
9
13
|
export const configureYucca = ({ api, baseUrl, language, }) => {
|
|
10
14
|
const client = clients[api];
|
|
@@ -14,7 +18,7 @@ export const configureYucca = ({ api, baseUrl, language, }) => {
|
|
|
14
18
|
const provider = {
|
|
15
19
|
api,
|
|
16
20
|
baseUrl: client.defaults.baseUrl.replace(/\/$/, ''),
|
|
17
|
-
getRepositories:
|
|
21
|
+
getRepositories: repositoryListers[api],
|
|
18
22
|
};
|
|
19
23
|
globalThis[KEY] = provider;
|
|
20
24
|
void setYuccaLanguage(language);
|
|
@@ -2,7 +2,7 @@ import CreateLocalBackend from '../components/backends/dialogs/CreateLocalBacken
|
|
|
2
2
|
import OAuthDeviceFlow from '../components/backends/dialogs/OAuthDeviceFlowModal.svelte';
|
|
3
3
|
import ReconfigureRepositoryBackendModal from '../components/backups/dialogs/ReconfigureRepositoryBackendModal.svelte';
|
|
4
4
|
import { SocketEvent } from '../events';
|
|
5
|
-
import {
|
|
5
|
+
import { futoBackupsCreateLocalBackend, futoBackupsGetBackends, } from '../fetch-client';
|
|
6
6
|
import { queryClient } from '../query-client';
|
|
7
7
|
import { handleError } from '../utils/handle-error';
|
|
8
8
|
import { modalManager } from '@immich/ui';
|
|
@@ -14,7 +14,7 @@ export const backendKeys = {
|
|
|
14
14
|
};
|
|
15
15
|
export const useBackends = () => createQuery(() => ({
|
|
16
16
|
queryKey: backendKeys.all,
|
|
17
|
-
queryFn: () =>
|
|
17
|
+
queryFn: () => futoBackupsGetBackends().then(({ backends }) => backends),
|
|
18
18
|
}), () => queryClient);
|
|
19
19
|
export const useBackendEventHandler = () => {
|
|
20
20
|
return {
|
|
@@ -39,7 +39,7 @@ export const handleSetupLocalStorage = (onCreate) => {
|
|
|
39
39
|
void modalManager.show(CreateLocalBackend, { onCreate });
|
|
40
40
|
};
|
|
41
41
|
export const useCreateLocalBackend = () => createMutation(() => ({
|
|
42
|
-
mutationFn: (dto) =>
|
|
42
|
+
mutationFn: (dto) => futoBackupsCreateLocalBackend(dto),
|
|
43
43
|
onError: (error) => handleError(error, gt `Failed to create local backend`),
|
|
44
44
|
}), () => queryClient);
|
|
45
45
|
export const handleReconfigureRepositoryBackend = async (repository) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { futoBackupsGetConfig, futoBackupsUpdateConfig, } from '../fetch-client';
|
|
2
2
|
import { queryClient } from '../query-client';
|
|
3
3
|
import { handleError } from '../utils/handle-error';
|
|
4
4
|
import { createMutation, createQuery } from '@tanstack/svelte-query';
|
|
@@ -28,10 +28,10 @@ export const toBandwidthDto = ({ mbps, quiet, quietStart, quietEnd, }) => {
|
|
|
28
28
|
};
|
|
29
29
|
export const useConfig = () => createQuery(() => ({
|
|
30
30
|
queryKey: configKeys.all,
|
|
31
|
-
queryFn: () =>
|
|
31
|
+
queryFn: () => futoBackupsGetConfig(),
|
|
32
32
|
}), () => queryClient);
|
|
33
33
|
export const useUpdateConfig = () => createMutation(() => ({
|
|
34
|
-
mutationFn: (dto) =>
|
|
34
|
+
mutationFn: (dto) => futoBackupsUpdateConfig(dto),
|
|
35
35
|
onSuccess: (config) => queryClient.setQueryData(configKeys.all, config),
|
|
36
36
|
onError: (error) => handleError(error, gt `Failed to save settings`),
|
|
37
37
|
}), () => queryClient);
|
|
@@ -3,7 +3,7 @@ import { handleError } from '../utils/handle-error';
|
|
|
3
3
|
import { gt } from 'svelte-i18n-lingui';
|
|
4
4
|
export const handleGetFileListing = async (path) => {
|
|
5
5
|
try {
|
|
6
|
-
return await sdk.
|
|
6
|
+
return await sdk.futoBackupsGetFileListing({ path });
|
|
7
7
|
}
|
|
8
8
|
catch (error) {
|
|
9
9
|
handleError(error, gt `Failed to load directory listing`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BackupsRecoveryKeyModal from '../components/onboarding/dialogs/BackupsRecoveryKeyModal.svelte';
|
|
2
2
|
import { modalManager } from '@immich/ui';
|
|
3
3
|
import { mdiCloudUploadOutline, mdiCogOutline, mdiKeyOutline } from '@mdi/js';
|
|
4
|
-
import {
|
|
4
|
+
import { futoBackupsConfigureImmichDatabaseDump, futoBackupsGetImmichBackupStatus, futoBackupsIgnoreImmichDatabaseDumpWarning, } from '../fetch-client';
|
|
5
5
|
import { queryClient } from '../query-client';
|
|
6
6
|
import { handleError } from '../utils/handle-error';
|
|
7
7
|
import { getBackupOutcome } from '../utils/backup-status';
|
|
@@ -72,7 +72,7 @@ export const toImmichBackupStatus = (data, loading) => {
|
|
|
72
72
|
export const useImmichBackupStatus = () => {
|
|
73
73
|
const query = createQuery(() => ({
|
|
74
74
|
queryKey: immichBackupStatusKeys.all,
|
|
75
|
-
queryFn: () =>
|
|
75
|
+
queryFn: () => futoBackupsGetImmichBackupStatus(),
|
|
76
76
|
}), () => queryClient);
|
|
77
77
|
return {
|
|
78
78
|
get repository() {
|
|
@@ -94,7 +94,7 @@ export const useImmichBackupStatus = () => {
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
export const useConfigureImmichDatabaseDump = () => createMutation(() => ({
|
|
97
|
-
mutationFn: (dto) =>
|
|
97
|
+
mutationFn: (dto) => futoBackupsConfigureImmichDatabaseDump(dto),
|
|
98
98
|
onSuccess: (_, dto) => updateImmichBackupStatus((data) => ({
|
|
99
99
|
...data,
|
|
100
100
|
databaseDump: data.databaseDump && { ...data.databaseDump, ...dto },
|
|
@@ -102,7 +102,7 @@ export const useConfigureImmichDatabaseDump = () => createMutation(() => ({
|
|
|
102
102
|
onError: (error) => handleError(error, gt `Failed to update Immich database dump settings`),
|
|
103
103
|
}), () => queryClient);
|
|
104
104
|
export const useIgnoreImmichDatabaseDumpWarning = () => createMutation(() => ({
|
|
105
|
-
mutationFn: () =>
|
|
105
|
+
mutationFn: () => futoBackupsIgnoreImmichDatabaseDumpWarning(),
|
|
106
106
|
onSuccess: () => updateImmichBackupStatus((data) => ({
|
|
107
107
|
...data,
|
|
108
108
|
databaseDumpWarningIgnored: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SocketEvent } from '../events';
|
|
2
|
-
import {
|
|
2
|
+
import { futoBackupsConfigureImmichIntegration, futoBackupsGetIntegrations, } from '../fetch-client';
|
|
3
3
|
import { queryClient } from '../query-client';
|
|
4
4
|
import { handleError } from '../utils/handle-error';
|
|
5
5
|
import { createMutation, createQuery } from '@tanstack/svelte-query';
|
|
@@ -10,7 +10,7 @@ export const integrationsKeys = {
|
|
|
10
10
|
};
|
|
11
11
|
export const useIntegrations = () => createQuery(() => ({
|
|
12
12
|
queryKey: integrationsKeys.all,
|
|
13
|
-
queryFn: () =>
|
|
13
|
+
queryFn: () => futoBackupsGetIntegrations(),
|
|
14
14
|
}), () => queryClient);
|
|
15
15
|
export const useIntegrationEventHandler = () => ({
|
|
16
16
|
onIntegrationUpdate(event) {
|
|
@@ -18,16 +18,16 @@ export const useIntegrationEventHandler = () => ({
|
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
export const useConfigureImmichIntegration = () => createMutation(() => ({
|
|
21
|
-
mutationFn: (dto) =>
|
|
21
|
+
mutationFn: (dto) => futoBackupsConfigureImmichIntegration(dto),
|
|
22
22
|
onError: (error) => handleError(error, gt `Failed to save backup settings`),
|
|
23
23
|
}), () => queryClient);
|
|
24
24
|
export const useConfigureAndStartImmichIntegration = () => createMutation(() => ({
|
|
25
25
|
mutationFn: async () => {
|
|
26
|
-
const { immichState } = await
|
|
26
|
+
const { immichState } = await futoBackupsGetIntegrations();
|
|
27
27
|
if (!immichState) {
|
|
28
28
|
throw new Error(gt `No Immich instance detected.`);
|
|
29
29
|
}
|
|
30
|
-
const { repositoryId } = await
|
|
30
|
+
const { repositoryId } = await futoBackupsConfigureImmichIntegration({
|
|
31
31
|
name: 'Immich',
|
|
32
32
|
worm: false,
|
|
33
33
|
cron: IMMICH_DEFAULT_CRON,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import CancelJobModal from '../components/backups/dialogs/CancelJobModal.svelte';
|
|
2
2
|
import ViewStatusModal from '../components/backups/dialogs/ViewStatusModal.svelte';
|
|
3
3
|
import { SocketEvent } from '../events';
|
|
4
|
-
import {
|
|
4
|
+
import { futoBackupsCancelJob, futoBackupsGetJob, futoBackupsGetJobs, } from '../fetch-client';
|
|
5
5
|
import { getProvider } from '../providers';
|
|
6
6
|
import { queryClient } from '../query-client';
|
|
7
7
|
import { formatDuration } from '../utils/format';
|
|
@@ -50,13 +50,13 @@ export const getRemainingText = (progress, now) => {
|
|
|
50
50
|
};
|
|
51
51
|
export const useJobs = (repositoryId, name) => createQuery(() => ({
|
|
52
52
|
queryKey: jobKeys.byRepository(repositoryId() ?? ''),
|
|
53
|
-
queryFn: () =>
|
|
53
|
+
queryFn: () => futoBackupsGetJobs(repositoryId()).then(({ jobs }) => jobs),
|
|
54
54
|
select: (jobs) => name ? jobs.filter((job) => job.name === name) : jobs,
|
|
55
55
|
enabled: repositoryId() !== undefined,
|
|
56
56
|
}), () => queryClient);
|
|
57
57
|
export const useJob = (jobId) => createQuery(() => ({
|
|
58
58
|
queryKey: jobKeys.byId(jobId),
|
|
59
|
-
queryFn: () =>
|
|
59
|
+
queryFn: () => futoBackupsGetJob(jobId),
|
|
60
60
|
}), () => queryClient);
|
|
61
61
|
export const useJobEventHandler = () => {
|
|
62
62
|
return {
|
|
@@ -133,7 +133,7 @@ export const handleCancelJob = async (jobId, type) => {
|
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
try {
|
|
136
|
-
await
|
|
136
|
+
await futoBackupsCancelJob(jobId);
|
|
137
137
|
}
|
|
138
138
|
catch (error) {
|
|
139
139
|
handleError(error, gt `Failed to cancel task`);
|
|
@@ -8,11 +8,11 @@ export const recoveryKeyKeys = {
|
|
|
8
8
|
};
|
|
9
9
|
export const useRecoveryKey = () => createQuery(() => ({
|
|
10
10
|
queryKey: recoveryKeyKeys.all,
|
|
11
|
-
queryFn: () => sdk.
|
|
11
|
+
queryFn: () => sdk.futoBackupsCurrentRecoveryKey(),
|
|
12
12
|
}), () => queryClient);
|
|
13
13
|
export const handleOnboardingStatus = async () => {
|
|
14
14
|
try {
|
|
15
|
-
return await sdk.
|
|
15
|
+
return await sdk.futoBackupsOnboardingStatus();
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
18
|
handleError(error, gt `Failed to load onboarding status`);
|
|
@@ -21,7 +21,7 @@ export const handleOnboardingStatus = async () => {
|
|
|
21
21
|
};
|
|
22
22
|
export const handleCurrentRecoveryKey = async () => {
|
|
23
23
|
try {
|
|
24
|
-
return await sdk.
|
|
24
|
+
return await sdk.futoBackupsCurrentRecoveryKey();
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
27
|
handleError(error, gt `Failed to load recovery key`);
|
|
@@ -30,7 +30,7 @@ export const handleCurrentRecoveryKey = async () => {
|
|
|
30
30
|
};
|
|
31
31
|
export const handleConfirmRecoveryKey = async () => {
|
|
32
32
|
try {
|
|
33
|
-
await sdk.
|
|
33
|
+
await sdk.futoBackupsConfirmRecoveryKey();
|
|
34
34
|
}
|
|
35
35
|
catch (error) {
|
|
36
36
|
handleError(error, gt `Failed to confirm recovery key`);
|
|
@@ -39,7 +39,7 @@ export const handleConfirmRecoveryKey = async () => {
|
|
|
39
39
|
};
|
|
40
40
|
export const handleImportRecoveryKey = async (dto) => {
|
|
41
41
|
try {
|
|
42
|
-
await sdk.
|
|
42
|
+
await sdk.futoBackupsImportRecoveryKey(dto);
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
45
|
handleError(error, gt `Failed to import recovery key`);
|
|
@@ -48,7 +48,7 @@ export const handleImportRecoveryKey = async (dto) => {
|
|
|
48
48
|
};
|
|
49
49
|
export const handleSkipOnboardingExtraConfig = async () => {
|
|
50
50
|
try {
|
|
51
|
-
await sdk.
|
|
51
|
+
await sdk.futoBackupsSkipOnboardingExtraConfig();
|
|
52
52
|
}
|
|
53
53
|
catch (error) {
|
|
54
54
|
handleError(error, gt `Failed to save preferences`);
|
|
@@ -56,10 +56,10 @@ export const handleSkipOnboardingExtraConfig = async () => {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
export const useEnableTelemetry = () => createMutation(() => ({
|
|
59
|
-
mutationFn: () => sdk.
|
|
59
|
+
mutationFn: () => sdk.futoBackupsEnableTelemetry(),
|
|
60
60
|
onError: (error) => handleError(error, gt `Failed to save preferences`),
|
|
61
61
|
}), () => queryClient);
|
|
62
62
|
export const useReportError = () => createMutation(() => ({
|
|
63
|
-
mutationFn: () => sdk.
|
|
63
|
+
mutationFn: () => sdk.futoBackupsReportError(),
|
|
64
64
|
onError: (error) => handleError(error, gt `Failed to report error`),
|
|
65
65
|
}), () => queryClient);
|
|
@@ -7,7 +7,7 @@ import MetricsHistoryModal from '../components/backups/metrics-history/MetricsHi
|
|
|
7
7
|
import RunHistoryModal from '../components/backups/run-history/RunHistoryModal.svelte';
|
|
8
8
|
import SnapshotsListModal from '../components/backups/snapshots-list/SnapshotsListModal.svelte';
|
|
9
9
|
import { SocketEvent } from '../events';
|
|
10
|
-
import {
|
|
10
|
+
import { futoBackupsInspectRepositories, futoBackupsReconfigureRepositoryPrimaryBackend, futoBackupsUpdateRepository, } from '../fetch-client';
|
|
11
11
|
import { getProvider } from '../providers';
|
|
12
12
|
import { queryClient } from '../query-client';
|
|
13
13
|
import { snapshotKeys } from './snapshot.service';
|
|
@@ -31,7 +31,7 @@ export const useRepositories = (initialData) => createQuery(() => ({
|
|
|
31
31
|
}), () => queryClient);
|
|
32
32
|
export const useInspectRepositories = (backendId, initialData) => createQuery(() => ({
|
|
33
33
|
queryKey: repositoryKeys.inspect(backendId),
|
|
34
|
-
queryFn: () =>
|
|
34
|
+
queryFn: () => futoBackupsInspectRepositories({ backend: backendId }).then(({ repositories }) => repositories),
|
|
35
35
|
initialData,
|
|
36
36
|
}), () => queryClient);
|
|
37
37
|
export const useRepositoryEventHandler = () => {
|
|
@@ -62,22 +62,24 @@ export const useRepositoryEventHandler = () => {
|
|
|
62
62
|
};
|
|
63
63
|
export const useCheckImportRepository = (id, backendId) => createQuery(() => ({
|
|
64
64
|
queryKey: repositoryKeys.checkImport(id, backendId),
|
|
65
|
-
queryFn: () => sdk.
|
|
65
|
+
queryFn: () => sdk.futoBackupsCheckImportRepository(id, backendId),
|
|
66
66
|
}), () => queryClient);
|
|
67
67
|
export const useCreateRepository = () => createMutation(() => ({
|
|
68
|
-
mutationFn: (dto) => sdk.
|
|
68
|
+
mutationFn: (dto) => sdk.futoBackupsCreateRepository(dto),
|
|
69
69
|
onError: (error) => handleError(error, gt `Failed to create repository`),
|
|
70
70
|
}), () => queryClient);
|
|
71
71
|
export const useImportRepository = () => createMutation(() => ({
|
|
72
|
-
mutationFn: ({ id, backendId }) => sdk.
|
|
72
|
+
mutationFn: ({ id, backendId }) => sdk.futoBackupsImportRepository(id, backendId),
|
|
73
73
|
onError: (error) => handleError(error, gt `Failed to import repository`),
|
|
74
74
|
}), () => queryClient);
|
|
75
75
|
export const useUpdateRepository = () => createMutation(() => ({
|
|
76
|
-
mutationFn: ({ id, dto, local = false, }) =>
|
|
76
|
+
mutationFn: ({ id, dto, local = false, }) => local
|
|
77
|
+
? sdk.futoBackupsUpdateRepository(id, dto)
|
|
78
|
+
: futoBackupsUpdateRepository(id, dto),
|
|
77
79
|
onError: (error) => handleError(error, gt `Failed to update repository`),
|
|
78
80
|
}), () => queryClient);
|
|
79
81
|
export const useReconfigureRepositoryPrimaryBackend = () => createMutation(() => ({
|
|
80
|
-
mutationFn: ({ id, backendId }) =>
|
|
82
|
+
mutationFn: ({ id, backendId }) => futoBackupsReconfigureRepositoryPrimaryBackend(id, { backendId }),
|
|
81
83
|
onSuccess: (_, { id }) => queryClient.invalidateQueries({
|
|
82
84
|
queryKey: snapshotKeys.byRepository(id),
|
|
83
85
|
}),
|
|
@@ -86,7 +88,7 @@ export const useReconfigureRepositoryPrimaryBackend = () => createMutation(() =>
|
|
|
86
88
|
export const handleCreateBackup = async (id) => {
|
|
87
89
|
try {
|
|
88
90
|
toastManager.info(gt `Started backup`);
|
|
89
|
-
const response = await sdk.
|
|
91
|
+
const response = await sdk.futoBackupsCreateBackup(id);
|
|
90
92
|
void modalManager.open(ViewStatusModal, {
|
|
91
93
|
jobId: response.jobId,
|
|
92
94
|
onRetry: () => void handleCreateBackup(id),
|
|
@@ -101,7 +103,7 @@ export const handleCreateBackup = async (id) => {
|
|
|
101
103
|
export const handlePruneRepository = async (id) => {
|
|
102
104
|
try {
|
|
103
105
|
toastManager.info(gt `Cleaning up old backups`);
|
|
104
|
-
const response = await sdk.
|
|
106
|
+
const response = await sdk.futoBackupsPruneRepository(id);
|
|
105
107
|
void modalManager.open(ViewStatusModal, {
|
|
106
108
|
jobId: response.jobId,
|
|
107
109
|
onRetry: () => void handlePruneRepository(id),
|
|
@@ -121,7 +123,7 @@ const syncRemoteDeletion = (repositoryId) => {
|
|
|
121
123
|
clearTimeout(timeout);
|
|
122
124
|
};
|
|
123
125
|
const onFocus = () => void sdk
|
|
124
|
-
.
|
|
126
|
+
.futoBackupsSyncRepositoryDeletion(repositoryId)
|
|
125
127
|
.then(({ deleted }) => deleted && stop())
|
|
126
128
|
.catch(stop);
|
|
127
129
|
const timeout = setTimeout(stop, REMOTE_DELETION_SYNC_TIMEOUT_MS);
|
|
@@ -133,7 +135,7 @@ const handleRemoveDeletedRepository = async (repositoryId) => {
|
|
|
133
135
|
return;
|
|
134
136
|
}
|
|
135
137
|
try {
|
|
136
|
-
await sdk.
|
|
138
|
+
await sdk.futoBackupsDeleteRepository(repositoryId);
|
|
137
139
|
}
|
|
138
140
|
catch (error) {
|
|
139
141
|
handleError(error, gt `Failed to remove repository`);
|
|
@@ -142,7 +144,7 @@ const handleRemoveDeletedRepository = async (repositoryId) => {
|
|
|
142
144
|
};
|
|
143
145
|
export const handleDeleteRepository = async (repositoryId, local) => {
|
|
144
146
|
try {
|
|
145
|
-
const action = local ? sdk.
|
|
147
|
+
const action = local ? sdk.futoBackupsCreateTicket : createTicket;
|
|
146
148
|
const { redirectTo } = await action({
|
|
147
149
|
action: 'repository.delete',
|
|
148
150
|
repositoryId,
|
|
@@ -163,7 +165,7 @@ export const handleDeleteRepository = async (repositoryId, local) => {
|
|
|
163
165
|
};
|
|
164
166
|
export const handleDisableWormRepository = async (repositoryId, local) => {
|
|
165
167
|
try {
|
|
166
|
-
const action = local ? sdk.
|
|
168
|
+
const action = local ? sdk.futoBackupsCreateTicket : createTicket;
|
|
167
169
|
const { redirectTo } = await action({
|
|
168
170
|
action: 'repository.disable-worm',
|
|
169
171
|
repositoryId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sdk } from '..';
|
|
2
2
|
import ConfigureScheduleModal from '../components/schedules/dialogs/ConfigureScheduleModal.svelte';
|
|
3
|
-
import {
|
|
3
|
+
import { futoBackupsGetSchedules, } from '../fetch-client';
|
|
4
4
|
import { SocketEvent } from '../events';
|
|
5
5
|
import { modalManager, toastManager } from '@immich/ui';
|
|
6
6
|
import { mdiCog, mdiDelete, mdiPause, mdiPlay } from '@mdi/js';
|
|
@@ -13,7 +13,7 @@ export const scheduleKeys = {
|
|
|
13
13
|
};
|
|
14
14
|
export const useSchedules = () => createQuery(() => ({
|
|
15
15
|
queryKey: scheduleKeys.all,
|
|
16
|
-
queryFn: () =>
|
|
16
|
+
queryFn: () => futoBackupsGetSchedules().then(({ schedules }) => schedules),
|
|
17
17
|
}), () => queryClient);
|
|
18
18
|
export const useScheduleEventHandler = () => {
|
|
19
19
|
return {
|
|
@@ -42,7 +42,7 @@ export const useScheduleEventHandler = () => {
|
|
|
42
42
|
};
|
|
43
43
|
export const handleGetSchedules = async () => {
|
|
44
44
|
try {
|
|
45
|
-
return await sdk.
|
|
45
|
+
return await sdk.futoBackupsGetSchedules();
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
48
|
handleError(error, gt `Failed to load schedules`);
|
|
@@ -50,16 +50,16 @@ export const handleGetSchedules = async () => {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
export const useCreateSchedule = () => createMutation(() => ({
|
|
53
|
-
mutationFn: (dto) => sdk.
|
|
53
|
+
mutationFn: (dto) => sdk.futoBackupsCreateSchedule(dto),
|
|
54
54
|
onError: (error) => handleError(error, gt `Failed to create schedule`),
|
|
55
55
|
}), () => queryClient);
|
|
56
56
|
export const useUpdateSchedule = () => createMutation(() => ({
|
|
57
|
-
mutationFn: ({ id, dto, }) => sdk.
|
|
57
|
+
mutationFn: ({ id, dto, }) => sdk.futoBackupsUpdateSchedule(id, dto),
|
|
58
58
|
onError: (error) => handleError(error, gt `Failed to update schedule`),
|
|
59
59
|
}), () => queryClient);
|
|
60
60
|
export const handlePauseSchedule = async (id, name) => {
|
|
61
61
|
try {
|
|
62
|
-
await sdk.
|
|
62
|
+
await sdk.futoBackupsUpdateSchedule(id, { paused: true });
|
|
63
63
|
toastManager.info(gt({ message: 'Paused schedule "{name}"', values: { name } }));
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
@@ -69,7 +69,7 @@ export const handlePauseSchedule = async (id, name) => {
|
|
|
69
69
|
};
|
|
70
70
|
export const handleResumeSchedule = async (id, name) => {
|
|
71
71
|
try {
|
|
72
|
-
await sdk.
|
|
72
|
+
await sdk.futoBackupsUpdateSchedule(id, { paused: false });
|
|
73
73
|
toastManager.success(gt({ message: 'Resumed schedule "{name}"', values: { name } }));
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
@@ -79,7 +79,7 @@ export const handleResumeSchedule = async (id, name) => {
|
|
|
79
79
|
};
|
|
80
80
|
export const handleRemoveSchedule = async (id, name) => {
|
|
81
81
|
try {
|
|
82
|
-
await sdk.
|
|
82
|
+
await sdk.futoBackupsRemoveSchedule(id);
|
|
83
83
|
toastManager.info(gt({ message: 'Deleted schedule "{name}"', values: { name } }));
|
|
84
84
|
}
|
|
85
85
|
catch (error) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { futoBackupsCreateSession, } from '../fetch-client';
|
|
2
2
|
import { getProvider } from '../providers';
|
|
3
3
|
import { queryClient } from '../query-client';
|
|
4
4
|
import { handleError } from '../utils/handle-error';
|
|
@@ -16,6 +16,6 @@ export const startDeviceFlow = (kind, onEvent) => {
|
|
|
16
16
|
return () => source.close();
|
|
17
17
|
};
|
|
18
18
|
export const useCreateSession = () => createMutation(() => ({
|
|
19
|
-
mutationFn: (token) =>
|
|
19
|
+
mutationFn: (token) => futoBackupsCreateSession({ token }),
|
|
20
20
|
onError: (error) => handleError(error, gt `Failed to log in`),
|
|
21
21
|
}), () => queryClient);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sdk } from '..';
|
|
2
2
|
import RestoreSnapshotModal from '../components/backups/dialogs/RestoreSnapshotModal.svelte';
|
|
3
3
|
import RollbackSnapshotModal from '../components/backups/dialogs/RollbackSnapshotModal.svelte';
|
|
4
|
-
import {
|
|
4
|
+
import { futoBackupsGetSnapshots, } from '../fetch-client';
|
|
5
5
|
import { queryClient } from '../query-client';
|
|
6
6
|
import { handleError } from '../utils/handle-error';
|
|
7
7
|
import { modalManager, toastManager } from '@immich/ui';
|
|
@@ -13,7 +13,7 @@ export const snapshotKeys = {
|
|
|
13
13
|
};
|
|
14
14
|
export const useSnapshots = (repositoryId) => createQuery(() => ({
|
|
15
15
|
queryKey: snapshotKeys.byRepository(repositoryId),
|
|
16
|
-
queryFn: () =>
|
|
16
|
+
queryFn: () => futoBackupsGetSnapshots(repositoryId).then(({ snapshots }) => snapshots.toSorted((a, b) => b.time.localeCompare(a.time))),
|
|
17
17
|
}), () => queryClient);
|
|
18
18
|
export const useSnapshotEventHandler = () => {
|
|
19
19
|
return {
|
|
@@ -35,7 +35,7 @@ export const useRemoveSnapshot = (repositoryId) => {
|
|
|
35
35
|
};
|
|
36
36
|
export const handleGetSnapshots = async (repositoryId) => {
|
|
37
37
|
try {
|
|
38
|
-
return await sdk.
|
|
38
|
+
return await sdk.futoBackupsGetSnapshots(repositoryId);
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
41
|
handleError(error, gt `Failed to load snapshots`);
|
|
@@ -43,11 +43,11 @@ export const handleGetSnapshots = async (repositoryId) => {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
export const useRestoreSnapshot = () => createMutation(() => ({
|
|
46
|
-
mutationFn: ({ repositoryId, snapshotId, options, }) => sdk.
|
|
46
|
+
mutationFn: ({ repositoryId, snapshotId, options, }) => sdk.futoBackupsRestoreSnapshot(repositoryId, snapshotId, options),
|
|
47
47
|
onError: (error) => handleError(error, gt `Failed to start restore`),
|
|
48
48
|
}), () => queryClient);
|
|
49
49
|
export const handleRestoreFromPoint = async (repositoryId, snapshotId, backendId, options) => {
|
|
50
|
-
return await sdk.
|
|
50
|
+
return await sdk.futoBackupsRestoreFromPoint(repositoryId, snapshotId, backendId, options);
|
|
51
51
|
};
|
|
52
52
|
export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
53
53
|
toastManager.info(gt `Deleting snapshot`, {
|
|
@@ -56,7 +56,7 @@ export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
|
56
56
|
timeout: null,
|
|
57
57
|
});
|
|
58
58
|
try {
|
|
59
|
-
await sdk.
|
|
59
|
+
await sdk.futoBackupsForgetSnapshot(repositoryId, snapshotId);
|
|
60
60
|
toastManager.success(gt `Deleted snapshot`);
|
|
61
61
|
}
|
|
62
62
|
catch (error) {
|
|
@@ -70,12 +70,12 @@ export const handleForgetSnapshot = async (repositoryId, snapshotId) => {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
export const useRollbackSnapshot = () => createMutation(() => ({
|
|
73
|
-
mutationFn: (dto) => sdk.
|
|
73
|
+
mutationFn: (dto) => sdk.futoBackupsStartImmichRollback(dto),
|
|
74
74
|
onError: (error) => handleError(error, gt `Failed to start rollback`),
|
|
75
75
|
}), () => queryClient);
|
|
76
76
|
export const handleGetSnapshotListing = async (id, snapshotId, path) => {
|
|
77
77
|
try {
|
|
78
|
-
return await sdk.
|
|
78
|
+
return await sdk.futoBackupsGetSnapshotListing(id, snapshotId, { path });
|
|
79
79
|
}
|
|
80
80
|
catch (error) {
|
|
81
81
|
handleError(error, gt `Failed to load directory listing`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { futoBackupsGetSupportMode, futoBackupsUpdateSupportMode, } from '../fetch-client';
|
|
2
2
|
import { queryClient } from '../query-client';
|
|
3
3
|
import { handleError } from '../utils/handle-error';
|
|
4
4
|
import { createMutation, createQuery } from '@tanstack/svelte-query';
|
|
@@ -9,11 +9,11 @@ export const supportModeKeys = {
|
|
|
9
9
|
export const maxSupportModeRuns = 20;
|
|
10
10
|
export const useSupportMode = () => createQuery(() => ({
|
|
11
11
|
queryKey: supportModeKeys.all,
|
|
12
|
-
queryFn: () =>
|
|
12
|
+
queryFn: () => futoBackupsGetSupportMode(),
|
|
13
13
|
}), () => queryClient);
|
|
14
14
|
export const refreshSupportMode = () => void queryClient.invalidateQueries({ queryKey: supportModeKeys.all });
|
|
15
15
|
export const useUpdateSupportMode = () => createMutation(() => ({
|
|
16
|
-
mutationFn: (dto) =>
|
|
16
|
+
mutationFn: (dto) => futoBackupsUpdateSupportMode(dto),
|
|
17
17
|
onSuccess: (supportMode) => queryClient.setQueryData(supportModeKeys.all, supportMode),
|
|
18
18
|
onError: (error) => handleError(error, gt `Failed to save support mode`),
|
|
19
19
|
}), () => queryClient);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@futo-org/backups-orchestrator-ui",
|
|
3
3
|
"repository": "https://github.com/futo-org/backups",
|
|
4
4
|
"description": "Backups orchestrator (UI library)",
|
|
5
|
-
"version": "1.11.
|
|
5
|
+
"version": "1.11.5",
|
|
6
6
|
"license": "Source First License 1.1",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"luxon": "^3.7.2",
|
|
70
70
|
"socket.io-client": "^4.8.3",
|
|
71
71
|
"svelte-i18n-lingui": "^0.2.2",
|
|
72
|
-
"@futo-org/backups-api-client": "^1.11.
|
|
72
|
+
"@futo-org/backups-api-client": "^1.11.5"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"dev": "vite dev --port 5174",
|