@burdenoff/microfe-integrations 2026.527.2 → 2026.530.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/components/AddConnectionDialog.js +140 -133
- package/dist/integrations/components/AddConnectionDialog.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 +247 -233
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +10 -7
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +4 -0
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.js +1 -0
- package/dist/integrations/pages/IntegrationsUserLandingPage.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +12 -10
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +159 -154
- 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
|
@@ -7,8 +7,9 @@ import { ArrowLeft as l, Loader2 as u, Save as d, Shield as f } from "lucide-rea
|
|
|
7
7
|
import { useParams as p } from "react-router-dom";
|
|
8
8
|
import { usePermissions as m } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
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 _ = [
|
|
|
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 y(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 b(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 x(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,65 +85,65 @@ function S() {
|
|
|
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
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
128
|
/* @__PURE__ */ g("div", {
|
|
128
129
|
className: "flex items-center gap-4",
|
|
129
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
135
|
children: /* @__PURE__ */ h(l, { size: 20 })
|
|
135
136
|
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
|
|
136
137
|
className: "text-2xl font-bold text-foreground",
|
|
137
|
-
children:
|
|
138
|
+
children: w ? "Edit Provider" : "Add Provider"
|
|
138
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
148
|
/* @__PURE__ */ g("div", {
|
|
148
149
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
|
|
@@ -153,68 +154,68 @@ function S() {
|
|
|
153
154
|
className: "font-semibold text-foreground",
|
|
154
155
|
children: "Core details"
|
|
155
156
|
}),
|
|
156
|
-
!
|
|
157
|
-
htmlFor:
|
|
157
|
+
!w && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
158
|
+
htmlFor: U("key"),
|
|
158
159
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
159
160
|
children: "Key"
|
|
160
161
|
}), /* @__PURE__ */ h("input", {
|
|
161
|
-
id:
|
|
162
|
+
id: U("key"),
|
|
162
163
|
"aria-label": "Key",
|
|
163
|
-
value:
|
|
164
|
-
onChange: (e) =>
|
|
164
|
+
value: z.key,
|
|
165
|
+
onChange: (e) => W("key", e.target.value),
|
|
165
166
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm",
|
|
166
167
|
placeholder: "e.g. slack-user"
|
|
167
168
|
})] }),
|
|
168
169
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
169
|
-
htmlFor:
|
|
170
|
+
htmlFor: U("name"),
|
|
170
171
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
171
172
|
children: "Name"
|
|
172
173
|
}), /* @__PURE__ */ h("input", {
|
|
173
|
-
id:
|
|
174
|
+
id: U("name"),
|
|
174
175
|
"aria-label": "Name",
|
|
175
|
-
value:
|
|
176
|
-
onChange: (e) =>
|
|
176
|
+
value: z.name,
|
|
177
|
+
onChange: (e) => W("name", e.target.value),
|
|
177
178
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
178
179
|
})] }),
|
|
179
180
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
180
|
-
htmlFor:
|
|
181
|
+
htmlFor: U("description"),
|
|
181
182
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
182
183
|
children: "Description"
|
|
183
184
|
}), /* @__PURE__ */ h("textarea", {
|
|
184
|
-
id:
|
|
185
|
+
id: U("description"),
|
|
185
186
|
"aria-label": "Description",
|
|
186
|
-
value:
|
|
187
|
-
onChange: (e) =>
|
|
187
|
+
value: z.description,
|
|
188
|
+
onChange: (e) => W("description", e.target.value),
|
|
188
189
|
rows: 4,
|
|
189
190
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
190
191
|
})] }),
|
|
191
192
|
/* @__PURE__ */ g("div", {
|
|
192
193
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
193
194
|
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
194
|
-
htmlFor:
|
|
195
|
+
htmlFor: U("category"),
|
|
195
196
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
196
197
|
children: "Category"
|
|
197
198
|
}), /* @__PURE__ */ h("select", {
|
|
198
|
-
id:
|
|
199
|
+
id: U("category"),
|
|
199
200
|
"aria-label": "Category",
|
|
200
|
-
value:
|
|
201
|
-
onChange: (e) =>
|
|
201
|
+
value: z.category,
|
|
202
|
+
onChange: (e) => W("category", e.target.value),
|
|
202
203
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm",
|
|
203
|
-
children:
|
|
204
|
+
children: v.map((e) => /* @__PURE__ */ h("option", {
|
|
204
205
|
value: e,
|
|
205
206
|
children: e
|
|
206
207
|
}, e))
|
|
207
208
|
})] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
208
|
-
htmlFor:
|
|
209
|
+
htmlFor: U("authType"),
|
|
209
210
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
210
211
|
children: "Auth Type"
|
|
211
212
|
}), /* @__PURE__ */ h("select", {
|
|
212
|
-
id:
|
|
213
|
+
id: U("authType"),
|
|
213
214
|
"aria-label": "Auth Type",
|
|
214
|
-
value:
|
|
215
|
-
onChange: (e) =>
|
|
215
|
+
value: z.authType,
|
|
216
|
+
onChange: (e) => W("authType", e.target.value),
|
|
216
217
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm",
|
|
217
|
-
children:
|
|
218
|
+
children: y.map((e) => /* @__PURE__ */ h("option", {
|
|
218
219
|
value: e,
|
|
219
220
|
children: e
|
|
220
221
|
}, e))
|
|
@@ -223,73 +224,73 @@ function S() {
|
|
|
223
224
|
/* @__PURE__ */ g("div", {
|
|
224
225
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
225
226
|
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
226
|
-
htmlFor:
|
|
227
|
+
htmlFor: U("website"),
|
|
227
228
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
228
229
|
children: "Website"
|
|
229
230
|
}), /* @__PURE__ */ h("input", {
|
|
230
|
-
id:
|
|
231
|
+
id: U("website"),
|
|
231
232
|
"aria-label": "Website",
|
|
232
|
-
value:
|
|
233
|
-
onChange: (e) =>
|
|
233
|
+
value: z.website,
|
|
234
|
+
onChange: (e) => W("website", e.target.value),
|
|
234
235
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
235
236
|
})] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
236
|
-
htmlFor:
|
|
237
|
+
htmlFor: U("docsUrl"),
|
|
237
238
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
238
239
|
children: "Docs URL"
|
|
239
240
|
}), /* @__PURE__ */ h("input", {
|
|
240
|
-
id:
|
|
241
|
+
id: U("docsUrl"),
|
|
241
242
|
"aria-label": "Docs URL",
|
|
242
|
-
value:
|
|
243
|
-
onChange: (e) =>
|
|
243
|
+
value: z.docsUrl,
|
|
244
|
+
onChange: (e) => W("docsUrl", e.target.value),
|
|
244
245
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
245
246
|
})] })]
|
|
246
247
|
}),
|
|
247
248
|
/* @__PURE__ */ g("div", {
|
|
248
249
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
249
250
|
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
250
|
-
htmlFor:
|
|
251
|
+
htmlFor: U("pluginVersion"),
|
|
251
252
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
252
253
|
children: "Plugin version"
|
|
253
254
|
}), /* @__PURE__ */ h("input", {
|
|
254
|
-
id:
|
|
255
|
+
id: U("pluginVersion"),
|
|
255
256
|
"aria-label": "Plugin version",
|
|
256
|
-
value:
|
|
257
|
-
onChange: (e) =>
|
|
257
|
+
value: z.pluginVersion,
|
|
258
|
+
onChange: (e) => W("pluginVersion", e.target.value),
|
|
258
259
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
259
260
|
})] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
260
|
-
htmlFor:
|
|
261
|
+
htmlFor: U("displayOrder"),
|
|
261
262
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
262
263
|
children: "Display order"
|
|
263
264
|
}), /* @__PURE__ */ h("input", {
|
|
264
|
-
id:
|
|
265
|
+
id: U("displayOrder"),
|
|
265
266
|
"aria-label": "Display order",
|
|
266
267
|
type: "number",
|
|
267
|
-
value:
|
|
268
|
-
onChange: (e) =>
|
|
268
|
+
value: z.displayOrder,
|
|
269
|
+
onChange: (e) => W("displayOrder", e.target.value),
|
|
269
270
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
270
271
|
})] })]
|
|
271
272
|
}),
|
|
272
273
|
/* @__PURE__ */ g("div", {
|
|
273
274
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
274
275
|
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
275
|
-
htmlFor:
|
|
276
|
+
htmlFor: U("pluginAuthor"),
|
|
276
277
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
277
278
|
children: "Plugin author"
|
|
278
279
|
}), /* @__PURE__ */ h("input", {
|
|
279
|
-
id:
|
|
280
|
+
id: U("pluginAuthor"),
|
|
280
281
|
"aria-label": "Plugin author",
|
|
281
|
-
value:
|
|
282
|
-
onChange: (e) =>
|
|
282
|
+
value: z.pluginAuthor,
|
|
283
|
+
onChange: (e) => W("pluginAuthor", e.target.value),
|
|
283
284
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
284
285
|
})] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
285
|
-
htmlFor:
|
|
286
|
+
htmlFor: U("pluginRepository"),
|
|
286
287
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
287
288
|
children: "Repository"
|
|
288
289
|
}), /* @__PURE__ */ h("input", {
|
|
289
|
-
id:
|
|
290
|
+
id: U("pluginRepository"),
|
|
290
291
|
"aria-label": "Repository",
|
|
291
|
-
value:
|
|
292
|
-
onChange: (e) =>
|
|
292
|
+
value: z.pluginRepository,
|
|
293
|
+
onChange: (e) => W("pluginRepository", e.target.value),
|
|
293
294
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
294
295
|
})] })]
|
|
295
296
|
})
|
|
@@ -302,77 +303,81 @@ function S() {
|
|
|
302
303
|
children: "Runtime config"
|
|
303
304
|
}),
|
|
304
305
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
305
|
-
htmlFor:
|
|
306
|
+
htmlFor: U("baseUrl"),
|
|
306
307
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
307
308
|
children: "Base URL"
|
|
308
309
|
}), /* @__PURE__ */ h("input", {
|
|
309
|
-
id:
|
|
310
|
+
id: U("baseUrl"),
|
|
310
311
|
"aria-label": "Base URL",
|
|
311
|
-
value:
|
|
312
|
-
onChange: (e) =>
|
|
312
|
+
value: z.baseUrl,
|
|
313
|
+
onChange: (e) => W("baseUrl", e.target.value),
|
|
313
314
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
314
315
|
})] }),
|
|
315
316
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
316
|
-
htmlFor:
|
|
317
|
+
htmlFor: U("apiVersion"),
|
|
317
318
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
318
319
|
children: "API version"
|
|
319
320
|
}), /* @__PURE__ */ h("input", {
|
|
320
|
-
id:
|
|
321
|
+
id: U("apiVersion"),
|
|
321
322
|
"aria-label": "API version",
|
|
322
|
-
value:
|
|
323
|
-
onChange: (e) =>
|
|
323
|
+
value: z.apiVersion,
|
|
324
|
+
onChange: (e) => W("apiVersion", e.target.value),
|
|
324
325
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
325
326
|
})] }),
|
|
326
327
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
327
|
-
htmlFor:
|
|
328
|
+
htmlFor: U("defaultScopes"),
|
|
328
329
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
329
330
|
children: "Default scopes"
|
|
330
331
|
}), /* @__PURE__ */ h("input", {
|
|
331
|
-
id:
|
|
332
|
+
id: U("defaultScopes"),
|
|
332
333
|
"aria-label": "Default scopes",
|
|
333
|
-
value:
|
|
334
|
-
onChange: (e) =>
|
|
334
|
+
value: z.defaultScopes,
|
|
335
|
+
onChange: (e) => W("defaultScopes", e.target.value),
|
|
335
336
|
placeholder: "openid, profile, email",
|
|
336
337
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
337
338
|
})] }),
|
|
338
339
|
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
|
|
339
|
-
htmlFor:
|
|
340
|
+
htmlFor: U("supportedFeatures"),
|
|
340
341
|
className: "block text-sm font-medium mb-1.5 text-foreground",
|
|
341
342
|
children: "Supported features"
|
|
342
343
|
}), /* @__PURE__ */ h("input", {
|
|
343
|
-
id:
|
|
344
|
+
id: U("supportedFeatures"),
|
|
344
345
|
"aria-label": "Supported features",
|
|
345
|
-
value:
|
|
346
|
-
onChange: (e) =>
|
|
346
|
+
value: z.supportedFeatures,
|
|
347
|
+
onChange: (e) => W("supportedFeatures", e.target.value),
|
|
347
348
|
placeholder: "messages, files, events",
|
|
348
349
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm"
|
|
349
350
|
})] }),
|
|
350
|
-
/* @__PURE__ */ h(
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
[
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
children:
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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
|
+
})
|
|
369
374
|
}),
|
|
370
375
|
/* @__PURE__ */ g("label", {
|
|
371
376
|
className: "flex items-center gap-3 rounded-lg border border-border/50 bg-background px-3 py-2.5",
|
|
372
377
|
children: [/* @__PURE__ */ h("input", {
|
|
373
378
|
type: "checkbox",
|
|
374
|
-
checked:
|
|
375
|
-
onChange: (e) =>
|
|
379
|
+
checked: z.isEnabled,
|
|
380
|
+
onChange: (e) => W("isEnabled", e.target.checked),
|
|
376
381
|
"aria-label": "Provider enabled"
|
|
377
382
|
}), /* @__PURE__ */ h("span", {
|
|
378
383
|
className: "text-sm text-foreground",
|
|
@@ -388,54 +393,54 @@ function S() {
|
|
|
388
393
|
type: "button",
|
|
389
394
|
onClick: async () => {
|
|
390
395
|
try {
|
|
391
|
-
|
|
396
|
+
R("");
|
|
392
397
|
let e = {
|
|
393
|
-
name:
|
|
394
|
-
description:
|
|
395
|
-
icon:
|
|
396
|
-
color:
|
|
397
|
-
website:
|
|
398
|
-
docsUrl:
|
|
399
|
-
baseUrl:
|
|
400
|
-
apiVersion:
|
|
401
|
-
pluginVersion:
|
|
402
|
-
pluginAuthor:
|
|
403
|
-
pluginRepository:
|
|
404
|
-
displayOrder: Number(
|
|
405
|
-
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) => {
|
|
406
411
|
let t = e.trim();
|
|
407
412
|
return t ? [t] : [];
|
|
408
413
|
}),
|
|
409
|
-
supportedFeatures:
|
|
414
|
+
supportedFeatures: z.supportedFeatures.split(",").flatMap((e) => {
|
|
410
415
|
let t = e.trim();
|
|
411
416
|
return t ? [t] : [];
|
|
412
417
|
}),
|
|
413
|
-
oauthConfig:
|
|
414
|
-
availableScopes:
|
|
415
|
-
rateLimitConfig:
|
|
416
|
-
configSchema:
|
|
417
|
-
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
|
|
418
423
|
};
|
|
419
|
-
if (
|
|
424
|
+
if (w && C) await F(C, e), E?.(n(T, `providers/${C}`));
|
|
420
425
|
else {
|
|
421
|
-
let t = await
|
|
422
|
-
key:
|
|
423
|
-
category:
|
|
424
|
-
authType:
|
|
426
|
+
let t = await N({
|
|
427
|
+
key: z.key.trim(),
|
|
428
|
+
category: z.category,
|
|
429
|
+
authType: z.authType,
|
|
425
430
|
...e
|
|
426
431
|
});
|
|
427
|
-
|
|
432
|
+
E?.(n(T, `providers/${t?.id || ""}`));
|
|
428
433
|
}
|
|
429
434
|
} catch (e) {
|
|
430
|
-
|
|
435
|
+
R(e instanceof Error ? e.message : "Failed to save provider");
|
|
431
436
|
}
|
|
432
437
|
},
|
|
433
|
-
disabled:
|
|
438
|
+
disabled: P || I,
|
|
434
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",
|
|
435
|
-
children: [
|
|
440
|
+
children: [P || I ? /* @__PURE__ */ h(u, {
|
|
436
441
|
size: 16,
|
|
437
442
|
className: "animate-spin"
|
|
438
|
-
}) : /* @__PURE__ */ h(d, { size: 16 }),
|
|
443
|
+
}) : /* @__PURE__ */ h(d, { size: 16 }), w ? "Save Provider" : "Create Provider"]
|
|
439
444
|
})
|
|
440
445
|
})
|
|
441
446
|
]
|
|
@@ -458,6 +463,6 @@ function S() {
|
|
|
458
463
|
});
|
|
459
464
|
}
|
|
460
465
|
//#endregion
|
|
461
|
-
export {
|
|
466
|
+
export { C as ProviderEditorPage };
|
|
462
467
|
|
|
463
468
|
//# sourceMappingURL=ProviderEditorPage.js.map
|