@futo-org/backups-orchestrator-ui 1.11.4 → 1.12.0

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/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: client.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 { createLocalBackend, getBackends, } from '../fetch-client';
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: () => getBackends().then(({ backends }) => backends),
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) => createLocalBackend(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 { getConfig, updateConfig, } from '../fetch-client';
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: () => getConfig(),
31
+ queryFn: () => futoBackupsGetConfig(),
32
32
  }), () => queryClient);
33
33
  export const useUpdateConfig = () => createMutation(() => ({
34
- mutationFn: (dto) => updateConfig(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.getFileListing({ path });
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 { configureImmichDatabaseDump, getImmichBackupStatus, ignoreImmichDatabaseDumpWarning, } from '../fetch-client';
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: () => getImmichBackupStatus(),
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) => configureImmichDatabaseDump(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: () => ignoreImmichDatabaseDumpWarning(),
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 { configureImmichIntegration, getIntegrations, } from '../fetch-client';
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: () => getIntegrations(),
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) => configureImmichIntegration(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 getIntegrations();
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 configureImmichIntegration({
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 { cancelJob, getJob, getJobs, } from '../fetch-client';
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: () => getJobs(repositoryId()).then(({ jobs }) => jobs),
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: () => getJob(jobId),
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 cancelJob(jobId);
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.currentRecoveryKey(),
11
+ queryFn: () => sdk.futoBackupsCurrentRecoveryKey(),
12
12
  }), () => queryClient);
13
13
  export const handleOnboardingStatus = async () => {
14
14
  try {
15
- return await sdk.onboardingStatus();
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.currentRecoveryKey();
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.confirmRecoveryKey();
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.importRecoveryKey(dto);
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.skipOnboardingExtraConfig();
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.enableTelemetry(),
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.reportError(),
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 { inspectRepositories, reconfigureRepositoryPrimaryBackend, updateRepository, } from '../fetch-client';
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: () => inspectRepositories({ backend: backendId }).then(({ repositories }) => repositories),
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.checkImportRepository(id, backendId),
65
+ queryFn: () => sdk.futoBackupsCheckImportRepository(id, backendId),
66
66
  }), () => queryClient);
67
67
  export const useCreateRepository = () => createMutation(() => ({
68
- mutationFn: (dto) => sdk.createRepository(dto),
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.importRepository(id, backendId),
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, }) => (local ? sdk.updateRepository(id, dto) : updateRepository(id, dto)),
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 }) => reconfigureRepositoryPrimaryBackend(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.createBackup(id);
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.pruneRepository(id);
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
- .syncRepositoryDeletion(repositoryId)
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.deleteRepository(repositoryId);
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.createTicket : createTicket;
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.createTicket : createTicket;
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 { getSchedules, } from '../fetch-client';
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: () => getSchedules().then(({ schedules }) => schedules),
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.getSchedules();
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.createSchedule(dto),
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.updateSchedule(id, dto),
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.updateSchedule(id, { paused: true });
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.updateSchedule(id, { paused: false });
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.removeSchedule(id);
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 { createSession } from '../fetch-client';
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) => createSession({ 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 { getSnapshots, } from '../fetch-client';
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: () => getSnapshots(repositoryId).then(({ snapshots }) => snapshots.toSorted((a, b) => b.time.localeCompare(a.time))),
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.getSnapshots(repositoryId);
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.restoreSnapshot(repositoryId, snapshotId, options),
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.restoreFromPoint(repositoryId, snapshotId, backendId, options);
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.forgetSnapshot(repositoryId, snapshotId);
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.startImmichRollback(dto),
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.getSnapshotListing(id, snapshotId, { path });
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 { getSupportMode, updateSupportMode, } from '../fetch-client';
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: () => getSupportMode(),
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) => updateSupportMode(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.4",
5
+ "version": "1.12.0",
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.4"
72
+ "@futo-org/backups-api-client": "^1.12.0"
73
73
  },
74
74
  "scripts": {
75
75
  "dev": "vite dev --port 5174",