@plutonhq/core-frontend 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist-lib/@types/backups.d.ts +26 -0
  2. package/dist-lib/@types/backups.d.ts.map +1 -1
  3. package/dist-lib/@types/devices.d.ts +7 -0
  4. package/dist-lib/@types/devices.d.ts.map +1 -1
  5. package/dist-lib/@types/plans.d.ts +21 -1
  6. package/dist-lib/@types/plans.d.ts.map +1 -1
  7. package/dist-lib/@types/restores.d.ts +2 -0
  8. package/dist-lib/@types/restores.d.ts.map +1 -1
  9. package/dist-lib/components/Device/DeviceBackups/DeviceBackups.d.ts +3 -2
  10. package/dist-lib/components/Device/DeviceBackups/DeviceBackups.d.ts.map +1 -1
  11. package/dist-lib/components/Device/DeviceBackups/DeviceBackups.js +73 -85
  12. package/dist-lib/components/Device/DeviceBackups/DeviceBackups.js.map +1 -1
  13. package/dist-lib/components/Plan/BackupEvents/BackupEvents.d.ts.map +1 -1
  14. package/dist-lib/components/Plan/BackupEvents/BackupEvents.js +88 -50
  15. package/dist-lib/components/Plan/BackupEvents/BackupEvents.js.map +1 -1
  16. package/dist-lib/components/Plan/BackupEvents/BackupEvents.module.scss.js +70 -38
  17. package/dist-lib/components/Plan/BackupEvents/BackupEvents.module.scss.js.map +1 -1
  18. package/dist-lib/components/Plan/BackupProgress/BackupProgress.d.ts.map +1 -1
  19. package/dist-lib/components/Plan/BackupProgress/BackupProgress.js +166 -123
  20. package/dist-lib/components/Plan/BackupProgress/BackupProgress.js.map +1 -1
  21. package/dist-lib/components/Plan/BackupProgress/BackupProgress.module.scss.js +64 -30
  22. package/dist-lib/components/Plan/BackupProgress/BackupProgress.module.scss.js.map +1 -1
  23. package/dist-lib/components/Plan/Backups/Backups.d.ts +8 -1
  24. package/dist-lib/components/Plan/Backups/Backups.d.ts.map +1 -1
  25. package/dist-lib/components/Plan/Backups/Backups.js +154 -125
  26. package/dist-lib/components/Plan/Backups/Backups.js.map +1 -1
  27. package/dist-lib/components/Plan/EditPlan/EditPlan.d.ts.map +1 -1
  28. package/dist-lib/components/Plan/EditPlan/EditPlan.js +11 -10
  29. package/dist-lib/components/Plan/EditPlan/EditPlan.js.map +1 -1
  30. package/dist-lib/components/Plan/Mirrors/MirrorDetails.d.ts +12 -0
  31. package/dist-lib/components/Plan/Mirrors/MirrorDetails.d.ts.map +1 -0
  32. package/dist-lib/components/Plan/Mirrors/MirrorDetails.js +68 -0
  33. package/dist-lib/components/Plan/Mirrors/MirrorDetails.js.map +1 -0
  34. package/dist-lib/components/Plan/Mirrors/MirrorDetails.module.scss.js +26 -0
  35. package/dist-lib/components/Plan/Mirrors/MirrorDetails.module.scss.js.map +1 -0
  36. package/dist-lib/components/Plan/Mirrors/MirrorStatusBadge.d.ts +11 -0
  37. package/dist-lib/components/Plan/Mirrors/MirrorStatusBadge.d.ts.map +1 -0
  38. package/dist-lib/components/Plan/Mirrors/MirrorStatusBadge.js +38 -0
  39. package/dist-lib/components/Plan/Mirrors/MirrorStatusBadge.js.map +1 -0
  40. package/dist-lib/components/Plan/Mirrors/MirrorStatusBadge.module.scss.js +16 -0
  41. package/dist-lib/components/Plan/Mirrors/MirrorStatusBadge.module.scss.js.map +1 -0
  42. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelector.d.ts +14 -0
  43. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelector.d.ts.map +1 -0
  44. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelector.js +54 -0
  45. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelector.js.map +1 -0
  46. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelector.module.scss.js +26 -0
  47. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelector.module.scss.js.map +1 -0
  48. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelectorModal.d.ts +15 -0
  49. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelectorModal.d.ts.map +1 -0
  50. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelectorModal.js +34 -0
  51. package/dist-lib/components/Plan/Mirrors/MirrorStorageSelectorModal.js.map +1 -0
  52. package/dist-lib/components/Plan/PlanBackups/PlanBackups.d.ts.map +1 -1
  53. package/dist-lib/components/Plan/PlanBackups/PlanBackups.js +20 -17
  54. package/dist-lib/components/Plan/PlanBackups/PlanBackups.js.map +1 -1
  55. package/dist-lib/components/Plan/PlanForm/PlanForm.d.ts +2 -1
  56. package/dist-lib/components/Plan/PlanForm/PlanForm.d.ts.map +1 -1
  57. package/dist-lib/components/Plan/PlanForm/PlanForm.js +121 -94
  58. package/dist-lib/components/Plan/PlanForm/PlanForm.js.map +1 -1
  59. package/dist-lib/components/Plan/PlanIntegrity/PlanIntegrity.d.ts +16 -0
  60. package/dist-lib/components/Plan/PlanIntegrity/PlanIntegrity.d.ts.map +1 -0
  61. package/dist-lib/components/Plan/PlanIntegrity/PlanIntegrity.js +115 -0
  62. package/dist-lib/components/Plan/PlanIntegrity/PlanIntegrity.js.map +1 -0
  63. package/dist-lib/components/Plan/PlanIntegrity/PlanIntegrity.module.scss.js +26 -0
  64. package/dist-lib/components/Plan/PlanIntegrity/PlanIntegrity.module.scss.js.map +1 -0
  65. package/dist-lib/components/Plan/PlanItems/PlanItem.d.ts.map +1 -1
  66. package/dist-lib/components/Plan/PlanItems/PlanItem.js +58 -59
  67. package/dist-lib/components/Plan/PlanItems/PlanItem.js.map +1 -1
  68. package/dist-lib/components/Plan/PlanPendingBackup/PlanPendingBackup.d.ts +2 -2
  69. package/dist-lib/components/Plan/PlanPendingBackup/PlanPendingBackup.d.ts.map +1 -1
  70. package/dist-lib/components/Plan/PlanPendingBackup/PlanPendingBackup.js.map +1 -1
  71. package/dist-lib/components/Plan/PlanRemoveModal/PlanRemoveModal.js +8 -8
  72. package/dist-lib/components/Plan/PlanRemoveModal/PlanRemoveModal.js.map +1 -1
  73. package/dist-lib/components/Plan/PlanSettings/PlanReplicationSettings.d.ts +14 -0
  74. package/dist-lib/components/Plan/PlanSettings/PlanReplicationSettings.d.ts.map +1 -0
  75. package/dist-lib/components/Plan/PlanSettings/PlanReplicationSettings.js +290 -0
  76. package/dist-lib/components/Plan/PlanSettings/PlanReplicationSettings.js.map +1 -0
  77. package/dist-lib/components/Plan/PlanSettings/PlanReplicationSettings.module.scss.js +26 -0
  78. package/dist-lib/components/Plan/PlanSettings/PlanReplicationSettings.module.scss.js.map +1 -0
  79. package/dist-lib/components/Plan/PlanStats/PlanStats.d.ts.map +1 -1
  80. package/dist-lib/components/Plan/PlanStats/PlanStats.js +41 -42
  81. package/dist-lib/components/Plan/PlanStats/PlanStats.js.map +1 -1
  82. package/dist-lib/components/Plan/PlanStats/PlanStats.module.scss.js +5 -5
  83. package/dist-lib/components/Plan/PlanStorageInfo/PlanStorageInfo.d.ts +15 -0
  84. package/dist-lib/components/Plan/PlanStorageInfo/PlanStorageInfo.d.ts.map +1 -0
  85. package/dist-lib/components/Plan/PlanStorageInfo/PlanStorageInfo.js +69 -0
  86. package/dist-lib/components/Plan/PlanStorageInfo/PlanStorageInfo.js.map +1 -0
  87. package/dist-lib/components/Plan/PlanStorageInfo/PlanStorageInfo.module.scss.js +16 -0
  88. package/dist-lib/components/Plan/PlanStorageInfo/PlanStorageInfo.module.scss.js.map +1 -0
  89. package/dist-lib/components/Restore/RestoreWizard/RestoreConfirmStep.d.ts.map +1 -1
  90. package/dist-lib/components/Restore/RestoreWizard/RestoreConfirmStep.js +36 -34
  91. package/dist-lib/components/Restore/RestoreWizard/RestoreConfirmStep.js.map +1 -1
  92. package/dist-lib/components/Restore/RestoreWizard/RestorePreviewStep.d.ts.map +1 -1
  93. package/dist-lib/components/Restore/RestoreWizard/RestorePreviewStep.js +7 -5
  94. package/dist-lib/components/Restore/RestoreWizard/RestorePreviewStep.js.map +1 -1
  95. package/dist-lib/components/Restore/RestoreWizard/RestoreSettingsStep.d.ts +12 -4
  96. package/dist-lib/components/Restore/RestoreWizard/RestoreSettingsStep.d.ts.map +1 -1
  97. package/dist-lib/components/Restore/RestoreWizard/RestoreSettingsStep.js +44 -32
  98. package/dist-lib/components/Restore/RestoreWizard/RestoreSettingsStep.js.map +1 -1
  99. package/dist-lib/components/Restore/RestoreWizard/RestoreWizard.d.ts +5 -1
  100. package/dist-lib/components/Restore/RestoreWizard/RestoreWizard.d.ts.map +1 -1
  101. package/dist-lib/components/Restore/RestoreWizard/RestoreWizard.js +48 -44
  102. package/dist-lib/components/Restore/RestoreWizard/RestoreWizard.js.map +1 -1
  103. package/dist-lib/components/Restore/RestoreWizard/RestoreWizard.module.scss.js +32 -32
  104. package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.d.ts +1 -1
  105. package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.d.ts.map +1 -1
  106. package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.js +52 -24
  107. package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.js.map +1 -1
  108. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.d.ts.map +1 -1
  109. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.js +28 -19
  110. package/dist-lib/components/Settings/IntegrationSettings/IntegrationSettings.js.map +1 -1
  111. package/dist-lib/components/Settings/TwoFactorSetup/TwoFactorSetup.d.ts +7 -0
  112. package/dist-lib/components/Settings/TwoFactorSetup/TwoFactorSetup.d.ts.map +1 -0
  113. package/dist-lib/components/Settings/TwoFactorSetup/TwoFactorSetup.js +79 -0
  114. package/dist-lib/components/Settings/TwoFactorSetup/TwoFactorSetup.js.map +1 -0
  115. package/dist-lib/components/Settings/TwoFactorSetup/TwoFactorSetup.module.scss.js +24 -0
  116. package/dist-lib/components/Settings/TwoFactorSetup/TwoFactorSetup.module.scss.js.map +1 -0
  117. package/dist-lib/components/common/Icon/Icon.d.ts.map +1 -1
  118. package/dist-lib/components/common/Icon/Icon.js +11 -0
  119. package/dist-lib/components/common/Icon/Icon.js.map +1 -1
  120. package/dist-lib/components/common/PageHeader/PageHeader.module.scss.js +6 -6
  121. package/dist-lib/components/index.d.ts +6 -0
  122. package/dist-lib/components/index.d.ts.map +1 -1
  123. package/dist-lib/components.js +102 -90
  124. package/dist-lib/components.js.map +1 -1
  125. package/dist-lib/hooks/usePwaAutoUpdate.d.ts +11 -2
  126. package/dist-lib/hooks/usePwaAutoUpdate.d.ts.map +1 -1
  127. package/dist-lib/hooks/usePwaAutoUpdate.js +32 -10
  128. package/dist-lib/hooks/usePwaAutoUpdate.js.map +1 -1
  129. package/dist-lib/router.d.ts.map +1 -1
  130. package/dist-lib/router.js +46 -35
  131. package/dist-lib/router.js.map +1 -1
  132. package/dist-lib/routes/DeviceSingle/DeviceSingle.d.ts.map +1 -1
  133. package/dist-lib/routes/DeviceSingle/DeviceSingle.js +40 -40
  134. package/dist-lib/routes/DeviceSingle/DeviceSingle.js.map +1 -1
  135. package/dist-lib/routes/PlanSingle/PlanSingle.d.ts.map +1 -1
  136. package/dist-lib/routes/PlanSingle/PlanSingle.js +123 -98
  137. package/dist-lib/routes/PlanSingle/PlanSingle.js.map +1 -1
  138. package/dist-lib/services/backups.d.ts +15 -2
  139. package/dist-lib/services/backups.d.ts.map +1 -1
  140. package/dist-lib/services/backups.js +119 -100
  141. package/dist-lib/services/backups.js.map +1 -1
  142. package/dist-lib/services/plans.d.ts +20 -0
  143. package/dist-lib/services/plans.d.ts.map +1 -1
  144. package/dist-lib/services/plans.js +227 -172
  145. package/dist-lib/services/plans.js.map +1 -1
  146. package/dist-lib/services/restores.d.ts +10 -2
  147. package/dist-lib/services/restores.d.ts.map +1 -1
  148. package/dist-lib/services/restores.js +61 -57
  149. package/dist-lib/services/restores.js.map +1 -1
  150. package/dist-lib/services/settings.d.ts +16 -0
  151. package/dist-lib/services/settings.d.ts.map +1 -1
  152. package/dist-lib/services/settings.js +147 -68
  153. package/dist-lib/services/settings.js.map +1 -1
  154. package/dist-lib/services/users.d.ts.map +1 -1
  155. package/dist-lib/services/users.js +32 -32
  156. package/dist-lib/services/users.js.map +1 -1
  157. package/dist-lib/services.js +113 -101
  158. package/dist-lib/styles/core-frontend.css +1 -1
  159. package/dist-lib/utils/progressHelpers.d.ts +12 -1
  160. package/dist-lib/utils/progressHelpers.d.ts.map +1 -1
  161. package/dist-lib/utils/progressHelpers.js +121 -63
  162. package/dist-lib/utils/progressHelpers.js.map +1 -1
  163. package/dist-lib/utils.js +29 -28
  164. package/package.json +1 -1
  165. package/src/@types/backups.ts +28 -0
  166. package/src/@types/devices.ts +8 -0
  167. package/src/@types/plans.ts +23 -1
  168. package/src/@types/restores.ts +2 -0
  169. package/src/components/Device/DeviceBackups/DeviceBackups.tsx +11 -36
  170. package/src/components/Plan/BackupEvents/BackupEvents.module.scss +65 -0
  171. package/src/components/Plan/BackupEvents/BackupEvents.tsx +65 -4
  172. package/src/components/Plan/BackupProgress/BackupProgress.module.scss +121 -3
  173. package/src/components/Plan/BackupProgress/BackupProgress.tsx +149 -71
  174. package/src/components/Plan/Backups/Backups.tsx +52 -4
  175. package/src/components/Plan/EditPlan/EditPlan.tsx +1 -0
  176. package/src/components/Plan/Mirrors/MirrorDetails.module.scss +76 -0
  177. package/src/components/Plan/Mirrors/MirrorDetails.tsx +100 -0
  178. package/src/components/Plan/Mirrors/MirrorStatusBadge.module.scss +25 -0
  179. package/src/components/Plan/Mirrors/MirrorStatusBadge.tsx +65 -0
  180. package/src/components/Plan/Mirrors/MirrorStorageSelector.module.scss +97 -0
  181. package/src/components/Plan/Mirrors/MirrorStorageSelector.tsx +70 -0
  182. package/src/components/Plan/Mirrors/MirrorStorageSelectorModal.tsx +40 -0
  183. package/src/components/Plan/PlanBackups/PlanBackups.tsx +4 -1
  184. package/src/components/Plan/PlanForm/PlanForm.tsx +44 -17
  185. package/src/components/Plan/PlanIntegrity/PlanIntegrity.module.scss +110 -0
  186. package/src/components/Plan/PlanIntegrity/PlanIntegrity.tsx +187 -0
  187. package/src/components/Plan/PlanItems/PlanItem.tsx +3 -3
  188. package/src/components/Plan/PlanPendingBackup/PlanPendingBackup.tsx +2 -2
  189. package/src/components/Plan/PlanRemoveModal/PlanRemoveModal.tsx +1 -1
  190. package/src/components/Plan/PlanSettings/PlanReplicationSettings.module.scss +105 -0
  191. package/src/components/Plan/PlanSettings/PlanReplicationSettings.tsx +334 -0
  192. package/src/components/Plan/PlanStats/PlanStats.module.scss +1 -1
  193. package/src/components/Plan/PlanStats/PlanStats.tsx +8 -8
  194. package/src/components/Plan/PlanStorageInfo/PlanStorageInfo.module.scss +43 -0
  195. package/src/components/Plan/PlanStorageInfo/PlanStorageInfo.tsx +83 -0
  196. package/src/components/Restore/RestoreWizard/RestoreConfirmStep.tsx +2 -0
  197. package/src/components/Restore/RestoreWizard/RestorePreviewStep.tsx +2 -0
  198. package/src/components/Restore/RestoreWizard/RestoreSettingsStep.tsx +36 -13
  199. package/src/components/Restore/RestoreWizard/RestoreWizard.module.scss +4 -0
  200. package/src/components/Restore/RestoreWizard/RestoreWizard.tsx +9 -1
  201. package/src/components/Settings/GeneralSettings/GeneralSettings.tsx +38 -2
  202. package/src/components/Settings/IntegrationSettings/IntegrationSettings.tsx +9 -2
  203. package/src/components/Settings/TwoFactorSetup/TwoFactorSetup.module.scss +62 -0
  204. package/src/components/Settings/TwoFactorSetup/TwoFactorSetup.tsx +102 -0
  205. package/src/components/common/Icon/Icon.tsx +10 -1
  206. package/src/components/common/PageHeader/PageHeader.module.scss +3 -0
  207. package/src/components/index.ts +8 -0
  208. package/src/hooks/usePwaAutoUpdate.ts +51 -11
  209. package/src/router.tsx +26 -17
  210. package/src/routes/DeviceSingle/DeviceSingle.tsx +3 -3
  211. package/src/routes/PlanSingle/PlanSingle.tsx +21 -0
  212. package/src/services/backups.ts +32 -9
  213. package/src/services/plans.ts +75 -0
  214. package/src/services/restores.ts +10 -2
  215. package/src/services/settings.ts +90 -0
  216. package/src/services/users.ts +14 -5
  217. package/src/utils/progressHelpers.ts +85 -1
