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