@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.
Files changed (28) hide show
  1. package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
  2. package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
  3. package/dist/integrations/components/AddConnectionDialog.js +278 -251
  4. package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
  5. package/dist/integrations/components/CredentialStorageSelector.js +56 -48
  6. package/dist/integrations/components/CredentialStorageSelector.js.map +1 -1
  7. package/dist/integrations/components/ProviderCard.js.map +1 -1
  8. package/dist/integrations/hooks/useProviders.js +22 -18
  9. package/dist/integrations/hooks/useProviders.js.map +1 -1
  10. package/dist/integrations/pages/AddConnectionWizard.js +254 -233
  11. package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
  12. package/dist/integrations/pages/ConnectionDetail.js +2 -1
  13. package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
  14. package/dist/integrations/pages/ConnectionLogs.js +114 -110
  15. package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
  16. package/dist/integrations/pages/ConnectionsList.js +116 -112
  17. package/dist/integrations/pages/ConnectionsList.js.map +1 -1
  18. package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
  19. package/dist/integrations/pages/IntegrationsSettings.js +3 -0
  20. package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
  21. package/dist/integrations/pages/ProviderCatalog.js +10 -10
  22. package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
  23. package/dist/integrations/pages/ProviderDetail.js.map +1 -1
  24. package/dist/integrations/pages/ProviderEditorPage.js +233 -179
  25. package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
  26. package/dist/integrations/utils/constants.js +10 -1
  27. package/dist/integrations/utils/constants.js.map +1 -1
  28. 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, 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";
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 g = [
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 v(e, t) {
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 y(e) {
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 b(e) {
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 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({
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
- !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
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
- }, [S, k]);
112
- let z = S ? O : D, B = (e, t) => {
113
- R((n) => ({
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 E || S && A ? /* @__PURE__ */ m("div", {
119
+ return O || w && M ? /* @__PURE__ */ h("div", {
119
120
  className: "flex items-center justify-center py-20",
120
- children: /* @__PURE__ */ m(l, {
121
+ children: /* @__PURE__ */ h(u, {
121
122
  size: 44,
122
123
  className: "animate-spin text-primary"
123
124
  })
124
- }) : z ? /* @__PURE__ */ h("div", {
125
+ }) : V ? /* @__PURE__ */ g("div", {
125
126
  className: "space-y-6 p-6 max-w-5xl mx-auto",
126
127
  children: [
127
- /* @__PURE__ */ h("div", {
128
+ /* @__PURE__ */ g("div", {
128
129
  className: "flex items-center gap-4",
129
- children: [/* @__PURE__ */ m("button", {
130
+ children: [/* @__PURE__ */ h("button", {
130
131
  type: "button",
131
- onClick: () => w?.(n(C, "providers")),
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__ */ m(c, { size: 20 })
135
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
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: S ? "Edit Provider" : "Add Provider"
138
- }), /* @__PURE__ */ m("p", {
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
- F && /* @__PURE__ */ m("div", {
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: F
146
+ children: L
146
147
  }),
147
- /* @__PURE__ */ h("div", {
148
+ /* @__PURE__ */ g("div", {
148
149
  className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
149
- children: [/* @__PURE__ */ h("div", {
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__ */ m("h2", {
153
+ /* @__PURE__ */ h("h2", {
153
154
  className: "font-semibold text-foreground",
154
155
  children: "Core details"
155
156
  }),
156
- !S && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
160
- value: L.key,
161
- onChange: (e) => B("key", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
169
- value: L.name,
170
- onChange: (e) => B("name", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("textarea", {
177
- value: L.description,
178
- onChange: (e) => B("description", e.target.value),
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__ */ h("div", {
192
+ /* @__PURE__ */ g("div", {
183
193
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
184
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("select", {
188
- value: L.category,
189
- onChange: (e) => B("category", e.target.value),
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: g.map((e) => /* @__PURE__ */ m("option", {
204
+ children: v.map((e) => /* @__PURE__ */ h("option", {
192
205
  value: e,
193
206
  children: e
194
207
  }, e))
195
- })] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("select", {
199
- value: L.authType,
200
- onChange: (e) => B("authType", e.target.value),
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: _.map((e) => /* @__PURE__ */ m("option", {
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__ */ h("div", {
224
+ /* @__PURE__ */ g("div", {
209
225
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
210
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
214
- value: L.website,
215
- onChange: (e) => B("website", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
221
- value: L.docsUrl,
222
- onChange: (e) => B("docsUrl", e.target.value),
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__ */ h("div", {
248
+ /* @__PURE__ */ g("div", {
227
249
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
228
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
232
- value: L.pluginVersion,
233
- onChange: (e) => B("pluginVersion", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
264
+ }), /* @__PURE__ */ h("input", {
265
+ id: U("displayOrder"),
266
+ "aria-label": "Display order",
239
267
  type: "number",
240
- value: L.displayOrder,
241
- onChange: (e) => B("displayOrder", e.target.value),
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__ */ h("div", {
273
+ /* @__PURE__ */ g("div", {
246
274
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
247
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
251
- value: L.pluginAuthor,
252
- onChange: (e) => B("pluginAuthor", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
258
- value: L.pluginRepository,
259
- onChange: (e) => B("pluginRepository", e.target.value),
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__ */ h("div", {
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__ */ m("h2", {
301
+ /* @__PURE__ */ h("h2", {
268
302
  className: "font-semibold text-foreground",
269
303
  children: "Runtime config"
270
304
  }),
271
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
275
- value: L.baseUrl,
276
- onChange: (e) => B("baseUrl", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
283
- value: L.apiVersion,
284
- onChange: (e) => B("apiVersion", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
291
- value: L.defaultScopes,
292
- onChange: (e) => B("defaultScopes", e.target.value),
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__ */ h("div", { children: [/* @__PURE__ */ m("label", {
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__ */ m("input", {
300
- value: L.supportedFeatures,
301
- onChange: (e) => B("supportedFeatures", e.target.value),
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__ */ m("div", {
306
- className: "space-y-3",
307
- children: [
308
- ["oauthConfig", "OAuth config JSON"],
309
- ["availableScopes", "Available scopes JSON"],
310
- ["rateLimitConfig", "Rate limit config JSON"],
311
- ["configSchema", "Config schema JSON"]
312
- ].map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
313
- className: "block text-sm font-medium mb-1.5 text-foreground",
314
- children: t
315
- }), /* @__PURE__ */ m("textarea", {
316
- value: L[e],
317
- onChange: (t) => B(e, t.target.value),
318
- rows: 4,
319
- className: "w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm font-mono"
320
- })] }, e))
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__ */ h("label", {
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__ */ m("input", {
377
+ children: [/* @__PURE__ */ h("input", {
325
378
  type: "checkbox",
326
- checked: L.isEnabled,
327
- onChange: (e) => B("isEnabled", e.target.checked)
328
- }), /* @__PURE__ */ m("span", {
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__ */ m("div", {
390
+ /* @__PURE__ */ h("div", {
337
391
  className: "flex justify-end",
338
- children: /* @__PURE__ */ h("button", {
392
+ children: /* @__PURE__ */ g("button", {
339
393
  type: "button",
340
394
  onClick: async () => {
341
395
  try {
342
- I("");
396
+ R("");
343
397
  let e = {
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) => {
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: L.supportedFeatures.split(",").flatMap((e) => {
414
+ supportedFeatures: z.supportedFeatures.split(",").flatMap((e) => {
361
415
  let t = e.trim();
362
416
  return t ? [t] : [];
363
417
  }),
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
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 (S && x) await N(x, e), w?.(n(C, `providers/${x}`));
424
+ if (w && C) await F(C, e), E?.(n(T, `providers/${C}`));
371
425
  else {
372
- let t = await j({
373
- key: L.key.trim(),
374
- category: L.category,
375
- authType: L.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
- w?.(n(C, `providers/${t?.id || ""}`));
432
+ E?.(n(T, `providers/${t?.id || ""}`));
379
433
  }
380
434
  } catch (e) {
381
- I(e instanceof Error ? e.message : "Failed to save provider");
435
+ R(e instanceof Error ? e.message : "Failed to save provider");
382
436
  }
383
437
  },
384
- disabled: M || P,
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: [M || P ? /* @__PURE__ */ m(l, {
440
+ children: [P || I ? /* @__PURE__ */ h(u, {
387
441
  size: 16,
388
442
  className: "animate-spin"
389
- }) : /* @__PURE__ */ m(u, { size: 16 }), S ? "Save Provider" : "Create Provider"]
443
+ }) : /* @__PURE__ */ h(d, { size: 16 }), w ? "Save Provider" : "Create Provider"]
390
444
  })
391
445
  })
392
446
  ]
393
- }) : /* @__PURE__ */ h("div", {
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__ */ m(d, {
450
+ /* @__PURE__ */ h(f, {
397
451
  size: 48,
398
452
  className: "text-muted-foreground mb-4"
399
453
  }),
400
- /* @__PURE__ */ m("h2", {
454
+ /* @__PURE__ */ h("h2", {
401
455
  className: "text-xl font-bold text-foreground mb-2",
402
456
  children: "Access Denied"
403
457
  }),
404
- /* @__PURE__ */ m("p", {
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 { x as ProviderEditorPage };
466
+ export { C as ProviderEditorPage };
413
467
 
414
468
  //# sourceMappingURL=ProviderEditorPage.js.map