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