@plutonhq/core-frontend 0.1.21 → 0.1.22
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-lib/components/Storage/AddStorage/AddStorage.module.scss.js +42 -26
- package/dist-lib/components/Storage/AddStorage/AddStorage.module.scss.js.map +1 -1
- package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.d.ts.map +1 -1
- package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.js +119 -53
- package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.js.map +1 -1
- package/dist-lib/services/storage.d.ts +10 -0
- package/dist-lib/services/storage.d.ts.map +1 -1
- package/dist-lib/services/storage.js +55 -20
- package/dist-lib/services/storage.js.map +1 -1
- package/dist-lib/services.js +55 -52
- package/dist-lib/styles/core-frontend.css +1 -1
- package/package.json +1 -1
- package/src/components/Storage/AddStorage/AddStorage.module.scss +74 -0
- package/src/components/Storage/StorageAuthSettings/StorageAuthSettings.tsx +136 -3
- package/src/services/storage.ts +49 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sources":["../../src/services/storage.ts"],"sourcesContent":["import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\r\nimport { API_URL } from '../utils/constants';\r\n\r\ninterface NewStoragePayload {\r\n name: string;\r\n type: string;\r\n authType: string;\r\n credentials: Record<string, string | number | boolean>;\r\n settings: Record<string, string | number | boolean>;\r\n tags?: string[];\r\n}\r\ninterface UpdateStoragePayload {\r\n id: string;\r\n data: {\r\n // name: string;\r\n type: string;\r\n credentials: Record<string, string | number | boolean>;\r\n settings: Record<string, string | number | boolean>;\r\n tags?: string[];\r\n };\r\n}\r\n\r\n// Get All Storages\r\nexport async function getAvailableStorages() {\r\n const url = new URL(`${API_URL}/storages/available`);\r\n\r\n const res = await fetch(url.toString(), {\r\n method: 'GET',\r\n credentials: 'include',\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useGetAvailableStorages() {\r\n return useQuery({\r\n queryKey: ['storageSettings'],\r\n queryFn: () => getAvailableStorages(),\r\n refetchOnMount: false,\r\n retry: false,\r\n });\r\n}\r\n\r\n// Get All Storages\r\nexport async function getAllStorages() {\r\n const url = new URL(`${API_URL}/storages`);\r\n\r\n const res = await fetch(url.toString(), {\r\n method: 'GET',\r\n credentials: 'include',\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useGetStorages() {\r\n return useQuery({\r\n queryKey: ['storages'],\r\n queryFn: () => getAllStorages(),\r\n refetchOnMount: true,\r\n retry: false,\r\n });\r\n}\r\n\r\n// Get Single Storage\r\nexport async function getStorage(id: string) {\r\n const url = new URL(`${API_URL}/storages/${id}`);\r\n\r\n const res = await fetch(url.toString(), {\r\n method: 'GET',\r\n credentials: 'include',\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useGetStorage(id: string) {\r\n return useQuery({\r\n queryKey: ['storage', id],\r\n queryFn: () => getStorage(id),\r\n refetchOnMount: true,\r\n retry: false,\r\n });\r\n}\r\n\r\n// Add New Storage\r\nexport async function addStorage(newStorage: NewStoragePayload) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages`, {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: header,\r\n body: JSON.stringify(newStorage),\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useAddStorage() {\r\n const queryClient = useQueryClient();\r\n return useMutation({\r\n mutationFn: addStorage,\r\n onSuccess: (res) => {\r\n console.log('# Storage Added! :', res);\r\n queryClient.invalidateQueries({ queryKey: ['storages'] });\r\n },\r\n });\r\n}\r\n\r\n// Update Storage\r\nexport async function updateStorage(updatedStorage: UpdateStoragePayload) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/${updatedStorage.id}`, {\r\n method: 'PUT',\r\n credentials: 'include',\r\n headers: header,\r\n body: JSON.stringify(updatedStorage.data),\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useUpdateStorage() {\r\n const queryClient = useQueryClient();\r\n return useMutation({\r\n mutationFn: updateStorage,\r\n onSuccess: (res) => {\r\n // TODO: Should Display a Nofitication Bubble.\r\n console.log('# Storage Updated! :', res);\r\n queryClient.invalidateQueries({ queryKey: ['storages'] });\r\n },\r\n });\r\n}\r\n\r\n// Remove Storage\r\nexport async function deleteStorage(id: string) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/${id}`, {\r\n method: 'DELETE',\r\n credentials: 'include',\r\n headers: header,\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useDeleteStorage() {\r\n const queryClient = useQueryClient();\r\n return useMutation({\r\n mutationFn: deleteStorage,\r\n onSuccess: (res) => {\r\n // TODO: Should Display a Nofitication Bubble.\r\n console.log('# Storage Updated! :', res);\r\n queryClient.invalidateQueries({ queryKey: ['storages'] });\r\n },\r\n });\r\n}\r\n\r\n// Verify Storage\r\nexport async function verifyStorage(id: string) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/verify/${id}`, {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: header,\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useVerifyStorage() {\r\n return useMutation({\r\n mutationFn: verifyStorage,\r\n onSuccess: (res) => {\r\n // TODO: Should Display a Nofitication Bubble.\r\n console.log('# Storage Verfied! :', res);\r\n },\r\n });\r\n}\r\n"],"names":["getAvailableStorages","url","API_URL","data","useGetAvailableStorages","useQuery","getAllStorages","useGetStorages","getStorage","id","useGetStorage","addStorage","newStorage","header","useAddStorage","queryClient","useQueryClient","useMutation","res","updateStorage","updatedStorage","useUpdateStorage","deleteStorage","useDeleteStorage","verifyStorage","useVerifyStorage"],"mappings":";;AAuBA,eAAsBA,IAAuB;AAC1C,QAAMC,IAAM,IAAI,IAAI,GAAGC,CAAO,qBAAqB,GAM7CC,IAAO,OAJD,MAAM,MAAMF,EAAI,YAAY;AAAA,IACrC,QAAQ;AAAA,IACR,aAAa;AAAA,EAAA,CACf,GACsB,KAAA;AACvB,MAAI,CAACE,EAAK;AACP,UAAM,IAAI,MAAMA,EAAK,KAAK;AAE7B,SAAOA;AACV;AAEO,SAASC,IAA0B;AACvC,SAAOC,EAAS;AAAA,IACb,UAAU,CAAC,iBAAiB;AAAA,IAC5B,SAAS,MAAML,EAAA;AAAA,IACf,gBAAgB;AAAA,IAChB,OAAO;AAAA,EAAA,CACT;AACJ;AAGA,eAAsBM,IAAiB;AACpC,QAAML,IAAM,IAAI,IAAI,GAAGC,CAAO,WAAW,GAMnCC,IAAO,OAJD,MAAM,MAAMF,EAAI,YAAY;AAAA,IACrC,QAAQ;AAAA,IACR,aAAa;AAAA,EAAA,CACf,GACsB,KAAA;AACvB,MAAI,CAACE,EAAK;AACP,UAAM,IAAI,MAAMA,EAAK,KAAK;AAE7B,SAAOA;AACV;AAEO,SAASI,IAAiB;AAC9B,SAAOF,EAAS;AAAA,IACb,UAAU,CAAC,UAAU;AAAA,IACrB,SAAS,MAAMC,EAAA;AAAA,IACf,gBAAgB;AAAA,IAChB,OAAO;AAAA,EAAA,CACT;AACJ;AAGA,eAAsBE,EAAWC,GAAY;AAC1C,QAAMR,IAAM,IAAI,IAAI,GAAGC,CAAO,aAAaO,CAAE,EAAE,GAMzCN,IAAO,OAJD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ASsB,IAAmB;AAChC,SAAOR,EAAY;AAAA,IAChB,YAAYO;AAAA,IACZ,WAAW,CAACN,MAAQ;AAEjB,cAAQ,IAAI,wBAAwBA,CAAG;AAAA,IAC1C;AAAA,EAAA,CACF;AACJ;"}
|
|
1
|
+
{"version":3,"file":"storage.js","sources":["../../src/services/storage.ts"],"sourcesContent":["import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\r\nimport { API_URL } from '../utils/constants';\r\n\r\ninterface NewStoragePayload {\r\n name: string;\r\n type: string;\r\n authType: string;\r\n credentials: Record<string, string | number | boolean>;\r\n settings: Record<string, string | number | boolean>;\r\n tags?: string[];\r\n}\r\ninterface UpdateStoragePayload {\r\n id: string;\r\n data: {\r\n // name: string;\r\n type: string;\r\n credentials: Record<string, string | number | boolean>;\r\n settings: Record<string, string | number | boolean>;\r\n tags?: string[];\r\n };\r\n}\r\n\r\n// Get All Storages\r\nexport async function getAvailableStorages() {\r\n const url = new URL(`${API_URL}/storages/available`);\r\n\r\n const res = await fetch(url.toString(), {\r\n method: 'GET',\r\n credentials: 'include',\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useGetAvailableStorages() {\r\n return useQuery({\r\n queryKey: ['storageSettings'],\r\n queryFn: () => getAvailableStorages(),\r\n refetchOnMount: false,\r\n retry: false,\r\n });\r\n}\r\n\r\n// Get All Storages\r\nexport async function getAllStorages() {\r\n const url = new URL(`${API_URL}/storages`);\r\n\r\n const res = await fetch(url.toString(), {\r\n method: 'GET',\r\n credentials: 'include',\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useGetStorages() {\r\n return useQuery({\r\n queryKey: ['storages'],\r\n queryFn: () => getAllStorages(),\r\n refetchOnMount: true,\r\n retry: false,\r\n });\r\n}\r\n\r\n// Get Single Storage\r\nexport async function getStorage(id: string) {\r\n const url = new URL(`${API_URL}/storages/${id}`);\r\n\r\n const res = await fetch(url.toString(), {\r\n method: 'GET',\r\n credentials: 'include',\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useGetStorage(id: string) {\r\n return useQuery({\r\n queryKey: ['storage', id],\r\n queryFn: () => getStorage(id),\r\n refetchOnMount: true,\r\n retry: false,\r\n });\r\n}\r\n\r\n// Add New Storage\r\nexport async function addStorage(newStorage: NewStoragePayload) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages`, {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: header,\r\n body: JSON.stringify(newStorage),\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useAddStorage() {\r\n const queryClient = useQueryClient();\r\n return useMutation({\r\n mutationFn: addStorage,\r\n onSuccess: (res) => {\r\n console.log('# Storage Added! :', res);\r\n queryClient.invalidateQueries({ queryKey: ['storages'] });\r\n },\r\n });\r\n}\r\n\r\n// Update Storage\r\nexport async function updateStorage(updatedStorage: UpdateStoragePayload) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/${updatedStorage.id}`, {\r\n method: 'PUT',\r\n credentials: 'include',\r\n headers: header,\r\n body: JSON.stringify(updatedStorage.data),\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useUpdateStorage() {\r\n const queryClient = useQueryClient();\r\n return useMutation({\r\n mutationFn: updateStorage,\r\n onSuccess: (res) => {\r\n // TODO: Should Display a Nofitication Bubble.\r\n console.log('# Storage Updated! :', res);\r\n queryClient.invalidateQueries({ queryKey: ['storages'] });\r\n },\r\n });\r\n}\r\n\r\n// Remove Storage\r\nexport async function deleteStorage(id: string) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/${id}`, {\r\n method: 'DELETE',\r\n credentials: 'include',\r\n headers: header,\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useDeleteStorage() {\r\n const queryClient = useQueryClient();\r\n return useMutation({\r\n mutationFn: deleteStorage,\r\n onSuccess: (res) => {\r\n // TODO: Should Display a Nofitication Bubble.\r\n console.log('# Storage Updated! :', res);\r\n queryClient.invalidateQueries({ queryKey: ['storages'] });\r\n },\r\n });\r\n}\r\n\r\n// Verify Storage\r\nexport async function verifyStorage(id: string) {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/verify/${id}`, {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: header,\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data;\r\n}\r\n\r\nexport function useVerifyStorage() {\r\n return useMutation({\r\n mutationFn: verifyStorage,\r\n onSuccess: (res) => {\r\n // TODO: Should Display a Nofitication Bubble.\r\n console.log('# Storage Verfied! :', res);\r\n },\r\n });\r\n}\r\n\r\n// ── OAuth Authorization ─────────────────────────────────────────────\r\nexport async function startStorageAuthorize(type: string): Promise<{ sessionId: string }> {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/authorize`, {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: header,\r\n body: JSON.stringify({ type }),\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data.result;\r\n}\r\n\r\nexport async function getStorageAuthorizeStatus(sessionId: string): Promise<{\r\n status: 'pending' | 'success' | 'error';\r\n token?: string;\r\n error?: string;\r\n authUrl?: string;\r\n}> {\r\n const url = new URL(`${API_URL}/storages/authorize/status`);\r\n url.searchParams.set('sessionId', sessionId);\r\n const res = await fetch(url.toString(), {\r\n method: 'GET',\r\n credentials: 'include',\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n return data.result;\r\n}\r\n\r\nexport async function cancelStorageAuthorize(sessionId: string): Promise<void> {\r\n const header = new Headers({ 'Content-Type': 'application/json', Accept: 'application/json' });\r\n const res = await fetch(`${API_URL}/storages/authorize/cancel`, {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: header,\r\n body: JSON.stringify({ sessionId }),\r\n });\r\n const data = await res.json();\r\n if (!data.success) {\r\n throw new Error(data.error);\r\n }\r\n}\r\n"],"names":["getAvailableStorages","url","API_URL","data","useGetAvailableStorages","useQuery","getAllStorages","useGetStorages","getStorage","id","useGetStorage","addStorage","newStorage","header","useAddStorage","queryClient","useQueryClient","useMutation","res","updateStorage","updatedStorage","useUpdateStorage","deleteStorage","useDeleteStorage","verifyStorage","useVerifyStorage","startStorageAuthorize","type","getStorageAuthorizeStatus","sessionId","cancelStorageAuthorize"],"mappings":";;AAuBA,eAAsBA,IAAuB;AAC1C,QAAMC,IAAM,IAAI,IAAI,GAAGC,CAAO,qBAAqB,GAM7CC,IAAO,OAJD,MAAM,MAAMF,EAAI,YAAY;AAAA,IACrC,QAAQ;AAAA,IACR,aAAa;AAAA,EAAA,CACf,GACsB,KAAA;AACvB,MAAI,CAACE,EAAK;AACP,UAAM,IAAI,MAAMA,EAAK,KAAK;AAE7B,SAAOA;AACV;AAEO,SAASC,IAA0B;AACvC,SAAOC,EAAS;AAAA,IACb,UAAU,CAAC,iBAAiB;AAAA,IAC5B,SAAS,MAAML,EAAA;AAAA,IACf,gBAAgB;AAAA,IAChB,OAAO;AAAA,EAAA,CACT;AACJ;AAGA,eAAsBM,IAAiB;AACpC,QAAML,IAAM,IAAI,IAAI,GAAGC,CAAO,WAAW,GAMnCC,IAAO,OAJD,MAAM,MAAMF,EAAI,YAAY;AAAA,IACrC,QAAQ;AAAA,I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,SAAOA,EAAK;AACf;AAEA,eAAsB2B,EAAuBD,GAAkC;AAC5E,QAAMhB,IAAS,IAAI,QAAQ,EAAE,gBAAgB,oBAAoB,QAAQ,oBAAoB,GAOvFV,IAAO,OAND,MAAM,MAAM,GAAGD,CAAO,8BAA8B;AAAA,IAC7D,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAASW;AAAA,IACT,MAAM,KAAK,UAAU,EAAE,WAAAgB,GAAW;AAAA,EAAA,CACpC,GACsB,KAAA;AACvB,MAAI,CAAC1B,EAAK;AACP,UAAM,IAAI,MAAMA,EAAK,KAAK;AAEhC;"}
|
package/dist-lib/services.js
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { cancelBackup as s, cancelBackupDownload as a, deleteBackup as o, generateBackupDownload as u, getBackupDownload as r, getBackupProgress as l, getSnapshotFiles as n, retryFailedReplications as
|
|
2
|
-
import { browseDir as w, getAllDevices as
|
|
3
|
-
import { checkActiveBackupsOrRestore as V, checkPlanIntegrity as I, createPlan as b, deletePlan as
|
|
4
|
-
import { cancelRestore as ie, deleteRestore as
|
|
5
|
-
import { checkLatestVersion as Ue, completeSetup as Ce, downloadAppLogs as Te, getAppLogs as xe, getSettings as Oe, getSetupStatus as Ve, setupTwoFactorAuth as Ie, updateSettings as be, useCheckLatestVersion as
|
|
6
|
-
import { addStorage as $e,
|
|
7
|
-
import { loginUser as
|
|
1
|
+
import { cancelBackup as s, cancelBackupDownload as a, deleteBackup as o, generateBackupDownload as u, getBackupDownload as r, getBackupProgress as l, getSnapshotFiles as n, retryFailedReplications as g, updateBackup as c, useCancelBackup as p, useCancelBackupDownload as i, useDeleteBackup as S, useDownloadBackup as d, useGetBackupDownload as P, useGetBackupProgress as k, useGetBackupProgressOnce as D, useGetSnapshotFiles as R, useRetryFailedReplications as G, useUpdateBackup as A } from "./services/backups.js";
|
|
2
|
+
import { browseDir as w, getAllDevices as h, getDevice as f, getSystemMetrics as m, updateDependent as v, updateDevice as y, useBrowseDir as L, useGetDevice as F, useGetDevices as U, useGetSystemMetrics as C, useUpdateDependent as T, useUpdateDevice as x } from "./services/devices.js";
|
|
3
|
+
import { checkActiveBackupsOrRestore as V, checkPlanIntegrity as I, createPlan as b, deletePlan as z, deleteReplicationStorage as M, downloadPlanLogs as j, getAllPlans as q, getPlanLogs as E, getSinglePlan as H, pausePlan as J, performBackup as K, prunePlan as N, resumePlan as Q, unlockPlan as W, updatePlan as X, useCheckActiveBackupsOrRestore as Y, useCheckPlanIntegrity as Z, useCreatePlan as _, useDeletePlan as $, useDeleteReplicationStorage as ee, useGetDownloadLogs as te, useGetPlan as se, useGetPlanLogs as ae, useGetPlans as oe, usePausePlan as ue, usePerformBackup as re, usePrunePlan as le, useResumePlan as ne, useUnlockPlan as ge, useUpdatePlan as ce } from "./services/plans.js";
|
|
4
|
+
import { cancelRestore as ie, deleteRestore as Se, getAllRestores as de, getDryRestoreStats as Pe, getRestoreProgress as ke, getRestoreStats as De, getSingleRestore as Re, restoreBackup as Ge, useCancelRestore as Ae, useDeleteRestore as Be, useGetDryRestoreStats as we, useGetRestore as he, useGetRestoreProgress as fe, useGetRestoreProgressOnce as me, useGetRestoreStats as ve, useGetRestores as ye, useRestoreBackup as Le } from "./services/restores.js";
|
|
5
|
+
import { checkLatestVersion as Ue, completeSetup as Ce, downloadAppLogs as Te, getAppLogs as xe, getSettings as Oe, getSetupStatus as Ve, setupTwoFactorAuth as Ie, updateSettings as be, useCheckLatestVersion as ze, useCompleteSetup as Me, useGetAppLogs as je, useGetDownloadAppLogs as qe, useGetSettings as Ee, useSetupStatus as He, useSetupTwoFactorAuth as Je, useUpdateSettings as Ke, useValidateIntegration as Ne, useVerifyTwoFactorAuth as Qe, useVerifyTwoFactorOTP as We, validateIntegration as Xe, verifyTwoFactorAuth as Ye, verifyTwoFactorOTP as Ze } from "./services/settings.js";
|
|
6
|
+
import { addStorage as $e, cancelStorageAuthorize as et, deleteStorage as tt, getAllStorages as st, getAvailableStorages as at, getStorage as ot, getStorageAuthorizeStatus as ut, startStorageAuthorize as rt, updateStorage as lt, useAddStorage as nt, useDeleteStorage as gt, useGetAvailableStorages as ct, useGetStorage as pt, useGetStorages as it, useUpdateStorage as St, useVerifyStorage as dt, verifyStorage as Pt } from "./services/storage.js";
|
|
7
|
+
import { loginUser as Dt, logoutUser as Rt, useAuth as Gt, useLogin as At, useLogout as Bt, validateAuth as wt } from "./services/users.js";
|
|
8
8
|
export {
|
|
9
9
|
$e as addStorage,
|
|
10
10
|
w as browseDir,
|
|
11
11
|
s as cancelBackup,
|
|
12
12
|
a as cancelBackupDownload,
|
|
13
13
|
ie as cancelRestore,
|
|
14
|
+
et as cancelStorageAuthorize,
|
|
14
15
|
V as checkActiveBackupsOrRestore,
|
|
15
16
|
Ue as checkLatestVersion,
|
|
16
17
|
I as checkPlanIntegrity,
|
|
17
18
|
Ce as completeSetup,
|
|
18
19
|
b as createPlan,
|
|
19
20
|
o as deleteBackup,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
z as deletePlan,
|
|
22
|
+
M as deleteReplicationStorage,
|
|
23
|
+
Se as deleteRestore,
|
|
24
|
+
tt as deleteStorage,
|
|
24
25
|
Te as downloadAppLogs,
|
|
25
|
-
|
|
26
|
+
j as downloadPlanLogs,
|
|
26
27
|
u as generateBackupDownload,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
h as getAllDevices,
|
|
29
|
+
q as getAllPlans,
|
|
30
|
+
de as getAllRestores,
|
|
31
|
+
st as getAllStorages,
|
|
31
32
|
xe as getAppLogs,
|
|
32
|
-
|
|
33
|
+
at as getAvailableStorages,
|
|
33
34
|
r as getBackupDownload,
|
|
34
35
|
l as getBackupProgress,
|
|
35
|
-
|
|
36
|
+
f as getDevice,
|
|
36
37
|
Pe as getDryRestoreStats,
|
|
37
38
|
E as getPlanLogs,
|
|
38
39
|
ke as getRestoreProgress,
|
|
@@ -42,66 +43,68 @@ export {
|
|
|
42
43
|
H as getSinglePlan,
|
|
43
44
|
Re as getSingleRestore,
|
|
44
45
|
n as getSnapshotFiles,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
ot as getStorage,
|
|
47
|
+
ut as getStorageAuthorizeStatus,
|
|
48
|
+
m as getSystemMetrics,
|
|
49
|
+
Dt as loginUser,
|
|
50
|
+
Rt as logoutUser,
|
|
49
51
|
J as pausePlan,
|
|
50
52
|
K as performBackup,
|
|
51
53
|
N as prunePlan,
|
|
52
54
|
Ge as restoreBackup,
|
|
53
55
|
Q as resumePlan,
|
|
54
|
-
|
|
56
|
+
g as retryFailedReplications,
|
|
55
57
|
Ie as setupTwoFactorAuth,
|
|
58
|
+
rt as startStorageAuthorize,
|
|
56
59
|
W as unlockPlan,
|
|
57
60
|
c as updateBackup,
|
|
58
|
-
|
|
61
|
+
v as updateDependent,
|
|
59
62
|
y as updateDevice,
|
|
60
63
|
X as updatePlan,
|
|
61
64
|
be as updateSettings,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
lt as updateStorage,
|
|
66
|
+
nt as useAddStorage,
|
|
67
|
+
Gt as useAuth,
|
|
65
68
|
L as useBrowseDir,
|
|
66
|
-
|
|
69
|
+
p as useCancelBackup,
|
|
67
70
|
i as useCancelBackupDownload,
|
|
68
|
-
|
|
71
|
+
Ae as useCancelRestore,
|
|
69
72
|
Y as useCheckActiveBackupsOrRestore,
|
|
70
|
-
|
|
73
|
+
ze as useCheckLatestVersion,
|
|
71
74
|
Z as useCheckPlanIntegrity,
|
|
72
|
-
|
|
75
|
+
Me as useCompleteSetup,
|
|
73
76
|
_ as useCreatePlan,
|
|
74
|
-
|
|
77
|
+
S as useDeleteBackup,
|
|
75
78
|
$ as useDeletePlan,
|
|
76
79
|
ee as useDeleteReplicationStorage,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
Be as useDeleteRestore,
|
|
81
|
+
gt as useDeleteStorage,
|
|
82
|
+
d as useDownloadBackup,
|
|
83
|
+
je as useGetAppLogs,
|
|
84
|
+
ct as useGetAvailableStorages,
|
|
82
85
|
P as useGetBackupDownload,
|
|
83
86
|
k as useGetBackupProgress,
|
|
84
87
|
D as useGetBackupProgressOnce,
|
|
85
88
|
F as useGetDevice,
|
|
86
89
|
U as useGetDevices,
|
|
87
|
-
|
|
90
|
+
qe as useGetDownloadAppLogs,
|
|
88
91
|
te as useGetDownloadLogs,
|
|
89
92
|
we as useGetDryRestoreStats,
|
|
90
93
|
se as useGetPlan,
|
|
91
94
|
ae as useGetPlanLogs,
|
|
92
95
|
oe as useGetPlans,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
he as useGetRestore,
|
|
97
|
+
fe as useGetRestoreProgress,
|
|
98
|
+
me as useGetRestoreProgressOnce,
|
|
99
|
+
ve as useGetRestoreStats,
|
|
97
100
|
ye as useGetRestores,
|
|
98
101
|
Ee as useGetSettings,
|
|
99
102
|
R as useGetSnapshotFiles,
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
pt as useGetStorage,
|
|
104
|
+
it as useGetStorages,
|
|
102
105
|
C as useGetSystemMetrics,
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
At as useLogin,
|
|
107
|
+
Bt as useLogout,
|
|
105
108
|
ue as usePausePlan,
|
|
106
109
|
re as usePerformBackup,
|
|
107
110
|
le as usePrunePlan,
|
|
@@ -110,20 +113,20 @@ export {
|
|
|
110
113
|
G as useRetryFailedReplications,
|
|
111
114
|
He as useSetupStatus,
|
|
112
115
|
Je as useSetupTwoFactorAuth,
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
ge as useUnlockPlan,
|
|
117
|
+
A as useUpdateBackup,
|
|
115
118
|
T as useUpdateDependent,
|
|
116
119
|
x as useUpdateDevice,
|
|
117
120
|
ce as useUpdatePlan,
|
|
118
121
|
Ke as useUpdateSettings,
|
|
119
|
-
|
|
122
|
+
St as useUpdateStorage,
|
|
120
123
|
Ne as useValidateIntegration,
|
|
121
|
-
|
|
124
|
+
dt as useVerifyStorage,
|
|
122
125
|
Qe as useVerifyTwoFactorAuth,
|
|
123
126
|
We as useVerifyTwoFactorOTP,
|
|
124
|
-
|
|
127
|
+
wt as validateAuth,
|
|
125
128
|
Xe as validateIntegration,
|
|
126
|
-
|
|
129
|
+
Pt as verifyStorage,
|
|
127
130
|
Ye as verifyTwoFactorAuth,
|
|
128
131
|
Ze as verifyTwoFactorOTP
|
|
129
132
|
};
|