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