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