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