@burdenoff/fe-libs 2026.1113.6 → 2026.1113.8
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/connections/ConnectionDialog.d.ts +13 -1
- package/dist/connections/ConnectionDialog.js +13 -11
- package/dist/connections/ConnectionDialogPanel.d.ts +5 -1
- package/dist/connections/ConnectionDialogPanel.js +230 -150
- package/dist/connections/ConnectionFormTab.d.ts +15 -0
- package/dist/connections/ConnectionFormTab.js +192 -189
- package/dist/connections/CredentialStorageSelector.d.ts +9 -0
- package/dist/connections/CredentialStorageSelector.js +145 -137
- package/dist/connections/OneScreenConnectionForm.d.ts +22 -0
- package/dist/connections/OneScreenConnectionForm.js +231 -0
- package/dist/connections/ProviderPickerPanel.d.ts +6 -0
- package/dist/connections/ProviderPickerPanel.js +98 -45
- package/dist/connections/api.d.ts +3 -0
- package/dist/connections/api.js +4 -2
- package/dist/connections/connectionFlow.d.ts +18 -0
- package/dist/connections/connectionFlow.js +3 -3
- package/dist/connections/index.d.ts +4 -3
- package/dist/connections/picker.d.ts +18 -0
- package/dist/connections/picker.js +35 -6
- package/dist/connections/scopes.d.ts +8 -0
- package/dist/connections/scopes.js +9 -1
- package/dist/connections/storage.d.ts +9 -1
- package/dist/connections/storage.js +13 -1
- package/dist/connections/types.d.ts +16 -0
- package/dist/connections/useConnectionSubmit.d.ts +38 -2
- package/dist/connections/useConnectionSubmit.js +115 -71
- package/dist/connections.js +11 -10
- package/dist/credentials/SchemaForm.d.ts +7 -1
- package/dist/credentials/SchemaForm.js +64 -64
- package/dist/credentials/index.d.ts +2 -2
- package/dist/credentials/schema.d.ts +11 -1
- package/dist/credentials/schema.js +13 -5
- package/dist/credentials/types.d.ts +9 -0
- package/dist/credentials.js +5 -5
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/use-heading-document-title.d.ts +19 -0
- package/dist/ui/use-heading-document-title.js +29 -0
- package/dist/ui.js +49 -48
- package/package.json +1 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { AuthMethodNotice as e, AuthMethodSelector as t } from "../credentials/AuthMethodSelector.js";
|
|
2
|
+
import { hasFieldsInPart as n } from "../credentials/schema.js";
|
|
3
|
+
import { SchemaForm as r } from "../credentials/SchemaForm.js";
|
|
4
|
+
import { OptionalFields as i } from "../ui/optional-fields.js";
|
|
5
|
+
import { collectsOwnClientId as a, needsCredentialStorage as o } from "./connectionFlow.js";
|
|
6
|
+
import { RedirectUrlBox as s, SecretReferenceChips as c } from "./ConnectionFormTab.js";
|
|
7
|
+
import { CredentialStorageSelector as l } from "./CredentialStorageSelector.js";
|
|
8
|
+
import { INPUT_CLASS as u } from "./frame.js";
|
|
9
|
+
import { ScopePicker as d } from "./ScopePicker.js";
|
|
10
|
+
import { grantedScopeSummary as f } from "./scopes.js";
|
|
11
|
+
import { AlertCircle as p, ExternalLink as m, Shield as h } from "lucide-react";
|
|
12
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
|
+
// src/connections/OneScreenConnectionForm.tsx
|
|
14
|
+
var y = "connections.connect.more-options", b = (e) => !!(e && /^https?:\/\//i.test(e));
|
|
15
|
+
function x(e, t, n) {
|
|
16
|
+
return e === "oauth2" ? n("integrations.addConnection.oneScreen.oauthIntro", "We'll open {{provider}} so you can sign in.", { provider: t }) : e === "minted" ? n("integrations.addConnection.oneScreen.mintedIntro", "Nothing to enter. Click Connect.", { provider: t }) : n("integrations.addConnection.oneScreen.fieldsIntro", "Enter the details from your {{provider}} account. They are stored encrypted and never shown again.", { provider: t });
|
|
17
|
+
}
|
|
18
|
+
var S = ({ message: e, signInBlocked: t, onOpenSignIn: n, translate: r }) => /* @__PURE__ */ v("div", {
|
|
19
|
+
role: "alert",
|
|
20
|
+
className: "space-y-2 rounded-md border border-status-error-border/20 bg-status-error-bg/10 px-3 py-2",
|
|
21
|
+
children: [/* @__PURE__ */ v("div", {
|
|
22
|
+
className: "flex items-start gap-2",
|
|
23
|
+
children: [/* @__PURE__ */ _(p, {
|
|
24
|
+
size: 16,
|
|
25
|
+
className: "mt-0.5 flex-shrink-0 text-status-error-text"
|
|
26
|
+
}), /* @__PURE__ */ _("span", {
|
|
27
|
+
className: "text-sm text-status-error-text",
|
|
28
|
+
children: e
|
|
29
|
+
})]
|
|
30
|
+
}), t && /* @__PURE__ */ v("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"data-testid": "open-sign-in-window",
|
|
33
|
+
onClick: n,
|
|
34
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
35
|
+
children: [/* @__PURE__ */ _(m, {
|
|
36
|
+
size: 14,
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}), r("integrations.addConnection.actions.openSignInWindow", "Open sign-in window")]
|
|
39
|
+
})]
|
|
40
|
+
}), C = ({ permissions: e, translate: t }) => /* @__PURE__ */ v("div", {
|
|
41
|
+
className: "space-y-1.5",
|
|
42
|
+
"data-testid": "connect-permissions-summary",
|
|
43
|
+
children: [/* @__PURE__ */ v("p", {
|
|
44
|
+
className: "flex items-center gap-2 text-sm font-medium text-text-primary",
|
|
45
|
+
children: [/* @__PURE__ */ _(h, {
|
|
46
|
+
size: 16,
|
|
47
|
+
className: "text-primary",
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
}), t("integrations.addConnection.oneScreen.permissionsTitle", "This app will be able to:")]
|
|
50
|
+
}), /* @__PURE__ */ _("ul", {
|
|
51
|
+
className: "list-disc space-y-0.5 ps-9 text-sm text-text-secondary",
|
|
52
|
+
children: e.map((e) => /* @__PURE__ */ _("li", { children: e }, e))
|
|
53
|
+
})]
|
|
54
|
+
}), w = ({ id: e, label: t, required: n = !1, value: r, onChange: i, placeholder: a, disabled: o }) => /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
55
|
+
htmlFor: e,
|
|
56
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
57
|
+
children: [t, n && /* @__PURE__ */ v(g, { children: [" ", /* @__PURE__ */ _("span", {
|
|
58
|
+
className: "text-status-error-text",
|
|
59
|
+
children: "*"
|
|
60
|
+
})] })]
|
|
61
|
+
}), /* @__PURE__ */ _("input", {
|
|
62
|
+
id: e,
|
|
63
|
+
type: "text",
|
|
64
|
+
value: r,
|
|
65
|
+
onChange: (e) => i(e.target.value),
|
|
66
|
+
placeholder: a,
|
|
67
|
+
disabled: o,
|
|
68
|
+
className: u
|
|
69
|
+
})] }), T = ({ provider: t, method: i, flow: a, schema: o, values: s, setValues: c, busy: l, translate: u, fieldId: d }) => {
|
|
70
|
+
let f = a !== "minted" && o !== null && n(o, s, "primary");
|
|
71
|
+
return /* @__PURE__ */ v(g, { children: [
|
|
72
|
+
/* @__PURE__ */ _("p", {
|
|
73
|
+
className: "text-sm text-text-secondary",
|
|
74
|
+
"data-testid": "connect-intro",
|
|
75
|
+
children: x(a, t.name, u)
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ _("div", {
|
|
78
|
+
className: "space-y-2",
|
|
79
|
+
children: /* @__PURE__ */ _(e, {
|
|
80
|
+
method: i,
|
|
81
|
+
translate: u
|
|
82
|
+
})
|
|
83
|
+
}),
|
|
84
|
+
a === "fields" && !o && /* @__PURE__ */ v("div", {
|
|
85
|
+
className: "flex items-center gap-2 rounded-md border border-border-default bg-status-error-bg-subtle px-3 py-2",
|
|
86
|
+
children: [/* @__PURE__ */ _(p, {
|
|
87
|
+
size: 16,
|
|
88
|
+
className: "flex-shrink-0 text-status-error-text"
|
|
89
|
+
}), /* @__PURE__ */ _("span", {
|
|
90
|
+
className: "text-sm text-status-error-text",
|
|
91
|
+
children: u("integrations.addConnection.authentication.noForm", "This authentication method does not declare a configuration form.")
|
|
92
|
+
})]
|
|
93
|
+
}),
|
|
94
|
+
f && o && /* @__PURE__ */ v("div", {
|
|
95
|
+
className: "space-y-2",
|
|
96
|
+
children: [/* @__PURE__ */ _(r, {
|
|
97
|
+
schema: o,
|
|
98
|
+
values: s,
|
|
99
|
+
onChange: c,
|
|
100
|
+
disabled: l,
|
|
101
|
+
idPrefix: d("credential"),
|
|
102
|
+
translate: u,
|
|
103
|
+
part: "primary"
|
|
104
|
+
}), b(t.docsUrl) && /* @__PURE__ */ v("a", {
|
|
105
|
+
href: t.docsUrl,
|
|
106
|
+
target: "_blank",
|
|
107
|
+
rel: "noopener noreferrer",
|
|
108
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",
|
|
109
|
+
children: [u("integrations.addConnection.oneScreen.whereToFind", "Where do I find this?"), /* @__PURE__ */ _(m, {
|
|
110
|
+
size: 12,
|
|
111
|
+
"aria-hidden": "true"
|
|
112
|
+
})]
|
|
113
|
+
})]
|
|
114
|
+
})
|
|
115
|
+
] });
|
|
116
|
+
}, E = ({ provider: e, methods: n, method: r, name: i, onNameChange: a, description: o, onDescriptionChange: s, onMethodChange: c, busy: l, translate: u, fieldId: d }) => /* @__PURE__ */ v(g, { children: [
|
|
117
|
+
/* @__PURE__ */ _(w, {
|
|
118
|
+
id: d("name"),
|
|
119
|
+
label: u("integrations.addConnection.fields.connectionName", "Connection Name"),
|
|
120
|
+
required: !0,
|
|
121
|
+
value: i,
|
|
122
|
+
onChange: a,
|
|
123
|
+
placeholder: u("integrations.addConnection.fields.connectionNamePlaceholder", "e.g., My {{provider}} Connection", { provider: e.name }),
|
|
124
|
+
disabled: l
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ _(w, {
|
|
127
|
+
id: d("description"),
|
|
128
|
+
label: u("integrations.addConnection.fields.description", "Description"),
|
|
129
|
+
value: o,
|
|
130
|
+
onChange: s,
|
|
131
|
+
placeholder: u("integrations.addConnection.fields.descriptionPlaceholder", "Optional description..."),
|
|
132
|
+
disabled: l
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ _(t, {
|
|
135
|
+
methods: n,
|
|
136
|
+
selectedKey: r?.key ?? null,
|
|
137
|
+
onSelect: c,
|
|
138
|
+
disabled: l,
|
|
139
|
+
idPrefix: d("auth-method"),
|
|
140
|
+
translate: u
|
|
141
|
+
})
|
|
142
|
+
] }), D = ({ flow: e, schema: t, values: i, setValues: o, scopeOptions: l, defaultScopes: u, scopeSelection: f, setScopeSelection: p, callbackUrl: m, busy: h, translate: y, fieldId: b }) => {
|
|
143
|
+
let x = e !== "minted" && t !== null && n(t, i, "more");
|
|
144
|
+
return /* @__PURE__ */ v(g, { children: [
|
|
145
|
+
x && t && /* @__PURE__ */ _(r, {
|
|
146
|
+
schema: t,
|
|
147
|
+
values: i,
|
|
148
|
+
onChange: o,
|
|
149
|
+
disabled: h,
|
|
150
|
+
idPrefix: b("credential"),
|
|
151
|
+
translate: y,
|
|
152
|
+
part: "more"
|
|
153
|
+
}),
|
|
154
|
+
e === "fields" && t && /* @__PURE__ */ v("div", {
|
|
155
|
+
className: "space-y-1.5",
|
|
156
|
+
children: [/* @__PURE__ */ v("p", {
|
|
157
|
+
className: "text-xs text-text-secondary",
|
|
158
|
+
children: [
|
|
159
|
+
y("integrations.addConnection.secretReferences.hint", "Or reference a secret from an external secret manager:"),
|
|
160
|
+
" ",
|
|
161
|
+
/* @__PURE__ */ _("code", {
|
|
162
|
+
className: "rounded bg-bg-muted px-1 py-0.5 font-mono text-text-primary",
|
|
163
|
+
children: "{{ $secrets.<provider>.<name> }}"
|
|
164
|
+
})
|
|
165
|
+
]
|
|
166
|
+
}), /* @__PURE__ */ _(c, {
|
|
167
|
+
values: i,
|
|
168
|
+
translate: y
|
|
169
|
+
})]
|
|
170
|
+
}),
|
|
171
|
+
e === "oauth2" && a(t) && /* @__PURE__ */ _(s, {
|
|
172
|
+
callbackUrl: m,
|
|
173
|
+
translate: y
|
|
174
|
+
}),
|
|
175
|
+
e !== "fields" && /* @__PURE__ */ _(d, {
|
|
176
|
+
options: l,
|
|
177
|
+
defaultScopes: u,
|
|
178
|
+
selection: f,
|
|
179
|
+
onChange: p,
|
|
180
|
+
translate: y,
|
|
181
|
+
disabled: h
|
|
182
|
+
})
|
|
183
|
+
] });
|
|
184
|
+
}, O = ({ api: e, provider: t, method: n, storage: r, setStorage: i, supportedStorageModes: a, requireVault: o, canCreateVault: s, busy: c, translate: u, onVaultsLoaded: d }) => /* @__PURE__ */ _(l, {
|
|
185
|
+
api: e,
|
|
186
|
+
value: r,
|
|
187
|
+
onChange: i,
|
|
188
|
+
supportedStorageModes: a,
|
|
189
|
+
authType: n?.authType ?? t.authType,
|
|
190
|
+
requireVault: o,
|
|
191
|
+
canCreateVault: s,
|
|
192
|
+
translate: u,
|
|
193
|
+
disabled: c,
|
|
194
|
+
autoSelectVault: !0,
|
|
195
|
+
onVaultsLoaded: d
|
|
196
|
+
}), k = (e) => {
|
|
197
|
+
let { provider: t, flow: n, reconnect: r, storageAtTop: a, sharing: s, about: c, translate: l } = e, u = n === "fields" ? [] : f(e.scopeOptions, e.scopeSelection, e.defaultScopes), d = !r && o(n, t) ? /* @__PURE__ */ _(O, { ...e }) : null;
|
|
198
|
+
return /* @__PURE__ */ v("div", {
|
|
199
|
+
className: "space-y-5",
|
|
200
|
+
"data-testid": "one-screen-connection-form",
|
|
201
|
+
children: [
|
|
202
|
+
e.errorMessage && /* @__PURE__ */ _(S, {
|
|
203
|
+
message: e.errorMessage,
|
|
204
|
+
signInBlocked: e.signInBlocked,
|
|
205
|
+
onOpenSignIn: e.onOpenSignIn,
|
|
206
|
+
translate: l
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ _(T, { ...e }),
|
|
209
|
+
u.length > 0 && /* @__PURE__ */ _(C, {
|
|
210
|
+
permissions: u,
|
|
211
|
+
translate: l
|
|
212
|
+
}),
|
|
213
|
+
a && d,
|
|
214
|
+
/* @__PURE__ */ _(i, {
|
|
215
|
+
storageKey: y,
|
|
216
|
+
label: l("integrations.addConnection.oneScreen.moreOptions", "More options"),
|
|
217
|
+
children: /* @__PURE__ */ v("div", {
|
|
218
|
+
className: "space-y-5",
|
|
219
|
+
children: [
|
|
220
|
+
!r && /* @__PURE__ */ _(E, { ...e }),
|
|
221
|
+
/* @__PURE__ */ _(D, { ...e }),
|
|
222
|
+
!a && d,
|
|
223
|
+
!r && s,
|
|
224
|
+
c
|
|
225
|
+
]
|
|
226
|
+
})
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
export { y as CONNECT_MORE_OPTIONS_KEY, k as OneScreenConnectionForm };
|
|
@@ -9,6 +9,12 @@ interface ProviderPickerPanelProps {
|
|
|
9
9
|
/** The dialog focuses this on open. */
|
|
10
10
|
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
11
11
|
onSelect: (provider: ConnectionProvider) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Navigation v2 (BOFF-11875): "Popular" apps first, no auth-type label, an
|
|
14
|
+
* "Ask an admin" hint on apps nobody has set up a sign-in for, and an empty
|
|
15
|
+
* state that does not ask the person to install anything.
|
|
16
|
+
*/
|
|
17
|
+
navigationV2?: boolean;
|
|
12
18
|
}
|
|
13
19
|
export declare const ProviderPickerPanel: FC<ProviderPickerPanelProps>;
|
|
14
20
|
export {};
|
|
@@ -2,82 +2,135 @@ import { cn as e } from "../lib/utils.js";
|
|
|
2
2
|
import { IllustratedEmptyState as t } from "../ui/illustration.js";
|
|
3
3
|
import { INPUT_CLASS as n } from "./frame.js";
|
|
4
4
|
import { authTypeLabel as r, categoryLabel as i } from "./labels.js";
|
|
5
|
-
import { groupByCategory as a,
|
|
6
|
-
import { ProviderIcon as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Loader2 as
|
|
9
|
-
import { jsx as
|
|
5
|
+
import { groupByCategory as a, needsAdminSetup as o, pickableProviders as s, popularFirst as c } from "./picker.js";
|
|
6
|
+
import { ProviderIcon as l } from "./ProviderIcon.js";
|
|
7
|
+
import { useEffect as u, useMemo as d, useState as f } from "react";
|
|
8
|
+
import { Loader2 as p, Search as m } from "lucide-react";
|
|
9
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
10
|
// src/connections/ProviderPickerPanel.tsx
|
|
11
|
-
var
|
|
12
|
-
let
|
|
13
|
-
|
|
11
|
+
var _ = ({ providers: e, translate: t, onSelect: n }) => {
|
|
12
|
+
let r = d(() => {
|
|
13
|
+
let { popular: n, others: r } = c(e);
|
|
14
|
+
return [...n.length > 0 ? [{
|
|
15
|
+
key: "popular",
|
|
16
|
+
label: t("integrations.addConnection.picker.popular", "Popular"),
|
|
17
|
+
items: n
|
|
18
|
+
}] : [], ...a(r).map(([e, n]) => ({
|
|
19
|
+
key: e,
|
|
20
|
+
label: i(e, t),
|
|
21
|
+
items: n
|
|
22
|
+
}))];
|
|
23
|
+
}, [e, t]);
|
|
24
|
+
return /* @__PURE__ */ h("div", {
|
|
25
|
+
className: "space-y-1",
|
|
26
|
+
"data-testid": "provider-picker-groups",
|
|
27
|
+
children: r.map((e) => /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("div", {
|
|
28
|
+
className: "px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary",
|
|
29
|
+
children: e.label
|
|
30
|
+
}), e.items.map((e) => /* @__PURE__ */ h(v, {
|
|
31
|
+
provider: e,
|
|
32
|
+
translate: t,
|
|
33
|
+
onSelect: n
|
|
34
|
+
}, e.id))] }, e.key))
|
|
35
|
+
});
|
|
36
|
+
}, v = ({ provider: e, translate: t, onSelect: n }) => /* @__PURE__ */ g("button", {
|
|
37
|
+
type: "button",
|
|
38
|
+
onClick: () => n(e),
|
|
39
|
+
className: "flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-start transition-colors hover:bg-accent/50",
|
|
40
|
+
children: [/* @__PURE__ */ h(l, {
|
|
41
|
+
provider: e,
|
|
42
|
+
size: 32
|
|
43
|
+
}), /* @__PURE__ */ g("span", {
|
|
44
|
+
className: "min-w-0 flex-1",
|
|
45
|
+
children: [/* @__PURE__ */ h("span", {
|
|
46
|
+
className: "block text-sm font-medium text-text-primary",
|
|
47
|
+
children: e.name
|
|
48
|
+
}), o(e) && /* @__PURE__ */ h("span", {
|
|
49
|
+
className: "block text-xs text-text-secondary",
|
|
50
|
+
children: t("integrations.addConnection.picker.askAdmin", "Ask an admin to set this up")
|
|
51
|
+
})]
|
|
52
|
+
})]
|
|
53
|
+
}), y = ({ search: e, translate: n }) => /* @__PURE__ */ h(t, {
|
|
54
|
+
illustration: e ? "empty-search" : "empty-data",
|
|
55
|
+
title: e ? n("integrations.addConnection.picker.noMatchTitle", "No app matches your search") : n("integrations.addConnection.picker.emptyTitle", "No apps to connect yet"),
|
|
56
|
+
description: e ? n("integrations.addConnection.picker.noMatchDescription", "Try a different name, or ask an admin to add the app you need.", { query: e }) : n("integrations.addConnection.picker.emptyDescription", "Ask a workspace admin to turn on the apps your workflows need.")
|
|
57
|
+
}), b = ({ api: o, source: c, translate: v, searchInputRef: b, onSelect: x, navigationV2: S = !1 }) => {
|
|
58
|
+
let [C, w] = f([]), [T, E] = f(!0), [D, O] = f(""), k = c === "installed";
|
|
59
|
+
u(() => {
|
|
14
60
|
let e = !1;
|
|
15
|
-
return
|
|
16
|
-
e ||
|
|
61
|
+
return o.listProviders(c).then((t) => {
|
|
62
|
+
e || w(t);
|
|
17
63
|
}).catch(() => {
|
|
18
|
-
e ||
|
|
64
|
+
e || w([]);
|
|
19
65
|
}).finally(() => {
|
|
20
|
-
e ||
|
|
66
|
+
e || E(!1);
|
|
21
67
|
}), () => {
|
|
22
68
|
e = !0;
|
|
23
69
|
};
|
|
24
|
-
}, [
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]),
|
|
31
|
-
return /* @__PURE__ */
|
|
70
|
+
}, [o, c]);
|
|
71
|
+
let A = d(() => s(C, c, D, v), [
|
|
72
|
+
C,
|
|
73
|
+
c,
|
|
74
|
+
D,
|
|
75
|
+
v
|
|
76
|
+
]), j = d(() => a(A), [A]);
|
|
77
|
+
return /* @__PURE__ */ g("div", {
|
|
32
78
|
className: "min-h-0 flex-1 overflow-y-auto p-5",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ g("div", {
|
|
34
80
|
className: "relative mb-4",
|
|
35
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ h(m, {
|
|
36
82
|
size: 16,
|
|
37
83
|
className: "absolute start-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
38
|
-
}), /* @__PURE__ */
|
|
39
|
-
ref:
|
|
84
|
+
}), /* @__PURE__ */ h("input", {
|
|
85
|
+
ref: b,
|
|
40
86
|
type: "text",
|
|
41
|
-
value:
|
|
42
|
-
onChange: (e) =>
|
|
43
|
-
placeholder:
|
|
44
|
-
"aria-label":
|
|
87
|
+
value: D,
|
|
88
|
+
onChange: (e) => O(e.target.value),
|
|
89
|
+
placeholder: k ? v("integrations.addConnection.search.placeholder", "Search installed providers...") : v("integrations.addConnection.search.catalogPlaceholder", "Search providers..."),
|
|
90
|
+
"aria-label": k ? v("integrations.addConnection.search.ariaLabel", "Search installed providers") : v("integrations.addConnection.search.catalogAriaLabel", "Search providers"),
|
|
45
91
|
className: e(n, "py-2.5 ps-9")
|
|
46
92
|
})]
|
|
47
|
-
}),
|
|
93
|
+
}), T ? /* @__PURE__ */ h("div", {
|
|
48
94
|
className: "flex items-center justify-center py-8",
|
|
49
|
-
children: /* @__PURE__ */ p
|
|
95
|
+
children: /* @__PURE__ */ h(p, {
|
|
50
96
|
size: 24,
|
|
51
97
|
className: "animate-spin text-text-secondary"
|
|
52
98
|
})
|
|
53
|
-
}) :
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
99
|
+
}) : A.length === 0 ? S ? /* @__PURE__ */ h(y, {
|
|
100
|
+
search: D,
|
|
101
|
+
translate: v
|
|
102
|
+
}) : /* @__PURE__ */ h(t, {
|
|
103
|
+
illustration: D ? "empty-search" : "empty-data",
|
|
104
|
+
title: D ? v("integrations.addConnection.empty.noMatchingProviders", "No matching providers") : v("integrations.addConnection.empty.noInstalledProviders", "No installed providers yet"),
|
|
105
|
+
description: D ? v("integrations.addConnection.empty.matchingDescription", "No installed provider matches your search. Try a different term or install one from the catalog.", { query: D }) : v("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.")
|
|
106
|
+
}) : S ? /* @__PURE__ */ h(_, {
|
|
107
|
+
providers: A,
|
|
108
|
+
translate: v,
|
|
109
|
+
onSelect: x
|
|
110
|
+
}) : /* @__PURE__ */ h("div", {
|
|
58
111
|
className: "space-y-1",
|
|
59
|
-
children:
|
|
112
|
+
children: j.map(([e, t]) => /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("div", {
|
|
60
113
|
className: "px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-text-secondary",
|
|
61
|
-
children: i(e,
|
|
62
|
-
}), t.map((e) => /* @__PURE__ */
|
|
114
|
+
children: i(e, v)
|
|
115
|
+
}), t.map((e) => /* @__PURE__ */ g("button", {
|
|
63
116
|
type: "button",
|
|
64
|
-
onClick: () =>
|
|
117
|
+
onClick: () => x(e),
|
|
65
118
|
className: "flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-start transition-colors hover:bg-accent/50",
|
|
66
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ h(l, {
|
|
67
120
|
provider: e,
|
|
68
121
|
size: 32
|
|
69
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ g("span", {
|
|
70
123
|
className: "min-w-0 flex-1",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ h("span", {
|
|
72
125
|
className: "block text-sm font-medium text-text-primary",
|
|
73
126
|
children: e.name
|
|
74
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ h("span", {
|
|
75
128
|
className: "block text-xs text-text-secondary",
|
|
76
|
-
children: r(e.authType,
|
|
129
|
+
children: r(e.authType, v)
|
|
77
130
|
})]
|
|
78
131
|
})]
|
|
79
132
|
}, e.id))] }, e))
|
|
80
133
|
})]
|
|
81
134
|
});
|
|
82
135
|
};
|
|
83
|
-
export {
|
|
136
|
+
export { b as ProviderPickerPanel };
|
|
@@ -6,6 +6,9 @@ export interface ConnectionRecord {
|
|
|
6
6
|
name: string;
|
|
7
7
|
status: string;
|
|
8
8
|
errorMessage: string | null;
|
|
9
|
+
/** The signed-in account, once the provider has told the service who it is. */
|
|
10
|
+
externalAccountEmail?: string | null;
|
|
11
|
+
externalAccountName?: string | null;
|
|
9
12
|
}
|
|
10
13
|
export interface CreateConnectionInput {
|
|
11
14
|
name: string;
|
package/dist/connections/api.js
CHANGED
|
@@ -34,7 +34,7 @@ var n = "\n id\n key\n name\n description\n category\n authType\n icon\n
|
|
|
34
34
|
${n}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
`, s = "\n id\n name\n status\n errorMessage\n", c = t`
|
|
37
|
+
`, s = "\n id\n name\n status\n errorMessage\n externalAccountEmail\n externalAccountName\n", c = t`
|
|
38
38
|
mutation ConnectionDialogCreate($input: CreateConnectionInput!) {
|
|
39
39
|
createConnection(input: $input) {
|
|
40
40
|
${s}
|
|
@@ -168,7 +168,9 @@ function T(e) {
|
|
|
168
168
|
id: n,
|
|
169
169
|
name: _(t.name),
|
|
170
170
|
status: _(t.status),
|
|
171
|
-
errorMessage: _(t.errorMessage) || null
|
|
171
|
+
errorMessage: _(t.errorMessage) || null,
|
|
172
|
+
externalAccountEmail: _(t.externalAccountEmail) || null,
|
|
173
|
+
externalAccountName: _(t.externalAccountName) || null
|
|
172
174
|
} : null;
|
|
173
175
|
}
|
|
174
176
|
function E(e) {
|
|
@@ -48,6 +48,11 @@ export interface ConnectionDraft {
|
|
|
48
48
|
* makes it visible to the whole workspace.
|
|
49
49
|
*/
|
|
50
50
|
visibility?: ConnectionVisibility;
|
|
51
|
+
/**
|
|
52
|
+
* Signing in again on a connection that already exists. Its storage was
|
|
53
|
+
* chosen when it was made, so no storage choice is checked.
|
|
54
|
+
*/
|
|
55
|
+
reconnect?: boolean;
|
|
51
56
|
}
|
|
52
57
|
/** The first thing stopping the draft from being submitted, or null. */
|
|
53
58
|
export declare function validateDraft(draft: ConnectionDraft, translate: Translator): string | null;
|
|
@@ -85,4 +90,17 @@ export type FlowStep = {
|
|
|
85
90
|
export declare function submitConnection(api: ConnectionsApi, draft: ConnectionDraft, options: {
|
|
86
91
|
redirectUri: string;
|
|
87
92
|
scopes?: string[];
|
|
93
|
+
/**
|
|
94
|
+
* A connection this flow already made (an earlier attempt whose sign-in
|
|
95
|
+
* was cancelled, blocked or failed, or a broken connection being
|
|
96
|
+
* reconnected). Authentication then runs on that record instead of
|
|
97
|
+
* creating another one, so retries leave no abandoned "not finished"
|
|
98
|
+
* rows behind and a reconnected connection keeps its id.
|
|
99
|
+
*/
|
|
100
|
+
existing?: ConnectionRecord;
|
|
101
|
+
/**
|
|
102
|
+
* Called as soon as a new record exists, before authentication runs, so a
|
|
103
|
+
* caller can sign in on it again if a later step fails.
|
|
104
|
+
*/
|
|
105
|
+
onCreated?: (connection: ConnectionRecord) => void;
|
|
88
106
|
}): Promise<FlowStep>;
|
|
@@ -51,7 +51,7 @@ function g(t, n) {
|
|
|
51
51
|
let i = s(t.provider, t.method), a = c(t.provider, t.method);
|
|
52
52
|
if (!t.name.trim()) return n("integrations.addConnection.errors.nameRequired", "Connection name is required");
|
|
53
53
|
if (t.method && !t.method.isConfigured) return n("integrations.addConnection.authentication.methodNotConfigured", "This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method.");
|
|
54
|
-
if (h(i, t.provider)) {
|
|
54
|
+
if (!t.reconnect && h(i, t.provider)) {
|
|
55
55
|
if (!f(t.provider, t.method).includes(t.storage.mode)) return n("integrations.addConnection.errors.storageModeUnsupported", "This authentication method does not support the selected credential storage mode.");
|
|
56
56
|
if (t.storage.mode === "existing") {
|
|
57
57
|
if (!t.storage.vaultId) return n("integrations.addConnection.errors.vaultRequired", "Please select a vault for storing or referencing credentials");
|
|
@@ -113,8 +113,8 @@ function y(e) {
|
|
|
113
113
|
return a;
|
|
114
114
|
}
|
|
115
115
|
async function b(e, t, n) {
|
|
116
|
-
let r = s(t.provider, t.method), i =
|
|
117
|
-
switch (r) {
|
|
116
|
+
let r = s(t.provider, t.method), i = n.existing;
|
|
117
|
+
switch (i || (i = await e.createConnection(y(t)), n.onCreated?.(i)), r) {
|
|
118
118
|
case "oauth2": {
|
|
119
119
|
let { redirectUrl: t } = await e.initiateOAuth({
|
|
120
120
|
connectionId: i.id,
|
|
@@ -17,8 +17,9 @@ export type { SharePanelsCopy, ShareRoleOption } from './SharePanels';
|
|
|
17
17
|
export { VisibilityChoice, type VisibilityChoiceCopy, type VisibilityChoiceProps, } from './VisibilityChoice';
|
|
18
18
|
export { canManageSharing, createConnectionSharingApi, createSharePrincipalLister, mapConnectionSharing, SHARE_PICKER_LIMIT, type ConnectionSharingApi, type ShareConnectionInput, } from './sharingApi';
|
|
19
19
|
export { CredentialStorageSelector } from './CredentialStorageSelector';
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
20
|
+
export { CONNECT_MORE_OPTIONS_KEY, OneScreenConnectionForm } from './OneScreenConnectionForm';
|
|
21
|
+
export { compatibleSecrets, defaultVault, EMPTY_STORAGE, withDefaultVault } from './storage';
|
|
22
|
+
export { groupByCategory, isPopularProvider, needsAdminSetup, pickableProviders, POPULAR_PROVIDER_KEYS, popularFirst, } from './picker';
|
|
22
23
|
export { ScopePicker } from './ScopePicker';
|
|
23
24
|
export { createConnectionsApi, mapProvider, normalizeAuthType, type ConnectionRecord, type ConnectionsApi, type ConnectionsApiOptions, type CreateConnectionInput, } from './api';
|
|
24
25
|
export { buildCreateInput, collectsOwnClientId, flowForAuthType, resolveFlow, resolveMethod, resolveSchema, submitConnection, submittedValues, validateDraft, type ConnectionDraft, type FlowStep, } from './connectionFlow';
|
|
@@ -26,5 +27,5 @@ export { waitForOAuthCompletion, isOAuthCallbackMessage } from './oauthPopup';
|
|
|
26
27
|
export { getProviderAccent, getProviderIconName, getProviderImageSource, getProviderTextIcon, normalizeProviderCategory, type ProviderIdentity, } from './providerIdentity';
|
|
27
28
|
export { isScopeChecked, parseScopeOptions, requestedScopes, toggleScope, type ScopeOption, type ScopeSelection, } from './scopes';
|
|
28
29
|
export { authTypeLabel, categoryLabel } from './labels';
|
|
29
|
-
export type { ConnectionAccess, ConnectionAuthMethod, ConnectionDialogEvent, ConnectionProvider, ConnectionShareGrant, ConnectionSharePrincipalType, ConnectionShareRole, ConnectionSharing, ConnectionVisibility, CreatedConnection, CredentialStorageState, ProviderAuthType, ProviderCategory, SharePrincipal, VaultSecretSummary, VaultSummary, } from './types';
|
|
30
|
+
export type { ConnectionAccess, ConnectionAuthMethod, ConnectionDialogEvent, ConnectionProvider, ConnectionReconnectTarget, ConnectionShareGrant, ConnectionSharePrincipalType, ConnectionShareRole, ConnectionSharing, ConnectionVisibility, CreatedConnection, CredentialStorageState, ProviderAuthType, ProviderCategory, SharePrincipal, VaultSecretSummary, VaultSummary, } from './types';
|
|
30
31
|
export type { Translator } from '../credentials/translate';
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { Translator } from '../credentials/translate';
|
|
2
2
|
import { ConnectionProvider } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The apps most people connect first, in the order the one-screen picker
|
|
5
|
+
* lists them under "Popular" (Navigation v2, BOFF-11875). Keys, so a renamed
|
|
6
|
+
* app keeps its place; an app this workspace does not offer is simply absent.
|
|
7
|
+
*/
|
|
8
|
+
export declare const POPULAR_PROVIDER_KEYS: readonly string[];
|
|
9
|
+
export declare function isPopularProvider(provider: ConnectionProvider): boolean;
|
|
10
|
+
/** Popular apps in their listed order; every other app keeps its place after them. */
|
|
11
|
+
export declare function popularFirst(providers: ConnectionProvider[]): {
|
|
12
|
+
popular: ConnectionProvider[];
|
|
13
|
+
others: ConnectionProvider[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Whether no sign-in method of this app is set up in this environment, so
|
|
17
|
+
* only an administrator can make it connectable. An app that declares no
|
|
18
|
+
* methods uses its own auth type, which needs no setup here.
|
|
19
|
+
*/
|
|
20
|
+
export declare function needsAdminSetup(provider: ConnectionProvider): boolean;
|
|
3
21
|
/** The providers the picker offers, filtered by the search query. */
|
|
4
22
|
export declare function pickableProviders(providers: ConnectionProvider[], source: 'installed' | 'catalog', query: string, translate: Translator): ConnectionProvider[];
|
|
5
23
|
/** Providers grouped by category, in first-seen order. */
|
|
@@ -1,10 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { selectableMethods as e } from "./connectionFlow.js";
|
|
2
|
+
import { categoryLabel as t } from "./labels.js";
|
|
2
3
|
// src/connections/picker.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var n = [
|
|
5
|
+
"google-gmail",
|
|
6
|
+
"gmail",
|
|
7
|
+
"slack",
|
|
8
|
+
"google-sheets",
|
|
9
|
+
"google-drive",
|
|
10
|
+
"google-calendar",
|
|
11
|
+
"notion",
|
|
12
|
+
"github",
|
|
13
|
+
"microsoft-teams",
|
|
14
|
+
"hubspot",
|
|
15
|
+
"airtable",
|
|
16
|
+
"openai",
|
|
17
|
+
"anthropic"
|
|
18
|
+
];
|
|
19
|
+
function r(e) {
|
|
20
|
+
return n.includes(e.key);
|
|
6
21
|
}
|
|
7
|
-
function
|
|
22
|
+
function i(e) {
|
|
23
|
+
return {
|
|
24
|
+
popular: e.filter(r).sort((e, t) => n.indexOf(e.key) - n.indexOf(t.key)),
|
|
25
|
+
others: e.filter((e) => !r(e))
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function a(t) {
|
|
29
|
+
let n = e(t);
|
|
30
|
+
return n.length > 0 && n.every((e) => !e.isConfigured);
|
|
31
|
+
}
|
|
32
|
+
function o(e, n, r, i) {
|
|
33
|
+
let a = e.filter((e) => e.isEnabled && (n === "catalog" || e.pluginStatus === "installed")), o = r.trim().toLowerCase();
|
|
34
|
+
return o ? a.filter((e) => e.name.toLowerCase().includes(o) || e.description.toLowerCase().includes(o) || e.key.toLowerCase().includes(o) || t(e.category, i).toLowerCase().includes(o)) : a;
|
|
35
|
+
}
|
|
36
|
+
function s(e) {
|
|
8
37
|
let t = /* @__PURE__ */ new Map();
|
|
9
38
|
for (let n of e) {
|
|
10
39
|
let e = t.get(n.category);
|
|
@@ -12,4 +41,4 @@ function n(e) {
|
|
|
12
41
|
}
|
|
13
42
|
return [...t.entries()];
|
|
14
43
|
}
|
|
15
|
-
export { n as groupByCategory,
|
|
44
|
+
export { n as POPULAR_PROVIDER_KEYS, s as groupByCategory, r as isPopularProvider, a as needsAdminSetup, o as pickableProviders, i as popularFirst };
|
|
@@ -39,3 +39,11 @@ export declare function toggleScope(scope: string, selection: ScopeSelection, de
|
|
|
39
39
|
* them.
|
|
40
40
|
*/
|
|
41
41
|
export declare function requestedScopes(selection: ScopeSelection, options: readonly ScopeOption[]): string[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* What the connection will be allowed to do, in the provider's own plain
|
|
44
|
+
* words: the description of every scope it will request (always-included and
|
|
45
|
+
* ticked). Scopes the service describes only by their raw protocol string are
|
|
46
|
+
* left out, so the summary never reads as jargon; an empty list means there
|
|
47
|
+
* is nothing plain to say.
|
|
48
|
+
*/
|
|
49
|
+
export declare function grantedScopeSummary(options: readonly ScopeOption[], selection: ScopeSelection, defaultScopes: readonly string[]): string[];
|
|
@@ -26,4 +26,12 @@ function r(e, t) {
|
|
|
26
26
|
let n = t.filter((e) => e.required).map((e) => e.scope);
|
|
27
27
|
return [.../* @__PURE__ */ new Set([...n, ...e])];
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
function i(e, n, r) {
|
|
30
|
+
let i = [];
|
|
31
|
+
for (let a of e) {
|
|
32
|
+
let e = a.required || t(a.scope, n, r), o = a.description?.trim();
|
|
33
|
+
e && o && !i.includes(o) && i.push(o);
|
|
34
|
+
}
|
|
35
|
+
return i;
|
|
36
|
+
}
|
|
37
|
+
export { i as grantedScopeSummary, t as isScopeChecked, e as parseScopeOptions, r as requestedScopes, n as toggleScope };
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { CredentialStorageState, ProviderAuthType, VaultSecretSummary } from './types';
|
|
1
|
+
import { CredentialStorageState, ProviderAuthType, VaultSecretSummary, VaultSummary } from './types';
|
|
2
2
|
export declare const EMPTY_STORAGE: CredentialStorageState;
|
|
3
3
|
/**
|
|
4
4
|
* Secrets that can hold this kind of credential. An OAuth or basic-auth
|
|
5
5
|
* connection needs a structured secret; a key or token fits a plain one.
|
|
6
6
|
*/
|
|
7
7
|
export declare function compatibleSecrets(secrets: VaultSecretSummary[], authType: ProviderAuthType): VaultSecretSummary[];
|
|
8
|
+
/** The vault a new connection uses when the person does not choose one: "Default", else the first. */
|
|
9
|
+
export declare function defaultVault(vaults: readonly VaultSummary[]): VaultSummary | null;
|
|
10
|
+
/**
|
|
11
|
+
* The storage choice with the default vault filled in, when nothing is picked
|
|
12
|
+
* yet and a new dedicated secret is being made (BOFF-11875). A choice the
|
|
13
|
+
* person already made, or an existing-secret binding, is kept as it is.
|
|
14
|
+
*/
|
|
15
|
+
export declare function withDefaultVault(current: CredentialStorageState, vaults: readonly VaultSummary[]): CredentialStorageState;
|