@burdenoff/microfe-integrations 2026.930.1 → 2026.930.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/generated/wspace-operations.d.ts +0 -137
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +73 -142
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/integrations/ConnectSourceDialog.js +10 -10
- package/dist/integrations/components/AddConnectionDialog.d.ts +15 -3
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +53 -631
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.js +69 -68
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.js +28 -28
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/ProviderCard.js +29 -29
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/hooks/useConnections.js +91 -102
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/hooks/useLogs.js +4 -4
- package/dist/integrations/hooks/useProviders.js +36 -36
- package/dist/integrations/pages/AddConnectionWizard.d.ts.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +281 -277
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +24 -24
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +7 -7
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +34 -34
- package/dist/integrations/pages/ProviderCatalog.js +4 -4
- package/dist/integrations/pages/ProviderDetail.js +110 -110
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +18 -0
- package/dist/integrations/translations/en.d.ts.map +1 -1
- package/dist/integrations/utils/appearance.d.ts +0 -3
- package/dist/integrations/utils/appearance.d.ts.map +1 -1
- package/dist/integrations/utils/appearance.js +1 -20
- package/dist/integrations/utils/appearance.js.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.js +1 -4
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/package.json +2 -2
- package/dist/integrations/assets/brands/bigconsole.js +0 -6
- package/dist/integrations/assets/brands/bigconsole.js.map +0 -1
- package/dist/integrations/assets/brands/burdenoff.js +0 -6
- package/dist/integrations/assets/brands/burdenoff.js.map +0 -1
- package/dist/integrations/components/AuthMethodSelector.d.ts +0 -30
- package/dist/integrations/components/AuthMethodSelector.d.ts.map +0 -1
- package/dist/integrations/components/AuthMethodSelector.js +0 -66
- package/dist/integrations/components/AuthMethodSelector.js.map +0 -1
- package/dist/integrations/components/CredentialStorageSelector.d.ts +0 -16
- package/dist/integrations/components/CredentialStorageSelector.d.ts.map +0 -1
- package/dist/integrations/components/CredentialStorageSelector.js +0 -262
- package/dist/integrations/components/CredentialStorageSelector.js.map +0 -1
- package/dist/integrations/components/ProviderIcon.d.ts +0 -25
- package/dist/integrations/components/ProviderIcon.d.ts.map +0 -1
- package/dist/integrations/components/ProviderIcon.js +0 -166
- package/dist/integrations/components/ProviderIcon.js.map +0 -1
- package/dist/integrations/components/SchemaForm.d.ts +0 -60
- package/dist/integrations/components/SchemaForm.d.ts.map +0 -1
- package/dist/integrations/components/SchemaForm.js +0 -235
- package/dist/integrations/components/SchemaForm.js.map +0 -1
- package/dist/integrations/hooks/useCredentialVaults.d.ts +0 -40
- package/dist/integrations/hooks/useCredentialVaults.d.ts.map +0 -1
- package/dist/integrations/hooks/useCredentialVaults.js +0 -98
- package/dist/integrations/hooks/useCredentialVaults.js.map +0 -1
- package/dist/integrations/utils/oauthPopup.d.ts +0 -16
- package/dist/integrations/utils/oauthPopup.d.ts.map +0 -1
- package/dist/integrations/utils/oauthPopup.js +0 -62
- package/dist/integrations/utils/oauthPopup.js.map +0 -1
- package/dist/node_modules/@iconify/react/dist/iconify.js +0 -1005
- package/dist/node_modules/@iconify/react/dist/iconify.js.map +0 -1
|
@@ -1,640 +1,62 @@
|
|
|
1
1
|
import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
|
|
2
2
|
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { waitForOAuthPopupCompletion as le } from "../utils/oauthPopup.js";
|
|
11
|
-
import { CredentialStorageSelector as ue } from "./CredentialStorageSelector.js";
|
|
12
|
-
import { AuthMethodNotice as de, AuthMethodSelector as fe } from "./AuthMethodSelector.js";
|
|
13
|
-
import { ProviderIcon as a } from "./ProviderIcon.js";
|
|
14
|
-
import { ConnectionModalFrame as pe } from "./ConnectionModalFrame.js";
|
|
15
|
-
import { SchemaForm as me, initialValuesFromSchema as he, isSchemaComplete as ge, parseFormSchema as _e, visibleValues as ve } from "./SchemaForm.js";
|
|
16
|
-
import { useCallback as ye, useEffect as o, useId as be, useMemo as s, useRef as c, useState as l } from "react";
|
|
17
|
-
import { AlertCircle as u, Check as xe, CheckCircle2 as Se, Copy as Ce, ExternalLink as we, Info as Te, Link2 as Ee, Loader2 as d, Search as De, Shield as f, X as Oe } from "lucide-react";
|
|
18
|
-
import { usePermissions as ke } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
19
|
-
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
20
|
-
import { IllustratedEmptyState as Ae } from "@burdenoff/fe-libs/ui";
|
|
3
|
+
import { INTEGRATION_PERMISSIONS as n } from "../constants/permissions.js";
|
|
4
|
+
import { useIntegrationsEventBus as r } from "../events/useIntegrationsEventBus.js";
|
|
5
|
+
import { useCallback as i } from "react";
|
|
6
|
+
import { useApolloClient as a } from "@apollo/client/react";
|
|
7
|
+
import { usePermissions as o } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
9
|
+
import { ConnectionDialog as c } from "@burdenoff/fe-libs/connections";
|
|
21
10
|
//#region src/integrations/components/AddConnectionDialog.tsx
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
E
|
|
48
|
-
]), o(() => {
|
|
49
|
-
if (_ && O) {
|
|
50
|
-
let e = setTimeout(() => ct.current?.focus(), 100);
|
|
51
|
-
return () => clearTimeout(e);
|
|
52
|
-
}
|
|
53
|
-
}, [_, O]);
|
|
54
|
-
let dt = !!(X && Object.prototype.hasOwnProperty.call(X.properties ?? {}, "clientId")), Z = s(() => {
|
|
55
|
-
let e = (C ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
|
|
56
|
-
if (!M.trim()) return e;
|
|
57
|
-
let t = M.toLowerCase();
|
|
58
|
-
return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t) || e.key.toLowerCase().includes(t));
|
|
59
|
-
}, [C, M]), ft = s(() => {
|
|
60
|
-
let e = {};
|
|
61
|
-
return Z.forEach((t) => {
|
|
62
|
-
let n = t.category;
|
|
63
|
-
e[n] || (e[n] = []), e[n].push(t);
|
|
64
|
-
}), e;
|
|
65
|
-
}, [Z]), pt = ye((e) => {
|
|
66
|
-
D(e), P(`${e.name} Connection`), k(!1), B("");
|
|
67
|
-
}, []), Q = Ue || Ge || at || qe || Ye, mt = ye(async () => {
|
|
68
|
-
if (!E || !N.trim()) return;
|
|
69
|
-
let e = q === "minted";
|
|
70
|
-
if (!e) {
|
|
71
|
-
if (!z.vaultId) {
|
|
72
|
-
B(x("integrations.addConnection.errors.vaultRequired", "Please select a vault for storing or referencing credentials"));
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (z.mode === "existing" && !z.secretId) {
|
|
76
|
-
B(x("integrations.addConnection.errors.secretRequired", "Please select an existing vault secret to reuse"));
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (q === "oauth2" && X && !ge(X, L)) {
|
|
81
|
-
B(x("integrations.addConnection.errors.fieldsRequired", "Please fill in all required fields"));
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (K && !K.isConfigured) {
|
|
85
|
-
B(x("integrations.addConnection.authentication.methodNotConfigured", "This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method."));
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
try {
|
|
89
|
-
B("");
|
|
90
|
-
let t = await He({
|
|
91
|
-
name: N.trim(),
|
|
92
|
-
description: F.trim() || void 0,
|
|
93
|
-
providerId: E.id,
|
|
94
|
-
authMethodKey: I ?? void 0,
|
|
95
|
-
...q === "oauth2" && X ? { config: ve(X, L) } : {},
|
|
96
|
-
...e ? {} : {
|
|
97
|
-
vaultId: z.vaultId,
|
|
98
|
-
credentialSecretId: z.mode === "existing" ? z.secretId : void 0,
|
|
99
|
-
managedSecretName: z.mode === "managed" && z.managedSecretName.trim() || void 0
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
if (!t) {
|
|
103
|
-
B(x("integrations.addConnection.errors.createFailed", "Failed to create connection"));
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
switch (st(t), q) {
|
|
107
|
-
case "oauth2": {
|
|
108
|
-
let e = await We(t, J, E.key);
|
|
109
|
-
if (e?.redirectUrl) {
|
|
110
|
-
let n = window.screenX + (window.innerWidth - 600) / 2, r = window.screenY + (window.innerHeight - 700) / 2, i = window.open(e.redirectUrl, "oauth_popup", `width=600,height=700,left=${n},top=${r},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
|
|
111
|
-
if (!i) {
|
|
112
|
-
B(x("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again."));
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
H.current = i, ot(!0), U.current?.(), U.current = le({
|
|
116
|
-
connectionId: t,
|
|
117
|
-
popup: i,
|
|
118
|
-
fetchConnectionStatus: async () => {
|
|
119
|
-
let { data: e } = await Xe({ variables: { id: t } });
|
|
120
|
-
return e?.getConnection ?? null;
|
|
121
|
-
},
|
|
122
|
-
onSuccess: () => {
|
|
123
|
-
V(!0), b?.(t);
|
|
124
|
-
},
|
|
125
|
-
onError: B,
|
|
126
|
-
onSettled: () => {
|
|
127
|
-
U.current = null, H.current = null, ot(!1);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
V(!0), b?.(t);
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
case "minted":
|
|
136
|
-
ut === "service_account" && await Je(t, Y.length > 0 ? Y : void 0), V(!0), b?.(t);
|
|
137
|
-
break;
|
|
138
|
-
default: {
|
|
139
|
-
if (X && !ge(X, L)) {
|
|
140
|
-
B(x("integrations.addConnection.errors.fieldsRequired", "Please fill in all required fields"));
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
let e = {};
|
|
144
|
-
for (let [t, n] of Object.entries(ve(X, L))) if (typeof n == "string") {
|
|
145
|
-
let r = n.trim();
|
|
146
|
-
r && (e[t] = r);
|
|
147
|
-
} else n != null && (e[t] = n);
|
|
148
|
-
await Ke(t, I ?? void 0, e), V(!0), b?.(t);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
} catch (e) {
|
|
152
|
-
B(e instanceof Error ? e.message : x("integrations.addConnection.errors.authFailed", "Authentication failed"));
|
|
11
|
+
function l(e) {
|
|
12
|
+
return e ? `${e}/integrations/oauth/callback` : "/integrations/oauth/callback";
|
|
13
|
+
}
|
|
14
|
+
function u({ open: u, onClose: d, preselectedProviderId: f, preselectedProviderKey: p, onConnectionCreated: m, presentation: h = "dialog", pickerTitle: g, extraConfig: _, renderSuccessAction: v }) {
|
|
15
|
+
let y = t(), b = a(), { apiGatewayUrl: x } = e(), { hasPermission: S, isLoading: C } = o(), w = r((e) => e.emit), T = C || S(n.CONNECTION_CREATE), E = !C && S(n.VAULT_CREATE), D = i((e) => {
|
|
16
|
+
switch (e.type) {
|
|
17
|
+
case "connection-created":
|
|
18
|
+
w("integrations:connection-created", {
|
|
19
|
+
connectionId: e.connectionId,
|
|
20
|
+
providerKey: e.providerKey
|
|
21
|
+
});
|
|
22
|
+
break;
|
|
23
|
+
case "oauth-started":
|
|
24
|
+
w("integrations:oauth-started", {
|
|
25
|
+
connectionId: e.connectionId,
|
|
26
|
+
providerKey: e.providerKey
|
|
27
|
+
});
|
|
28
|
+
break;
|
|
29
|
+
case "oauth-failed":
|
|
30
|
+
w("integrations:oauth-failed", {
|
|
31
|
+
connectionId: e.connectionId,
|
|
32
|
+
providerKey: e.providerKey,
|
|
33
|
+
error: e.error
|
|
34
|
+
});
|
|
35
|
+
break;
|
|
153
36
|
}
|
|
154
|
-
}, [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
]), ht = [{
|
|
175
|
-
key: "connection",
|
|
176
|
-
label: x("integrations.addConnection.tabs.connection", "Connection"),
|
|
177
|
-
icon: Ee
|
|
178
|
-
}, {
|
|
179
|
-
key: "details",
|
|
180
|
-
label: x("integrations.addConnection.tabs.details", "Details"),
|
|
181
|
-
icon: Te
|
|
182
|
-
}], gt = (e) => W(`tab-${e}`), _t = W("tabpanel"), vt = (e) => {
|
|
183
|
-
let t = g.indexOf(A), n;
|
|
184
|
-
e.key === "ArrowRight" || e.key === "ArrowDown" ? n = g[(t + 1) % g.length] : e.key === "ArrowLeft" || e.key === "ArrowUp" ? n = g[(t - 1 + g.length) % g.length] : e.key === "Home" ? n = g[0] : e.key === "End" && (n = g[g.length - 1]), n && (e.preventDefault(), j(n), document.getElementById(gt(n))?.focus());
|
|
185
|
-
};
|
|
186
|
-
if (!_) return null;
|
|
187
|
-
let $ = "add-connection-dialog-title", yt = "add-connection-denied-title", bt = !!E && !O && !it;
|
|
188
|
-
return !Ve && !Be ? /* @__PURE__ */ h(pe, {
|
|
189
|
-
onClose: v,
|
|
190
|
-
labelledBy: yt,
|
|
191
|
-
presentation: je,
|
|
192
|
-
size: "notice",
|
|
193
|
-
testId: "add-connection-dialog",
|
|
194
|
-
children: [
|
|
195
|
-
/* @__PURE__ */ m(f, {
|
|
196
|
-
size: 40,
|
|
197
|
-
className: "text-text-secondary"
|
|
198
|
-
}),
|
|
199
|
-
/* @__PURE__ */ m("h2", {
|
|
200
|
-
id: yt,
|
|
201
|
-
className: "text-lg font-semibold text-text-primary",
|
|
202
|
-
children: x("integrations.addConnection.denied.title", "Access Denied")
|
|
203
|
-
}),
|
|
204
|
-
/* @__PURE__ */ m("p", {
|
|
205
|
-
className: "text-sm text-text-secondary",
|
|
206
|
-
children: x("integrations.addConnection.denied.description", "You don't have permission to create connections.")
|
|
207
|
-
}),
|
|
208
|
-
/* @__PURE__ */ m("button", {
|
|
209
|
-
type: "button",
|
|
210
|
-
onClick: v,
|
|
211
|
-
className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors",
|
|
212
|
-
children: x("integrations.common.close", "Close")
|
|
213
|
-
})
|
|
214
|
-
]
|
|
215
|
-
}) : /* @__PURE__ */ h(pe, {
|
|
216
|
-
onClose: v,
|
|
217
|
-
labelledBy: $,
|
|
218
|
-
presentation: je,
|
|
219
|
-
size: "form",
|
|
220
|
-
testId: "add-connection-dialog",
|
|
221
|
-
children: [
|
|
222
|
-
/* @__PURE__ */ h("div", {
|
|
223
|
-
className: "flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0",
|
|
224
|
-
children: [/* @__PURE__ */ m("div", {
|
|
225
|
-
className: "flex items-center gap-3 min-w-0",
|
|
226
|
-
children: E && !O ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
|
|
227
|
-
provider: E,
|
|
228
|
-
size: 32
|
|
229
|
-
}), /* @__PURE__ */ h("div", {
|
|
230
|
-
className: "min-w-0",
|
|
231
|
-
children: [/* @__PURE__ */ m("h2", {
|
|
232
|
-
id: $,
|
|
233
|
-
className: "text-base font-semibold text-text-primary",
|
|
234
|
-
children: x("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: E.name })
|
|
235
|
-
}), /* @__PURE__ */ m("p", {
|
|
236
|
-
className: "text-xs text-text-secondary",
|
|
237
|
-
children: S(E.authType)
|
|
238
|
-
})]
|
|
239
|
-
})] }) : /* @__PURE__ */ h("div", {
|
|
240
|
-
className: "min-w-0",
|
|
241
|
-
children: [/* @__PURE__ */ m("h2", {
|
|
242
|
-
id: $,
|
|
243
|
-
className: "text-base font-semibold text-text-primary",
|
|
244
|
-
children: Me ?? x("integrations.addConnection.dialog.title", "Add new credential")
|
|
245
|
-
}), /* @__PURE__ */ m("p", {
|
|
246
|
-
className: "text-xs text-text-secondary",
|
|
247
|
-
children: x("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
|
|
248
|
-
})]
|
|
249
|
-
})
|
|
250
|
-
}), /* @__PURE__ */ m("button", {
|
|
251
|
-
type: "button",
|
|
252
|
-
onClick: v,
|
|
253
|
-
className: "flex-shrink-0 p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary",
|
|
254
|
-
"aria-label": x("integrations.addConnection.actions.close", "Close dialog"),
|
|
255
|
-
children: /* @__PURE__ */ m(Oe, { size: 20 })
|
|
256
|
-
})]
|
|
257
|
-
}),
|
|
258
|
-
/* @__PURE__ */ h("div", {
|
|
259
|
-
"data-testid": "add-connection-body",
|
|
260
|
-
className: "flex flex-1 min-h-0 flex-col overflow-hidden sm:flex-row",
|
|
261
|
-
children: [
|
|
262
|
-
O && !E && /* @__PURE__ */ h("div", {
|
|
263
|
-
className: "flex-1 min-h-0 p-5 overflow-y-auto",
|
|
264
|
-
children: [
|
|
265
|
-
/* @__PURE__ */ m("p", {
|
|
266
|
-
className: "text-sm text-text-secondary mb-3",
|
|
267
|
-
children: x("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
|
|
268
|
-
}),
|
|
269
|
-
/* @__PURE__ */ h("div", {
|
|
270
|
-
className: "relative mb-4",
|
|
271
|
-
children: [/* @__PURE__ */ m(De, {
|
|
272
|
-
size: 16,
|
|
273
|
-
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
274
|
-
}), /* @__PURE__ */ m("input", {
|
|
275
|
-
ref: ct,
|
|
276
|
-
type: "text",
|
|
277
|
-
value: M,
|
|
278
|
-
onChange: (e) => Ze(e.target.value),
|
|
279
|
-
placeholder: x("integrations.addConnection.search.placeholder", "Search installed providers..."),
|
|
280
|
-
"aria-label": x("integrations.addConnection.search.ariaLabel", "Search installed providers"),
|
|
281
|
-
className: "w-full pl-9 pr-3 py-2.5 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
282
|
-
})]
|
|
283
|
-
}),
|
|
284
|
-
w ? /* @__PURE__ */ m("div", {
|
|
285
|
-
className: "flex items-center justify-center py-8",
|
|
286
|
-
children: /* @__PURE__ */ m(d, {
|
|
287
|
-
size: 24,
|
|
288
|
-
className: "animate-spin text-text-secondary"
|
|
289
|
-
})
|
|
290
|
-
}) : Z.length === 0 ? /* @__PURE__ */ m(Ae, {
|
|
291
|
-
illustration: M ? "empty-search" : "empty-data",
|
|
292
|
-
title: M ? x("integrations.addConnection.empty.noMatchingProviders", "No matching providers") : x("integrations.addConnection.empty.noInstalledProviders", "No installed providers yet"),
|
|
293
|
-
description: M ? x("integrations.addConnection.empty.matchingDescription", "No installed provider matches your search. Try a different term or install one from the catalog.", { query: M }) : x("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.")
|
|
294
|
-
}) : /* @__PURE__ */ m("div", {
|
|
295
|
-
className: "max-h-[400px] overflow-y-auto space-y-1",
|
|
296
|
-
children: Object.entries(ft).map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
297
|
-
className: "px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider",
|
|
298
|
-
children: Ne(e)
|
|
299
|
-
}), t.map((e) => /* @__PURE__ */ h("button", {
|
|
300
|
-
type: "button",
|
|
301
|
-
onClick: () => pt(e),
|
|
302
|
-
className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
|
|
303
|
-
children: [/* @__PURE__ */ m(a, {
|
|
304
|
-
provider: e,
|
|
305
|
-
size: 32
|
|
306
|
-
}), /* @__PURE__ */ h("div", {
|
|
307
|
-
className: "flex-1 min-w-0",
|
|
308
|
-
children: [/* @__PURE__ */ m("div", {
|
|
309
|
-
className: "text-sm font-medium text-text-primary",
|
|
310
|
-
children: e.name
|
|
311
|
-
}), /* @__PURE__ */ m("div", {
|
|
312
|
-
className: "text-xs text-text-secondary",
|
|
313
|
-
children: S(e.authType)
|
|
314
|
-
})]
|
|
315
|
-
})]
|
|
316
|
-
}, e.id))] }, e))
|
|
317
|
-
})
|
|
318
|
-
]
|
|
319
|
-
}),
|
|
320
|
-
!O && !E && Re && /* @__PURE__ */ m("div", {
|
|
321
|
-
className: "flex-1 flex items-center justify-center",
|
|
322
|
-
children: /* @__PURE__ */ m(d, {
|
|
323
|
-
size: 32,
|
|
324
|
-
className: "animate-spin text-text-secondary"
|
|
325
|
-
})
|
|
326
|
-
}),
|
|
327
|
-
!O && !E && !Re && y && /* @__PURE__ */ h("div", {
|
|
328
|
-
className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
|
|
329
|
-
children: [/* @__PURE__ */ m(u, {
|
|
330
|
-
size: 32,
|
|
331
|
-
className: "text-text-secondary mb-3"
|
|
332
|
-
}), /* @__PURE__ */ m("p", {
|
|
333
|
-
className: "text-sm text-text-secondary",
|
|
334
|
-
children: x("integrations.addConnection.providerUnavailable", "This provider isn't available.")
|
|
335
|
-
})]
|
|
336
|
-
}),
|
|
337
|
-
it && E && /* @__PURE__ */ h("div", {
|
|
338
|
-
className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
|
|
339
|
-
children: [
|
|
340
|
-
/* @__PURE__ */ m("div", {
|
|
341
|
-
className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
|
|
342
|
-
children: /* @__PURE__ */ m(Se, {
|
|
343
|
-
size: 48,
|
|
344
|
-
className: "text-status-success-text"
|
|
345
|
-
})
|
|
346
|
-
}),
|
|
347
|
-
/* @__PURE__ */ m("h3", {
|
|
348
|
-
className: "text-lg font-semibold text-text-primary mb-1",
|
|
349
|
-
children: x("integrations.addConnection.success.title", "Connection Created!")
|
|
350
|
-
}),
|
|
351
|
-
/* @__PURE__ */ m("p", {
|
|
352
|
-
className: "text-sm text-text-secondary mb-6",
|
|
353
|
-
children: x("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: E.name })
|
|
354
|
-
}),
|
|
355
|
-
/* @__PURE__ */ m("button", {
|
|
356
|
-
type: "button",
|
|
357
|
-
onClick: v,
|
|
358
|
-
className: "px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
359
|
-
children: x("integrations.addConnection.actions.close", "Close dialog")
|
|
360
|
-
})
|
|
361
|
-
]
|
|
362
|
-
}),
|
|
363
|
-
E && bt && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
|
|
364
|
-
role: "tablist",
|
|
365
|
-
"aria-labelledby": $,
|
|
366
|
-
"data-testid": "add-connection-tabs",
|
|
367
|
-
className: "flex flex-shrink-0 overflow-x-auto border-b border-border-subtle sm:block sm:w-40 sm:overflow-x-visible sm:border-b-0 sm:border-r sm:py-3",
|
|
368
|
-
children: ht.map((e) => {
|
|
369
|
-
let t = e.icon, r = A === e.key;
|
|
370
|
-
return /* @__PURE__ */ h("button", {
|
|
371
|
-
id: gt(e.key),
|
|
372
|
-
type: "button",
|
|
373
|
-
role: "tab",
|
|
374
|
-
"aria-selected": r,
|
|
375
|
-
"aria-controls": _t,
|
|
376
|
-
tabIndex: r ? 0 : -1,
|
|
377
|
-
onClick: () => j(e.key),
|
|
378
|
-
onKeyDown: vt,
|
|
379
|
-
className: n("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", r ? "text-text-primary bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2" : "text-text-secondary hover:text-text-primary hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2"),
|
|
380
|
-
children: [/* @__PURE__ */ m(t, {
|
|
381
|
-
size: 16,
|
|
382
|
-
"aria-hidden": "true"
|
|
383
|
-
}), e.label]
|
|
384
|
-
}, e.key);
|
|
385
|
-
})
|
|
386
|
-
}), /* @__PURE__ */ h("div", {
|
|
387
|
-
id: _t,
|
|
388
|
-
role: "tabpanel",
|
|
389
|
-
"aria-labelledby": gt(A),
|
|
390
|
-
"data-testid": "add-connection-pane",
|
|
391
|
-
className: "flex-1 min-h-0 min-w-0 p-5 overflow-y-auto",
|
|
392
|
-
children: [A === "connection" && /* @__PURE__ */ h("div", {
|
|
393
|
-
className: "space-y-5",
|
|
394
|
-
children: [
|
|
395
|
-
tt && /* @__PURE__ */ h("div", {
|
|
396
|
-
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20",
|
|
397
|
-
children: [/* @__PURE__ */ m(u, {
|
|
398
|
-
size: 16,
|
|
399
|
-
className: "text-status-error-text flex-shrink-0"
|
|
400
|
-
}), /* @__PURE__ */ m("span", {
|
|
401
|
-
className: "text-sm text-status-error-text",
|
|
402
|
-
children: tt
|
|
403
|
-
})]
|
|
404
|
-
}),
|
|
405
|
-
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
|
|
406
|
-
htmlFor: W("conn-name"),
|
|
407
|
-
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
408
|
-
children: [
|
|
409
|
-
x("integrations.addConnection.fields.connectionName", "Connection Name"),
|
|
410
|
-
" ",
|
|
411
|
-
/* @__PURE__ */ m("span", {
|
|
412
|
-
className: "text-status-error-text",
|
|
413
|
-
children: "*"
|
|
414
|
-
})
|
|
415
|
-
]
|
|
416
|
-
}), /* @__PURE__ */ m("input", {
|
|
417
|
-
id: W("conn-name"),
|
|
418
|
-
"aria-label": x("integrations.addConnection.fields.connectionName", "Connection Name"),
|
|
419
|
-
type: "text",
|
|
420
|
-
value: N,
|
|
421
|
-
onChange: (e) => P(e.target.value),
|
|
422
|
-
placeholder: x("integrations.addConnection.fields.connectionNamePlaceholder", "e.g., My {{provider}} Connection", { provider: E.name }),
|
|
423
|
-
disabled: Q,
|
|
424
|
-
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
|
|
425
|
-
})] }),
|
|
426
|
-
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
427
|
-
htmlFor: W("conn-desc"),
|
|
428
|
-
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
429
|
-
children: x("integrations.addConnection.fields.description", "Description")
|
|
430
|
-
}), /* @__PURE__ */ m("input", {
|
|
431
|
-
id: W("conn-desc"),
|
|
432
|
-
"aria-label": x("integrations.addConnection.fields.description", "Description"),
|
|
433
|
-
type: "text",
|
|
434
|
-
value: F,
|
|
435
|
-
onChange: (e) => Qe(e.target.value),
|
|
436
|
-
placeholder: x("integrations.addConnection.fields.descriptionPlaceholder", "Optional description..."),
|
|
437
|
-
disabled: Q,
|
|
438
|
-
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
|
|
439
|
-
})] }),
|
|
440
|
-
E.authType !== "service_account" && /* @__PURE__ */ m(ue, {
|
|
441
|
-
value: z,
|
|
442
|
-
onChange: et,
|
|
443
|
-
providerAuthType: E.authType
|
|
444
|
-
}),
|
|
445
|
-
/* @__PURE__ */ h("div", {
|
|
446
|
-
className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4 space-y-3",
|
|
447
|
-
children: [
|
|
448
|
-
/* @__PURE__ */ h("div", {
|
|
449
|
-
className: "flex items-center justify-between gap-3",
|
|
450
|
-
children: [/* @__PURE__ */ h("h3", {
|
|
451
|
-
className: "font-medium text-text-primary flex items-center gap-2 text-sm",
|
|
452
|
-
children: [
|
|
453
|
-
/* @__PURE__ */ m(f, {
|
|
454
|
-
size: 16,
|
|
455
|
-
className: "text-primary"
|
|
456
|
-
}),
|
|
457
|
-
x("integrations.addConnection.authentication.title", "Authentication"),
|
|
458
|
-
G.length <= 1 && /* @__PURE__ */ h("span", {
|
|
459
|
-
className: "text-text-secondary font-normal",
|
|
460
|
-
children: [
|
|
461
|
-
"·",
|
|
462
|
-
" ",
|
|
463
|
-
K?.displayName ?? S(E.authType)
|
|
464
|
-
]
|
|
465
|
-
})
|
|
466
|
-
]
|
|
467
|
-
}), /* @__PURE__ */ m(fe, {
|
|
468
|
-
methods: G,
|
|
469
|
-
selectedKey: I,
|
|
470
|
-
onSelect: $e,
|
|
471
|
-
disabled: Q,
|
|
472
|
-
idPrefix: W("auth-method"),
|
|
473
|
-
compact: !0
|
|
474
|
-
})]
|
|
475
|
-
}),
|
|
476
|
-
/* @__PURE__ */ m("div", {
|
|
477
|
-
className: "space-y-2",
|
|
478
|
-
children: /* @__PURE__ */ m(de, { method: K })
|
|
479
|
-
}),
|
|
480
|
-
q === "oauth2" && /* @__PURE__ */ h(p, { children: [
|
|
481
|
-
X && /* @__PURE__ */ m(me, {
|
|
482
|
-
schema: X,
|
|
483
|
-
values: L,
|
|
484
|
-
onChange: R,
|
|
485
|
-
disabled: Q,
|
|
486
|
-
idPrefix: W("oauth-cfg")
|
|
487
|
-
}),
|
|
488
|
-
dt && /* @__PURE__ */ h("div", {
|
|
489
|
-
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 space-y-1.5",
|
|
490
|
-
children: [/* @__PURE__ */ h("div", {
|
|
491
|
-
className: "flex items-center justify-between gap-2",
|
|
492
|
-
children: [/* @__PURE__ */ m("span", {
|
|
493
|
-
className: "text-xs font-medium text-text-primary",
|
|
494
|
-
children: x("integrations.addConnection.authentication.redirectUriLabel", "Redirect URL to register in your app")
|
|
495
|
-
}), /* @__PURE__ */ h("button", {
|
|
496
|
-
type: "button",
|
|
497
|
-
onClick: () => {
|
|
498
|
-
navigator.clipboard?.writeText(J), rt(!0), window.setTimeout(() => rt(!1), 2e3);
|
|
499
|
-
},
|
|
500
|
-
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",
|
|
501
|
-
children: [/* @__PURE__ */ m(Ce, { size: 12 }), nt ? x("integrations.addConnection.authentication.copied", "Copied") : x("integrations.addConnection.authentication.copy", "Copy")]
|
|
502
|
-
})]
|
|
503
|
-
}), /* @__PURE__ */ m("code", {
|
|
504
|
-
className: "block break-all text-xs text-text-secondary",
|
|
505
|
-
children: J
|
|
506
|
-
})]
|
|
507
|
-
}),
|
|
508
|
-
/* @__PURE__ */ h("div", {
|
|
509
|
-
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
|
|
510
|
-
children: [/* @__PURE__ */ m(we, {
|
|
511
|
-
size: 14,
|
|
512
|
-
className: "text-status-info-text flex-shrink-0"
|
|
513
|
-
}), /* @__PURE__ */ m("span", {
|
|
514
|
-
className: "text-xs text-status-info-text",
|
|
515
|
-
children: x("integrations.addConnection.authentication.oauthPopupInfo", "A popup window will open for {{provider}} sign-in", { provider: E.name })
|
|
516
|
-
})]
|
|
517
|
-
})
|
|
518
|
-
] }),
|
|
519
|
-
q === "minted" && /* @__PURE__ */ h("div", {
|
|
520
|
-
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
|
|
521
|
-
children: [/* @__PURE__ */ m(f, {
|
|
522
|
-
size: 14,
|
|
523
|
-
className: "text-status-info-text flex-shrink-0"
|
|
524
|
-
}), /* @__PURE__ */ m("span", {
|
|
525
|
-
className: "text-xs text-status-info-text",
|
|
526
|
-
children: x("integrations.addConnection.authentication.serviceAccount.description", "No credentials to enter — access is granted on your behalf and tokens are issued per use.", { provider: E.name })
|
|
527
|
-
})]
|
|
528
|
-
}),
|
|
529
|
-
q === "fields" && (X ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("p", {
|
|
530
|
-
className: "text-xs text-text-secondary",
|
|
531
|
-
children: x("integrations.addConnection.authentication.secretsEncrypted", "Secret values are stored encrypted and never shown again.")
|
|
532
|
-
}), /* @__PURE__ */ m(me, {
|
|
533
|
-
schema: X,
|
|
534
|
-
values: L,
|
|
535
|
-
onChange: R,
|
|
536
|
-
disabled: Q,
|
|
537
|
-
idPrefix: W("cred")
|
|
538
|
-
})] }) : /* @__PURE__ */ h("div", {
|
|
539
|
-
className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default",
|
|
540
|
-
children: [/* @__PURE__ */ m(u, {
|
|
541
|
-
size: 16,
|
|
542
|
-
className: "text-status-error-text flex-shrink-0"
|
|
543
|
-
}), /* @__PURE__ */ m("span", {
|
|
544
|
-
className: "text-sm text-status-error-text",
|
|
545
|
-
children: x("integrations.addConnection.authentication.noForm", "This authentication method does not declare a configuration form.")
|
|
546
|
-
})]
|
|
547
|
-
}))
|
|
548
|
-
]
|
|
549
|
-
})
|
|
550
|
-
]
|
|
551
|
-
}), A === "details" && /* @__PURE__ */ h("div", {
|
|
552
|
-
className: "space-y-4",
|
|
553
|
-
children: [/* @__PURE__ */ m("h3", {
|
|
554
|
-
className: "text-sm font-semibold text-text-primary",
|
|
555
|
-
children: x("integrations.addConnection.tabs.details", "Details")
|
|
556
|
-
}), /* @__PURE__ */ h("div", {
|
|
557
|
-
className: "space-y-3",
|
|
558
|
-
children: [
|
|
559
|
-
/* @__PURE__ */ h("div", {
|
|
560
|
-
className: "flex items-center gap-3 p-3 rounded-md border border-border-subtle",
|
|
561
|
-
children: [/* @__PURE__ */ m(a, {
|
|
562
|
-
provider: E,
|
|
563
|
-
size: 40
|
|
564
|
-
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
|
|
565
|
-
className: "text-sm font-medium text-text-primary",
|
|
566
|
-
children: E.name
|
|
567
|
-
}), /* @__PURE__ */ h("p", {
|
|
568
|
-
className: "text-xs text-text-secondary",
|
|
569
|
-
children: [
|
|
570
|
-
S(E.authType),
|
|
571
|
-
" ·",
|
|
572
|
-
" ",
|
|
573
|
-
Ne(E.category)
|
|
574
|
-
]
|
|
575
|
-
})] })]
|
|
576
|
-
}),
|
|
577
|
-
E.description && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
578
|
-
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
579
|
-
children: x("integrations.addConnection.fields.description", "Description")
|
|
580
|
-
}), /* @__PURE__ */ m("p", {
|
|
581
|
-
className: "text-sm text-text-primary mt-1",
|
|
582
|
-
children: E.description
|
|
583
|
-
})] }),
|
|
584
|
-
E.website && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
585
|
-
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
586
|
-
children: x("integrations.providerDetail.sections.website", "Website")
|
|
587
|
-
}), /* @__PURE__ */ m("a", {
|
|
588
|
-
href: E.website,
|
|
589
|
-
target: "_blank",
|
|
590
|
-
rel: "noopener noreferrer",
|
|
591
|
-
className: "block text-sm text-primary hover:underline mt-1",
|
|
592
|
-
children: E.website
|
|
593
|
-
})] }),
|
|
594
|
-
E.docsUrl && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
|
|
595
|
-
className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
|
|
596
|
-
children: x("integrations.providerDetail.sections.documentation", "Documentation")
|
|
597
|
-
}), /* @__PURE__ */ m("a", {
|
|
598
|
-
href: E.docsUrl,
|
|
599
|
-
target: "_blank",
|
|
600
|
-
rel: "noopener noreferrer",
|
|
601
|
-
className: "block text-sm text-primary hover:underline mt-1",
|
|
602
|
-
children: E.docsUrl
|
|
603
|
-
})] })
|
|
604
|
-
]
|
|
605
|
-
})]
|
|
606
|
-
})]
|
|
607
|
-
})] })
|
|
608
|
-
]
|
|
609
|
-
}),
|
|
610
|
-
E && bt && /* @__PURE__ */ h("div", {
|
|
611
|
-
"data-testid": "add-connection-footer",
|
|
612
|
-
className: "flex flex-shrink-0 items-center justify-end gap-2 border-t border-border-subtle px-5 py-3",
|
|
613
|
-
children: [/* @__PURE__ */ m("button", {
|
|
614
|
-
type: "button",
|
|
615
|
-
onClick: v,
|
|
616
|
-
className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle text-text-primary hover:bg-accent transition-colors",
|
|
617
|
-
children: x("integrations.addConnection.actions.cancel", "Cancel")
|
|
618
|
-
}), /* @__PURE__ */ h("button", {
|
|
619
|
-
type: "button",
|
|
620
|
-
"data-testid": "add-connection-submit",
|
|
621
|
-
onClick: mt,
|
|
622
|
-
disabled: Q || !N.trim(),
|
|
623
|
-
className: "inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
624
|
-
children: [Q ? /* @__PURE__ */ m(d, {
|
|
625
|
-
size: 14,
|
|
626
|
-
className: "animate-spin",
|
|
627
|
-
"aria-hidden": "true"
|
|
628
|
-
}) : /* @__PURE__ */ m(xe, {
|
|
629
|
-
size: 14,
|
|
630
|
-
"aria-hidden": "true"
|
|
631
|
-
}), at ? x("integrations.addConnection.actions.waiting", "Waiting...") : x("integrations.addConnection.actions.connect", "Connect")]
|
|
632
|
-
})]
|
|
633
|
-
})
|
|
634
|
-
]
|
|
37
|
+
}, [w]), O = i((e) => m?.(e.id), [m]);
|
|
38
|
+
return /* @__PURE__ */ s(c, {
|
|
39
|
+
open: u,
|
|
40
|
+
onClose: d,
|
|
41
|
+
client: b,
|
|
42
|
+
callbackUrl: l(x),
|
|
43
|
+
translate: y,
|
|
44
|
+
providerId: f ?? null,
|
|
45
|
+
providerKey: p ?? null,
|
|
46
|
+
providerSource: "installed",
|
|
47
|
+
requireVault: !0,
|
|
48
|
+
canCreate: T,
|
|
49
|
+
canCreateVault: E,
|
|
50
|
+
extraConfig: _,
|
|
51
|
+
refetchQueriesOnCreate: ["GetConnections"],
|
|
52
|
+
presentation: h,
|
|
53
|
+
pickerTitle: g,
|
|
54
|
+
renderSuccessAction: v,
|
|
55
|
+
onConnectionCreated: O,
|
|
56
|
+
onEvent: D
|
|
635
57
|
});
|
|
636
58
|
}
|
|
637
59
|
//#endregion
|
|
638
|
-
export {
|
|
60
|
+
export { u as AddConnectionDialog };
|
|
639
61
|
|
|
640
62
|
//# sourceMappingURL=AddConnectionDialog.js.map
|