@burdenoff/microfe-integrations 2026.807.1 → 2026.810.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.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +147 -131
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodSelector.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodSelector.js +10 -5
- package/dist/integrations/components/AuthMethodSelector.js.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.js +7 -5
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
- package/dist/integrations/components/SchemaForm.d.ts +17 -0
- package/dist/integrations/components/SchemaForm.d.ts.map +1 -1
- package/dist/integrations/components/SchemaForm.js +131 -71
- package/dist/integrations/components/SchemaForm.js.map +1 -1
- package/dist/integrations/types/index.d.ts +1 -1
- package/dist/integrations/types/index.d.ts.map +1 -1
- package/dist/integrations/utils/mappers.d.ts.map +1 -1
- package/dist/integrations/utils/mappers.js +1 -0
- package/dist/integrations/utils/mappers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddConnectionDialog.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"AddConnectionDialog.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqDH,MAAM,WAAW,wBAAwB;IACvC,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4DAA4D;IAC5D,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAQD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,qBAAqB,EACrB,mBAAmB,GACpB,EAAE,wBAAwB,sCAk2B1B"}
|
|
@@ -9,23 +9,23 @@ import { waitForOAuthPopupCompletion as ce } from "../utils/oauthPopup.js";
|
|
|
9
9
|
import { CredentialStorageSelector as le } from "./CredentialStorageSelector.js";
|
|
10
10
|
import { AuthMethodSelector as ue } from "./AuthMethodSelector.js";
|
|
11
11
|
import { ProviderIcon as a } from "./ProviderIcon.js";
|
|
12
|
-
import { SchemaForm as de,
|
|
13
|
-
import { useCallback as
|
|
14
|
-
import { AlertCircle as u, Check as
|
|
15
|
-
import { usePermissions as
|
|
12
|
+
import { SchemaForm as de, initialValuesFromSchema as fe, isSchemaComplete as pe, parseFormSchema as me, visibleValues as he } from "./SchemaForm.js";
|
|
13
|
+
import { useCallback as ge, useEffect as o, useId as _e, useMemo as s, useRef as c, useState as l } from "react";
|
|
14
|
+
import { AlertCircle as u, Check as ve, CheckCircle2 as ye, ExternalLink as be, Info as xe, Link2 as Se, Loader2 as d, Search as Ce, Shield as f, X as we } from "lucide-react";
|
|
15
|
+
import { usePermissions as Te } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
16
16
|
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
17
|
-
import { IllustratedEmptyState as
|
|
17
|
+
import { IllustratedEmptyState as Ee } from "@burdenoff/fe-libs/ui";
|
|
18
18
|
//#region src/integrations/components/AddConnectionDialog.tsx
|
|
19
19
|
function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated: y }) {
|
|
20
|
-
let { apiGatewayUrl: b } = e(), { providers: x, loading: S } = re(),
|
|
20
|
+
let { apiGatewayUrl: b } = e(), { providers: x, loading: S } = re(), C = s(() => v ? (x ?? []).find((e) => e.id === v) ?? null : null, [x, v]), { provider: De, loading: Oe } = ne(!S && v && !C ? v : ""), w = C ?? De, T = !!v && !w && (S || Oe), { hasPermission: ke, isLoading: Ae } = Te(), je = !Ae && ke(n.CONNECTION_CREATE), { createConnection: Me, loading: Ne } = oe(), { initiateOAuth: Pe, loading: Fe } = se(), { authenticateConnection: Ie, loading: Le } = ie(), { authenticateWithServiceAccount: Re, loading: ze } = ae(), [Be] = te({ fetchPolicy: "network-only" }), [E, D] = l(null), [O, k] = l(!v), [A, Ve] = l("connection"), [j, He] = l(""), [M, N] = l(""), [P, Ue] = l(""), [F, We] = l(null), [I, L] = l({}), [R, Ge] = l({
|
|
21
21
|
mode: "managed",
|
|
22
22
|
vaultId: "",
|
|
23
23
|
secretId: "",
|
|
24
24
|
managedSecretName: ""
|
|
25
|
-
}), [
|
|
25
|
+
}), [Ke, z] = l(""), [B, V] = l(!1), [qe, H] = l(!1), [, U] = l(null), W = c(null), G = c(null), Je = c(null), Ye = _e(), K = (e) => `${Ye}-${e}`, q = s(() => (E?.authMethods ?? []).filter((e) => e.isEnabled), [E]), J = s(() => q.find((e) => e.key === F) ?? q[0] ?? null, [q, F]), Y = J?.flow ?? ee(E?.authType), Xe = J?.authType ?? E?.authType, X = s(() => J?.defaultScopes?.length ? J.defaultScopes : E?.defaultScopes ?? [], [J, E]), Z = s(() => me(J?.configSchema ?? E?.configSchema), [J, E]);
|
|
26
26
|
o(() => {
|
|
27
|
-
|
|
28
|
-
}, [
|
|
27
|
+
L(fe(Z)), z("");
|
|
28
|
+
}, [F, E?.id]), o(() => {
|
|
29
29
|
if (!g) return;
|
|
30
30
|
let e = (e) => {
|
|
31
31
|
e.key === "Escape" && _();
|
|
@@ -34,144 +34,154 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
34
34
|
}, [g, _]), o(() => () => {
|
|
35
35
|
G.current?.(), W.current && !W.current.closed && W.current.close();
|
|
36
36
|
}, []), o(() => {
|
|
37
|
-
g && (
|
|
37
|
+
g && (Ve("connection"), He(""), N(""), Ue(""), We(null), L({}), Ge({
|
|
38
38
|
mode: "managed",
|
|
39
39
|
vaultId: "",
|
|
40
40
|
secretId: "",
|
|
41
41
|
managedSecretName: ""
|
|
42
|
-
}),
|
|
42
|
+
}), z(""), V(!1), H(!1), U(null), v ? (k(!1), D(null)) : (k(!0), D(null)));
|
|
43
43
|
}, [g, v]), o(() => {
|
|
44
|
-
g && v &&
|
|
44
|
+
g && v && w && !E && (D(w), N(`${w.name} Connection`), k(!1));
|
|
45
45
|
}, [
|
|
46
46
|
g,
|
|
47
47
|
v,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
w,
|
|
49
|
+
E
|
|
50
50
|
]), o(() => {
|
|
51
|
-
if (g &&
|
|
52
|
-
let e = setTimeout(() =>
|
|
51
|
+
if (g && O) {
|
|
52
|
+
let e = setTimeout(() => Je.current?.focus(), 100);
|
|
53
53
|
return () => clearTimeout(e);
|
|
54
54
|
}
|
|
55
|
-
}, [g,
|
|
55
|
+
}, [g, O]);
|
|
56
56
|
let Q = s(() => {
|
|
57
57
|
let e = (x ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
|
|
58
|
-
if (!
|
|
59
|
-
let t =
|
|
58
|
+
if (!j.trim()) return e;
|
|
59
|
+
let t = j.toLowerCase();
|
|
60
60
|
return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t) || e.key.toLowerCase().includes(t));
|
|
61
|
-
}, [x,
|
|
61
|
+
}, [x, j]), Ze = s(() => {
|
|
62
62
|
let e = {};
|
|
63
63
|
return Q.forEach((t) => {
|
|
64
64
|
let n = t.category;
|
|
65
65
|
e[n] || (e[n] = []), e[n].push(t);
|
|
66
66
|
}), e;
|
|
67
|
-
}, [Q]),
|
|
68
|
-
|
|
69
|
-
}, []), $ =
|
|
70
|
-
if (!
|
|
67
|
+
}, [Q]), Qe = ge((e) => {
|
|
68
|
+
D(e), N(`${e.name} Connection`), k(!1), z("");
|
|
69
|
+
}, []), $ = Ne || Fe || qe || Le || ze, $e = ge(async () => {
|
|
70
|
+
if (!E || !M.trim()) return;
|
|
71
71
|
let e = Y === "minted";
|
|
72
72
|
if (!e) {
|
|
73
|
-
if (!
|
|
74
|
-
|
|
73
|
+
if (!R.vaultId) {
|
|
74
|
+
z("Please select a vault for this connection");
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
if (
|
|
78
|
-
|
|
77
|
+
if (R.mode === "existing" && !R.secretId) {
|
|
78
|
+
z("Please select an existing vault secret");
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
if (Y === "oauth2" && Z && !pe(Z, I)) {
|
|
83
|
+
z("Please fill in all required fields");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (J && !J.isConfigured) {
|
|
87
|
+
z("This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method.");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
82
90
|
try {
|
|
83
|
-
|
|
84
|
-
let t = await
|
|
85
|
-
name:
|
|
86
|
-
description:
|
|
87
|
-
providerId:
|
|
88
|
-
authMethodKey:
|
|
91
|
+
z("");
|
|
92
|
+
let t = await Me({
|
|
93
|
+
name: M.trim(),
|
|
94
|
+
description: P.trim() || void 0,
|
|
95
|
+
providerId: E.id,
|
|
96
|
+
authMethodKey: F ?? void 0,
|
|
97
|
+
...Y === "oauth2" && Z ? { config: he(Z, I) } : {},
|
|
89
98
|
...e ? {} : {
|
|
90
|
-
vaultId:
|
|
91
|
-
credentialSecretId:
|
|
92
|
-
managedSecretName:
|
|
99
|
+
vaultId: R.vaultId,
|
|
100
|
+
credentialSecretId: R.mode === "existing" ? R.secretId : void 0,
|
|
101
|
+
managedSecretName: R.mode === "managed" && R.managedSecretName.trim() || void 0
|
|
93
102
|
}
|
|
94
103
|
});
|
|
95
104
|
if (!t) {
|
|
96
|
-
|
|
105
|
+
z("Failed to create connection");
|
|
97
106
|
return;
|
|
98
107
|
}
|
|
99
|
-
switch (
|
|
108
|
+
switch (U(t), Y) {
|
|
100
109
|
case "oauth2": {
|
|
101
|
-
let e = await
|
|
110
|
+
let e = await Pe(t, b ? `${b}/integrations/oauth/callback` : "/integrations/oauth/callback", E.key);
|
|
102
111
|
if (e?.redirectUrl) {
|
|
103
112
|
let n = window.screenX + (window.innerWidth - 600) / 2, r = window.screenY + (window.innerHeight - 700) / 2, i = window.open(e.redirectUrl, "oauth_popup", `width=600,height=700,left=${n},top=${r},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
|
|
104
113
|
if (!i) {
|
|
105
|
-
|
|
114
|
+
z("Popup was blocked. Please allow popups for this site and try again.");
|
|
106
115
|
return;
|
|
107
116
|
}
|
|
108
|
-
W.current = i,
|
|
117
|
+
W.current = i, H(!0), G.current?.(), G.current = ce({
|
|
109
118
|
connectionId: t,
|
|
110
119
|
popup: i,
|
|
111
120
|
fetchConnectionStatus: async () => {
|
|
112
|
-
let { data: e } = await
|
|
121
|
+
let { data: e } = await Be({ variables: { id: t } });
|
|
113
122
|
return e?.getConnection ?? null;
|
|
114
123
|
},
|
|
115
124
|
onSuccess: () => {
|
|
116
|
-
|
|
125
|
+
V(!0), y?.(t);
|
|
117
126
|
},
|
|
118
|
-
onError:
|
|
127
|
+
onError: z,
|
|
119
128
|
onSettled: () => {
|
|
120
|
-
G.current = null, W.current = null,
|
|
129
|
+
G.current = null, W.current = null, H(!1);
|
|
121
130
|
}
|
|
122
131
|
});
|
|
123
132
|
return;
|
|
124
133
|
}
|
|
125
|
-
|
|
134
|
+
V(!0), y?.(t);
|
|
126
135
|
break;
|
|
127
136
|
}
|
|
128
137
|
case "minted":
|
|
129
|
-
|
|
138
|
+
Xe === "service_account" && await Re(t, X.length > 0 ? X : void 0), V(!0), y?.(t);
|
|
130
139
|
break;
|
|
131
140
|
default: {
|
|
132
|
-
if (Z && !
|
|
133
|
-
|
|
141
|
+
if (Z && !pe(Z, I)) {
|
|
142
|
+
z("Please fill in all required fields");
|
|
134
143
|
return;
|
|
135
144
|
}
|
|
136
145
|
let e = {};
|
|
137
|
-
for (let [t, n] of Object.entries(
|
|
146
|
+
for (let [t, n] of Object.entries(he(Z, I))) if (typeof n == "string") {
|
|
138
147
|
let r = n.trim();
|
|
139
148
|
r && (e[t] = r);
|
|
140
149
|
} else n != null && (e[t] = n);
|
|
141
|
-
await
|
|
150
|
+
await Ie(t, F ?? void 0, e), V(!0), y?.(t);
|
|
142
151
|
}
|
|
143
152
|
}
|
|
144
153
|
} catch (e) {
|
|
145
|
-
|
|
154
|
+
z(e instanceof Error ? e.message : "Connection failed");
|
|
146
155
|
}
|
|
147
156
|
}, [
|
|
148
|
-
|
|
149
|
-
|
|
157
|
+
E,
|
|
158
|
+
M,
|
|
159
|
+
P,
|
|
150
160
|
F,
|
|
151
|
-
I,
|
|
152
161
|
Y,
|
|
153
|
-
|
|
162
|
+
Xe,
|
|
154
163
|
X,
|
|
155
164
|
Z,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
I,
|
|
166
|
+
J,
|
|
167
|
+
Me,
|
|
168
|
+
Pe,
|
|
169
|
+
Be,
|
|
170
|
+
Ie,
|
|
171
|
+
Re,
|
|
162
172
|
b,
|
|
163
173
|
y,
|
|
164
|
-
|
|
165
|
-
]),
|
|
174
|
+
R
|
|
175
|
+
]), et = [{
|
|
166
176
|
key: "connection",
|
|
167
177
|
label: "Connection",
|
|
168
|
-
icon:
|
|
178
|
+
icon: Se
|
|
169
179
|
}, {
|
|
170
180
|
key: "details",
|
|
171
181
|
label: "Details",
|
|
172
|
-
icon:
|
|
182
|
+
icon: xe
|
|
173
183
|
}];
|
|
174
|
-
return g ? !
|
|
184
|
+
return g ? !je && !Ae ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
|
|
175
185
|
className: "fixed inset-0 bg-bg-overlay z-50 animate-in fade-in-0 duration-200",
|
|
176
186
|
onClick: _
|
|
177
187
|
}), /* @__PURE__ */ h("div", {
|
|
@@ -212,16 +222,16 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
212
222
|
className: "flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0",
|
|
213
223
|
children: [/* @__PURE__ */ m("div", {
|
|
214
224
|
className: "flex items-center gap-3",
|
|
215
|
-
children:
|
|
216
|
-
provider:
|
|
225
|
+
children: E && !O ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
|
|
226
|
+
provider: E,
|
|
217
227
|
size: 32
|
|
218
228
|
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("h2", {
|
|
219
229
|
id: "add-connection-dialog-title",
|
|
220
230
|
className: "text-base font-semibold text-text-primary",
|
|
221
|
-
children: [
|
|
231
|
+
children: [E.name, " account"]
|
|
222
232
|
}), /* @__PURE__ */ m("p", {
|
|
223
233
|
className: "text-xs text-text-secondary",
|
|
224
|
-
children: r(
|
|
234
|
+
children: r(E.authType)
|
|
225
235
|
})] })] }) : /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
|
|
226
236
|
id: "add-connection-dialog-title",
|
|
227
237
|
className: "text-base font-semibold text-text-primary",
|
|
@@ -232,27 +242,27 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
232
242
|
})] })
|
|
233
243
|
}), /* @__PURE__ */ h("div", {
|
|
234
244
|
className: "flex items-center gap-2",
|
|
235
|
-
children: [
|
|
245
|
+
children: [E && !O && !B && /* @__PURE__ */ h("button", {
|
|
236
246
|
type: "button",
|
|
237
|
-
onClick:
|
|
238
|
-
disabled: $ || !
|
|
247
|
+
onClick: $e,
|
|
248
|
+
disabled: $ || !M.trim(),
|
|
239
249
|
className: "inline-flex items-center gap-1.5 px-4 py-1.5 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
240
250
|
children: [$ ? /* @__PURE__ */ m(d, {
|
|
241
251
|
size: 14,
|
|
242
252
|
className: "animate-spin"
|
|
243
|
-
}) : /* @__PURE__ */ m(
|
|
253
|
+
}) : /* @__PURE__ */ m(ve, { size: 14 }), qe ? "Waiting..." : "Save"]
|
|
244
254
|
}), /* @__PURE__ */ m("button", {
|
|
245
255
|
type: "button",
|
|
246
256
|
onClick: _,
|
|
247
257
|
className: "p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary",
|
|
248
258
|
"aria-label": "Close",
|
|
249
|
-
children: /* @__PURE__ */ m(
|
|
259
|
+
children: /* @__PURE__ */ m(we, { size: 20 })
|
|
250
260
|
})]
|
|
251
261
|
})]
|
|
252
262
|
}), /* @__PURE__ */ h("div", {
|
|
253
263
|
className: "flex flex-1 min-h-0 overflow-hidden",
|
|
254
264
|
children: [
|
|
255
|
-
|
|
265
|
+
O && !E && /* @__PURE__ */ h("div", {
|
|
256
266
|
className: "flex-1 p-5 overflow-y-auto",
|
|
257
267
|
children: [
|
|
258
268
|
/* @__PURE__ */ m("p", {
|
|
@@ -261,14 +271,14 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
261
271
|
}),
|
|
262
272
|
/* @__PURE__ */ h("div", {
|
|
263
273
|
className: "relative mb-4",
|
|
264
|
-
children: [/* @__PURE__ */ m(
|
|
274
|
+
children: [/* @__PURE__ */ m(Ce, {
|
|
265
275
|
size: 16,
|
|
266
276
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
267
277
|
}), /* @__PURE__ */ m("input", {
|
|
268
|
-
ref:
|
|
278
|
+
ref: Je,
|
|
269
279
|
type: "text",
|
|
270
|
-
value:
|
|
271
|
-
onChange: (e) =>
|
|
280
|
+
value: j,
|
|
281
|
+
onChange: (e) => He(e.target.value),
|
|
272
282
|
placeholder: "Search providers...",
|
|
273
283
|
"aria-label": "Search providers",
|
|
274
284
|
className: "w-full pl-9 pr-3 py-2.5 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
@@ -280,18 +290,18 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
280
290
|
size: 24,
|
|
281
291
|
className: "animate-spin text-text-secondary"
|
|
282
292
|
})
|
|
283
|
-
}) : Q.length === 0 ? /* @__PURE__ */ m(
|
|
284
|
-
illustration:
|
|
285
|
-
title:
|
|
286
|
-
description:
|
|
293
|
+
}) : Q.length === 0 ? /* @__PURE__ */ m(Ee, {
|
|
294
|
+
illustration: j ? "empty-search" : "empty-data",
|
|
295
|
+
title: j ? "No matching providers" : "No providers available",
|
|
296
|
+
description: j ? `No installed provider matches “${j}”. Try a different term.` : "Install and enable a provider from the catalog to create a connection."
|
|
287
297
|
}) : /* @__PURE__ */ m("div", {
|
|
288
298
|
className: "max-h-[400px] overflow-y-auto space-y-1",
|
|
289
|
-
children: Object.entries(
|
|
299
|
+
children: Object.entries(Ze).map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
290
300
|
className: "px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider",
|
|
291
301
|
children: i(e)
|
|
292
302
|
}), t.map((e) => /* @__PURE__ */ h("button", {
|
|
293
303
|
type: "button",
|
|
294
|
-
onClick: () =>
|
|
304
|
+
onClick: () => Qe(e),
|
|
295
305
|
className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
|
|
296
306
|
children: [/* @__PURE__ */ m(a, {
|
|
297
307
|
provider: e,
|
|
@@ -310,14 +320,14 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
310
320
|
})
|
|
311
321
|
]
|
|
312
322
|
}),
|
|
313
|
-
!
|
|
323
|
+
!O && !E && T && /* @__PURE__ */ m("div", {
|
|
314
324
|
className: "flex-1 flex items-center justify-center",
|
|
315
325
|
children: /* @__PURE__ */ m(d, {
|
|
316
326
|
size: 32,
|
|
317
327
|
className: "animate-spin text-text-secondary"
|
|
318
328
|
})
|
|
319
329
|
}),
|
|
320
|
-
!
|
|
330
|
+
!O && !E && !T && v && /* @__PURE__ */ h("div", {
|
|
321
331
|
className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
|
|
322
332
|
children: [/* @__PURE__ */ m(u, {
|
|
323
333
|
size: 32,
|
|
@@ -327,12 +337,12 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
327
337
|
children: "This provider isn't available."
|
|
328
338
|
})]
|
|
329
339
|
}),
|
|
330
|
-
|
|
340
|
+
B && E && /* @__PURE__ */ h("div", {
|
|
331
341
|
className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
|
|
332
342
|
children: [
|
|
333
343
|
/* @__PURE__ */ m("div", {
|
|
334
344
|
className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
|
|
335
|
-
children: /* @__PURE__ */ m(
|
|
345
|
+
children: /* @__PURE__ */ m(ye, {
|
|
336
346
|
size: 48,
|
|
337
347
|
className: "text-status-success-text"
|
|
338
348
|
})
|
|
@@ -345,7 +355,7 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
345
355
|
className: "text-sm text-text-secondary mb-6",
|
|
346
356
|
children: [
|
|
347
357
|
"Your ",
|
|
348
|
-
|
|
358
|
+
E.name,
|
|
349
359
|
" connection has been set up successfully."
|
|
350
360
|
]
|
|
351
361
|
}),
|
|
@@ -357,30 +367,30 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
357
367
|
})
|
|
358
368
|
]
|
|
359
369
|
}),
|
|
360
|
-
|
|
370
|
+
E && !O && !B && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
|
|
361
371
|
className: "w-full border-b border-border-subtle sm:w-40 sm:border-b-0 sm:border-r flex-shrink-0 py-3 overflow-x-auto",
|
|
362
|
-
children:
|
|
372
|
+
children: et.map((e) => {
|
|
363
373
|
let n = e.icon;
|
|
364
374
|
return /* @__PURE__ */ h("button", {
|
|
365
375
|
type: "button",
|
|
366
|
-
onClick: () =>
|
|
367
|
-
className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full",
|
|
376
|
+
onClick: () => Ve(e.key),
|
|
377
|
+
className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", A === e.key ? "text-text-primary bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2" : "text-text-secondary hover:text-text-primary hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2"),
|
|
368
378
|
children: [/* @__PURE__ */ m(n, { size: 16 }), e.label]
|
|
369
379
|
}, e.key);
|
|
370
380
|
})
|
|
371
381
|
}), /* @__PURE__ */ h("div", {
|
|
372
382
|
className: "flex-1 p-5 overflow-y-auto",
|
|
373
|
-
children: [
|
|
383
|
+
children: [A === "connection" && /* @__PURE__ */ h("div", {
|
|
374
384
|
className: "space-y-5",
|
|
375
385
|
children: [
|
|
376
|
-
|
|
386
|
+
Ke && /* @__PURE__ */ h("div", {
|
|
377
387
|
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20",
|
|
378
388
|
children: [/* @__PURE__ */ m(u, {
|
|
379
389
|
size: 16,
|
|
380
390
|
className: "text-status-error-text flex-shrink-0"
|
|
381
391
|
}), /* @__PURE__ */ m("span", {
|
|
382
392
|
className: "text-sm text-status-error-text",
|
|
383
|
-
children:
|
|
393
|
+
children: Ke
|
|
384
394
|
})]
|
|
385
395
|
}),
|
|
386
396
|
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
|
|
@@ -394,9 +404,9 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
394
404
|
id: K("conn-name"),
|
|
395
405
|
"aria-label": "Connection Name",
|
|
396
406
|
type: "text",
|
|
397
|
-
value:
|
|
398
|
-
onChange: (e) =>
|
|
399
|
-
placeholder: `My ${
|
|
407
|
+
value: M,
|
|
408
|
+
onChange: (e) => N(e.target.value),
|
|
409
|
+
placeholder: `My ${E.name} Connection`,
|
|
400
410
|
disabled: $,
|
|
401
411
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
|
|
402
412
|
})] }),
|
|
@@ -408,16 +418,16 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
408
418
|
id: K("conn-desc"),
|
|
409
419
|
"aria-label": "Description",
|
|
410
420
|
type: "text",
|
|
411
|
-
value:
|
|
412
|
-
onChange: (e) =>
|
|
421
|
+
value: P,
|
|
422
|
+
onChange: (e) => Ue(e.target.value),
|
|
413
423
|
placeholder: "Optional description",
|
|
414
424
|
disabled: $,
|
|
415
425
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
|
|
416
426
|
})] }),
|
|
417
|
-
|
|
418
|
-
value:
|
|
419
|
-
onChange:
|
|
420
|
-
providerAuthType:
|
|
427
|
+
E.authType !== "service_account" && /* @__PURE__ */ m(le, {
|
|
428
|
+
value: R,
|
|
429
|
+
onChange: Ge,
|
|
430
|
+
providerAuthType: E.authType
|
|
421
431
|
}),
|
|
422
432
|
/* @__PURE__ */ h("div", {
|
|
423
433
|
className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4 space-y-3",
|
|
@@ -435,32 +445,38 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
435
445
|
children: [
|
|
436
446
|
"·",
|
|
437
447
|
" ",
|
|
438
|
-
J?.displayName ?? r(
|
|
448
|
+
J?.displayName ?? r(E.authType)
|
|
439
449
|
]
|
|
440
450
|
})
|
|
441
451
|
]
|
|
442
452
|
}),
|
|
443
453
|
/* @__PURE__ */ m(ue, {
|
|
444
454
|
methods: q,
|
|
445
|
-
selectedKey:
|
|
446
|
-
onSelect:
|
|
455
|
+
selectedKey: F,
|
|
456
|
+
onSelect: We,
|
|
447
457
|
disabled: $,
|
|
448
458
|
idPrefix: K("auth-method")
|
|
449
459
|
}),
|
|
450
|
-
Y === "oauth2" && /* @__PURE__ */ h(
|
|
460
|
+
Y === "oauth2" && /* @__PURE__ */ h(p, { children: [Z && /* @__PURE__ */ m(de, {
|
|
461
|
+
schema: Z,
|
|
462
|
+
values: I,
|
|
463
|
+
onChange: L,
|
|
464
|
+
disabled: $,
|
|
465
|
+
idPrefix: K("oauth-cfg")
|
|
466
|
+
}), /* @__PURE__ */ h("div", {
|
|
451
467
|
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
|
|
452
|
-
children: [/* @__PURE__ */ m(
|
|
468
|
+
children: [/* @__PURE__ */ m(be, {
|
|
453
469
|
size: 14,
|
|
454
470
|
className: "text-status-info-text flex-shrink-0"
|
|
455
471
|
}), /* @__PURE__ */ h("span", {
|
|
456
472
|
className: "text-xs text-status-info-text",
|
|
457
473
|
children: [
|
|
458
474
|
"A popup window will open for ",
|
|
459
|
-
|
|
475
|
+
E.name,
|
|
460
476
|
" sign-in"
|
|
461
477
|
]
|
|
462
478
|
})]
|
|
463
|
-
}),
|
|
479
|
+
})] }),
|
|
464
480
|
Y === "minted" && /* @__PURE__ */ h("div", {
|
|
465
481
|
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
|
|
466
482
|
children: [/* @__PURE__ */ m(f, {
|
|
@@ -476,8 +492,8 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
476
492
|
children: "Secret values are stored encrypted and never shown again."
|
|
477
493
|
}), /* @__PURE__ */ m(de, {
|
|
478
494
|
schema: Z,
|
|
479
|
-
values:
|
|
480
|
-
onChange:
|
|
495
|
+
values: I,
|
|
496
|
+
onChange: L,
|
|
481
497
|
disabled: $,
|
|
482
498
|
idPrefix: K("cred")
|
|
483
499
|
})] }) : /* @__PURE__ */ h("div", {
|
|
@@ -493,7 +509,7 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
493
509
|
]
|
|
494
510
|
})
|
|
495
511
|
]
|
|
496
|
-
}),
|
|
512
|
+
}), A === "details" && /* @__PURE__ */ h("div", {
|
|
497
513
|
className: "space-y-4",
|
|
498
514
|
children: [/* @__PURE__ */ m("h3", {
|
|
499
515
|
className: "text-sm font-semibold text-text-primary",
|
|
@@ -504,47 +520,47 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
|
|
|
504
520
|
/* @__PURE__ */ h("div", {
|
|
505
521
|
className: "flex items-center gap-3 p-3 rounded-md border border-border-subtle",
|
|
506
522
|
children: [/* @__PURE__ */ m(a, {
|
|
507
|
-
provider:
|
|
523
|
+
provider: E,
|
|
508
524
|
size: 40
|
|
509
525
|
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
510
526
|
className: "text-sm font-medium text-text-primary",
|
|
511
|
-
children:
|
|
527
|
+
children: E.name
|
|
512
528
|
}), /* @__PURE__ */ h("p", {
|
|
513
529
|
className: "text-xs text-text-secondary",
|
|
514
530
|
children: [
|
|
515
|
-
r(
|
|
531
|
+
r(E.authType),
|
|
516
532
|
" ·",
|
|
517
533
|
" ",
|
|
518
|
-
i(
|
|
534
|
+
i(E.category)
|
|
519
535
|
]
|
|
520
536
|
})] })]
|
|
521
537
|
}),
|
|
522
|
-
|
|
538
|
+
E.description && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
523
539
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
524
540
|
children: "Description"
|
|
525
541
|
}), /* @__PURE__ */ m("p", {
|
|
526
542
|
className: "text-sm text-text-primary mt-1",
|
|
527
|
-
children:
|
|
543
|
+
children: E.description
|
|
528
544
|
})] }),
|
|
529
|
-
|
|
545
|
+
E.website && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
530
546
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
531
547
|
children: "Website"
|
|
532
548
|
}), /* @__PURE__ */ m("a", {
|
|
533
|
-
href:
|
|
549
|
+
href: E.website,
|
|
534
550
|
target: "_blank",
|
|
535
551
|
rel: "noopener noreferrer",
|
|
536
552
|
className: "block text-sm text-primary hover:underline mt-1",
|
|
537
|
-
children:
|
|
553
|
+
children: E.website
|
|
538
554
|
})] }),
|
|
539
|
-
|
|
555
|
+
E.docsUrl && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
540
556
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
541
557
|
children: "Documentation"
|
|
542
558
|
}), /* @__PURE__ */ m("a", {
|
|
543
|
-
href:
|
|
559
|
+
href: E.docsUrl,
|
|
544
560
|
target: "_blank",
|
|
545
561
|
rel: "noopener noreferrer",
|
|
546
562
|
className: "block text-sm text-primary hover:underline mt-1",
|
|
547
|
-
children:
|
|
563
|
+
children: E.docsUrl
|
|
548
564
|
})] })
|
|
549
565
|
]
|
|
550
566
|
})]
|