@plutonhq/core-frontend 0.1.21 → 0.1.23

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 (70) hide show
  1. package/dist-lib/@types/plans.d.ts +11 -20
  2. package/dist-lib/@types/plans.d.ts.map +1 -1
  3. package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.js +49 -47
  4. package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.js.map +1 -1
  5. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.d.ts +7 -4
  6. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.d.ts.map +1 -1
  7. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.js +177 -52
  8. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettings.js.map +1 -1
  9. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.d.ts +9 -0
  10. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.d.ts.map +1 -0
  11. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.js +62 -0
  12. package/dist-lib/components/Plan/PlanSettings/PlanNotificationSettingsTester.js.map +1 -0
  13. package/dist-lib/components/Plan/PlanSettings/PlanPruneSettings.js +2 -2
  14. package/dist-lib/components/Plan/PlanSettings/PlanPruneSettings.js.map +1 -1
  15. package/dist-lib/components/Plan/PlanSettings/PlanSettings.module.scss.js +56 -40
  16. package/dist-lib/components/Plan/PlanSettings/PlanSettings.module.scss.js.map +1 -1
  17. package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.d.ts.map +1 -1
  18. package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.js +16 -8
  19. package/dist-lib/components/Settings/GeneralSettings/GeneralSettings.js.map +1 -1
  20. package/dist-lib/components/Storage/AddStorage/AddStorage.module.scss.js +42 -26
  21. package/dist-lib/components/Storage/AddStorage/AddStorage.module.scss.js.map +1 -1
  22. package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.d.ts.map +1 -1
  23. package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.js +119 -53
  24. package/dist-lib/components/Storage/StorageAuthSettings/StorageAuthSettings.js.map +1 -1
  25. package/dist-lib/components/common/Icon/Icon.d.ts.map +1 -1
  26. package/dist-lib/components/common/Icon/Icon.js +15 -1
  27. package/dist-lib/components/common/Icon/Icon.js.map +1 -1
  28. package/dist-lib/components/index.d.ts +1 -0
  29. package/dist-lib/components/index.d.ts.map +1 -1
  30. package/dist-lib/components.js +86 -84
  31. package/dist-lib/components.js.map +1 -1
  32. package/dist-lib/providers/s3compatible.png +0 -0
  33. package/dist-lib/services/plans.d.ts +13 -1
  34. package/dist-lib/services/plans.d.ts.map +1 -1
  35. package/dist-lib/services/plans.js +88 -61
  36. package/dist-lib/services/plans.js.map +1 -1
  37. package/dist-lib/services/settings.d.ts.map +1 -1
  38. package/dist-lib/services/settings.js +25 -24
  39. package/dist-lib/services/settings.js.map +1 -1
  40. package/dist-lib/services/storage.d.ts +10 -0
  41. package/dist-lib/services/storage.d.ts.map +1 -1
  42. package/dist-lib/services/storage.js +55 -20
  43. package/dist-lib/services/storage.js.map +1 -1
  44. package/dist-lib/services.js +106 -101
  45. package/dist-lib/styles/core-frontend.css +1 -1
  46. package/dist-lib/utils/constants.d.ts.map +1 -1
  47. package/dist-lib/utils/constants.js +28 -5
  48. package/dist-lib/utils/constants.js.map +1 -1
  49. package/dist-lib/utils/helpers.d.ts +1 -0
  50. package/dist-lib/utils/helpers.d.ts.map +1 -1
  51. package/dist-lib/utils/helpers.js +17 -10
  52. package/dist-lib/utils/helpers.js.map +1 -1
  53. package/dist-lib/utils.js +28 -27
  54. package/package.json +1 -1
  55. package/src/@types/plans.ts +11 -20
  56. package/src/components/Plan/PlanSettings/PlanAdvancedSettings.tsx +4 -4
  57. package/src/components/Plan/PlanSettings/PlanNotificationSettings.tsx +179 -47
  58. package/src/components/Plan/PlanSettings/PlanNotificationSettingsTester.tsx +85 -0
  59. package/src/components/Plan/PlanSettings/PlanPruneSettings.tsx +2 -2
  60. package/src/components/Plan/PlanSettings/PlanSettings.module.scss +71 -0
  61. package/src/components/Settings/GeneralSettings/GeneralSettings.tsx +6 -1
  62. package/src/components/Storage/AddStorage/AddStorage.module.scss +74 -0
  63. package/src/components/Storage/StorageAuthSettings/StorageAuthSettings.tsx +136 -3
  64. package/src/components/common/Icon/Icon.tsx +16 -0
  65. package/src/components/index.ts +1 -0
  66. package/src/services/plans.ts +38 -1
  67. package/src/services/settings.ts +2 -2
  68. package/src/services/storage.ts +49 -0
  69. package/src/utils/constants.ts +23 -0
  70. package/src/utils/helpers.ts +9 -0
