@burdenoff/microfe-integrations 2026.525.3 → 2026.527.1
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/integrations/IntegrationsAdminRoutes.js +4 -3
- package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.js +4 -3
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +7 -4
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/ProviderCard.js +2 -0
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/hooks/useLogs.js.map +1 -1
- package/dist/integrations/hooks/useProviders.js.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +14 -2
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +8 -1
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.js +9 -1
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +11 -2
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +11 -5
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.js +6 -2
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +9 -2
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +13 -2
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +174 -172
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/dist/integrations/providers/IntegrationsProvider.js +1 -1
- package/dist/integrations/providers/IntegrationsProvider.js.map +1 -1
- package/dist/integrations/utils/constants.js.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@ import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
|
|
|
2
2
|
import { INTEGRATION_PERMISSIONS as t } from "../constants/permissions.js";
|
|
3
3
|
import { joinPath as n } from "../utils/navigation.js";
|
|
4
4
|
import { useInstallPlugin as r, useProvider as i, useUpdatePlugin as a } from "../hooks/useProviders.js";
|
|
5
|
-
import { useEffect as o,
|
|
6
|
-
import { ArrowLeft as
|
|
7
|
-
import { useParams as
|
|
8
|
-
import { usePermissions as
|
|
9
|
-
import { jsx as
|
|
5
|
+
import { useEffect as o, useState as s } from "react";
|
|
6
|
+
import { ArrowLeft as c, Loader2 as l, Save as u, Shield as d } from "lucide-react";
|
|
7
|
+
import { useParams as f } from "react-router-dom";
|
|
8
|
+
import { usePermissions as p } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
10
|
//#region src/integrations/pages/ProviderEditorPage.tsx
|
|
11
|
-
var
|
|
11
|
+
var g = [
|
|
12
12
|
"COMMUNICATION",
|
|
13
13
|
"PRODUCTIVITY",
|
|
14
14
|
"CLOUD_STORAGE",
|
|
@@ -20,14 +20,14 @@ var _ = [
|
|
|
20
20
|
"PAYMENT",
|
|
21
21
|
"ANALYTICS",
|
|
22
22
|
"CUSTOM"
|
|
23
|
-
],
|
|
23
|
+
], _ = [
|
|
24
24
|
"OAUTH2",
|
|
25
25
|
"API_KEY",
|
|
26
26
|
"BASIC_AUTH",
|
|
27
27
|
"BEARER_TOKEN",
|
|
28
28
|
"CUSTOM"
|
|
29
29
|
];
|
|
30
|
-
function
|
|
30
|
+
function v(e, t) {
|
|
31
31
|
let n = e.trim();
|
|
32
32
|
if (n) try {
|
|
33
33
|
return JSON.parse(n);
|
|
@@ -35,7 +35,7 @@ function y(e, t) {
|
|
|
35
35
|
throw Error(`${t} must be valid JSON`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function y(e) {
|
|
39
39
|
return {
|
|
40
40
|
communication: "COMMUNICATION",
|
|
41
41
|
productivity: "PRODUCTIVITY",
|
|
@@ -50,7 +50,7 @@ function b(e) {
|
|
|
50
50
|
other: "CUSTOM"
|
|
51
51
|
}[e || ""] || "CUSTOM";
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function b(e) {
|
|
54
54
|
return {
|
|
55
55
|
oauth2: "OAUTH2",
|
|
56
56
|
api_key: "API_KEY",
|
|
@@ -58,8 +58,8 @@ function x(e) {
|
|
|
58
58
|
bearer_token: "BEARER_TOKEN"
|
|
59
59
|
}[e || ""] || "CUSTOM";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
let { providerId:
|
|
61
|
+
function x() {
|
|
62
|
+
let { providerId: x } = f(), S = !!x, { basePath: C = "/", navigate: w } = e(), { hasPermission: T, isLoading: E } = p(), D = T(t.PROVIDER_CREATE), O = T(t.PROVIDER_UPDATE), { provider: k, loading: A } = i(x ?? ""), { installPlugin: j, loading: M } = r(), { updatePlugin: N, loading: P } = a(), [F, I] = s(""), [L, R] = s({
|
|
63
63
|
key: "",
|
|
64
64
|
name: "",
|
|
65
65
|
description: "",
|
|
@@ -84,252 +84,248 @@ function S() {
|
|
|
84
84
|
isEnabled: !0
|
|
85
85
|
});
|
|
86
86
|
o(() => {
|
|
87
|
-
!
|
|
88
|
-
key:
|
|
89
|
-
name:
|
|
90
|
-
description:
|
|
91
|
-
category:
|
|
92
|
-
authType:
|
|
93
|
-
icon:
|
|
94
|
-
color:
|
|
95
|
-
website:
|
|
96
|
-
docsUrl:
|
|
97
|
-
baseUrl:
|
|
98
|
-
apiVersion:
|
|
99
|
-
pluginVersion:
|
|
100
|
-
pluginAuthor:
|
|
101
|
-
pluginRepository:
|
|
102
|
-
displayOrder: String(
|
|
103
|
-
defaultScopes: (
|
|
104
|
-
supportedFeatures: (
|
|
105
|
-
oauthConfig:
|
|
106
|
-
availableScopes:
|
|
107
|
-
rateLimitConfig:
|
|
108
|
-
configSchema:
|
|
109
|
-
isEnabled:
|
|
87
|
+
!k || !S || R({
|
|
88
|
+
key: k.key,
|
|
89
|
+
name: k.name,
|
|
90
|
+
description: k.description || "",
|
|
91
|
+
category: y(k.category),
|
|
92
|
+
authType: b(k.authType),
|
|
93
|
+
icon: k.icon || "",
|
|
94
|
+
color: k.color || "",
|
|
95
|
+
website: k.website || "",
|
|
96
|
+
docsUrl: k.docsUrl || "",
|
|
97
|
+
baseUrl: k.baseUrl || "",
|
|
98
|
+
apiVersion: k.apiVersion || "",
|
|
99
|
+
pluginVersion: k.pluginVersion || "1.0.0",
|
|
100
|
+
pluginAuthor: k.pluginAuthor || "",
|
|
101
|
+
pluginRepository: k.pluginRepository || "",
|
|
102
|
+
displayOrder: String(k.displayOrder || 0),
|
|
103
|
+
defaultScopes: (k.defaultScopes || []).join(", "),
|
|
104
|
+
supportedFeatures: (k.supportedFeatures || []).join(", "),
|
|
105
|
+
oauthConfig: k.oauthConfig ? JSON.stringify(k.oauthConfig, null, 2) : "",
|
|
106
|
+
availableScopes: k.availableScopes ? JSON.stringify(k.availableScopes, null, 2) : "",
|
|
107
|
+
rateLimitConfig: k.rateLimitConfig ? JSON.stringify(k.rateLimitConfig, null, 2) : "",
|
|
108
|
+
configSchema: k.configSchema ? JSON.stringify(k.configSchema, null, 2) : "",
|
|
109
|
+
isEnabled: k.isEnabled
|
|
110
110
|
});
|
|
111
|
-
}, [
|
|
112
|
-
let
|
|
113
|
-
|
|
114
|
-
k,
|
|
115
|
-
C
|
|
116
|
-
]), V = (e, t) => {
|
|
117
|
-
z((n) => ({
|
|
111
|
+
}, [S, k]);
|
|
112
|
+
let z = S ? O : D, B = (e, t) => {
|
|
113
|
+
R((n) => ({
|
|
118
114
|
...n,
|
|
119
115
|
[e]: t
|
|
120
116
|
}));
|
|
121
117
|
};
|
|
122
|
-
return
|
|
118
|
+
return E || S && A ? /* @__PURE__ */ m("div", {
|
|
123
119
|
className: "flex items-center justify-center py-20",
|
|
124
|
-
children: /* @__PURE__ */
|
|
120
|
+
children: /* @__PURE__ */ m(l, {
|
|
125
121
|
size: 44,
|
|
126
122
|
className: "animate-spin text-primary"
|
|
127
123
|
})
|
|
128
|
-
}) :
|
|
124
|
+
}) : z ? /* @__PURE__ */ h("div", {
|
|
129
125
|
className: "space-y-6 p-6 max-w-5xl mx-auto",
|
|
130
126
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ h("div", {
|
|
132
128
|
className: "flex items-center gap-4",
|
|
133
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ m("button", {
|
|
134
130
|
type: "button",
|
|
135
|
-
onClick: () =>
|
|
131
|
+
onClick: () => w?.(n(C, "providers")),
|
|
136
132
|
className: "p-2.5 hover:bg-accent rounded-lg transition-all",
|
|
137
133
|
"aria-label": "Back to providers",
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
-
}), /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ m(c, { size: 20 })
|
|
135
|
+
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
|
|
140
136
|
className: "text-2xl font-bold text-foreground",
|
|
141
|
-
children:
|
|
142
|
-
}), /* @__PURE__ */
|
|
137
|
+
children: S ? "Edit Provider" : "Add Provider"
|
|
138
|
+
}), /* @__PURE__ */ m("p", {
|
|
143
139
|
className: "text-sm text-muted-foreground mt-1",
|
|
144
140
|
children: "Configure catalog metadata, auth configuration, and runtime settings."
|
|
145
141
|
})] })]
|
|
146
142
|
}),
|
|
147
|
-
|
|
143
|
+
F && /* @__PURE__ */ m("div", {
|
|
148
144
|
className: "rounded-xl border border-border-default bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
149
|
-
children:
|
|
145
|
+
children: F
|
|
150
146
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ h("div", {
|
|
152
148
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ h("div", {
|
|
154
150
|
className: "rounded-xl border border-border/50 bg-card p-5 space-y-4",
|
|
155
151
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ m("h2", {
|
|
157
153
|
className: "font-semibold text-foreground",
|
|
158
154
|
children: "Core details"
|
|
159
155
|
}),
|
|
160
|
-
!
|
|
156
|
+
!S && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
161
157
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
162
158
|
children: "Key"
|
|
163
|
-
}), /* @__PURE__ */
|
|
164
|
-
value:
|
|
165
|
-
onChange: (e) =>
|
|
159
|
+
}), /* @__PURE__ */ m("input", {
|
|
160
|
+
value: L.key,
|
|
161
|
+
onChange: (e) => B("key", e.target.value),
|
|
166
162
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm",
|
|
167
163
|
placeholder: "e.g. slack-user"
|
|
168
164
|
})] }),
|
|
169
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
170
166
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
171
167
|
children: "Name"
|
|
172
|
-
}), /* @__PURE__ */
|
|
173
|
-
value:
|
|
174
|
-
onChange: (e) =>
|
|
168
|
+
}), /* @__PURE__ */ m("input", {
|
|
169
|
+
value: L.name,
|
|
170
|
+
onChange: (e) => B("name", e.target.value),
|
|
175
171
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
176
172
|
})] }),
|
|
177
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
178
174
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
179
175
|
children: "Description"
|
|
180
|
-
}), /* @__PURE__ */
|
|
181
|
-
value:
|
|
182
|
-
onChange: (e) =>
|
|
176
|
+
}), /* @__PURE__ */ m("textarea", {
|
|
177
|
+
value: L.description,
|
|
178
|
+
onChange: (e) => B("description", e.target.value),
|
|
183
179
|
rows: 4,
|
|
184
180
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
185
181
|
})] }),
|
|
186
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ h("div", {
|
|
187
183
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
189
185
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
190
186
|
children: "Category"
|
|
191
|
-
}), /* @__PURE__ */
|
|
192
|
-
value:
|
|
193
|
-
onChange: (e) =>
|
|
187
|
+
}), /* @__PURE__ */ m("select", {
|
|
188
|
+
value: L.category,
|
|
189
|
+
onChange: (e) => B("category", e.target.value),
|
|
194
190
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm",
|
|
195
|
-
children:
|
|
191
|
+
children: g.map((e) => /* @__PURE__ */ m("option", {
|
|
196
192
|
value: e,
|
|
197
193
|
children: e
|
|
198
194
|
}, e))
|
|
199
|
-
})] }), /* @__PURE__ */
|
|
195
|
+
})] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
200
196
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
201
197
|
children: "Auth Type"
|
|
202
|
-
}), /* @__PURE__ */
|
|
203
|
-
value:
|
|
204
|
-
onChange: (e) =>
|
|
198
|
+
}), /* @__PURE__ */ m("select", {
|
|
199
|
+
value: L.authType,
|
|
200
|
+
onChange: (e) => B("authType", e.target.value),
|
|
205
201
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm",
|
|
206
|
-
children:
|
|
202
|
+
children: _.map((e) => /* @__PURE__ */ m("option", {
|
|
207
203
|
value: e,
|
|
208
204
|
children: e
|
|
209
205
|
}, e))
|
|
210
206
|
})] })]
|
|
211
207
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ h("div", {
|
|
213
209
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
215
211
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
216
212
|
children: "Website"
|
|
217
|
-
}), /* @__PURE__ */
|
|
218
|
-
value:
|
|
219
|
-
onChange: (e) =>
|
|
213
|
+
}), /* @__PURE__ */ m("input", {
|
|
214
|
+
value: L.website,
|
|
215
|
+
onChange: (e) => B("website", e.target.value),
|
|
220
216
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
221
|
-
})] }), /* @__PURE__ */
|
|
217
|
+
})] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
222
218
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
223
219
|
children: "Docs URL"
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
-
value:
|
|
226
|
-
onChange: (e) =>
|
|
220
|
+
}), /* @__PURE__ */ m("input", {
|
|
221
|
+
value: L.docsUrl,
|
|
222
|
+
onChange: (e) => B("docsUrl", e.target.value),
|
|
227
223
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
228
224
|
})] })]
|
|
229
225
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ h("div", {
|
|
231
227
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
233
229
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
234
230
|
children: "Plugin version"
|
|
235
|
-
}), /* @__PURE__ */
|
|
236
|
-
value:
|
|
237
|
-
onChange: (e) =>
|
|
231
|
+
}), /* @__PURE__ */ m("input", {
|
|
232
|
+
value: L.pluginVersion,
|
|
233
|
+
onChange: (e) => B("pluginVersion", e.target.value),
|
|
238
234
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
239
|
-
})] }), /* @__PURE__ */
|
|
235
|
+
})] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
240
236
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
241
237
|
children: "Display order"
|
|
242
|
-
}), /* @__PURE__ */
|
|
238
|
+
}), /* @__PURE__ */ m("input", {
|
|
243
239
|
type: "number",
|
|
244
|
-
value:
|
|
245
|
-
onChange: (e) =>
|
|
240
|
+
value: L.displayOrder,
|
|
241
|
+
onChange: (e) => B("displayOrder", e.target.value),
|
|
246
242
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
247
243
|
})] })]
|
|
248
244
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ h("div", {
|
|
250
246
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
247
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
252
248
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
253
249
|
children: "Plugin author"
|
|
254
|
-
}), /* @__PURE__ */
|
|
255
|
-
value:
|
|
256
|
-
onChange: (e) =>
|
|
250
|
+
}), /* @__PURE__ */ m("input", {
|
|
251
|
+
value: L.pluginAuthor,
|
|
252
|
+
onChange: (e) => B("pluginAuthor", e.target.value),
|
|
257
253
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
258
|
-
})] }), /* @__PURE__ */
|
|
254
|
+
})] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
259
255
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
260
256
|
children: "Repository"
|
|
261
|
-
}), /* @__PURE__ */
|
|
262
|
-
value:
|
|
263
|
-
onChange: (e) =>
|
|
257
|
+
}), /* @__PURE__ */ m("input", {
|
|
258
|
+
value: L.pluginRepository,
|
|
259
|
+
onChange: (e) => B("pluginRepository", e.target.value),
|
|
264
260
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
265
261
|
})] })]
|
|
266
262
|
})
|
|
267
263
|
]
|
|
268
|
-
}), /* @__PURE__ */
|
|
264
|
+
}), /* @__PURE__ */ h("div", {
|
|
269
265
|
className: "rounded-xl border border-border/50 bg-card p-5 space-y-4",
|
|
270
266
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ m("h2", {
|
|
272
268
|
className: "font-semibold text-foreground",
|
|
273
269
|
children: "Runtime config"
|
|
274
270
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
276
272
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
277
273
|
children: "Base URL"
|
|
278
|
-
}), /* @__PURE__ */
|
|
279
|
-
value:
|
|
280
|
-
onChange: (e) =>
|
|
274
|
+
}), /* @__PURE__ */ m("input", {
|
|
275
|
+
value: L.baseUrl,
|
|
276
|
+
onChange: (e) => B("baseUrl", e.target.value),
|
|
281
277
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
282
278
|
})] }),
|
|
283
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
284
280
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
285
281
|
children: "API version"
|
|
286
|
-
}), /* @__PURE__ */
|
|
287
|
-
value:
|
|
288
|
-
onChange: (e) =>
|
|
282
|
+
}), /* @__PURE__ */ m("input", {
|
|
283
|
+
value: L.apiVersion,
|
|
284
|
+
onChange: (e) => B("apiVersion", e.target.value),
|
|
289
285
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
290
286
|
})] }),
|
|
291
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
292
288
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
293
289
|
children: "Default scopes"
|
|
294
|
-
}), /* @__PURE__ */
|
|
295
|
-
value:
|
|
296
|
-
onChange: (e) =>
|
|
290
|
+
}), /* @__PURE__ */ m("input", {
|
|
291
|
+
value: L.defaultScopes,
|
|
292
|
+
onChange: (e) => B("defaultScopes", e.target.value),
|
|
297
293
|
placeholder: "openid, profile, email",
|
|
298
294
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
299
295
|
})] }),
|
|
300
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
301
297
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
302
298
|
children: "Supported features"
|
|
303
|
-
}), /* @__PURE__ */
|
|
304
|
-
value:
|
|
305
|
-
onChange: (e) =>
|
|
299
|
+
}), /* @__PURE__ */ m("input", {
|
|
300
|
+
value: L.supportedFeatures,
|
|
301
|
+
onChange: (e) => B("supportedFeatures", e.target.value),
|
|
306
302
|
placeholder: "messages, files, events",
|
|
307
303
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
308
304
|
})] }),
|
|
309
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ m("div", {
|
|
310
306
|
className: "space-y-3",
|
|
311
307
|
children: [
|
|
312
308
|
["oauthConfig", "OAuth config JSON"],
|
|
313
309
|
["availableScopes", "Available scopes JSON"],
|
|
314
310
|
["rateLimitConfig", "Rate limit config JSON"],
|
|
315
311
|
["configSchema", "Config schema JSON"]
|
|
316
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
312
|
+
].map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
317
313
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
318
314
|
children: t
|
|
319
|
-
}), /* @__PURE__ */
|
|
320
|
-
value:
|
|
321
|
-
onChange: (t) =>
|
|
315
|
+
}), /* @__PURE__ */ m("textarea", {
|
|
316
|
+
value: L[e],
|
|
317
|
+
onChange: (t) => B(e, t.target.value),
|
|
322
318
|
rows: 4,
|
|
323
319
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm font-mono"
|
|
324
320
|
})] }, e))
|
|
325
321
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ h("label", {
|
|
327
323
|
className: "flex items-center gap-3 rounded-lg border border-border/50 bg-background px-3 py-2.5",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ m("input", {
|
|
329
325
|
type: "checkbox",
|
|
330
|
-
checked:
|
|
331
|
-
onChange: (e) =>
|
|
332
|
-
}), /* @__PURE__ */
|
|
326
|
+
checked: L.isEnabled,
|
|
327
|
+
onChange: (e) => B("isEnabled", e.target.checked)
|
|
328
|
+
}), /* @__PURE__ */ m("span", {
|
|
333
329
|
className: "text-sm text-foreground",
|
|
334
330
|
children: "Provider enabled"
|
|
335
331
|
})]
|
|
@@ -337,69 +333,75 @@ function S() {
|
|
|
337
333
|
]
|
|
338
334
|
})]
|
|
339
335
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ m("div", {
|
|
341
337
|
className: "flex justify-end",
|
|
342
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ h("button", {
|
|
343
339
|
type: "button",
|
|
344
340
|
onClick: async () => {
|
|
345
341
|
try {
|
|
346
|
-
|
|
342
|
+
I("");
|
|
347
343
|
let e = {
|
|
348
|
-
name:
|
|
349
|
-
description:
|
|
350
|
-
icon:
|
|
351
|
-
color:
|
|
352
|
-
website:
|
|
353
|
-
docsUrl:
|
|
354
|
-
baseUrl:
|
|
355
|
-
apiVersion:
|
|
356
|
-
pluginVersion:
|
|
357
|
-
pluginAuthor:
|
|
358
|
-
pluginRepository:
|
|
359
|
-
displayOrder: Number(
|
|
360
|
-
defaultScopes:
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
344
|
+
name: L.name.trim(),
|
|
345
|
+
description: L.description.trim() || void 0,
|
|
346
|
+
icon: L.icon.trim() || void 0,
|
|
347
|
+
color: L.color.trim() || void 0,
|
|
348
|
+
website: L.website.trim() || void 0,
|
|
349
|
+
docsUrl: L.docsUrl.trim() || void 0,
|
|
350
|
+
baseUrl: L.baseUrl.trim() || void 0,
|
|
351
|
+
apiVersion: L.apiVersion.trim() || void 0,
|
|
352
|
+
pluginVersion: L.pluginVersion.trim() || void 0,
|
|
353
|
+
pluginAuthor: L.pluginAuthor.trim() || void 0,
|
|
354
|
+
pluginRepository: L.pluginRepository.trim() || void 0,
|
|
355
|
+
displayOrder: Number(L.displayOrder || "0"),
|
|
356
|
+
defaultScopes: L.defaultScopes.split(",").flatMap((e) => {
|
|
357
|
+
let t = e.trim();
|
|
358
|
+
return t ? [t] : [];
|
|
359
|
+
}),
|
|
360
|
+
supportedFeatures: L.supportedFeatures.split(",").flatMap((e) => {
|
|
361
|
+
let t = e.trim();
|
|
362
|
+
return t ? [t] : [];
|
|
363
|
+
}),
|
|
364
|
+
oauthConfig: v(L.oauthConfig, "OAuth config"),
|
|
365
|
+
availableScopes: v(L.availableScopes, "Available scopes"),
|
|
366
|
+
rateLimitConfig: v(L.rateLimitConfig, "Rate limit config"),
|
|
367
|
+
configSchema: v(L.configSchema, "Config schema"),
|
|
368
|
+
isEnabled: L.isEnabled
|
|
367
369
|
};
|
|
368
|
-
if (
|
|
370
|
+
if (S && x) await N(x, e), w?.(n(C, `providers/${x}`));
|
|
369
371
|
else {
|
|
370
|
-
let t = await
|
|
371
|
-
key:
|
|
372
|
-
category:
|
|
373
|
-
authType:
|
|
372
|
+
let t = await j({
|
|
373
|
+
key: L.key.trim(),
|
|
374
|
+
category: L.category,
|
|
375
|
+
authType: L.authType,
|
|
374
376
|
...e
|
|
375
377
|
});
|
|
376
|
-
|
|
378
|
+
w?.(n(C, `providers/${t?.id || ""}`));
|
|
377
379
|
}
|
|
378
380
|
} catch (e) {
|
|
379
|
-
|
|
381
|
+
I(e instanceof Error ? e.message : "Failed to save provider");
|
|
380
382
|
}
|
|
381
383
|
},
|
|
382
|
-
disabled:
|
|
384
|
+
disabled: M || P,
|
|
383
385
|
className: "inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
|
|
384
|
-
children: [
|
|
386
|
+
children: [M || P ? /* @__PURE__ */ m(l, {
|
|
385
387
|
size: 16,
|
|
386
388
|
className: "animate-spin"
|
|
387
|
-
}) : /* @__PURE__ */
|
|
389
|
+
}) : /* @__PURE__ */ m(u, { size: 16 }), S ? "Save Provider" : "Create Provider"]
|
|
388
390
|
})
|
|
389
391
|
})
|
|
390
392
|
]
|
|
391
|
-
}) : /* @__PURE__ */
|
|
393
|
+
}) : /* @__PURE__ */ h("div", {
|
|
392
394
|
className: "flex flex-col items-center justify-center py-20 text-center p-6",
|
|
393
395
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ m(d, {
|
|
395
397
|
size: 48,
|
|
396
398
|
className: "text-muted-foreground mb-4"
|
|
397
399
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ m("h2", {
|
|
399
401
|
className: "text-xl font-bold text-foreground mb-2",
|
|
400
402
|
children: "Access Denied"
|
|
401
403
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ m("p", {
|
|
403
405
|
className: "text-sm text-muted-foreground max-w-md",
|
|
404
406
|
children: "You do not have permission to manage providers."
|
|
405
407
|
})
|
|
@@ -407,6 +409,6 @@ function S() {
|
|
|
407
409
|
});
|
|
408
410
|
}
|
|
409
411
|
//#endregion
|
|
410
|
-
export {
|
|
412
|
+
export { x as ProviderEditorPage };
|
|
411
413
|
|
|
412
414
|
//# sourceMappingURL=ProviderEditorPage.js.map
|