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