@@ -1,92 +1,158 @@
1
- import { jsxs as o, jsx as e, Fragment as b } from "react/jsx-runtime";
2
- import { useState as u, useEffect as v } from "react";
3
- import A from "../../common/form/Tristate/Tristate.js";
4
- import l from "../../common/Icon/Icon.js";
5
- import t from "../AddStorage/AddStorage.module.scss.js";
6
- import k from "../StorageSettings/StorageSettings.js";
7
- const P = ({
8
- storageType: r,
9
- fields: h,
10
- settings: p,
11
- authTypes: n,
12
- currentAuthType: c,
13
- errors: m,
14
- onUpdate: f,
15
- onAuthTypeChange: s
1
+ import { jsxs as t, jsx as e, Fragment as D } from "react/jsx-runtime";
2
+ import { useState as u, useRef as F, useEffect as U, useCallback as y } from "react";
3
+ import R from "../../common/form/Tristate/Tristate.js";
4
+ import i from "../../common/Icon/Icon.js";
5
+ import o from "../AddStorage/AddStorage.module.scss.js";
6
+ import $ from "../StorageSettings/StorageSettings.js";
7
+ import { startStorageAuthorize as L, getStorageAuthorizeStatus as j, cancelStorageAuthorize as q } from "../../../services/storage.js";
8
+ const M = ({
9
+ storageType: m,
10
+ fields: S,
11
+ settings: g,
12
+ authTypes: a,
13
+ currentAuthType: l,
14
+ errors: O,
15
+ onUpdate: w,
16
+ onAuthTypeChange: b
16
17
  }) => {
17
- const [i, g] = u(!0), [d, w] = u(!1);
18
- return console.log("availableAuthTypes :", h, n, c), v(() => {
19
- !c && n.length > 0 && s(n[0]);
20
- }, [n, c, s]), /* @__PURE__ */ o("div", { className: t.authSettings, children: [
21
- /* @__PURE__ */ o(
18
+ const [p, B] = u(!0), [k, _] = u(!1), [s, c] = u("idle"), [A, N] = u(null), [I, v] = u(null), [E, f] = u(null), d = F(null), C = window.plutonInstallType, z = C === "binary" || C === "dev";
19
+ console.log("availableAuthTypes :", S, a, l), U(() => {
20
+ !l && a.length > 0 && b(a[0]);
21
+ }, [a, l, b]), U(() => () => {
22
+ d.current && clearInterval(d.current);
23
+ }, []);
24
+ const h = y(() => {
25
+ d.current && (clearInterval(d.current), d.current = null);
26
+ }, []), P = y(async () => {
27
+ c("authorizing"), v(null), f(null);
28
+ try {
29
+ const { sessionId: n } = await L(m);
30
+ N(n), d.current = setInterval(async () => {
31
+ try {
32
+ const r = await j(n);
33
+ r.authUrl && v(r.authUrl), r.status === "success" && r.token ? (h(), c("success"), w({ ...g, token: r.token })) : r.status === "error" && (h(), c("error"), f(r.error || "Authorization failed"));
34
+ } catch (r) {
35
+ h(), c("error"), f((r == null ? void 0 : r.message) || "Failed to check authorization status");
36
+ }
37
+ }, 2e3);
38
+ } catch (n) {
39
+ c("error"), f((n == null ? void 0 : n.message) || "Failed to start authorization");
40
+ }
41
+ }, [m, g, w, h]), x = y(async () => {
42
+ if (h(), A)
43
+ try {
44
+ await q(A);
45
+ } catch {
46
+ }
47
+ c("idle"), N(null), v(null), f(null);
48
+ }, [A, h]);
49
+ return /* @__PURE__ */ t("div", { className: o.authSettings, children: [
50
+ /* @__PURE__ */ t(
22
51
  "div",
23
52
  {
24
- className: `${t.advancedButton} ${i ? t.advancedButtonActive : ""}`,
25
- onClick: () => g(!i),
53
+ className: `${o.advancedButton} ${p ? o.advancedButtonActive : ""}`,
54
+ onClick: () => B(!p),
26
55
  children: [
27
- /* @__PURE__ */ e(l, { type: "authentication", size: 14 }),
28
- /* @__PURE__ */ e("span", { children: r === "local" ? "Local Storage Setup" : "Account Authentication" }),
29
- /* @__PURE__ */ e(l, { type: i ? "caret-up" : "caret-down" })
56
+ /* @__PURE__ */ e(i, { type: "authentication", size: 14 }),
57
+ /* @__PURE__ */ e("span", { children: m === "local" ? "Local Storage Setup" : "Account Authentication" }),
58
+ /* @__PURE__ */ e(i, { type: p ? "caret-up" : "caret-down" })
30
59
  ]
31
60
  }
32
61
  ),
33
- i && /* @__PURE__ */ o("div", { className: t.advancedOptions, children: [
34
- i && n.length > 1 && /* @__PURE__ */ e("div", { className: t.field, children: /* @__PURE__ */ e(
35
- A,
62
+ p && /* @__PURE__ */ t("div", { className: o.advancedOptions, children: [
63
+ p && a.length > 1 && /* @__PURE__ */ e("div", { className: o.field, children: /* @__PURE__ */ e(
64
+ R,
36
65
  {
37
66
  label: "Authentication Type",
38
67
  inline: !0,
39
- fieldValue: c,
68
+ fieldValue: l,
40
69
  options: [
41
- { label: "User (oAuth)", value: "oauth", disabled: n.includes("oauth") === !1 },
42
- { label: "User/Pass", value: "password", disabled: n.includes("password") === !1 },
43
- { label: "App/Client", value: "client", disabled: n.includes("client") === !1 }
70
+ { label: "User (oAuth)", value: "oauth", disabled: a.includes("oauth") === !1 },
71
+ { label: "User/Pass", value: "password", disabled: a.includes("password") === !1 },
72
+ { label: "App/Client", value: "client", disabled: a.includes("client") === !1 }
44
73
  ],
45
74
  hint: `User (oAuth): Use the generated Link to login to your account and authorize the App.
46
75
  Username/Password: Your own Username/Password will be used to backup.
47
76
  App/Client: Provide App/Client keys that can be found in your cloud storage account dashboard`,
48
- onUpdate: (a) => s(a)
77
+ onUpdate: (n) => b(n)
49
78
  }
50
79
  ) }),
51
80
  /* @__PURE__ */ e(
52
- k,
81
+ $,
53
82
  {
54
- fields: h.filter((a) => a.authFieldType === c),
55
- settings: p,
56
- onUpdate: (a) => f(a),
57
- errors: m
83
+ fields: S.filter((n) => n.authFieldType === l),
84
+ settings: g,
85
+ onUpdate: (n) => w(n),
86
+ errors: O
58
87
  }
59
88
  ),
60
- c === "oauth" && /* @__PURE__ */ o("div", { className: t.oauthDoc, children: [
61
- /* @__PURE__ */ o("h4", { onClick: () => w(!d), children: [
62
- /* @__PURE__ */ e(l, { type: "key", size: 14 }),
89
+ l === "oauth" && z && s === "idle" && /* @__PURE__ */ e("div", { className: o.oauthButton, children: /* @__PURE__ */ t("button", { className: o.oauthAuthorizeBtn, onClick: P, children: [
90
+ /* @__PURE__ */ e(i, { type: "key", size: 14 }),
91
+ " Authorize & Get Access Token"
92
+ ] }) }),
93
+ l === "oauth" && z && s !== "idle" && /* @__PURE__ */ t("div", { className: `${o.oauthContainer} ${o[s]}`, children: [
94
+ s === "authorizing" && /* @__PURE__ */ t("div", { className: o.oauthProgress, children: [
95
+ /* @__PURE__ */ t("p", { children: [
96
+ /* @__PURE__ */ e("strong", { children: "Waiting for authorization..." }),
97
+ /* @__PURE__ */ e("br", {}),
98
+ "A browser window should have opened. Please authorize the connection in your browser."
99
+ ] }),
100
+ I && /* @__PURE__ */ t("p", { children: [
101
+ "If the browser didn't open automatically,",
102
+ " ",
103
+ /* @__PURE__ */ e("a", { href: I, target: "_blank", rel: "noopener noreferrer", children: "click here to authorize" }),
104
+ "."
105
+ ] }),
106
+ /* @__PURE__ */ e("button", { className: o.oauthInnerBtn, onClick: x, children: "Cancel" })
107
+ ] }),
108
+ s === "success" && /* @__PURE__ */ e("div", { className: o.oauthProgress, children: /* @__PURE__ */ t("p", { children: [
109
+ /* @__PURE__ */ e(i, { type: "check", size: 14 }),
110
+ " ",
111
+ /* @__PURE__ */ e("strong", { children: "Authorization successful!" }),
112
+ " Token has been automatically filled in."
113
+ ] }) }),
114
+ s === "error" && /* @__PURE__ */ t("div", { className: o.oauthProgress, children: [
115
+ /* @__PURE__ */ t("p", { children: [
116
+ /* @__PURE__ */ e("strong", { children: "Authorization failed:" }),
117
+ " ",
118
+ E
119
+ ] }),
120
+ /* @__PURE__ */ t("button", { className: o.oauthInnerBtn, onClick: P, children: [
121
+ /* @__PURE__ */ e(i, { type: "key", size: 14 }),
122
+ " Try Again"
123
+ ] })
124
+ ] })
125
+ ] }),
126
+ l === "oauth" && !z && /* @__PURE__ */ t("div", { className: o.oauthDoc, children: [
127
+ /* @__PURE__ */ t("h4", { onClick: () => _(!k), children: [
128
+ /* @__PURE__ */ e(i, { type: "key", size: 14 }),
63
129
  " Acquiring the OAuth Access Token",
64
- /* @__PURE__ */ e("button", { children: /* @__PURE__ */ e(l, { type: d ? "caret-up" : "caret-down" }) })
130
+ /* @__PURE__ */ e("button", { children: /* @__PURE__ */ e(i, { type: k ? "caret-up" : "caret-down" }) })
65
131
  ] }),
66
- d && /* @__PURE__ */ o(b, { children: [
67
- /* @__PURE__ */ o("p", { children: [
132
+ k && /* @__PURE__ */ t(D, { children: [
133
+ /* @__PURE__ */ t("p", { children: [
68
134
  /* @__PURE__ */ e("strong", { children: "Step 1:" }),
69
135
  " On a machine with a browser,",
70
136
  " ",
71
137
  /* @__PURE__ */ e("a", { href: "https://rclone.org/downloads/", target: "_blank", children: "install rclone" }),
72
138
  " ",
73
139
  "and execute this command in the CLI: ",
74
- /* @__PURE__ */ o("code", { className: t.codeBlock, children: [
140
+ /* @__PURE__ */ t("code", { className: o.codeBlock, children: [
75
141
  "rclone authorize ",
76
- r
142
+ m
77
143
  ] })
78
144
  ] }),
79
- /* @__PURE__ */ o("p", { children: [
145
+ /* @__PURE__ */ t("p", { children: [
80
146
  /* @__PURE__ */ e("strong", { children: "Step 2:" }),
81
147
  " A browser window will open where you will need to authorize Rclone to connect to your",
82
148
  " ",
83
- r,
149
+ m,
84
150
  " account. Authorize the connection."
85
151
  ] }),
86
- /* @__PURE__ */ o("p", { children: [
152
+ /* @__PURE__ */ t("p", { children: [
87
153
  /* @__PURE__ */ e("strong", { children: "Step 3:" }),
88
154
  " Once authorized, the cli where you ran the command, should display a message similar to this:",
89
- /* @__PURE__ */ o("code", { className: t.codeBlock, children: [
155
+ /* @__PURE__ */ t("code", { className: o.codeBlock, children: [
90
156
  "Paste the following into your remote machine --->",
91
157
  /* @__PURE__ */ e("strong", { children: '{"access_token":"....","token_type":"bearer...}' }),
92
158
  "<---End paste"
@@ -99,13 +165,13 @@ const P = ({
99
165
  " ",
100
166
  /* @__PURE__ */ e("code", { children: '{"access_token":"....","token_type":"bearer...}' })
101
167
  ] }),
102
- /* @__PURE__ */ o("p", { children: [
168
+ /* @__PURE__ */ t("p", { children: [
103
169
  /* @__PURE__ */ e("strong", { children: "Step 4:" }),
104
170
  " Paste the copied content in the ",
105
171
  /* @__PURE__ */ e("strong", { children: "OAuth Access Token" }),
106
172
  " field above."
107
173
  ] }),
108
- /* @__PURE__ */ o("p", { children: [
174
+ /* @__PURE__ */ t("p", { children: [
109
175
  /* @__PURE__ */ e("strong", { children: "Step 5:" }),
110
176
  " If you no longer need Rclone, you can safely remove it from your system."
111
177
  ] })
@@ -115,6 +181,6 @@ const P = ({
115
181
  ] });
116
182
  };
117
183
  export {
118
- P as default
184
+ M as default
119
185
  };
120
186
  //# sourceMappingURL=StorageAuthSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageAuthSettings.js","sources":["../../../../src/components/Storage/StorageAuthSettings/StorageAuthSettings.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\r\nimport { storageOptionField } from '../../../@types/storages';\r\nimport Tristate from '../../common/form/Tristate/Tristate';\r\nimport Icon from '../../common/Icon/Icon';\r\nimport classes from '../AddStorage/AddStorage.module.scss';\r\nimport StorageSettings from '../StorageSettings/StorageSettings';\r\n\r\ninterface StorageAuthSettingsProps {\r\n storageType: string;\r\n fields: storageOptionField[];\r\n settings: Record<string, string | number | boolean>;\r\n authTypes: string[];\r\n errors: Record<string, string>;\r\n currentAuthType: string;\r\n onUpdate: (newSettings: StorageAuthSettingsProps['settings']) => void;\r\n onAuthTypeChange: (authType: string) => void;\r\n}\r\n\r\nconst StorageAuthSettings = ({\r\n storageType,\r\n fields,\r\n settings,\r\n authTypes,\r\n currentAuthType,\r\n errors,\r\n onUpdate,\r\n onAuthTypeChange,\r\n}: StorageAuthSettingsProps) => {\r\n const [showAdvanced, setShowAdvanced] = useState(true);\r\n const [showOAuthDoc, setShowOAuthDoc] = useState(false);\r\n\r\n console.log('availableAuthTypes :', fields, authTypes, currentAuthType);\r\n\r\n useEffect(() => {\r\n if (!currentAuthType && authTypes.length > 0) {\r\n onAuthTypeChange(authTypes[0]);\r\n }\r\n }, [authTypes, currentAuthType, onAuthTypeChange]);\r\n\r\n return (\r\n <div className={classes.authSettings}>\r\n <div\r\n className={`${classes.advancedButton} ${showAdvanced ? classes.advancedButtonActive : ''}`}\r\n onClick={() => setShowAdvanced(!showAdvanced)}\r\n >\r\n <Icon type={'authentication'} size={14} />\r\n <span>{storageType === 'local' ? 'Local Storage Setup' : 'Account Authentication'}</span>\r\n <Icon type={showAdvanced ? 'caret-up' : 'caret-down'} />\r\n </div>\r\n {showAdvanced && (\r\n <div className={classes.advancedOptions}>\r\n {showAdvanced && authTypes.length > 1 && (\r\n <div className={classes.field}>\r\n <Tristate\r\n label={'Authentication Type'}\r\n inline={true}\r\n fieldValue={currentAuthType}\r\n options={[\r\n { label: 'User (oAuth)', value: 'oauth', disabled: authTypes.includes('oauth') === false },\r\n { label: 'User/Pass', value: 'password', disabled: authTypes.includes('password') === false },\r\n { label: 'App/Client', value: 'client', disabled: authTypes.includes('client') === false },\r\n ]}\r\n hint={\r\n 'User (oAuth): Use the generated Link to login to your account and authorize the App.\\n Username/Password: Your own Username/Password will be used to backup. \\n App/Client: Provide App/Client keys that can be found in your cloud storage account dashboard'\r\n }\r\n onUpdate={(newVal: string) => onAuthTypeChange(newVal)}\r\n />\r\n </div>\r\n )}\r\n\r\n <StorageSettings\r\n fields={fields.filter((f) => f.authFieldType === currentAuthType)}\r\n settings={settings}\r\n onUpdate={(newSettings) => onUpdate(newSettings)}\r\n errors={errors}\r\n />\r\n {currentAuthType === 'oauth' && (\r\n <div className={classes.oauthDoc}>\r\n <h4 onClick={() => setShowOAuthDoc(!showOAuthDoc)}>\r\n <Icon type={'key'} size={14} /> Acquiring the OAuth Access Token\r\n <button>\r\n <Icon type={showOAuthDoc ? 'caret-up' : 'caret-down'} />\r\n </button>\r\n </h4>\r\n {showOAuthDoc && (\r\n <>\r\n <p>\r\n <strong>Step 1:</strong> On a machine with a browser,{' '}\r\n <a href=\"https://rclone.org/downloads/\" target=\"_blank\">\r\n install rclone\r\n </a>{' '}\r\n and execute this command in the CLI: <code className={classes.codeBlock}>rclone authorize {storageType}</code>\r\n </p>\r\n <p>\r\n <strong>Step 2:</strong> A browser window will open where you will need to authorize Rclone to connect to your{' '}\r\n {storageType} account. Authorize the connection.\r\n </p>\r\n <p>\r\n <strong>Step 3:</strong> Once authorized, the cli where you ran the command, should display a message similar to this:\r\n <code className={classes.codeBlock}>\r\n {`Paste the following into your remote machine --->`}\r\n <strong>{`{\"access_token\":\"....\",\"token_type\":\"bearer...}`}</strong>\r\n {`<---End paste`}\r\n </code>\r\n Copy everything between <code>{`--->`}</code> and <code>{`<---`}</code>. Eg:{' '}\r\n <code>{`{\"access_token\":\"....\",\"token_type\":\"bearer...}`}</code>\r\n </p>\r\n <p>\r\n <strong>Step 4:</strong> Paste the copied content in the <strong>OAuth Access Token</strong> field above.\r\n </p>\r\n <p>\r\n <strong>Step 5:</strong> If you no longer need Rclone, you can safely remove it from your system.\r\n </p>\r\n </>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\nexport default StorageAuthSettings;\r\n"],"names":["StorageAuthSettings","storageType","fields","settings","authTypes","currentAuthType","errors","onUpdate","onAuthTypeChange","showAdvanced","setShowAdvanced","useState","showOAuthDoc","setShowOAuthDoc","useEffect","jsxs","classes","jsx","Icon","Tristate","newVal","StorageSettings","f","newSettings","Fragment"],"mappings":";;;;;;AAkBA,MAAMA,IAAsB,CAAC;AAAA,EAC1B,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,E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AAAA,YAAA,gBAAAgB,EAAC,YAAO,UAAA,UAAA,CAAO;AAAA,YAAS;AAAA,YAAuF;AAAA,YAC9GhB;AAAA,YAAY;AAAA,UAAA,GAChB;AAAA,4BACC,KAAA,EACE,UAAA;AAAA,YAAA,gBAAAgB,EAAC,YAAO,UAAA,UAAA,CAAO;AAAA,YAAS;AAAA,YACxB,gBAAAF,EAAC,QAAA,EAAK,WAAWC,EAAQ,WACrB,UAAA;AAAA,cAAA;AAAA,cACD,gBAAAC,EAAC,YAAQ,UAAA,kDAAA,CAAkD;AAAA,cAC1D;AAAA,YAAA,GACJ;AAAA,YAAO;AAAA,YACiB,gBAAAA,EAAC,UAAM,UAAA,OAAA,CAAO;AAAA,YAAO;AAAA,YAAK,gBAAAA,EAAC,UAAM,UAAA,OAAA,CAAO;AAAA,YAAO;AAAA,YAAM;AAAA,YAC7E,gBAAAA,EAAC,UAAM,UAAA,kDAAA,CAAkD;AAAA,UAAA,GAC5D;AAAA,4BACC,KAAA,EACE,UAAA;AAAA,YAAA,gBAAAA,EAAC,YAAO,UAAA,UAAA,CAAO;AAAA,YAAS;AAAA,YAAiC,gBAAAA,EAAC,YAAO,UAAA,qBAAA,CAAkB;AAAA,YAAS;AAAA,UAAA,GAC/F;AAAA,4BACC,KAAA,EACE,UAAA;AAAA,YAAA,gBAAAA,EAAC,YAAO,UAAA,UAAA,CAAO;AAAA,YAAS;AAAA,UAAA,EAAA,CAC3B;AAAA,QAAA,EAAA,CACH;AAAA,MAAA,EAAA,CAEN;AAAA,IAAA,EAAA,CAEN;AAAA,EAAA,GAEN;AAEN;"}
1
+ {"version":3,"file":"StorageAuthSettings.js","sources":["../../../../src/components/Storage/StorageAuthSettings/StorageAuthSettings.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\r\nimport { storageOptionField } from '../../../@types/storages';\r\nimport Tristate from '../../common/form/Tristate/Tristate';\r\nimport Icon from '../../common/Icon/Icon';\r\nimport classes from '../AddStorage/AddStorage.module.scss';\r\nimport StorageSettings from '../StorageSettings/StorageSettings';\r\nimport { startStorageAuthorize, getStorageAuthorizeStatus, cancelStorageAuthorize } from '../../../services/storage';\r\n\r\ninterface StorageAuthSettingsProps {\r\n storageType: string;\r\n fields: storageOptionField[];\r\n settings: Record<string, string | number | boolean>;\r\n authTypes: string[];\r\n errors: Record<string, string>;\r\n currentAuthType: string;\r\n onUpdate: (newSettings: StorageAuthSettingsProps['settings']) => void;\r\n onAuthTypeChange: (authType: string) => void;\r\n}\r\n\r\ntype OAuthStatus = 'idle' | 'authorizing' | 'success' | 'error';\r\n\r\nconst StorageAuthSettings = ({\r\n storageType,\r\n fields,\r\n settings,\r\n authTypes,\r\n currentAuthType,\r\n errors,\r\n onUpdate,\r\n onAuthTypeChange,\r\n}: StorageAuthSettingsProps) => {\r\n const [showAdvanced, setShowAdvanced] = useState(true);\r\n const [showOAuthDoc, setShowOAuthDoc] = useState(false);\r\n\r\n // OAuth auto-authorize state\r\n const [oauthStatus, setOauthStatus] = useState<OAuthStatus>('idle');\r\n const [authSessionId, setAuthSessionId] = useState<string | null>(null);\r\n const [authUrl, setAuthUrl] = useState<string | null>(null);\r\n const [authError, setAuthError] = useState<string | null>(null);\r\n const pollingRef = useRef<ReturnType<typeof setInterval> | null>(null);\r\n\r\n const installType = (window as any).plutonInstallType;\r\n const isDesktop = installType === 'binary' || installType === 'dev';\r\n\r\n console.log('availableAuthTypes :', fields, authTypes, currentAuthType);\r\n\r\n useEffect(() => {\r\n if (!currentAuthType && authTypes.length > 0) {\r\n onAuthTypeChange(authTypes[0]);\r\n }\r\n }, [authTypes, currentAuthType, onAuthTypeChange]);\r\n\r\n // Cleanup polling on unmount\r\n useEffect(() => {\r\n return () => {\r\n if (pollingRef.current) {\r\n clearInterval(pollingRef.current);\r\n }\r\n };\r\n }, []);\r\n\r\n const stopPolling = useCallback(() => {\r\n if (pollingRef.current) {\r\n clearInterval(pollingRef.current);\r\n pollingRef.current = null;\r\n }\r\n }, []);\r\n\r\n const startOAuthAuthorize = useCallback(async () => {\r\n setOauthStatus('authorizing');\r\n setAuthUrl(null);\r\n setAuthError(null);\r\n\r\n try {\r\n const { sessionId } = await startStorageAuthorize(storageType);\r\n setAuthSessionId(sessionId);\r\n\r\n // Start polling every 2 seconds\r\n pollingRef.current = setInterval(async () => {\r\n try {\r\n const result = await getStorageAuthorizeStatus(sessionId);\r\n\r\n if (result.authUrl) {\r\n setAuthUrl(result.authUrl);\r\n }\r\n\r\n if (result.status === 'success' && result.token) {\r\n stopPolling();\r\n setOauthStatus('success');\r\n onUpdate({ ...settings, token: result.token });\r\n } else if (result.status === 'error') {\r\n stopPolling();\r\n setOauthStatus('error');\r\n setAuthError(result.error || 'Authorization failed');\r\n }\r\n } catch (err: any) {\r\n stopPolling();\r\n setOauthStatus('error');\r\n setAuthError(err?.message || 'Failed to check authorization status');\r\n }\r\n }, 2000);\r\n } catch (err: any) {\r\n setOauthStatus('error');\r\n setAuthError(err?.message || 'Failed to start authorization');\r\n }\r\n }, [storageType, settings, onUpdate, stopPolling]);\r\n\r\n const handleCancelAuthorize = useCallback(async () => {\r\n stopPolling();\r\n if (authSessionId) {\r\n try {\r\n await cancelStorageAuthorize(authSessionId);\r\n } catch {\r\n // Ignore cancel errors\r\n }\r\n }\r\n setOauthStatus('idle');\r\n setAuthSessionId(null);\r\n setAuthUrl(null);\r\n setAuthError(null);\r\n }, [authSessionId, stopPolling]);\r\n\r\n return (\r\n <div className={classes.authSettings}>\r\n <div\r\n className={`${classes.advancedButton} ${showAdvanced ? classes.advancedButtonActive : ''}`}\r\n onClick={() => setShowAdvanced(!showAdvanced)}\r\n >\r\n <Icon type={'authentication'} size={14} />\r\n <span>{storageType === 'local' ? 'Local Storage Setup' : 'Account Authentication'}</span>\r\n <Icon type={showAdvanced ? 'caret-up' : 'caret-down'} />\r\n </div>\r\n {showAdvanced && (\r\n <div className={classes.advancedOptions}>\r\n {showAdvanced && authTypes.length > 1 && (\r\n <div className={classes.field}>\r\n <Tristate\r\n label={'Authentication Type'}\r\n inline={true}\r\n fieldValue={currentAuthType}\r\n options={[\r\n { label: 'User (oAuth)', value: 'oauth', disabled: authTypes.includes('oauth') === false },\r\n { label: 'User/Pass', value: 'password', disabled: authTypes.includes('password') === false },\r\n { label: 'App/Client', value: 'client', disabled: authTypes.includes('client') === false },\r\n ]}\r\n hint={\r\n 'User (oAuth): Use the generated Link to login to your account and authorize the App.\\n Username/Password: Your own Username/Password will be used to backup. \\n App/Client: Provide App/Client keys that can be found in your cloud storage account dashboard'\r\n }\r\n onUpdate={(newVal: string) => onAuthTypeChange(newVal)}\r\n />\r\n </div>\r\n )}\r\n <StorageSettings\r\n fields={fields.filter((f) => f.authFieldType === currentAuthType)}\r\n settings={settings}\r\n onUpdate={(newSettings) => onUpdate(newSettings)}\r\n errors={errors}\r\n />\r\n\r\n {currentAuthType === 'oauth' && isDesktop && oauthStatus === 'idle' && (\r\n <div className={classes.oauthButton}>\r\n <button className={classes.oauthAuthorizeBtn} onClick={startOAuthAuthorize}>\r\n <Icon type={'key'} size={14} /> Authorize & Get Access Token\r\n </button>\r\n </div>\r\n )}\r\n\r\n {currentAuthType === 'oauth' && isDesktop && oauthStatus !== 'idle' && (\r\n <div className={`${classes.oauthContainer} ${classes[oauthStatus]}`}>\r\n {oauthStatus === 'authorizing' && (\r\n <div className={classes.oauthProgress}>\r\n <p>\r\n <strong>Waiting for authorization...</strong>\r\n <br />A browser window should have opened. Please authorize the connection in your browser.\r\n </p>\r\n {authUrl && (\r\n <p>\r\n If the browser didn't open automatically,{' '}\r\n <a href={authUrl} target=\"_blank\" rel=\"noopener noreferrer\">\r\n click here to authorize\r\n </a>\r\n .\r\n </p>\r\n )}\r\n <button className={classes.oauthInnerBtn} onClick={handleCancelAuthorize}>\r\n Cancel\r\n </button>\r\n </div>\r\n )}\r\n {oauthStatus === 'success' && (\r\n <div className={classes.oauthProgress}>\r\n <p>\r\n <Icon type={'check'} size={14} /> <strong>Authorization successful!</strong> Token has been automatically filled in.\r\n </p>\r\n </div>\r\n )}\r\n {oauthStatus === 'error' && (\r\n <div className={classes.oauthProgress}>\r\n <p>\r\n <strong>Authorization failed:</strong> {authError}\r\n </p>\r\n <button className={classes.oauthInnerBtn} onClick={startOAuthAuthorize}>\r\n <Icon type={'key'} size={14} /> Try Again\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n\r\n {currentAuthType === 'oauth' && !isDesktop && (\r\n <div className={classes.oauthDoc}>\r\n <h4 onClick={() => setShowOAuthDoc(!showOAuthDoc)}>\r\n <Icon type={'key'} size={14} /> Acquiring the OAuth Access Token\r\n <button>\r\n <Icon type={showOAuthDoc ? 'caret-up' : 'caret-down'} />\r\n </button>\r\n </h4>\r\n {showOAuthDoc && (\r\n <>\r\n <p>\r\n <strong>Step 1:</strong> On a machine with a browser,{' '}\r\n <a href=\"https://rclone.org/downloads/\" target=\"_blank\">\r\n install rclone\r\n </a>{' '}\r\n and execute this command in the CLI: <code className={classes.codeBlock}>rclone authorize {storageType}</code>\r\n </p>\r\n <p>\r\n <strong>Step 2:</strong> A browser window will open where you will need to authorize Rclone to connect to your{' '}\r\n {storageType} account. Authorize the connection.\r\n </p>\r\n <p>\r\n <strong>Step 3:</strong> Once authorized, the cli where you ran the command, should display a message similar to this:\r\n <code className={classes.codeBlock}>\r\n {`Paste the following into your remote machine --->`}\r\n <strong>{`{\"access_token\":\"....\",\"token_type\":\"bearer...}`}</strong>\r\n {`<---End paste`}\r\n </code>\r\n Copy everything between <code>{`--->`}</code> and <code>{`<---`}</code>. Eg:{' '}\r\n <code>{`{\"access_token\":\"....\",\"token_type\":\"bearer...}`}</code>\r\n </p>\r\n <p>\r\n <strong>Step 4:</strong> Paste the copied content in the <strong>OAuth Access Token</strong> field above.\r\n </p>\r\n <p>\r\n <strong>Step 5:</strong> If you no longer need Rclone, you can safely remove it from your system.\r\n </p>\r\n </>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\nexport default StorageAuthSettings;\r\n"],"names":["StorageAuthSettings","storageType","fields","settings","authTypes","currentAuthType","errors","onUpdate","onAuthTypeChange","showAdvanced","setShowAdvanced","useState","showOAuthDoc","setShowOAuthDoc","oauthStatus","setOauthStatus","authSessionId","setAuthSessionId","authUrl","setAuthUrl","authError","setAuthError","pollingRef","useRef","installType","isDesktop","useEffect","stopPolling","useCallback","startOAuthAuthorize","sessionId","startStorageAuthorize","result","getStorageAuthorizeStatus","err","handleCancelAuthorize","cancelStorageAuthorize","jsxs","classes","jsx","Icon","Tristate","newVal","StorageSettings","f","newSettings","Fragment"],"mappings":";;;;;;;AAqBA,MAAMA,IAAsB,CAAC;AAAA,EAC1B,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AACH,MAAgC;AAC7B,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAI,GAC/C,CAACC,GAAcC,CAAe,IAAIF,EAAS,EAAK,GAGhD,CAACG,GAAaC,CAAc,IAAIJ,EAAsB,MAAM,GAC5D,CAACK,GAAeC,CAAgB,IAAIN,EAAwB,IAAI,GAChE,CAACO,GAASC,CAAU,IAAIR,EAAwB,IAAI,GACpD,CAACS,GAAWC,CAAY,IAAIV,EAAwB,IAAI,GACxDW,IAAaC,EAA8C,IAAI,GAE/DC,IAAe,OAAe,mBAC9BC,IAAYD,MAAgB,YAAYA,MAAgB;AAE9D,UAAQ,IAAI,wBAAwBtB,GAAQE,GAAWC,CAAe,GAEtEqB,EAAU,MAAM;AACb,IAAI,CAACrB,KAAmBD,EAAU,SAAS,KACxCI,EAAiBJ,EAAU,CAAC,CAAC;AAAA,EAEnC,GAAG,CAACA,GAAWC,GAAiBG,CAAgB,CAAC,GAGjDkB,EAAU,MACA,MAAM;AACV,IAAIJ,EAAW,WACZ,cAAcA,EAAW,OAAO;AAAA,EAEtC,G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AE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAOF,QAAA,MAAM,IAAI,GAAI,uCAAuE,SAAS,4CAw9C7F,CAAC;AAmBF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/components/common/Icon/Icon.tsx"],"names":[],"mappings":"AAEA,KAAK,SAAS,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAOF,QAAA,MAAM,IAAI,GAAI,uCAAuE,SAAS,4CAw+C7F,CAAC;AAmBF,eAAe,IAAI,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs as e, jsx as a } from "react/jsx-runtime";
2
- const r = ({ type: c, color: l = "currentColor", size: h = 16, title: d = "", classes: t = "" }) => /* @__PURE__ */ e("span", { className: `icon ${t}`, title: d, children: [
2
+ const r = ({ type: c, color: l = "currentColor", size: h = 16, title: t = "", classes: d = "" }) => /* @__PURE__ */ e("span", { className: `icon ${d}`, title: t, children: [
3
3
  c === "logo" && /* @__PURE__ */ a(i, { size: h, viewBox: "0 0 120 120", children: /* @__PURE__ */ a(
4
4
  "path",
5
5
  {
@@ -1364,6 +1364,20 @@ const r = ({ type: c, color: l = "currentColor", size: h = 16, title: d = "", cl
1364
1364
  fill: "#338574",
1365
1365
  d: "M11 1H1c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1M9.5 9h-4c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h4c.28 0 .5.22.5.5s-.22.5-.5.5m-7 .12a.62.62 0 0 1-.44-.18a.63.63 0 0 1 0-.88L4.12 6L2.06 3.94a.63.63 0 0 1 0-.88c.24-.24.64-.24.88 0L5.09 5.2c.44.44.44 1.15 0 1.59L2.94 8.94a.62.62 0 0 1-.44.18"
1366
1366
  }
1367
+ ) }),
1368
+ c === "discord" && /* @__PURE__ */ a(i, { size: h, viewBox: "0 0 256 199", children: /* @__PURE__ */ a(
1369
+ "path",
1370
+ {
1371
+ fill: "#5865f2",
1372
+ d: "M216.856 16.597A208.5 208.5 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046q-29.538-4.442-58.533 0c-1.832-4.4-4.55-9.933-6.846-14.046a207.8 207.8 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161 161 0 0 0 79.735 175.3a136.4 136.4 0 0 1-21.846-10.632a109 109 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a132 132 0 0 0 5.355 4.237a136 136 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848c21.142-6.58 42.646-16.637 64.815-33.213c5.316-56.288-9.08-105.09-38.056-148.36M85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2s23.236 11.804 23.015 26.2c.02 14.375-10.148 26.18-23.015 26.18m85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2c0 14.375-10.148 26.18-23.015 26.18"
1373
+ }
1374
+ ) }),
1375
+ c === "webhook" && /* @__PURE__ */ a(i, { size: h, viewBox: "0 0 24 24", children: /* @__PURE__ */ a(
1376
+ "path",
1377
+ {
1378
+ fill: l,
1379
+ d: "M7 21q-2.075 0-3.537-1.463T2 16q0-1.4.675-2.537t1.8-1.788q.525-.3 1.025.013t.5.862q0 .275-.112.5t-.313.325q-.7.375-1.137 1.075T4 16q0 1.25.875 2.125T7 19t2.125-.875T10 16q0-.425.238-.712T10.9 15h4.975q.2-.225.488-.363T17 14.5q.625 0 1.063.438T18.5 16t-.437 1.063T17 17.5q-.35 0-.638-.137T15.876 17H11.9q-.35 1.725-1.713 2.863T7 21m0-3.5q-.625 0-1.062-.437T5.5 16q0-.55.35-.95t.85-.525l2.35-3.9q-.725-.675-1.138-1.612T7.5 7q0-2.075 1.463-3.537T12.5 2q1.75 0 3.088 1.063T17.35 5.75q.125.475-.175.863t-.8.387q-.325 0-.612-.238t-.388-.587q-.275-.95-1.05-1.562T12.5 4q-1.25 0-2.125.875T9.5 7q0 .825.413 1.513T10.974 9.6q.35.2.438.5t-.088.6l-2.9 4.85q.05.125.063.225T8.5 16q0 .625-.437 1.063T7 17.5M17 21q-.65 0-1.263-.162T14.6 20.4q-.675-.375-.537-1.137t1.012-.763q.125 0 .275.05t.275.125q.325.175.663.25T17 19q1.25 0 2.125-.875T20 16t-.875-2.125T17 13q-.25 0-.475.038t-.45.112q-.4.125-.75.013t-.525-.388l-2.575-4.3q-.525-.1-.875-.5T11 7q0-.625.438-1.062T12.5 5.5t1.063.438T14 7v.213q0 .087-.05.212l2.175 3.65q.2-.05.425-.062T17 11q2.075 0 3.538 1.463T22 16t-1.463 3.538T17 21"
1380
+ }
1367
1381
  ) })
1368
1382
  ] }), i = ({ children: c, viewBox: l, size: h }) => /* @__PURE__ */ a(
1369
1383
  "svg",