@@ -1,269 +1,269 @@
1
- import { useQuery as d, useMutation as r, useQueryClient as c } from "@tanstack/react-query";
2
- import { toast as l } from "react-toastify";
1
+ import { useQuery as y, useMutation as r, useQueryClient as c } from "@tanstack/react-query";
2
+ import { toast as u } from "react-toastify";
3
3
  import { API_URL as a } from "../utils/constants.js";
4
4
  async function g() {
5
- const e = new URL(`${a}/plans`), o = await (await fetch(e.toString(), {
5
+ const n = new URL(`${a}/plans`), t = await (await fetch(n.toString(), {
6
6
  method: "GET",
7
7
  credentials: "include"
8
8
  })).json();
9
- if (!o.success)
10
- throw new Error(o.error);
11
- return o;
9
+ if (!t.success)
10
+ throw new Error(t.error);
11
+ return t;
12
12
  }
13
- function F() {
14
- return d({
13
+ function U() {
14
+ return y({
15
15
  queryKey: ["plans"],
16
16
  queryFn: () => g(),
17
17
  refetchOnMount: !0,
18
18
  retry: !1
19
19
  });
20
20
  }
21
- async function P(e) {
22
- if (!e)
21
+ async function P(n) {
22
+ if (!n)
23
23
  throw new Error("ID Not Provided.");
24
- const n = new URL(`${a}/plans/${e}`), o = await fetch(n.toString(), {
24
+ const e = new URL(`${a}/plans/${n}`), t = await fetch(e.toString(), {
25
25
  method: "GET",
26
26
  credentials: "include"
27
- }), t = await o.json();
28
- if (!t.success) {
29
- const s = new Error(t.error);
30
- throw s.status = o.status, s;
27
+ }), o = await t.json();
28
+ if (!o.success) {
29
+ const s = new Error(o.error);
30
+ throw s.status = t.status, s;
31
31
  }
32
- return t;
32
+ return o;
33
33
  }
34
- function Q(e) {
35
- return d({
36
- queryKey: ["plan", e],
37
- queryFn: () => P(e),
34
+ function A(n) {
35
+ return y({
36
+ queryKey: ["plan", n],
37
+ queryFn: () => P(n),
38
38
  refetchOnMount: !0,
39
39
  retry: !1,
40
40
  staleTime: 0
41
41
  });
42
42
  }
43
- async function j(e) {
44
- const n = new URL(`${a}/plans/${e}/logs`), o = await fetch(n.toString(), {
43
+ async function E(n) {
44
+ const e = new URL(`${a}/plans/${n}/logs`), t = await fetch(e.toString(), {
45
45
  method: "GET",
46
46
  credentials: "include"
47
- }), t = await o.json();
48
- if (!t.success) {
49
- const s = new Error(t.error);
50
- throw s.status = o.status, s;
47
+ }), o = await t.json();
48
+ if (!o.success) {
49
+ const s = new Error(o.error);
50
+ throw s.status = t.status, s;
51
51
  }
52
- return t;
52
+ return o;
53
53
  }
54
- function U(e) {
55
- return d({
56
- queryKey: ["planLogs", e],
57
- queryFn: () => j(e),
54
+ function B(n) {
55
+ return y({
56
+ queryKey: ["planLogs", n],
57
+ queryFn: () => E(n),
58
58
  refetchOnMount: !0,
59
59
  retry: !1
60
60
  });
61
61
  }
62
- async function E(e) {
63
- var w, y;
64
- const n = await fetch(`${a}/plans/${e}/logs/download`, {
62
+ async function j(n) {
63
+ var w, f;
64
+ const e = await fetch(`${a}/plans/${n}/logs/download`, {
65
65
  method: "GET",
66
66
  credentials: "include"
67
67
  // headers: header,
68
68
  });
69
- if (!n.ok) {
70
- const u = await n.json();
71
- throw new Error(u.error);
69
+ if (!e.ok) {
70
+ const l = await e.json();
71
+ throw new Error(l.error);
72
72
  }
73
- const o = ((w = n.headers.get("content-disposition")) == null ? void 0 : w.split("filename=")[1]) || `plan-${e}.log`, t = (y = n.body) == null ? void 0 : y.getReader(), s = new ReadableStream({
74
- async start(u) {
73
+ const t = ((w = e.headers.get("content-disposition")) == null ? void 0 : w.split("filename=")[1]) || `plan-${n}.log`, o = (f = e.body) == null ? void 0 : f.getReader(), s = new ReadableStream({
74
+ async start(l) {
75
75
  for (; ; ) {
76
- const { done: h, value: m } = await t.read();
76
+ const { done: h, value: m } = await o.read();
77
77
  if (h) break;
78
- u.enqueue(m);
78
+ l.enqueue(m);
79
79
  }
80
- u.close(), t.releaseLock();
80
+ l.close(), o.releaseLock();
81
81
  }
82
- }), f = await new Response(s).blob(), p = window.URL.createObjectURL(f), i = document.createElement("a");
83
- i.href = p, i.download = o, document.body.appendChild(i), i.click(), i.remove(), window.URL.revokeObjectURL(p);
82
+ }), d = await new Response(s).blob(), p = window.URL.createObjectURL(d), i = document.createElement("a");
83
+ i.href = p, i.download = t, document.body.appendChild(i), i.click(), i.remove(), window.URL.revokeObjectURL(p);
84
84
  }
85
- function A() {
85
+ function D() {
86
86
  return r({
87
- mutationFn: E,
88
- onSuccess: (e) => {
89
- console.log("# Logs Downloaded! :", e);
87
+ mutationFn: j,
88
+ onSuccess: (n) => {
89
+ console.log("# Logs Downloaded! :", n);
90
90
  },
91
- onError: (e) => {
92
- console.log("# Logs Download Failed! :", e);
91
+ onError: (n) => {
92
+ console.log("# Logs Download Failed! :", n);
93
93
  }
94
94
  });
95
95
  }
96
- async function k(e) {
97
- const n = new Headers({ "Content-Type": "application/json", Accept: "application/json" });
98
- console.log("newPlan :", e);
99
- const t = await (await fetch(`${a}/plans`, {
96
+ async function S(n) {
97
+ const e = new Headers({ "Content-Type": "application/json", Accept: "application/json" });
98
+ console.log("newPlan :", n);
99
+ const o = await (await fetch(`${a}/plans`, {
100
100
  method: "POST",
101
101
  credentials: "include",
102
- headers: n,
103
- body: JSON.stringify(e)
102
+ headers: e,
103
+ body: JSON.stringify(n)
104
104
  })).json();
105
- if (!t.success)
106
- throw new Error(t.error || t.result);
107
- return t;
105
+ if (!o.success)
106
+ throw new Error(o.error || o.result);
107
+ return o;
108
108
  }
109
- function B() {
110
- const e = c();
109
+ function G() {
110
+ const n = c();
111
111
  return r({
112
- mutationFn: k,
113
- onSuccess: (n) => {
114
- console.log("# Plan Created! :", n), e.invalidateQueries({ queryKey: ["plans"] });
112
+ mutationFn: S,
113
+ onSuccess: (e) => {
114
+ console.log("# Plan Created! :", e), n.invalidateQueries({ queryKey: ["plans"] });
115
115
  }
116
116
  });
117
117
  }
118
- async function q(e) {
119
- const n = new Headers({ "Content-Type": "application/json", Accept: "application/json" });
120
- console.log("newPlan :", e);
121
- const t = await (await fetch(`${a}/plans/${e.id}`, {
118
+ async function k(n) {
119
+ const e = new Headers({ "Content-Type": "application/json", Accept: "application/json" });
120
+ console.log("newPlan :", n);
121
+ const o = await (await fetch(`${a}/plans/${n.id}`, {
122
122
  method: "PUT",
123
123
  credentials: "include",
124
- headers: n,
125
- body: JSON.stringify({ plan: e.data })
124
+ headers: e,
125
+ body: JSON.stringify({ plan: n.data })
126
126
  })).json();
127
- if (console.log("data :", t), !t.success)
128
- throw new Error(t.error);
129
- return t;
127
+ if (console.log("data :", o), !o.success)
128
+ throw new Error(o.error);
129
+ return o;
130
130
  }
131
- function G() {
132
- const e = c();
131
+ function H() {
132
+ const n = c();
133
133
  return r({
134
- mutationFn: q,
135
- onSuccess: (n) => {
136
- var t;
137
- console.log("# Plan Updated! :", n);
138
- const o = (t = n == null ? void 0 : n.result) == null ? void 0 : t.id;
139
- o && e.invalidateQueries({ queryKey: ["plan", o] }), e.invalidateQueries({ queryKey: ["plans"] });
134
+ mutationFn: k,
135
+ onSuccess: (e) => {
136
+ var o;
137
+ console.log("# Plan Updated! :", e);
138
+ const t = (o = e == null ? void 0 : e.result) == null ? void 0 : o.id;
139
+ t && n.invalidateQueries({ queryKey: ["plan", t] }), n.invalidateQueries({ queryKey: ["plans"] });
140
140
  }
141
141
  });
142
142
  }
143
- async function S({ id: e, removeRemoteData: n }) {
144
- const o = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), s = await (await fetch(`${a}/plans/${e}?removeData=${n}`, {
143
+ async function q({ id: n, removeRemoteData: e }) {
144
+ const t = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), s = await (await fetch(`${a}/plans/${n}?removeData=${e}`, {
145
145
  method: "DELETE",
146
146
  credentials: "include",
147
- headers: o
147
+ headers: t
148
148
  })).json();
149
149
  if (!s.success)
150
150
  throw new Error(s.error);
151
151
  return s;
152
152
  }
153
- function D() {
154
- const e = c();
153
+ function M() {
154
+ const n = c();
155
155
  return r({
156
- mutationFn: S,
157
- onSuccess: (n) => {
158
- console.log("# Plan Removed! :", n), e.invalidateQueries({ queryKey: ["plans"] });
156
+ mutationFn: q,
157
+ onSuccess: (e) => {
158
+ console.log("# Plan Removed! :", e), n.invalidateQueries({ queryKey: ["plans"] });
159
159
  }
160
160
  });
161
161
  }
162
- async function $(e) {
163
- const n = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), t = await (await fetch(`${a}/plans/${e}/action/backup`, {
162
+ async function $(n) {
163
+ const e = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), o = await (await fetch(`${a}/plans/${n}/action/backup`, {
164
164
  method: "POST",
165
165
  credentials: "include",
166
- headers: n
166
+ headers: e
167
167
  })).json();
168
- if (!t.success)
169
- throw new Error(t.error);
170
- return t;
168
+ if (!o.success)
169
+ throw new Error(o.error);
170
+ return o;
171
171
  }
172
- function H() {
173
- const e = c();
172
+ function N() {
173
+ const n = c();
174
174
  return r({
175
175
  mutationFn: $,
176
- onSuccess: (n, o) => {
177
- console.log("# Backup Started! :", n, o), e.invalidateQueries({ queryKey: ["plan", o] }), e.invalidateQueries({ queryKey: ["plans"] });
176
+ onSuccess: (e, t) => {
177
+ console.log("# Backup Started! :", e, t), n.invalidateQueries({ queryKey: ["plan", t] }), n.invalidateQueries({ queryKey: ["plans"] });
178
178
  }
179
179
  });
180
180
  }
181
- async function v(e) {
182
- const n = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), t = await (await fetch(`${a}/plans/${e}/action/pause`, {
181
+ async function v(n) {
182
+ const e = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), o = await (await fetch(`${a}/plans/${n}/action/pause`, {
183
183
  method: "POST",
184
184
  credentials: "include",
185
- headers: n
185
+ headers: e
186
186
  })).json();
187
- if (!t.success)
188
- throw new Error(t.error);
189
- return t;
187
+ if (!o.success)
188
+ throw new Error(o.error);
189
+ return o;
190
190
  }
191
- function M() {
192
- const e = c();
191
+ function I() {
192
+ const n = c();
193
193
  return r({
194
194
  mutationFn: v,
195
- onSuccess: (n, o) => {
196
- console.log("# Backup Paused! :", n, o), e.invalidateQueries({ queryKey: ["plan", o] }), e.invalidateQueries({ queryKey: ["plans"] });
195
+ onSuccess: (e, t) => {
196
+ console.log("# Backup Paused! :", e, t), n.invalidateQueries({ queryKey: ["plan", t] }), n.invalidateQueries({ queryKey: ["plans"] });
197
197
  }
198
198
  });
199
199
  }
200
- async function C(e) {
201
- const n = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), t = await (await fetch(`${a}/plans/${e}/action/resume`, {
200
+ async function C(n) {
201
+ const e = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), o = await (await fetch(`${a}/plans/${n}/action/resume`, {
202
202
  method: "POST",
203
203
  credentials: "include",
204
- headers: n
204
+ headers: e
205
205
  })).json();
206
- if (!t.success)
207
- throw new Error(t.error);
208
- return t;
206
+ if (!o.success)
207
+ throw new Error(o.error);
208
+ return o;
209
209
  }
210
- function N() {
211
- const e = c();
210
+ function J() {
211
+ const n = c();
212
212
  return r({
213
213
  mutationFn: C,
214
- onSuccess: (n, o) => {
215
- console.log("# Backup Resumed! :", n, o), e.invalidateQueries({ queryKey: ["plan", o] }), e.invalidateQueries({ queryKey: ["plans"] });
214
+ onSuccess: (e, t) => {
215
+ console.log("# Backup Resumed! :", e, t), n.invalidateQueries({ queryKey: ["plan", t] }), n.invalidateQueries({ queryKey: ["plans"] });
216
216
  }
217
217
  });
218
218
  }
219
- async function T(e) {
220
- const n = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), t = await (await fetch(`${a}/plans/${e}/action/prune`, {
219
+ async function R(n) {
220
+ const e = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), o = await (await fetch(`${a}/plans/${n}/action/prune`, {
221
221
  method: "POST",
222
222
  credentials: "include",
223
- headers: n
223
+ headers: e
224
224
  })).json();
225
- if (!t.success)
226
- throw new Error(t.error);
227
- return t;
225
+ if (!o.success)
226
+ throw new Error(o.error);
227
+ return o;
228
228
  }
229
- function J() {
230
- const e = c();
229
+ function x() {
230
+ const n = c();
231
231
  return r({
232
- mutationFn: T,
233
- onError: (n) => {
234
- console.log("error :", n == null ? void 0 : n.message), l.error(n.message || "Error Removing Old Backups.");
232
+ mutationFn: R,
233
+ onError: (e) => {
234
+ console.log("error :", e == null ? void 0 : e.message), u.error(e.message || "Error Removing Old Backups.");
235
235
  },
236
- onSuccess: (n, o) => {
237
- console.log("# Backup Pruned! :", n, o), e.invalidateQueries({ queryKey: ["plan", o] }), l.success((n == null ? void 0 : n.message) || "Removed Old Backups Successfully!", { autoClose: 5e3 });
236
+ onSuccess: (e, t) => {
237
+ console.log("# Backup Pruned! :", e, t), n.invalidateQueries({ queryKey: ["plan", t] }), u.success((e == null ? void 0 : e.message) || "Removed Old Backups Successfully!", { autoClose: 5e3 });
238
238
  }
239
239
  });
240
240
  }
241
- async function R(e) {
242
- const n = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), t = await (await fetch(`${a}/plans/${e}/action/unlock`, {
241
+ async function T(n) {
242
+ const e = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), o = await (await fetch(`${a}/plans/${n}/action/unlock`, {
243
243
  method: "POST",
244
244
  credentials: "include",
245
- headers: n
245
+ headers: e
246
246
  })).json();
247
- if (!t.success)
248
- throw new Error(t.error);
249
- return t;
247
+ if (!o.success)
248
+ throw new Error(o.error);
249
+ return o;
250
250
  }
251
- function x() {
252
- const e = c();
251
+ function _() {
252
+ const n = c();
253
253
  return r({
254
- mutationFn: R,
255
- onError: (n) => {
256
- console.log("error :", n == null ? void 0 : n.message), l.error(n.message || "Error Removing stale locks.");
254
+ mutationFn: T,
255
+ onError: (e) => {
256
+ console.log("error :", e == null ? void 0 : e.message), u.error(e.message || "Error Removing stale locks.");
257
257
  },
258
- onSuccess: (n, o) => {
259
- console.log("# Backup Pruned! :", n, o), e.invalidateQueries({ queryKey: ["plan", o] }), l.success("Removed Stale locks Successfully!", { autoClose: 5e3 });
258
+ onSuccess: (e, t) => {
259
+ console.log("# Backup Pruned! :", e, t), n.invalidateQueries({ queryKey: ["plan", t] }), u.success("Removed Stale locks Successfully!", { autoClose: 5e3 });
260
260
  }
261
261
  });
262
262
  }
263
- async function L(e, n = "backup") {
264
- const o = new URL(`${a}/plans/${e}/checkactive`);
265
- o.searchParams.append("type", n);
266
- const s = await (await fetch(o.toString(), {
263
+ async function O(n, e = "backup") {
264
+ const t = new URL(`${a}/plans/${n}/checkactive`);
265
+ t.searchParams.append("type", e);
266
+ const s = await (await fetch(t.toString(), {
267
267
  method: "GET",
268
268
  credentials: "include"
269
269
  })).json();
@@ -271,39 +271,94 @@ async function L(e, n = "backup") {
271
271
  throw new Error(s.error);
272
272
  return s;
273
273
  }
274
- function _() {
274
+ function z() {
275
275
  return r({
276
276
  // queryKey: ['planActiveBackups-' + planId],
277
- mutationFn: ({ planId: e, type: n }) => L(e, n)
277
+ mutationFn: ({ planId: n, type: e }) => O(n, e)
278
278
  // refetchOnMount: true,
279
279
  });
280
280
  }
281
+ async function K({
282
+ planID: n,
283
+ storageID: e,
284
+ storagePath: t,
285
+ removeData: o,
286
+ replicationId: s
287
+ }) {
288
+ const d = new Headers({ "Content-Type": "application/json", Accept: "application/json" }), i = await (await fetch(`${a}/plans/${n}/action/delete-replication-storage`, {
289
+ method: "POST",
290
+ credentials: "include",
291
+ headers: d,
292
+ body: JSON.stringify({ storageID: e, storagePath: t, removeData: o, replicationId: s })
293
+ })).json();
294
+ if (!i.success)
295
+ throw new Error(i.error);
296
+ return i;
297
+ }
298
+ function V() {
299
+ const n = c();
300
+ return r({
301
+ mutationFn: K,
302
+ onError: (e) => {
303
+ console.log("error :", e == null ? void 0 : e.message), u.error(e.message || "Error removing replication storage.");
304
+ },
305
+ onSuccess: (e, t) => {
306
+ console.log("# Replication Storage Removed! :", e, t), n.invalidateQueries({ queryKey: ["plan", t.planID] }), n.invalidateQueries({ queryKey: ["plans"] }), u.success((e == null ? void 0 : e.message) || "Replication storage removed successfully!", { autoClose: 5e3 });
307
+ }
308
+ });
309
+ }
310
+ async function L({ planId: n }) {
311
+ const t = await (await fetch(`${a}/plans/${n}/action/checkintegrity`, {
312
+ method: "POST",
313
+ credentials: "include"
314
+ // headers: header,
315
+ })).json();
316
+ if (!t.success)
317
+ throw new Error(t.error);
318
+ return t;
319
+ }
320
+ function W() {
321
+ const n = c();
322
+ return r({
323
+ mutationFn: L,
324
+ onSuccess: (e, t) => {
325
+ n.invalidateQueries({ queryKey: ["plan", t.planId] }), console.log("res :", t, e);
326
+ },
327
+ onError: (e, t) => {
328
+ console.error("Error checking plan integrity for planId:", t.planId, e), u.error(`Error checking plan integrity. ${e instanceof Error ? e.message : "Unknown error"}`, { autoClose: !1 });
329
+ }
330
+ });
331
+ }
281
332
  export {
282
- L as checkActiveBackupsOrRestore,
283
- k as createPlan,
284
- S as deletePlan,
285
- E as downloadPlanLogs,
333
+ O as checkActiveBackupsOrRestore,
334
+ L as checkPlanIntegrity,
335
+ S as createPlan,
336
+ q as deletePlan,
337
+ K as deleteReplicationStorage,
338
+ j as downloadPlanLogs,
286
339
  g as getAllPlans,
287
- j as getPlanLogs,
340
+ E as getPlanLogs,
288
341
  P as getSinglePlan,
289
342
  v as pausePlan,
290
343
  $ as performBackup,
291
- T as prunePlan,
344
+ R as prunePlan,
292
345
  C as resumePlan,
293
- R as unlockPlan,
294
- q as updatePlan,
295
- _ as useCheckActiveBackupsOrRestore,
296
- B as useCreatePlan,
297
- D as useDeletePlan,
298
- A as useGetDownloadLogs,
299
- Q as useGetPlan,
300
- U as useGetPlanLogs,
301
- F as useGetPlans,
302
- M as usePausePlan,
303
- H as usePerformBackup,
304
- J as usePrunePlan,
305
- N as useResumePlan,
306
- x as useUnlockPlan,
307
- G as useUpdatePlan
346
+ T as unlockPlan,
347
+ k as updatePlan,
348
+ z as useCheckActiveBackupsOrRestore,
349
+ W as useCheckPlanIntegrity,
350
+ G as useCreatePlan,
351
+ M as useDeletePlan,
352
+ V as useDeleteReplicationStorage,
353
+ D as useGetDownloadLogs,
354
+ A as useGetPlan,
355
+ B as useGetPlanLogs,
356
+ U as useGetPlans,
357
+ I as usePausePlan,
358
+ N as usePerformBackup,
359
+ x as usePrunePlan,
360
+ J as useResumePlan,
361
+ _ as useUnlockPlan,
362
+ H as useUpdatePlan
308
363
  };
309
364
  //# sourceMappingURL=plans.js.map