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