@burdenoff/microfe-integrations 2026.715.2 → 2026.724.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/integrations/components/AddConnectionDialog.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +331 -241
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/ProviderIcon.d.ts.map +1 -1
- package/dist/integrations/components/ProviderIcon.js +3 -0
- package/dist/integrations/components/ProviderIcon.js.map +1 -1
- 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 +22 -4
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.d.ts.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +308 -220
- package/dist/integrations/pages/AddConnectionWizard.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/constants.d.ts.map +1 -1
- package/dist/integrations/utils/constants.js +7 -0
- package/dist/integrations/utils/constants.js.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.d.ts +17 -0
- package/dist/integrations/utils/integrationsHelpers.d.ts.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.js +10 -1
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/dist/integrations/utils/mappers.js +1 -1
- package/dist/integrations/utils/mappers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,153 +1,171 @@
|
|
|
1
1
|
import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { INTEGRATION_PERMISSIONS as n } from "../constants/permissions.js";
|
|
4
|
-
import { getAuthTypeLabel as r, getCategoryLabel as i } from "../utils/integrationsHelpers.js";
|
|
4
|
+
import { getAuthTypeLabel as r, getCategoryLabel as i, parseConfigSchema as a } from "../utils/integrationsHelpers.js";
|
|
5
5
|
import { useGetConnectionLazyQuery as ee } from "../../generated/wspace-operations.js";
|
|
6
6
|
import { useProvider as te, useProviders as ne } from "../hooks/useProviders.js";
|
|
7
|
-
import { useAuthenticateWithApiKey as re, useAuthenticateWithBasicAuth as ie, useAuthenticateWithBearerToken as ae,
|
|
8
|
-
import { waitForOAuthPopupCompletion as
|
|
9
|
-
import { CredentialStorageSelector as
|
|
10
|
-
import { ProviderIcon as
|
|
11
|
-
import { useCallback as
|
|
12
|
-
import { AlertCircle as
|
|
13
|
-
import { usePermissions as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { IllustratedEmptyState as
|
|
7
|
+
import { useAuthenticateWithApiKey as re, useAuthenticateWithBasicAuth as ie, useAuthenticateWithBearerToken as ae, useAuthenticateWithCustomConfig as oe, useAuthenticateWithServiceAccount as se, useCreateConnection as ce, useInitiateOAuth as le } from "../hooks/useConnections.js";
|
|
8
|
+
import { waitForOAuthPopupCompletion as ue } from "../utils/oauthPopup.js";
|
|
9
|
+
import { CredentialStorageSelector as de } from "./CredentialStorageSelector.js";
|
|
10
|
+
import { ProviderIcon as o } from "./ProviderIcon.js";
|
|
11
|
+
import { useCallback as fe, useEffect as s, useId as pe, useMemo as c, useRef as l, useState as u } from "react";
|
|
12
|
+
import { AlertCircle as d, Check as me, CheckCircle2 as he, ExternalLink as ge, Info as _e, Key as f, Link2 as ve, Loader2 as p, Lock as m, Search as ye, Shield as be, X as xe } from "lucide-react";
|
|
13
|
+
import { usePermissions as Se } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
14
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
|
+
import { IllustratedEmptyState as Ce } from "@burdenoff/fe-libs/ui";
|
|
16
16
|
//#region src/integrations/components/AddConnectionDialog.tsx
|
|
17
|
-
function
|
|
18
|
-
let { apiGatewayUrl:
|
|
17
|
+
function v({ open: v, onClose: y, preselectedProviderId: b, onConnectionCreated: x }) {
|
|
18
|
+
let { apiGatewayUrl: S } = e(), { providers: C, loading: w } = ne(), we = c(() => b ? (C ?? []).find((e) => e.id === b) ?? null : null, [C, b]), { provider: Te, loading: Ee } = te(!w && b && !we ? b : ""), T = we ?? Te, De = !!b && !T && (w || Ee), { hasPermission: Oe, isLoading: ke } = Se(), Ae = !ke && Oe(n.CONNECTION_CREATE), { createConnection: je, loading: Me } = ce(), { initiateOAuth: Ne, loading: Pe } = le(), { authenticateWithApiKey: Fe, loading: Ie } = re(), { authenticateWithBasicAuth: Le, loading: Re } = ie(), { authenticateWithBearerToken: ze, loading: Be } = ae(), { authenticateWithServiceAccount: Ve, loading: He } = se(), { authenticateWithCustomConfig: Ue, loading: We } = oe(), [E] = ee({ fetchPolicy: "network-only" }), [D, O] = u(null), [k, A] = u(!b), [j, Ge] = u("connection"), [M, Ke] = u(""), [N, P] = u(""), [F, qe] = u(""), [I, Je] = u(""), [L, Ye] = u(""), [R, Xe] = u(""), [z, Ze] = u(""), [B, V] = u({}), [H, Qe] = u({
|
|
19
19
|
mode: "managed",
|
|
20
20
|
vaultId: "",
|
|
21
21
|
secretId: "",
|
|
22
22
|
managedSecretName: ""
|
|
23
|
-
}), [
|
|
24
|
-
|
|
25
|
-
if (!
|
|
23
|
+
}), [U, $e] = u(!1), [et, W] = u(""), [G, K] = u(!1), [q, J] = u(!1), [, tt] = u(null), Y = l(null), X = l(null), nt = l(null), rt = pe(), Z = (e) => `${rt}-${e}`;
|
|
24
|
+
s(() => {
|
|
25
|
+
if (!v) return;
|
|
26
26
|
let e = (e) => {
|
|
27
|
-
e.key === "Escape" &&
|
|
27
|
+
e.key === "Escape" && y();
|
|
28
28
|
};
|
|
29
29
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
}, []),
|
|
33
|
-
|
|
30
|
+
}, [v, y]), s(() => () => {
|
|
31
|
+
X.current?.(), Y.current && !Y.current.closed && Y.current.close();
|
|
32
|
+
}, []), s(() => {
|
|
33
|
+
v && (Ge("connection"), Ke(""), P(""), qe(""), Je(""), Ye(""), Xe(""), Ze(""), V({}), Qe({
|
|
34
34
|
mode: "managed",
|
|
35
35
|
vaultId: "",
|
|
36
36
|
secretId: "",
|
|
37
37
|
managedSecretName: ""
|
|
38
|
-
}),
|
|
39
|
-
}, [
|
|
40
|
-
|
|
38
|
+
}), $e(!1), W(""), K(!1), J(!1), tt(null), b ? (A(!1), O(null)) : (A(!0), O(null)));
|
|
39
|
+
}, [v, b]), s(() => {
|
|
40
|
+
v && b && T && !D && (O(T), P(`${T.name} Connection`), A(!1));
|
|
41
41
|
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
v,
|
|
43
|
+
b,
|
|
44
|
+
T,
|
|
45
45
|
D
|
|
46
|
-
]),
|
|
47
|
-
if (
|
|
48
|
-
let e = setTimeout(() =>
|
|
46
|
+
]), s(() => {
|
|
47
|
+
if (v && k) {
|
|
48
|
+
let e = setTimeout(() => nt.current?.focus(), 100);
|
|
49
49
|
return () => clearTimeout(e);
|
|
50
50
|
}
|
|
51
|
-
}, [
|
|
52
|
-
let
|
|
53
|
-
let e = (
|
|
51
|
+
}, [v, k]);
|
|
52
|
+
let Q = c(() => {
|
|
53
|
+
let e = (C ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
|
|
54
54
|
if (!M.trim()) return e;
|
|
55
55
|
let t = M.toLowerCase();
|
|
56
56
|
return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t) || e.key.toLowerCase().includes(t));
|
|
57
|
-
}, [
|
|
57
|
+
}, [C, M]), it = c(() => {
|
|
58
58
|
let e = {};
|
|
59
|
-
return
|
|
59
|
+
return Q.forEach((t) => {
|
|
60
60
|
let n = t.category;
|
|
61
61
|
e[n] || (e[n] = []), e[n].push(t);
|
|
62
62
|
}), e;
|
|
63
|
-
}, [
|
|
64
|
-
O(e), P(`${e.name} Connection`), A(!1),
|
|
65
|
-
}, []),
|
|
63
|
+
}, [Q]), at = fe((e) => {
|
|
64
|
+
O(e), P(`${e.name} Connection`), A(!1), W("");
|
|
65
|
+
}, []), $ = Me || Pe || q || Ie || Re || Be || He || We, ot = fe(async () => {
|
|
66
66
|
if (!D || !N.trim()) return;
|
|
67
67
|
let e = D.authType === "service_account";
|
|
68
68
|
if (!e) {
|
|
69
|
-
if (!
|
|
70
|
-
|
|
69
|
+
if (!H.vaultId) {
|
|
70
|
+
W("Please select a vault for this connection");
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
74
|
-
|
|
73
|
+
if (H.mode === "existing" && !H.secretId) {
|
|
74
|
+
W("Please select an existing vault secret");
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
try {
|
|
79
|
-
|
|
80
|
-
let t = await
|
|
79
|
+
W("");
|
|
80
|
+
let t = await je({
|
|
81
81
|
name: N.trim(),
|
|
82
82
|
description: F.trim() || void 0,
|
|
83
83
|
providerId: D.id,
|
|
84
84
|
...e ? {} : {
|
|
85
|
-
vaultId:
|
|
86
|
-
credentialSecretId:
|
|
87
|
-
managedSecretName:
|
|
85
|
+
vaultId: H.vaultId,
|
|
86
|
+
credentialSecretId: H.mode === "existing" ? H.secretId : void 0,
|
|
87
|
+
managedSecretName: H.mode === "managed" && H.managedSecretName.trim() || void 0
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
if (!t) {
|
|
91
|
-
|
|
91
|
+
W("Failed to create connection");
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
switch (
|
|
94
|
+
switch (tt(t), D.authType) {
|
|
95
95
|
case "oauth2": {
|
|
96
|
-
let e = await
|
|
96
|
+
let e = await Ne(t, S ? `${S}/integrations/oauth/callback` : "/integrations/oauth/callback", D.key);
|
|
97
97
|
if (e?.redirectUrl) {
|
|
98
98
|
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`);
|
|
99
99
|
if (!i) {
|
|
100
|
-
|
|
100
|
+
W("Popup was blocked. Please allow popups for this site and try again.");
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
Y.current = i, J(!0), X.current?.(), X.current = ue({
|
|
104
104
|
connectionId: t,
|
|
105
105
|
popup: i,
|
|
106
106
|
fetchConnectionStatus: async () => {
|
|
107
|
-
let { data: e } = await
|
|
107
|
+
let { data: e } = await E({ variables: { id: t } });
|
|
108
108
|
return e?.getConnection ?? null;
|
|
109
109
|
},
|
|
110
110
|
onSuccess: () => {
|
|
111
|
-
|
|
111
|
+
K(!0), x?.(t);
|
|
112
112
|
},
|
|
113
|
-
onError:
|
|
113
|
+
onError: W,
|
|
114
114
|
onSettled: () => {
|
|
115
|
-
|
|
115
|
+
X.current = null, Y.current = null, J(!1);
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
K(!0), x?.(t);
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
case "api_key":
|
|
124
124
|
if (!I.trim()) {
|
|
125
|
-
|
|
125
|
+
W("API key is required");
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
await
|
|
128
|
+
await Fe(t, I.trim()), K(!0), x?.(t);
|
|
129
129
|
break;
|
|
130
130
|
case "basic_auth":
|
|
131
131
|
if (!L.trim() || !R.trim()) {
|
|
132
|
-
|
|
132
|
+
W("Username and password are required");
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
await
|
|
135
|
+
await Le(t, L.trim(), R.trim()), K(!0), x?.(t);
|
|
136
136
|
break;
|
|
137
137
|
case "bearer_token":
|
|
138
138
|
if (!z.trim()) {
|
|
139
|
-
|
|
139
|
+
W("Bearer token is required");
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
await
|
|
142
|
+
await ze(t, z.trim()), K(!0), x?.(t);
|
|
143
143
|
break;
|
|
144
144
|
case "service_account":
|
|
145
|
-
await
|
|
145
|
+
await Ve(t, D.defaultScopes && D.defaultScopes.length > 0 ? D.defaultScopes : void 0), K(!0), x?.(t);
|
|
146
|
+
break;
|
|
147
|
+
case "custom": {
|
|
148
|
+
let e = a(D.configSchema);
|
|
149
|
+
if (!e) {
|
|
150
|
+
W("This provider does not declare a configuration form");
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
for (let t of e.required) if (!B[t]?.trim()) {
|
|
154
|
+
W(`${e.properties[t]?.title ?? t} is required`);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
let n = {};
|
|
158
|
+
for (let t of Object.keys(e.properties)) {
|
|
159
|
+
let e = B[t]?.trim();
|
|
160
|
+
e && (n[t] = e);
|
|
161
|
+
}
|
|
162
|
+
await Ue(t, n), K(!0), x?.(t);
|
|
146
163
|
break;
|
|
147
|
-
|
|
164
|
+
}
|
|
165
|
+
default: K(!0), x?.(t);
|
|
148
166
|
}
|
|
149
167
|
} catch (e) {
|
|
150
|
-
|
|
168
|
+
W(e instanceof Error ? e.message : "Connection failed");
|
|
151
169
|
}
|
|
152
170
|
}, [
|
|
153
171
|
D,
|
|
@@ -157,17 +175,19 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
157
175
|
L,
|
|
158
176
|
R,
|
|
159
177
|
z,
|
|
160
|
-
|
|
178
|
+
B,
|
|
179
|
+
je,
|
|
180
|
+
Ne,
|
|
161
181
|
E,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
]),
|
|
182
|
+
Fe,
|
|
183
|
+
Le,
|
|
184
|
+
ze,
|
|
185
|
+
Ve,
|
|
186
|
+
Ue,
|
|
187
|
+
S,
|
|
188
|
+
x,
|
|
189
|
+
H
|
|
190
|
+
]), st = [{
|
|
171
191
|
key: "connection",
|
|
172
192
|
label: "Connection",
|
|
173
193
|
icon: ve
|
|
@@ -176,137 +196,137 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
176
196
|
label: "Details",
|
|
177
197
|
icon: _e
|
|
178
198
|
}];
|
|
179
|
-
return
|
|
199
|
+
return v ? !Ae && !ke ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
180
200
|
className: "fixed inset-0 bg-bg-overlay z-50 animate-in fade-in-0 duration-200",
|
|
181
|
-
onClick:
|
|
182
|
-
}), /* @__PURE__ */
|
|
201
|
+
onClick: y
|
|
202
|
+
}), /* @__PURE__ */ _("div", {
|
|
183
203
|
role: "dialog",
|
|
184
204
|
"aria-modal": "true",
|
|
185
205
|
"aria-labelledby": "add-connection-denied-title",
|
|
186
206
|
className: "fixed inset-x-4 top-1/2 z-50 mx-auto flex max-w-md -translate-y-1/2 flex-col items-center gap-4 rounded-xl border border-border-subtle bg-bg-surface p-8 shadow-2xl text-center",
|
|
187
207
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ g(be, {
|
|
189
209
|
size: 40,
|
|
190
210
|
className: "text-text-secondary"
|
|
191
211
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ g("h2", {
|
|
193
213
|
id: "add-connection-denied-title",
|
|
194
214
|
className: "text-lg font-semibold text-text-primary",
|
|
195
215
|
children: "Access Denied"
|
|
196
216
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ g("p", {
|
|
198
218
|
className: "text-sm text-text-secondary",
|
|
199
219
|
children: "You don't have permission to create connections."
|
|
200
220
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ g("button", {
|
|
202
222
|
type: "button",
|
|
203
|
-
onClick:
|
|
223
|
+
onClick: y,
|
|
204
224
|
className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors",
|
|
205
225
|
children: "Close"
|
|
206
226
|
})
|
|
207
227
|
]
|
|
208
|
-
})] }) : /* @__PURE__ */
|
|
228
|
+
})] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
209
229
|
className: "fixed inset-0 bg-bg-overlay z-50 animate-in fade-in-0 duration-200",
|
|
210
|
-
onClick:
|
|
211
|
-
}), /* @__PURE__ */
|
|
230
|
+
onClick: y
|
|
231
|
+
}), /* @__PURE__ */ _("div", {
|
|
212
232
|
role: "dialog",
|
|
213
233
|
"aria-modal": "true",
|
|
214
234
|
"aria-labelledby": "add-connection-dialog-title",
|
|
215
235
|
className: "fixed inset-x-4 top-4 bottom-4 z-50 mx-auto flex w-auto max-w-2xl flex-col overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200 sm:inset-x-6 sm:top-1/2 sm:bottom-auto sm:w-full sm:-translate-y-1/2",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ _("div", {
|
|
217
237
|
className: "flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ g("div", {
|
|
219
239
|
className: "flex items-center gap-3",
|
|
220
|
-
children: D && !k ? /* @__PURE__ */
|
|
240
|
+
children: D && !k ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, {
|
|
221
241
|
provider: D,
|
|
222
242
|
size: 32
|
|
223
|
-
}), /* @__PURE__ */
|
|
243
|
+
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("h2", {
|
|
224
244
|
id: "add-connection-dialog-title",
|
|
225
245
|
className: "text-base font-semibold text-text-primary",
|
|
226
246
|
children: [D.name, " account"]
|
|
227
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ g("p", {
|
|
228
248
|
className: "text-xs text-text-secondary",
|
|
229
249
|
children: r(D.authType)
|
|
230
|
-
})] })] }) : /* @__PURE__ */
|
|
250
|
+
})] })] }) : /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
|
|
231
251
|
id: "add-connection-dialog-title",
|
|
232
252
|
className: "text-base font-semibold text-text-primary",
|
|
233
253
|
children: "Add new credential"
|
|
234
|
-
}), /* @__PURE__ */
|
|
254
|
+
}), /* @__PURE__ */ g("p", {
|
|
235
255
|
className: "text-xs text-text-secondary",
|
|
236
256
|
children: "Select an app or service to connect to"
|
|
237
257
|
})] })
|
|
238
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ _("div", {
|
|
239
259
|
className: "flex items-center gap-2",
|
|
240
|
-
children: [D && !k && !
|
|
260
|
+
children: [D && !k && !G && /* @__PURE__ */ _("button", {
|
|
241
261
|
type: "button",
|
|
242
|
-
onClick:
|
|
243
|
-
disabled:
|
|
262
|
+
onClick: ot,
|
|
263
|
+
disabled: $ || !N.trim(),
|
|
244
264
|
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",
|
|
245
|
-
children: [
|
|
265
|
+
children: [$ ? /* @__PURE__ */ g(p, {
|
|
246
266
|
size: 14,
|
|
247
267
|
className: "animate-spin"
|
|
248
|
-
}) : /* @__PURE__ */
|
|
249
|
-
}), /* @__PURE__ */
|
|
268
|
+
}) : /* @__PURE__ */ g(me, { size: 14 }), q ? "Waiting..." : "Save"]
|
|
269
|
+
}), /* @__PURE__ */ g("button", {
|
|
250
270
|
type: "button",
|
|
251
|
-
onClick:
|
|
271
|
+
onClick: y,
|
|
252
272
|
className: "p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary",
|
|
253
273
|
"aria-label": "Close",
|
|
254
|
-
children: /* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ g(xe, { size: 20 })
|
|
255
275
|
})]
|
|
256
276
|
})]
|
|
257
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ _("div", {
|
|
258
278
|
className: "flex flex-1 min-h-0 overflow-hidden",
|
|
259
279
|
children: [
|
|
260
|
-
k && !D && /* @__PURE__ */
|
|
280
|
+
k && !D && /* @__PURE__ */ _("div", {
|
|
261
281
|
className: "flex-1 p-5 overflow-y-auto",
|
|
262
282
|
children: [
|
|
263
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ g("p", {
|
|
264
284
|
className: "text-sm text-text-secondary mb-3",
|
|
265
285
|
children: "Select an app or service to connect to"
|
|
266
286
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ _("div", {
|
|
268
288
|
className: "relative mb-4",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ g(ye, {
|
|
270
290
|
size: 16,
|
|
271
291
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
272
|
-
}), /* @__PURE__ */
|
|
273
|
-
ref:
|
|
292
|
+
}), /* @__PURE__ */ g("input", {
|
|
293
|
+
ref: nt,
|
|
274
294
|
type: "text",
|
|
275
295
|
value: M,
|
|
276
|
-
onChange: (e) =>
|
|
296
|
+
onChange: (e) => Ke(e.target.value),
|
|
277
297
|
placeholder: "Search providers...",
|
|
278
298
|
"aria-label": "Search providers",
|
|
279
299
|
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
300
|
})]
|
|
281
301
|
}),
|
|
282
|
-
|
|
302
|
+
w ? /* @__PURE__ */ g("div", {
|
|
283
303
|
className: "flex items-center justify-center py-8",
|
|
284
|
-
children: /* @__PURE__ */ p
|
|
304
|
+
children: /* @__PURE__ */ g(p, {
|
|
285
305
|
size: 24,
|
|
286
306
|
className: "animate-spin text-text-secondary"
|
|
287
307
|
})
|
|
288
|
-
}) :
|
|
308
|
+
}) : Q.length === 0 ? /* @__PURE__ */ g(Ce, {
|
|
289
309
|
illustration: M ? "empty-search" : "empty-data",
|
|
290
310
|
title: M ? "No matching providers" : "No providers available",
|
|
291
311
|
description: M ? `No installed provider matches “${M}”. Try a different term.` : "Install and enable a provider from the catalog to create a connection."
|
|
292
|
-
}) : /* @__PURE__ */
|
|
312
|
+
}) : /* @__PURE__ */ g("div", {
|
|
293
313
|
className: "max-h-[400px] overflow-y-auto space-y-1",
|
|
294
|
-
children: Object.entries(
|
|
314
|
+
children: Object.entries(it).map(([e, t]) => /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
|
|
295
315
|
className: "px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider",
|
|
296
316
|
children: i(e)
|
|
297
|
-
}), t.map((e) => /* @__PURE__ */
|
|
317
|
+
}), t.map((e) => /* @__PURE__ */ _("button", {
|
|
298
318
|
type: "button",
|
|
299
|
-
onClick: () =>
|
|
319
|
+
onClick: () => at(e),
|
|
300
320
|
className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ g(o, {
|
|
302
322
|
provider: e,
|
|
303
323
|
size: 32
|
|
304
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ _("div", {
|
|
305
325
|
className: "flex-1 min-w-0",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ g("div", {
|
|
307
327
|
className: "text-sm font-medium text-text-primary",
|
|
308
328
|
children: e.name
|
|
309
|
-
}), /* @__PURE__ */
|
|
329
|
+
}), /* @__PURE__ */ g("div", {
|
|
310
330
|
className: "text-xs text-text-secondary",
|
|
311
331
|
children: r(e.authType)
|
|
312
332
|
})]
|
|
@@ -315,38 +335,38 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
315
335
|
})
|
|
316
336
|
]
|
|
317
337
|
}),
|
|
318
|
-
!k && !D &&
|
|
338
|
+
!k && !D && De && /* @__PURE__ */ g("div", {
|
|
319
339
|
className: "flex-1 flex items-center justify-center",
|
|
320
|
-
children: /* @__PURE__ */ p
|
|
340
|
+
children: /* @__PURE__ */ g(p, {
|
|
321
341
|
size: 32,
|
|
322
342
|
className: "animate-spin text-text-secondary"
|
|
323
343
|
})
|
|
324
344
|
}),
|
|
325
|
-
!k && !D && !
|
|
345
|
+
!k && !D && !De && b && /* @__PURE__ */ _("div", {
|
|
326
346
|
className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ g(d, {
|
|
328
348
|
size: 32,
|
|
329
349
|
className: "text-text-secondary mb-3"
|
|
330
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ g("p", {
|
|
331
351
|
className: "text-sm text-text-secondary",
|
|
332
352
|
children: "This provider isn't available."
|
|
333
353
|
})]
|
|
334
354
|
}),
|
|
335
|
-
|
|
355
|
+
G && D && /* @__PURE__ */ _("div", {
|
|
336
356
|
className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
|
|
337
357
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ g("div", {
|
|
339
359
|
className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
|
|
340
|
-
children: /* @__PURE__ */
|
|
360
|
+
children: /* @__PURE__ */ g(he, {
|
|
341
361
|
size: 48,
|
|
342
362
|
className: "text-status-success-text"
|
|
343
363
|
})
|
|
344
364
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ g("h3", {
|
|
346
366
|
className: "text-lg font-semibold text-text-primary mb-1",
|
|
347
367
|
children: "Connection Created!"
|
|
348
368
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ _("p", {
|
|
350
370
|
className: "text-sm text-text-secondary mb-6",
|
|
351
371
|
children: [
|
|
352
372
|
"Your ",
|
|
@@ -354,83 +374,83 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
354
374
|
" connection has been set up successfully."
|
|
355
375
|
]
|
|
356
376
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ g("button", {
|
|
358
378
|
type: "button",
|
|
359
|
-
onClick:
|
|
379
|
+
onClick: y,
|
|
360
380
|
className: "px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
361
381
|
children: "Close dialog"
|
|
362
382
|
})
|
|
363
383
|
]
|
|
364
384
|
}),
|
|
365
|
-
D && !k && !
|
|
385
|
+
D && !k && !G && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
366
386
|
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",
|
|
367
|
-
children:
|
|
387
|
+
children: st.map((e) => {
|
|
368
388
|
let n = e.icon;
|
|
369
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ _("button", {
|
|
370
390
|
type: "button",
|
|
371
|
-
onClick: () =>
|
|
391
|
+
onClick: () => Ge(e.key),
|
|
372
392
|
className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", j === 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"),
|
|
373
|
-
children: [/* @__PURE__ */
|
|
393
|
+
children: [/* @__PURE__ */ g(n, { size: 16 }), e.label]
|
|
374
394
|
}, e.key);
|
|
375
395
|
})
|
|
376
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ _("div", {
|
|
377
397
|
className: "flex-1 p-5 overflow-y-auto",
|
|
378
|
-
children: [j === "connection" && /* @__PURE__ */
|
|
398
|
+
children: [j === "connection" && /* @__PURE__ */ _("div", {
|
|
379
399
|
className: "space-y-5",
|
|
380
400
|
children: [
|
|
381
|
-
|
|
401
|
+
et && /* @__PURE__ */ _("div", {
|
|
382
402
|
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ g(d, {
|
|
384
404
|
size: 16,
|
|
385
405
|
className: "text-status-error-text flex-shrink-0"
|
|
386
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ g("span", {
|
|
387
407
|
className: "text-sm text-status-error-text",
|
|
388
|
-
children:
|
|
408
|
+
children: et
|
|
389
409
|
})]
|
|
390
410
|
}),
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
htmlFor:
|
|
411
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
412
|
+
htmlFor: Z("conn-name"),
|
|
393
413
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
394
|
-
children: ["Connection Name ", /* @__PURE__ */
|
|
414
|
+
children: ["Connection Name ", /* @__PURE__ */ g("span", {
|
|
395
415
|
className: "text-status-error-text",
|
|
396
416
|
children: "*"
|
|
397
417
|
})]
|
|
398
|
-
}), /* @__PURE__ */
|
|
399
|
-
id:
|
|
418
|
+
}), /* @__PURE__ */ g("input", {
|
|
419
|
+
id: Z("conn-name"),
|
|
400
420
|
"aria-label": "Connection Name",
|
|
401
421
|
type: "text",
|
|
402
422
|
value: N,
|
|
403
423
|
onChange: (e) => P(e.target.value),
|
|
404
424
|
placeholder: `My ${D.name} Connection`,
|
|
405
|
-
disabled:
|
|
425
|
+
disabled: $,
|
|
406
426
|
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"
|
|
407
427
|
})] }),
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
htmlFor:
|
|
428
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
|
|
429
|
+
htmlFor: Z("conn-desc"),
|
|
410
430
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
411
431
|
children: "Description"
|
|
412
|
-
}), /* @__PURE__ */
|
|
413
|
-
id:
|
|
432
|
+
}), /* @__PURE__ */ g("input", {
|
|
433
|
+
id: Z("conn-desc"),
|
|
414
434
|
"aria-label": "Description",
|
|
415
435
|
type: "text",
|
|
416
436
|
value: F,
|
|
417
|
-
onChange: (e) =>
|
|
437
|
+
onChange: (e) => qe(e.target.value),
|
|
418
438
|
placeholder: "Optional description",
|
|
419
|
-
disabled:
|
|
439
|
+
disabled: $,
|
|
420
440
|
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"
|
|
421
441
|
})] }),
|
|
422
|
-
D.authType !== "service_account" && /* @__PURE__ */
|
|
423
|
-
value:
|
|
424
|
-
onChange:
|
|
442
|
+
D.authType !== "service_account" && /* @__PURE__ */ g(de, {
|
|
443
|
+
value: H,
|
|
444
|
+
onChange: Qe,
|
|
425
445
|
providerAuthType: D.authType
|
|
426
446
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ _("div", {
|
|
428
448
|
className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4",
|
|
429
449
|
children: [
|
|
430
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ _("h3", {
|
|
431
451
|
className: "font-medium text-text-primary flex items-center gap-2 mb-3 text-sm",
|
|
432
452
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ g(be, {
|
|
434
454
|
size: 16,
|
|
435
455
|
className: "text-primary"
|
|
436
456
|
}),
|
|
@@ -438,16 +458,16 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
438
458
|
r(D.authType)
|
|
439
459
|
]
|
|
440
460
|
}),
|
|
441
|
-
D.authType === "oauth2" && /* @__PURE__ */
|
|
461
|
+
D.authType === "oauth2" && /* @__PURE__ */ g("div", {
|
|
442
462
|
className: "space-y-3",
|
|
443
|
-
children:
|
|
463
|
+
children: q ? /* @__PURE__ */ _("div", {
|
|
444
464
|
className: "flex flex-col items-center gap-3 py-4",
|
|
445
465
|
children: [
|
|
446
|
-
/* @__PURE__ */ p
|
|
466
|
+
/* @__PURE__ */ g(p, {
|
|
447
467
|
size: 28,
|
|
448
468
|
className: "animate-spin text-primary"
|
|
449
469
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ _("p", {
|
|
451
471
|
className: "text-sm font-medium text-text-primary",
|
|
452
472
|
children: [
|
|
453
473
|
"Waiting for ",
|
|
@@ -455,33 +475,33 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
455
475
|
" authorization…"
|
|
456
476
|
]
|
|
457
477
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ g("p", {
|
|
459
479
|
className: "text-xs text-text-secondary",
|
|
460
480
|
children: "Complete the sign-in in the popup window"
|
|
461
481
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ _("div", {
|
|
463
483
|
className: "p-2 rounded-md bg-status-warning-bg-subtle border border-border-default text-xs text-status-warning-text flex items-center gap-1.5",
|
|
464
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ g(ge, { size: 12 }), "Don't see the popup? Check if it was blocked"]
|
|
465
485
|
})
|
|
466
486
|
]
|
|
467
|
-
}) : /* @__PURE__ */
|
|
487
|
+
}) : /* @__PURE__ */ _("div", {
|
|
468
488
|
className: "space-y-3",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
489
|
+
children: [/* @__PURE__ */ _("div", {
|
|
470
490
|
className: "p-2.5 rounded-md bg-status-info-bg-subtle border border-border-default text-sm text-status-info-text flex items-center gap-2",
|
|
471
491
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ g(ge, { size: 14 }),
|
|
473
493
|
"A popup window will open for",
|
|
474
494
|
" ",
|
|
475
495
|
D.name,
|
|
476
496
|
" sign-in"
|
|
477
497
|
]
|
|
478
|
-
}), /* @__PURE__ */
|
|
498
|
+
}), /* @__PURE__ */ _("button", {
|
|
479
499
|
type: "button",
|
|
480
|
-
onClick:
|
|
481
|
-
disabled:
|
|
500
|
+
onClick: ot,
|
|
501
|
+
disabled: $ || !N.trim(),
|
|
482
502
|
className: "w-full inline-flex items-center justify-center gap-2.5 rounded-md border border-primary bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
483
503
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ g(o, {
|
|
485
505
|
provider: D,
|
|
486
506
|
size: 20
|
|
487
507
|
}),
|
|
@@ -492,53 +512,53 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
492
512
|
})]
|
|
493
513
|
})
|
|
494
514
|
}),
|
|
495
|
-
D.authType === "api_key" && /* @__PURE__ */
|
|
515
|
+
D.authType === "api_key" && /* @__PURE__ */ _("div", {
|
|
496
516
|
className: "space-y-3",
|
|
497
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ _("p", {
|
|
498
518
|
className: "text-xs text-text-secondary",
|
|
499
519
|
children: [
|
|
500
520
|
"Enter your ",
|
|
501
521
|
D.name,
|
|
502
522
|
" API key."
|
|
503
523
|
]
|
|
504
|
-
}), /* @__PURE__ */
|
|
505
|
-
htmlFor:
|
|
524
|
+
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
525
|
+
htmlFor: Z("api-key"),
|
|
506
526
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
507
|
-
children: ["API Key ", /* @__PURE__ */
|
|
527
|
+
children: ["API Key ", /* @__PURE__ */ g("span", {
|
|
508
528
|
className: "text-status-error-text",
|
|
509
529
|
children: "*"
|
|
510
530
|
})]
|
|
511
|
-
}), /* @__PURE__ */
|
|
531
|
+
}), /* @__PURE__ */ _("div", {
|
|
512
532
|
className: "relative",
|
|
513
533
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ g(f, {
|
|
515
535
|
size: 14,
|
|
516
536
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
517
537
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
id:
|
|
538
|
+
/* @__PURE__ */ g("input", {
|
|
539
|
+
id: Z("api-key"),
|
|
520
540
|
"aria-label": "API Key",
|
|
521
|
-
type:
|
|
541
|
+
type: U ? "text" : "password",
|
|
522
542
|
value: I,
|
|
523
|
-
onChange: (e) =>
|
|
543
|
+
onChange: (e) => Je(e.target.value),
|
|
524
544
|
placeholder: "Enter your API key",
|
|
525
|
-
disabled:
|
|
545
|
+
disabled: $,
|
|
526
546
|
className: "w-full pl-9 pr-10 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
|
|
527
547
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ g("button", {
|
|
529
549
|
type: "button",
|
|
530
|
-
onClick: () =>
|
|
531
|
-
"aria-label":
|
|
550
|
+
onClick: () => $e(!U),
|
|
551
|
+
"aria-label": U ? "Hide secret" : "Show secret",
|
|
532
552
|
className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
|
|
533
|
-
children:
|
|
553
|
+
children: g(U ? m : f, { size: 14 })
|
|
534
554
|
})
|
|
535
555
|
]
|
|
536
556
|
})] })]
|
|
537
557
|
}),
|
|
538
|
-
D.authType === "basic_auth" && /* @__PURE__ */
|
|
558
|
+
D.authType === "basic_auth" && /* @__PURE__ */ _("div", {
|
|
539
559
|
className: "space-y-3",
|
|
540
560
|
children: [
|
|
541
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ _("p", {
|
|
542
562
|
className: "text-xs text-text-secondary",
|
|
543
563
|
children: [
|
|
544
564
|
"Enter your ",
|
|
@@ -546,91 +566,91 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
546
566
|
" credentials."
|
|
547
567
|
]
|
|
548
568
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
htmlFor:
|
|
569
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
570
|
+
htmlFor: Z("username"),
|
|
551
571
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
552
|
-
children: ["Username ", /* @__PURE__ */
|
|
572
|
+
children: ["Username ", /* @__PURE__ */ g("span", {
|
|
553
573
|
className: "text-status-error-text",
|
|
554
574
|
children: "*"
|
|
555
575
|
})]
|
|
556
|
-
}), /* @__PURE__ */
|
|
557
|
-
id:
|
|
576
|
+
}), /* @__PURE__ */ g("input", {
|
|
577
|
+
id: Z("username"),
|
|
558
578
|
"aria-label": "Username",
|
|
559
579
|
type: "text",
|
|
560
580
|
value: L,
|
|
561
|
-
onChange: (e) =>
|
|
581
|
+
onChange: (e) => Ye(e.target.value),
|
|
562
582
|
placeholder: "Username or email",
|
|
563
|
-
disabled:
|
|
583
|
+
disabled: $,
|
|
564
584
|
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"
|
|
565
585
|
})] }),
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
htmlFor:
|
|
586
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
587
|
+
htmlFor: Z("password"),
|
|
568
588
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
569
|
-
children: ["Password ", /* @__PURE__ */
|
|
589
|
+
children: ["Password ", /* @__PURE__ */ g("span", {
|
|
570
590
|
className: "text-status-error-text",
|
|
571
591
|
children: "*"
|
|
572
592
|
})]
|
|
573
|
-
}), /* @__PURE__ */
|
|
593
|
+
}), /* @__PURE__ */ _("div", {
|
|
574
594
|
className: "relative",
|
|
575
|
-
children: [/* @__PURE__ */
|
|
595
|
+
children: [/* @__PURE__ */ g(m, {
|
|
576
596
|
size: 14,
|
|
577
597
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
578
|
-
}), /* @__PURE__ */
|
|
579
|
-
id:
|
|
598
|
+
}), /* @__PURE__ */ g("input", {
|
|
599
|
+
id: Z("password"),
|
|
580
600
|
"aria-label": "Password",
|
|
581
601
|
type: "password",
|
|
582
602
|
value: R,
|
|
583
|
-
onChange: (e) =>
|
|
603
|
+
onChange: (e) => Xe(e.target.value),
|
|
584
604
|
placeholder: "Password",
|
|
585
|
-
disabled:
|
|
605
|
+
disabled: $,
|
|
586
606
|
className: "w-full pl-9 pr-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"
|
|
587
607
|
})]
|
|
588
608
|
})] })
|
|
589
609
|
]
|
|
590
610
|
}),
|
|
591
|
-
D.authType === "bearer_token" && /* @__PURE__ */
|
|
611
|
+
D.authType === "bearer_token" && /* @__PURE__ */ _("div", {
|
|
592
612
|
className: "space-y-3",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
613
|
+
children: [/* @__PURE__ */ _("p", {
|
|
594
614
|
className: "text-xs text-text-secondary",
|
|
595
615
|
children: [
|
|
596
616
|
"Enter your ",
|
|
597
617
|
D.name,
|
|
598
618
|
" bearer token."
|
|
599
619
|
]
|
|
600
|
-
}), /* @__PURE__ */
|
|
601
|
-
htmlFor:
|
|
620
|
+
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
|
|
621
|
+
htmlFor: Z("bearer-token"),
|
|
602
622
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
603
|
-
children: ["Bearer Token ", /* @__PURE__ */
|
|
623
|
+
children: ["Bearer Token ", /* @__PURE__ */ g("span", {
|
|
604
624
|
className: "text-status-error-text",
|
|
605
625
|
children: "*"
|
|
606
626
|
})]
|
|
607
|
-
}), /* @__PURE__ */
|
|
627
|
+
}), /* @__PURE__ */ _("div", {
|
|
608
628
|
className: "relative",
|
|
609
|
-
children: [/* @__PURE__ */
|
|
629
|
+
children: [/* @__PURE__ */ g(f, {
|
|
610
630
|
size: 14,
|
|
611
631
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
612
|
-
}), /* @__PURE__ */
|
|
613
|
-
id:
|
|
632
|
+
}), /* @__PURE__ */ g("input", {
|
|
633
|
+
id: Z("bearer-token"),
|
|
614
634
|
"aria-label": "Bearer Token",
|
|
615
635
|
type: "password",
|
|
616
636
|
value: z,
|
|
617
|
-
onChange: (e) =>
|
|
637
|
+
onChange: (e) => Ze(e.target.value),
|
|
618
638
|
placeholder: "Enter your token",
|
|
619
|
-
disabled:
|
|
639
|
+
disabled: $,
|
|
620
640
|
className: "w-full pl-9 pr-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
|
|
621
641
|
})]
|
|
622
642
|
})] })]
|
|
623
643
|
}),
|
|
624
|
-
D.authType === "service_account" && /* @__PURE__ */
|
|
644
|
+
D.authType === "service_account" && /* @__PURE__ */ g("div", {
|
|
625
645
|
className: "space-y-3",
|
|
626
|
-
children: /* @__PURE__ */
|
|
646
|
+
children: /* @__PURE__ */ _("div", {
|
|
627
647
|
className: "rounded-md border border-border bg-status-success-bg-subtle p-3",
|
|
628
648
|
children: [
|
|
629
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ g("p", {
|
|
630
650
|
className: "text-sm font-medium text-foreground",
|
|
631
651
|
children: "No credentials needed"
|
|
632
652
|
}),
|
|
633
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ _("p", {
|
|
634
654
|
className: "text-xs text-muted-foreground mt-1",
|
|
635
655
|
children: [
|
|
636
656
|
D.name,
|
|
@@ -639,33 +659,103 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
639
659
|
" permission to act on your behalf; access tokens are issued securely per use — there are no keys or secrets to manage."
|
|
640
660
|
]
|
|
641
661
|
}),
|
|
642
|
-
D.defaultScopes && D.defaultScopes.length > 0 && /* @__PURE__ */
|
|
662
|
+
D.defaultScopes && D.defaultScopes.length > 0 && /* @__PURE__ */ _("p", {
|
|
643
663
|
className: "text-xs text-muted-foreground mt-2",
|
|
644
664
|
children: ["Scopes: ", D.defaultScopes.join(", ")]
|
|
645
665
|
})
|
|
646
666
|
]
|
|
647
667
|
})
|
|
648
|
-
})
|
|
668
|
+
}),
|
|
669
|
+
D.authType === "custom" && (() => {
|
|
670
|
+
let e = a(D.configSchema);
|
|
671
|
+
if (!e) return /* @__PURE__ */ _("div", {
|
|
672
|
+
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default",
|
|
673
|
+
children: [/* @__PURE__ */ g(d, {
|
|
674
|
+
size: 16,
|
|
675
|
+
className: "text-status-error-text flex-shrink-0"
|
|
676
|
+
}), /* @__PURE__ */ g("span", {
|
|
677
|
+
className: "text-sm text-status-error-text",
|
|
678
|
+
children: "This provider does not declare a configuration form."
|
|
679
|
+
})]
|
|
680
|
+
});
|
|
681
|
+
let t = new Set(e.required);
|
|
682
|
+
return /* @__PURE__ */ _("div", {
|
|
683
|
+
className: "space-y-3",
|
|
684
|
+
children: [/* @__PURE__ */ _("p", {
|
|
685
|
+
className: "text-xs text-text-secondary",
|
|
686
|
+
children: [
|
|
687
|
+
"Enter your ",
|
|
688
|
+
D.name,
|
|
689
|
+
" configuration. Secret fields are stored encrypted and never shown again."
|
|
690
|
+
]
|
|
691
|
+
}), Object.entries(e.properties).map(([e, n]) => /* @__PURE__ */ _("div", { children: [
|
|
692
|
+
/* @__PURE__ */ _("label", {
|
|
693
|
+
htmlFor: Z(`custom-${e}`),
|
|
694
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
695
|
+
children: [
|
|
696
|
+
n?.title ?? e,
|
|
697
|
+
" ",
|
|
698
|
+
t.has(e) && /* @__PURE__ */ g("span", {
|
|
699
|
+
className: "text-status-error-text",
|
|
700
|
+
children: "*"
|
|
701
|
+
})
|
|
702
|
+
]
|
|
703
|
+
}),
|
|
704
|
+
n?.secret ? /* @__PURE__ */ g("textarea", {
|
|
705
|
+
id: Z(`custom-${e}`),
|
|
706
|
+
"aria-label": n?.title ?? e,
|
|
707
|
+
value: B[e] ?? "",
|
|
708
|
+
onChange: (t) => V((n) => ({
|
|
709
|
+
...n,
|
|
710
|
+
[e]: t.target.value
|
|
711
|
+
})),
|
|
712
|
+
placeholder: n?.description,
|
|
713
|
+
disabled: $,
|
|
714
|
+
rows: 4,
|
|
715
|
+
autoComplete: "off",
|
|
716
|
+
spellCheck: !1,
|
|
717
|
+
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
|
|
718
|
+
}) : /* @__PURE__ */ g("input", {
|
|
719
|
+
id: Z(`custom-${e}`),
|
|
720
|
+
"aria-label": n?.title ?? e,
|
|
721
|
+
type: "text",
|
|
722
|
+
value: B[e] ?? "",
|
|
723
|
+
onChange: (t) => V((n) => ({
|
|
724
|
+
...n,
|
|
725
|
+
[e]: t.target.value
|
|
726
|
+
})),
|
|
727
|
+
placeholder: n?.description,
|
|
728
|
+
disabled: $,
|
|
729
|
+
autoComplete: "off",
|
|
730
|
+
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"
|
|
731
|
+
}),
|
|
732
|
+
n?.description && /* @__PURE__ */ g("p", {
|
|
733
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
734
|
+
children: n.description
|
|
735
|
+
})
|
|
736
|
+
] }, e))]
|
|
737
|
+
});
|
|
738
|
+
})()
|
|
649
739
|
]
|
|
650
740
|
})
|
|
651
741
|
]
|
|
652
|
-
}), j === "details" && /* @__PURE__ */
|
|
742
|
+
}), j === "details" && /* @__PURE__ */ _("div", {
|
|
653
743
|
className: "space-y-4",
|
|
654
|
-
children: [/* @__PURE__ */
|
|
744
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
655
745
|
className: "text-sm font-semibold text-text-primary",
|
|
656
746
|
children: "Details"
|
|
657
|
-
}), /* @__PURE__ */
|
|
747
|
+
}), /* @__PURE__ */ _("div", {
|
|
658
748
|
className: "space-y-3",
|
|
659
749
|
children: [
|
|
660
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ _("div", {
|
|
661
751
|
className: "flex items-center gap-3 p-3 rounded-md border border-border-subtle",
|
|
662
|
-
children: [/* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ g(o, {
|
|
663
753
|
provider: D,
|
|
664
754
|
size: 40
|
|
665
|
-
}), /* @__PURE__ */
|
|
755
|
+
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
666
756
|
className: "text-sm font-medium text-text-primary",
|
|
667
757
|
children: D.name
|
|
668
|
-
}), /* @__PURE__ */
|
|
758
|
+
}), /* @__PURE__ */ _("p", {
|
|
669
759
|
className: "text-xs text-text-secondary",
|
|
670
760
|
children: [
|
|
671
761
|
r(D.authType),
|
|
@@ -675,27 +765,27 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
675
765
|
]
|
|
676
766
|
})] })]
|
|
677
767
|
}),
|
|
678
|
-
D.description && /* @__PURE__ */
|
|
768
|
+
D.description && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
|
|
679
769
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
680
770
|
children: "Description"
|
|
681
|
-
}), /* @__PURE__ */
|
|
771
|
+
}), /* @__PURE__ */ g("p", {
|
|
682
772
|
className: "text-sm text-text-primary mt-1",
|
|
683
773
|
children: D.description
|
|
684
774
|
})] }),
|
|
685
|
-
D.website && /* @__PURE__ */
|
|
775
|
+
D.website && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
|
|
686
776
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
687
777
|
children: "Website"
|
|
688
|
-
}), /* @__PURE__ */
|
|
778
|
+
}), /* @__PURE__ */ g("a", {
|
|
689
779
|
href: D.website,
|
|
690
780
|
target: "_blank",
|
|
691
781
|
rel: "noopener noreferrer",
|
|
692
782
|
className: "block text-sm text-primary hover:underline mt-1",
|
|
693
783
|
children: D.website
|
|
694
784
|
})] }),
|
|
695
|
-
D.docsUrl && /* @__PURE__ */
|
|
785
|
+
D.docsUrl && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
|
|
696
786
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
697
787
|
children: "Documentation"
|
|
698
|
-
}), /* @__PURE__ */
|
|
788
|
+
}), /* @__PURE__ */ g("a", {
|
|
699
789
|
href: D.docsUrl,
|
|
700
790
|
target: "_blank",
|
|
701
791
|
rel: "noopener noreferrer",
|
|
@@ -711,6 +801,6 @@ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated:
|
|
|
711
801
|
})] }) : null;
|
|
712
802
|
}
|
|
713
803
|
//#endregion
|
|
714
|
-
export {
|
|
804
|
+
export { v as AddConnectionDialog };
|
|
715
805
|
|
|
716
806
|
//# sourceMappingURL=AddConnectionDialog.js.map
|