@burdenoff/fe-libs 2026.930.4 → 2026.1001.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connections/ConnectionDetailsTab.d.ts +11 -0
- package/dist/connections/ConnectionDetailsTab.d.ts.map +1 -0
- package/dist/connections/ConnectionDetailsTab.js +71 -0
- package/dist/connections/ConnectionDialog.d.ts +57 -0
- package/dist/connections/ConnectionDialog.d.ts.map +1 -0
- package/dist/connections/ConnectionDialog.js +88 -0
- package/dist/connections/ConnectionDialogPanel.d.ts +26 -0
- package/dist/connections/ConnectionDialogPanel.d.ts.map +1 -0
- package/dist/connections/ConnectionDialogPanel.js +272 -0
- package/dist/connections/ConnectionFormTab.d.ts +37 -0
- package/dist/connections/ConnectionFormTab.d.ts.map +1 -0
- package/dist/connections/ConnectionFormTab.js +185 -0
- package/dist/connections/CredentialStorageSelector.d.ts +19 -0
- package/dist/connections/CredentialStorageSelector.d.ts.map +1 -0
- package/dist/connections/CredentialStorageSelector.js +294 -0
- package/dist/connections/DialogHeading.d.ts +7 -0
- package/dist/connections/DialogHeading.d.ts.map +1 -0
- package/dist/connections/DialogHeading.js +16 -0
- package/dist/connections/ProviderIcon.d.ts +10 -0
- package/dist/connections/ProviderIcon.d.ts.map +1 -0
- package/dist/connections/ProviderIcon.js +57 -0
- package/dist/connections/ProviderPickerPanel.d.ts +15 -0
- package/dist/connections/ProviderPickerPanel.d.ts.map +1 -0
- package/dist/connections/ProviderPickerPanel.js +84 -0
- package/dist/connections/ScopePicker.d.ts +15 -0
- package/dist/connections/ScopePicker.d.ts.map +1 -0
- package/dist/connections/ScopePicker.js +38 -0
- package/dist/connections/api.d.ts +60 -0
- package/dist/connections/api.d.ts.map +1 -0
- package/dist/connections/api.js +259 -0
- package/dist/connections/assets/bigconsole.png.js +4 -0
- package/dist/connections/assets/burdenoff.png.js +4 -0
- package/dist/connections/connectionFlow.d.ts +81 -0
- package/dist/connections/connectionFlow.d.ts.map +1 -0
- package/dist/connections/connectionFlow.js +101 -0
- package/dist/connections/frame.d.ts +32 -0
- package/dist/connections/frame.d.ts.map +1 -0
- package/dist/connections/frame.js +13 -0
- package/dist/connections/index.d.ts +24 -0
- package/dist/connections/index.d.ts.map +1 -0
- package/dist/connections/labels.d.ts +5 -0
- package/dist/connections/labels.d.ts.map +1 -0
- package/dist/connections/labels.js +35 -0
- package/dist/connections/oauthPopup.d.ts +48 -0
- package/dist/connections/oauthPopup.d.ts.map +1 -0
- package/dist/connections/oauthPopup.js +70 -0
- package/dist/connections/picker.d.ts +7 -0
- package/dist/connections/picker.d.ts.map +1 -0
- package/dist/connections/picker.js +16 -0
- package/dist/connections/providerIdentity.d.ts +23 -0
- package/dist/connections/providerIdentity.d.ts.map +1 -0
- package/dist/connections/providerIdentity.js +175 -0
- package/dist/connections/scopes.d.ts +42 -0
- package/dist/connections/scopes.d.ts.map +1 -0
- package/dist/connections/scopes.js +30 -0
- package/dist/connections/storage.d.ts +8 -0
- package/dist/connections/storage.d.ts.map +1 -0
- package/dist/connections/storage.js +21 -0
- package/dist/connections/types.d.ts +82 -0
- package/dist/connections/types.d.ts.map +1 -0
- package/dist/connections/useConnectionSubmit.d.ts +22 -0
- package/dist/connections/useConnectionSubmit.d.ts.map +1 -0
- package/dist/connections/useConnectionSubmit.js +99 -0
- package/dist/connections.d.ts +2 -0
- package/dist/connections.js +14 -0
- package/dist/credentials/AuthMethodSelector.d.ts +4 -0
- package/dist/credentials/AuthMethodSelector.d.ts.map +1 -1
- package/dist/credentials/AuthMethodSelector.js +42 -33
- package/dist/credentials/SchemaForm.d.ts +3 -28
- package/dist/credentials/SchemaForm.d.ts.map +1 -1
- package/dist/credentials/SchemaForm.js +116 -162
- package/dist/credentials/index.d.ts +5 -2
- package/dist/credentials/index.d.ts.map +1 -1
- package/dist/credentials/methods.d.ts +11 -0
- package/dist/credentials/methods.d.ts.map +1 -0
- package/dist/credentials/methods.js +6 -0
- package/dist/credentials/schema.d.ts +43 -0
- package/dist/credentials/schema.d.ts.map +1 -0
- package/dist/credentials/schema.js +56 -0
- package/dist/credentials/translate.d.ts +18 -0
- package/dist/credentials/translate.d.ts.map +1 -0
- package/dist/credentials/translate.js +7 -0
- package/dist/credentials/types.d.ts +1 -1
- package/dist/credentials.js +6 -3
- package/dist/shared/assistant/conversation.d.ts +5 -1
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyApi.d.ts +25 -9
- package/dist/shared/assistant/history/historyApi.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyApi.js +220 -75
- package/dist/shared/assistant/history/historyControls.d.ts +86 -0
- package/dist/shared/assistant/history/historyControls.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyControls.js +80 -0
- package/dist/shared/assistant/history/historyEngine.d.ts +23 -3
- package/dist/shared/assistant/history/historyEngine.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyEngine.js +578 -369
- package/dist/shared/assistant/history/historyErrors.d.ts +25 -5
- package/dist/shared/assistant/history/historyErrors.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyErrors.js +39 -30
- package/dist/shared/assistant/history/historyList.d.ts +33 -7
- package/dist/shared/assistant/history/historyList.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyList.js +72 -51
- package/dist/shared/assistant/history/historyOperations.d.ts +36 -7
- package/dist/shared/assistant/history/historyOperations.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyOperations.js +100 -25
- package/dist/shared/assistant/history/historyStatus.d.ts +27 -1
- package/dist/shared/assistant/history/historyStatus.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyStatus.js +6 -2
- package/dist/shared/assistant/history/historyStore.d.ts +29 -7
- package/dist/shared/assistant/history/historyStore.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyStore.js +172 -103
- package/dist/shared/assistant/history/historyTransportErrors.d.ts +28 -0
- package/dist/shared/assistant/history/historyTransportErrors.d.ts.map +1 -0
- package/dist/shared/assistant/history/historyTransportErrors.js +16 -0
- package/dist/shared/assistant/history/historyTypes.d.ts +80 -1
- package/dist/shared/assistant/history/historyTypes.d.ts.map +1 -1
- package/dist/shared/assistant/history/stampRegistry.d.ts +19 -1
- package/dist/shared/assistant/history/stampRegistry.d.ts.map +1 -1
- package/dist/shared/assistant/history/stampRegistry.js +13 -1
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/store.d.ts +8 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +50 -46
- package/dist/shared/assistant/writeReplyBinder.d.ts +1 -1
- package/dist/shared-assistant.js +164 -162
- package/package.json +11 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Translator } from '../credentials/translate';
|
|
3
|
+
import { ConnectionProvider } from './types';
|
|
4
|
+
export declare const ConnectionDetailsTab: FC<{
|
|
5
|
+
provider: ConnectionProvider;
|
|
6
|
+
translate: Translator;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ConnectionSharingTab: FC<{
|
|
9
|
+
translate: Translator;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=ConnectionDetailsTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionDetailsTab.d.ts","sourceRoot":"","sources":["../../src/connections/ConnectionDetailsTab.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC;IACpC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,SAAS,EAAE,UAAU,CAAC;CACvB,CAiDA,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC;IAAE,SAAS,EAAE,UAAU,CAAA;CAAE,CAe9D,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { authTypeLabel as e, categoryLabel as t } from "./labels.js";
|
|
2
|
+
import { ProviderIcon as n } from "./ProviderIcon.js";
|
|
3
|
+
import { Share2 as r } from "lucide-react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/connections/ConnectionDetailsTab.tsx
|
|
6
|
+
var o = ({ provider: r, translate: o }) => /* @__PURE__ */ a("div", {
|
|
7
|
+
className: "space-y-4",
|
|
8
|
+
children: [
|
|
9
|
+
/* @__PURE__ */ i("h3", {
|
|
10
|
+
className: "text-sm font-semibold text-text-primary",
|
|
11
|
+
children: o("integrations.addConnection.tabs.details", "Details")
|
|
12
|
+
}),
|
|
13
|
+
/* @__PURE__ */ a("div", {
|
|
14
|
+
className: "flex items-center gap-3 rounded-md border border-border-subtle p-3",
|
|
15
|
+
children: [/* @__PURE__ */ i(n, {
|
|
16
|
+
provider: r,
|
|
17
|
+
size: 40
|
|
18
|
+
}), /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("p", {
|
|
19
|
+
className: "text-sm font-medium text-text-primary",
|
|
20
|
+
children: r.name
|
|
21
|
+
}), /* @__PURE__ */ a("p", {
|
|
22
|
+
className: "text-xs text-text-secondary",
|
|
23
|
+
children: [
|
|
24
|
+
e(r.authType, o),
|
|
25
|
+
" · ",
|
|
26
|
+
t(r.category, o)
|
|
27
|
+
]
|
|
28
|
+
})] })]
|
|
29
|
+
}),
|
|
30
|
+
r.description && /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("div", {
|
|
31
|
+
className: "text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
32
|
+
children: o("integrations.addConnection.fields.description", "Description")
|
|
33
|
+
}), /* @__PURE__ */ i("p", {
|
|
34
|
+
className: "mt-1 text-sm text-text-primary",
|
|
35
|
+
children: r.description
|
|
36
|
+
})] }),
|
|
37
|
+
[{
|
|
38
|
+
url: r.website,
|
|
39
|
+
label: o("integrations.providerDetail.sections.website", "Website")
|
|
40
|
+
}, {
|
|
41
|
+
url: r.docsUrl,
|
|
42
|
+
label: o("integrations.providerDetail.sections.documentation", "Documentation")
|
|
43
|
+
}].filter((e) => /^https?:\/\//i.test(e.url)).map((e) => /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("div", {
|
|
44
|
+
className: "text-xs font-medium uppercase tracking-wider text-text-secondary",
|
|
45
|
+
children: e.label
|
|
46
|
+
}), /* @__PURE__ */ i("a", {
|
|
47
|
+
href: e.url,
|
|
48
|
+
target: "_blank",
|
|
49
|
+
rel: "noopener noreferrer",
|
|
50
|
+
className: "mt-1 block break-all text-sm text-primary hover:underline",
|
|
51
|
+
children: e.url
|
|
52
|
+
})] }, e.label))
|
|
53
|
+
]
|
|
54
|
+
}), s = ({ translate: e }) => /* @__PURE__ */ a("div", {
|
|
55
|
+
className: "space-y-4",
|
|
56
|
+
children: [/* @__PURE__ */ i("h3", {
|
|
57
|
+
className: "text-sm font-semibold text-text-primary",
|
|
58
|
+
children: e("integrations.addConnection.tabs.sharing", "Sharing")
|
|
59
|
+
}), /* @__PURE__ */ a("div", {
|
|
60
|
+
className: "rounded-md border border-border-subtle bg-accent/30 p-4 text-center",
|
|
61
|
+
children: [/* @__PURE__ */ i(r, {
|
|
62
|
+
size: 32,
|
|
63
|
+
className: "mx-auto mb-2 text-text-secondary"
|
|
64
|
+
}), /* @__PURE__ */ i("p", {
|
|
65
|
+
className: "text-sm text-text-secondary",
|
|
66
|
+
children: e("integrations.addConnection.sharing.placeholder", "Connection sharing settings will be available in a future update.")
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { o as ConnectionDetailsTab, s as ConnectionSharingTab };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ApolloClient } from '@apollo/client';
|
|
3
|
+
import { Translator } from '../credentials/translate';
|
|
4
|
+
import { ConnectionsApi } from './api';
|
|
5
|
+
import { ConnectionDialogPresentation } from './frame';
|
|
6
|
+
import { ConnectionDialogEvent, CreatedConnection } from './types';
|
|
7
|
+
export interface ConnectionDialogProps {
|
|
8
|
+
open: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** The host's Apollo client, pointed at the workspace gateway. */
|
|
11
|
+
client: ApolloClient;
|
|
12
|
+
/**
|
|
13
|
+
* The absolute OAuth callback URL. Providers compare it exactly with what a
|
|
14
|
+
* bring-your-own app registered, so it is shown to the user as well as sent.
|
|
15
|
+
*/
|
|
16
|
+
callbackUrl: string;
|
|
17
|
+
/** Host translator; English when omitted. */
|
|
18
|
+
translate?: Translator;
|
|
19
|
+
/** Open on this provider instead of the picker. */
|
|
20
|
+
providerId?: string | null;
|
|
21
|
+
/** Open on this provider, by key — what a workflow node knows. */
|
|
22
|
+
providerKey?: string | null;
|
|
23
|
+
/** What the picker lists: the workspace's installed providers, or the catalog. */
|
|
24
|
+
providerSource?: 'installed' | 'catalog';
|
|
25
|
+
/**
|
|
26
|
+
* Whether a vault must be chosen. Without one, the integrations service
|
|
27
|
+
* stores the credential itself.
|
|
28
|
+
*/
|
|
29
|
+
requireVault?: boolean;
|
|
30
|
+
/** False shows an access-denied notice instead of the form. */
|
|
31
|
+
canCreate?: boolean;
|
|
32
|
+
/** Offer creating a vault from inside the dialog. */
|
|
33
|
+
canCreateVault?: boolean;
|
|
34
|
+
/** Initial connection name; defaults to "<Provider> Connection". */
|
|
35
|
+
defaultName?: string;
|
|
36
|
+
/** Settings stored on the connection, e.g. a Botlit return path. */
|
|
37
|
+
extraConfig?: Record<string, unknown>;
|
|
38
|
+
/** Show the Sharing tab. */
|
|
39
|
+
showSharingTab?: boolean;
|
|
40
|
+
/** Named queries to refetch after a create, e.g. `GetConnections`. */
|
|
41
|
+
refetchQueriesOnCreate?: string[];
|
|
42
|
+
/** Called once the connection is usable. */
|
|
43
|
+
onConnectionCreated?: (connection: CreatedConnection) => void;
|
|
44
|
+
onError?: (error: Error) => void;
|
|
45
|
+
/** Lifecycle events, for a host that mirrors them onto its own bus. */
|
|
46
|
+
onEvent?: (event: ConnectionDialogEvent) => void;
|
|
47
|
+
/** Replaces the success panel's button — e.g. "Link to bot channel". */
|
|
48
|
+
renderSuccessAction?: (connection: CreatedConnection) => ReactNode;
|
|
49
|
+
/** `dialog` (default) or `sheet` — see {@link ConnectionDialogPresentation}. */
|
|
50
|
+
presentation?: ConnectionDialogPresentation;
|
|
51
|
+
/** Heading while the provider picker shows. Defaults to "Add new credential". */
|
|
52
|
+
pickerTitle?: string;
|
|
53
|
+
/** Test seam: supply the service directly instead of via `client`. */
|
|
54
|
+
api?: ConnectionsApi;
|
|
55
|
+
}
|
|
56
|
+
export declare const ConnectionDialog: FC<ConnectionDialogProps>;
|
|
57
|
+
//# sourceMappingURL=ConnectionDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionDialog.d.ts","sourceRoot":"","sources":["../../src/connections/ConnectionDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAmB,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAOL,KAAK,4BAA4B,EAClC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAExE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kEAAkE;IAClE,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kFAAkF;IAClF,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACzC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qDAAqD;IACrD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,4BAA4B;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sEAAsE;IACtE,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,uEAAuE;IACvE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,SAAS,CAAC;IACnE,gFAAgF;IAChF,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,GAAG,CAAC,EAAE,cAAc,CAAC;CACtB;AA2BD,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAuGtD,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { cn as e } from "../lib/utils.js";
|
|
2
|
+
import { englishTranslator as t } from "../credentials/translate.js";
|
|
3
|
+
import { createConnectionsApi as n } from "./api.js";
|
|
4
|
+
import { CONNECTION_DIALOG_FRAME_CLASSES as r, DENIED_TITLE_ID as i, DIALOG_Z as a, OVERLAY_Z as o, SURFACE_CLASS as s, TITLE_ID as c } from "./frame.js";
|
|
5
|
+
import { DialogHeading as l } from "./DialogHeading.js";
|
|
6
|
+
import { ConnectionDialogPanel as u } from "./ConnectionDialogPanel.js";
|
|
7
|
+
import { useMemo as d, useRef as f } from "react";
|
|
8
|
+
import { Shield as p } from "lucide-react";
|
|
9
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
|
+
import * as _ from "@radix-ui/react-dialog";
|
|
11
|
+
//#region src/connections/ConnectionDialog.tsx
|
|
12
|
+
var v = ({ onClose: e, translate: t }) => /* @__PURE__ */ g(m, { children: [
|
|
13
|
+
/* @__PURE__ */ h(p, {
|
|
14
|
+
size: 40,
|
|
15
|
+
className: "text-text-secondary"
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ h(l, {
|
|
18
|
+
id: i,
|
|
19
|
+
className: "text-lg font-semibold text-text-primary",
|
|
20
|
+
children: t("integrations.addConnection.denied.title", "Access Denied")
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ h(_.Description, {
|
|
23
|
+
className: "text-sm text-text-secondary",
|
|
24
|
+
children: t("integrations.addConnection.denied.description", "You don't have permission to create connections.")
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ h("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
onClick: e,
|
|
29
|
+
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium transition-colors hover:bg-accent",
|
|
30
|
+
children: t("integrations.common.close", "Close")
|
|
31
|
+
})
|
|
32
|
+
] }), y = ({ open: l, onClose: p, client: m, callbackUrl: y, translate: b = t, providerId: x, providerKey: S, providerSource: C = "installed", requireVault: w = !0, canCreate: T = !0, canCreateVault: E = !1, defaultName: D, extraConfig: O, showSharingTab: k = !1, refetchQueriesOnCreate: A, onConnectionCreated: j, onError: M, onEvent: N, renderSuccessAction: P, presentation: F = "dialog", pickerTitle: I, api: L }) => {
|
|
33
|
+
let R = A?.join("|") ?? "", z = d(() => L ?? n(m, { refetchQueriesOnCreate: R ? R.split("|") : void 0 }), [
|
|
34
|
+
L,
|
|
35
|
+
m,
|
|
36
|
+
R
|
|
37
|
+
]), B = f(null), V = f(null), H = f(null);
|
|
38
|
+
return /* @__PURE__ */ h(_.Root, {
|
|
39
|
+
open: l,
|
|
40
|
+
onOpenChange: (e) => !e && p(),
|
|
41
|
+
children: /* @__PURE__ */ g(_.Portal, { children: [/* @__PURE__ */ h(_.Overlay, {
|
|
42
|
+
"data-testid": "add-connection-dialog-backdrop",
|
|
43
|
+
style: { zIndex: o },
|
|
44
|
+
className: "fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200"
|
|
45
|
+
}), /* @__PURE__ */ h(_.Content, {
|
|
46
|
+
ref: V,
|
|
47
|
+
"aria-modal": "true",
|
|
48
|
+
"aria-labelledby": T ? c : i,
|
|
49
|
+
"data-testid": "add-connection-dialog",
|
|
50
|
+
"data-presentation": F,
|
|
51
|
+
style: { zIndex: a },
|
|
52
|
+
className: e(s, r[F][T ? "form" : "notice"]),
|
|
53
|
+
onOpenAutoFocus: (e) => {
|
|
54
|
+
B.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.preventDefault(), (H.current ?? V.current)?.focus({ preventScroll: !0 });
|
|
55
|
+
},
|
|
56
|
+
onCloseAutoFocus: (e) => {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
let t = B.current;
|
|
59
|
+
t && t.isConnected && t !== document.body && t.focus({ preventScroll: !0 });
|
|
60
|
+
},
|
|
61
|
+
children: T ? /* @__PURE__ */ h(u, {
|
|
62
|
+
api: z,
|
|
63
|
+
onClose: p,
|
|
64
|
+
callbackUrl: y,
|
|
65
|
+
translate: b,
|
|
66
|
+
providerId: x,
|
|
67
|
+
providerKey: S,
|
|
68
|
+
providerSource: C,
|
|
69
|
+
requireVault: w,
|
|
70
|
+
canCreateVault: E,
|
|
71
|
+
defaultName: D,
|
|
72
|
+
extraConfig: O,
|
|
73
|
+
showSharingTab: k,
|
|
74
|
+
pickerTitle: I,
|
|
75
|
+
searchInputRef: H,
|
|
76
|
+
onConnectionCreated: j,
|
|
77
|
+
onError: M,
|
|
78
|
+
onEvent: N,
|
|
79
|
+
renderSuccessAction: P
|
|
80
|
+
}) : /* @__PURE__ */ h(v, {
|
|
81
|
+
onClose: p,
|
|
82
|
+
translate: b
|
|
83
|
+
})
|
|
84
|
+
})] })
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { y as ConnectionDialog };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { Translator } from '../credentials/translate';
|
|
3
|
+
import { ConnectionsApi } from './api';
|
|
4
|
+
import { ConnectionDialogEvent, CreatedConnection } from './types';
|
|
5
|
+
export interface ConnectionDialogPanelProps {
|
|
6
|
+
api: ConnectionsApi;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
callbackUrl: string;
|
|
9
|
+
translate: Translator;
|
|
10
|
+
providerId?: string | null;
|
|
11
|
+
providerKey?: string | null;
|
|
12
|
+
providerSource: 'installed' | 'catalog';
|
|
13
|
+
requireVault: boolean;
|
|
14
|
+
canCreateVault: boolean;
|
|
15
|
+
defaultName?: string;
|
|
16
|
+
extraConfig?: Record<string, unknown>;
|
|
17
|
+
showSharingTab: boolean;
|
|
18
|
+
pickerTitle?: string;
|
|
19
|
+
searchInputRef: RefObject<HTMLInputElement | null>;
|
|
20
|
+
onConnectionCreated?: (connection: CreatedConnection) => void;
|
|
21
|
+
onError?: (error: Error) => void;
|
|
22
|
+
onEvent?: (event: ConnectionDialogEvent) => void;
|
|
23
|
+
renderSuccessAction?: (connection: CreatedConnection) => ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const ConnectionDialogPanel: FC<ConnectionDialogPanelProps>;
|
|
26
|
+
//# sourceMappingURL=ConnectionDialogPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionDialogPanel.d.ts","sourceRoot":"","sources":["../../src/connections/ConnectionDialogPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAML,KAAK,EAAE,EAEP,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAW5C,OAAO,KAAK,EACV,qBAAqB,EAErB,iBAAiB,EAElB,MAAM,SAAS,CAAC;AAKjB,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,SAAS,CAAC;CACpE;AAUD,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CA8WhE,CAAC"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { cn as e } from "../lib/utils.js";
|
|
2
|
+
import { initialValuesFromSchema as t } from "../credentials/schema.js";
|
|
3
|
+
import { resolveFlow as n, resolveMethod as r, resolveSchema as i, selectableMethods as ee } from "./connectionFlow.js";
|
|
4
|
+
import { authTypeLabel as a } from "./labels.js";
|
|
5
|
+
import { ProviderIcon as o } from "./ProviderIcon.js";
|
|
6
|
+
import { ConnectionDetailsTab as te, ConnectionSharingTab as ne } from "./ConnectionDetailsTab.js";
|
|
7
|
+
import { EMPTY_STORAGE as re } from "./storage.js";
|
|
8
|
+
import { TITLE_ID as ie } from "./frame.js";
|
|
9
|
+
import { parseScopeOptions as ae, requestedScopes as oe } from "./scopes.js";
|
|
10
|
+
import { ConnectionFormTab as se } from "./ConnectionFormTab.js";
|
|
11
|
+
import { DialogHeading as ce } from "./DialogHeading.js";
|
|
12
|
+
import { ProviderPickerPanel as le } from "./ProviderPickerPanel.js";
|
|
13
|
+
import { useConnectionSubmit as ue } from "./useConnectionSubmit.js";
|
|
14
|
+
import { useCallback as s, useEffect as de, useId as fe, useMemo as c, useState as l } from "react";
|
|
15
|
+
import { AlertCircle as u, Check as pe, CheckCircle2 as me, Info as he, Link2 as ge, Loader2 as d, Share2 as _e, X as ve } from "lucide-react";
|
|
16
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
17
|
+
import * as h from "@radix-ui/react-dialog";
|
|
18
|
+
//#region src/connections/ConnectionDialogPanel.tsx
|
|
19
|
+
function g(e, n) {
|
|
20
|
+
return t(i(e, r(e, n)));
|
|
21
|
+
}
|
|
22
|
+
var _ = ({ api: t, onClose: _, callbackUrl: v, translate: y, providerId: b, providerKey: x, providerSource: ye, requireVault: S, canCreateVault: be, defaultName: C, extraConfig: xe, showSharingTab: Se, pickerTitle: Ce, searchInputRef: we, onConnectionCreated: Te, onError: w, onEvent: T, renderSuccessAction: E }) => {
|
|
23
|
+
let D = !!(b || x), [O, Ee] = l(null), [k, De] = l(D), [A, j] = l("connection"), [M, N] = l(C ?? ""), [P, Oe] = l(""), [ke, F] = l(null), [I, L] = l({}), [R, z] = l(null), [B, Ae] = l(re), V = fe(), H = s((e) => `${V}-${e}`, [V]), { submit: je, busy: U, oauthWaiting: Me, errorMessage: Ne, setErrorMessage: W, created: G } = ue({
|
|
24
|
+
api: t,
|
|
25
|
+
callbackUrl: v,
|
|
26
|
+
translate: y,
|
|
27
|
+
onConnectionCreated: Te,
|
|
28
|
+
onError: w,
|
|
29
|
+
onEvent: T
|
|
30
|
+
}), K = s((e) => {
|
|
31
|
+
Ee(e), N(C ?? `${e.name} Connection`), F(null), L(g(e, null)), z(null), W("");
|
|
32
|
+
}, [C, W]), q = s((e) => {
|
|
33
|
+
O && (F(e), L(g(O, e)), z(null), W(""));
|
|
34
|
+
}, [O, W]);
|
|
35
|
+
de(() => {
|
|
36
|
+
if (!D) return;
|
|
37
|
+
let e = !1;
|
|
38
|
+
return t.getProvider({
|
|
39
|
+
id: b ?? void 0,
|
|
40
|
+
key: x ?? void 0
|
|
41
|
+
}).then((t) => {
|
|
42
|
+
!e && t && K(t);
|
|
43
|
+
}).catch(() => void 0).finally(() => {
|
|
44
|
+
e || De(!1);
|
|
45
|
+
}), () => {
|
|
46
|
+
e = !0;
|
|
47
|
+
};
|
|
48
|
+
}, [
|
|
49
|
+
D,
|
|
50
|
+
b,
|
|
51
|
+
x,
|
|
52
|
+
t,
|
|
53
|
+
K
|
|
54
|
+
]);
|
|
55
|
+
let J = O ? r(O, ke) : null, Pe = O ? n(O, J) : "fields", Fe = c(() => O ? i(O, J) : null, [O, J]), Y = c(() => ae(J?.availableScopes ?? O?.availableScopes), [J, O]), Ie = J && J.defaultScopes.length > 0 ? J.defaultScopes : O?.defaultScopes ?? [], Le = () => {
|
|
56
|
+
O && je({
|
|
57
|
+
provider: O,
|
|
58
|
+
method: J,
|
|
59
|
+
name: M,
|
|
60
|
+
description: P,
|
|
61
|
+
values: I,
|
|
62
|
+
storage: B,
|
|
63
|
+
requireVault: S,
|
|
64
|
+
extraConfig: xe
|
|
65
|
+
}, oe(R, Y));
|
|
66
|
+
}, X = [
|
|
67
|
+
{
|
|
68
|
+
key: "connection",
|
|
69
|
+
label: y("integrations.addConnection.tabs.connection", "Connection"),
|
|
70
|
+
icon: ge
|
|
71
|
+
},
|
|
72
|
+
...Se ? [{
|
|
73
|
+
key: "sharing",
|
|
74
|
+
label: y("integrations.addConnection.tabs.sharing", "Sharing"),
|
|
75
|
+
icon: _e
|
|
76
|
+
}] : [],
|
|
77
|
+
{
|
|
78
|
+
key: "details",
|
|
79
|
+
label: y("integrations.addConnection.tabs.details", "Details"),
|
|
80
|
+
icon: he
|
|
81
|
+
}
|
|
82
|
+
], Z = (e) => H(`tab-${e}`), Q = H("tabpanel"), Re = (e) => {
|
|
83
|
+
let t = X.map((e) => e.key), n = t.indexOf(A), r = {
|
|
84
|
+
ArrowRight: n + 1,
|
|
85
|
+
ArrowDown: n + 1,
|
|
86
|
+
ArrowLeft: n - 1,
|
|
87
|
+
ArrowUp: n - 1,
|
|
88
|
+
Home: 0,
|
|
89
|
+
End: t.length - 1
|
|
90
|
+
}[e.key];
|
|
91
|
+
if (r === void 0) return;
|
|
92
|
+
let i = t[(r + t.length) % t.length];
|
|
93
|
+
e.preventDefault(), j(i), document.getElementById(Z(i))?.focus();
|
|
94
|
+
}, $ = !!O && !G;
|
|
95
|
+
return /* @__PURE__ */ m(f, { children: [
|
|
96
|
+
/* @__PURE__ */ m("div", {
|
|
97
|
+
className: "flex flex-shrink-0 items-center justify-between border-b border-border-subtle px-5 py-4",
|
|
98
|
+
children: [/* @__PURE__ */ m("div", {
|
|
99
|
+
className: "flex min-w-0 items-center gap-3",
|
|
100
|
+
children: [O && /* @__PURE__ */ p(o, {
|
|
101
|
+
provider: O,
|
|
102
|
+
size: 32
|
|
103
|
+
}), /* @__PURE__ */ m("div", {
|
|
104
|
+
className: "min-w-0",
|
|
105
|
+
children: [/* @__PURE__ */ p(ce, {
|
|
106
|
+
id: ie,
|
|
107
|
+
className: e("text-base font-semibold text-text-primary", O && "truncate"),
|
|
108
|
+
children: O ? y("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: O.name }) : Ce ?? y("integrations.addConnection.dialog.title", "Add new credential")
|
|
109
|
+
}), /* @__PURE__ */ p(h.Description, {
|
|
110
|
+
className: "text-xs text-text-secondary",
|
|
111
|
+
children: O ? a(J?.authType ?? O.authType, y) : y("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
|
|
112
|
+
})]
|
|
113
|
+
})]
|
|
114
|
+
}), /* @__PURE__ */ p(h.Close, {
|
|
115
|
+
asChild: !0,
|
|
116
|
+
children: /* @__PURE__ */ p("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
className: "flex-shrink-0 rounded-md p-1.5 text-text-secondary transition-colors hover:bg-accent hover:text-text-primary",
|
|
119
|
+
"aria-label": y("integrations.addConnection.actions.close", "Close dialog"),
|
|
120
|
+
children: /* @__PURE__ */ p(ve, { size: 20 })
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ m("div", {
|
|
125
|
+
"data-testid": "add-connection-body",
|
|
126
|
+
className: "flex min-h-0 flex-1 flex-col overflow-hidden sm:flex-row",
|
|
127
|
+
children: [
|
|
128
|
+
!D && !O && /* @__PURE__ */ p(le, {
|
|
129
|
+
api: t,
|
|
130
|
+
source: ye,
|
|
131
|
+
translate: y,
|
|
132
|
+
searchInputRef: we,
|
|
133
|
+
onSelect: K
|
|
134
|
+
}),
|
|
135
|
+
D && !O && k && /* @__PURE__ */ p("div", {
|
|
136
|
+
className: "flex flex-1 items-center justify-center p-8",
|
|
137
|
+
children: /* @__PURE__ */ p(d, {
|
|
138
|
+
size: 32,
|
|
139
|
+
className: "animate-spin text-text-secondary"
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
D && !O && !k && /* @__PURE__ */ m("div", {
|
|
143
|
+
className: "flex flex-1 flex-col items-center justify-center p-8 text-center",
|
|
144
|
+
children: [/* @__PURE__ */ p(u, {
|
|
145
|
+
size: 32,
|
|
146
|
+
className: "mb-3 text-text-secondary"
|
|
147
|
+
}), /* @__PURE__ */ p("p", {
|
|
148
|
+
className: "text-sm text-text-secondary",
|
|
149
|
+
children: y("integrations.addConnection.providerUnavailable", "This provider isn't available.")
|
|
150
|
+
})]
|
|
151
|
+
}),
|
|
152
|
+
O && G && /* @__PURE__ */ m("div", {
|
|
153
|
+
className: "flex flex-1 flex-col items-center justify-center p-8 text-center",
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ p("div", {
|
|
156
|
+
className: "mb-4 rounded-full bg-status-success-bg-subtle p-3",
|
|
157
|
+
children: /* @__PURE__ */ p(me, {
|
|
158
|
+
size: 48,
|
|
159
|
+
className: "text-status-success-text"
|
|
160
|
+
})
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ p("h3", {
|
|
163
|
+
className: "mb-1 text-lg font-semibold text-text-primary",
|
|
164
|
+
children: y("integrations.addConnection.success.title", "Connection Created!")
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ p("p", {
|
|
167
|
+
className: "mb-6 text-sm text-text-secondary",
|
|
168
|
+
children: y("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: O.name })
|
|
169
|
+
}),
|
|
170
|
+
E ? E(G) : /* @__PURE__ */ p("button", {
|
|
171
|
+
type: "button",
|
|
172
|
+
onClick: _,
|
|
173
|
+
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
174
|
+
children: y("integrations.addConnection.actions.done", "Done")
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
}),
|
|
178
|
+
O && $ && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
|
|
179
|
+
role: "tablist",
|
|
180
|
+
"aria-labelledby": "add-connection-dialog-title",
|
|
181
|
+
"data-testid": "add-connection-tabs",
|
|
182
|
+
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",
|
|
183
|
+
children: X.map((t) => {
|
|
184
|
+
let n = t.icon, r = A === t.key;
|
|
185
|
+
return /* @__PURE__ */ m("button", {
|
|
186
|
+
id: Z(t.key),
|
|
187
|
+
type: "button",
|
|
188
|
+
role: "tab",
|
|
189
|
+
"aria-selected": r,
|
|
190
|
+
"aria-controls": Q,
|
|
191
|
+
tabIndex: r ? 0 : -1,
|
|
192
|
+
onClick: () => j(t.key),
|
|
193
|
+
onKeyDown: Re,
|
|
194
|
+
className: e("flex min-w-max items-center gap-2 border-b-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full sm:border-b-0 sm:border-l-2", r ? "border-primary bg-accent/50 text-text-primary" : "border-transparent text-text-secondary hover:bg-accent/30 hover:text-text-primary"),
|
|
195
|
+
children: [/* @__PURE__ */ p(n, {
|
|
196
|
+
size: 16,
|
|
197
|
+
"aria-hidden": "true"
|
|
198
|
+
}), t.label]
|
|
199
|
+
}, t.key);
|
|
200
|
+
})
|
|
201
|
+
}), /* @__PURE__ */ m("div", {
|
|
202
|
+
id: Q,
|
|
203
|
+
role: "tabpanel",
|
|
204
|
+
"aria-labelledby": Z(A),
|
|
205
|
+
"data-testid": "add-connection-pane",
|
|
206
|
+
className: "min-h-0 min-w-0 flex-1 overflow-y-auto p-5",
|
|
207
|
+
children: [
|
|
208
|
+
A === "connection" && /* @__PURE__ */ p(se, {
|
|
209
|
+
api: t,
|
|
210
|
+
provider: O,
|
|
211
|
+
methods: ee(O),
|
|
212
|
+
method: J,
|
|
213
|
+
flow: Pe,
|
|
214
|
+
schema: Fe,
|
|
215
|
+
name: M,
|
|
216
|
+
onNameChange: N,
|
|
217
|
+
description: P,
|
|
218
|
+
onDescriptionChange: Oe,
|
|
219
|
+
values: I,
|
|
220
|
+
setValues: L,
|
|
221
|
+
onMethodChange: q,
|
|
222
|
+
storage: B,
|
|
223
|
+
setStorage: Ae,
|
|
224
|
+
scopeOptions: Y,
|
|
225
|
+
defaultScopes: Ie,
|
|
226
|
+
scopeSelection: R,
|
|
227
|
+
setScopeSelection: z,
|
|
228
|
+
callbackUrl: v,
|
|
229
|
+
requireVault: S,
|
|
230
|
+
canCreateVault: be,
|
|
231
|
+
errorMessage: Ne,
|
|
232
|
+
busy: U,
|
|
233
|
+
translate: y,
|
|
234
|
+
fieldId: H
|
|
235
|
+
}),
|
|
236
|
+
A === "sharing" && /* @__PURE__ */ p(ne, { translate: y }),
|
|
237
|
+
A === "details" && /* @__PURE__ */ p(te, {
|
|
238
|
+
provider: O,
|
|
239
|
+
translate: y
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
})] })
|
|
243
|
+
]
|
|
244
|
+
}),
|
|
245
|
+
O && $ && /* @__PURE__ */ m("div", {
|
|
246
|
+
"data-testid": "add-connection-footer",
|
|
247
|
+
className: "flex flex-shrink-0 items-center justify-end gap-2 border-t border-border-subtle px-5 py-3",
|
|
248
|
+
children: [/* @__PURE__ */ p("button", {
|
|
249
|
+
type: "button",
|
|
250
|
+
onClick: _,
|
|
251
|
+
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-accent",
|
|
252
|
+
children: y("integrations.addConnection.actions.cancel", "Cancel")
|
|
253
|
+
}), /* @__PURE__ */ m("button", {
|
|
254
|
+
type: "button",
|
|
255
|
+
"data-testid": "add-connection-submit",
|
|
256
|
+
onClick: Le,
|
|
257
|
+
disabled: U || !M.trim(),
|
|
258
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
259
|
+
children: [U ? /* @__PURE__ */ p(d, {
|
|
260
|
+
size: 14,
|
|
261
|
+
className: "animate-spin",
|
|
262
|
+
"aria-hidden": "true"
|
|
263
|
+
}) : /* @__PURE__ */ p(pe, {
|
|
264
|
+
size: 14,
|
|
265
|
+
"aria-hidden": "true"
|
|
266
|
+
}), Me ? y("integrations.addConnection.actions.waiting", "Waiting...") : y("integrations.addConnection.actions.connect", "Connect")]
|
|
267
|
+
})]
|
|
268
|
+
})
|
|
269
|
+
] });
|
|
270
|
+
};
|
|
271
|
+
//#endregion
|
|
272
|
+
export { _ as ConnectionDialogPanel };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Translator } from '../credentials/translate';
|
|
3
|
+
import { AuthMethodFlow, FormSchema } from '../credentials/types';
|
|
4
|
+
import { ConnectionsApi } from './api';
|
|
5
|
+
import { ScopeOption, ScopeSelection } from './scopes';
|
|
6
|
+
import { ConnectionAuthMethod, ConnectionProvider, CredentialStorageState } from './types';
|
|
7
|
+
export interface ConnectionFormTabProps {
|
|
8
|
+
api: ConnectionsApi;
|
|
9
|
+
provider: ConnectionProvider;
|
|
10
|
+
methods: ConnectionAuthMethod[];
|
|
11
|
+
method: ConnectionAuthMethod | null;
|
|
12
|
+
flow: AuthMethodFlow;
|
|
13
|
+
schema: FormSchema | null;
|
|
14
|
+
name: string;
|
|
15
|
+
onNameChange: (name: string) => void;
|
|
16
|
+
description: string;
|
|
17
|
+
onDescriptionChange: (description: string) => void;
|
|
18
|
+
values: Record<string, unknown>;
|
|
19
|
+
setValues: (values: Record<string, unknown>) => void;
|
|
20
|
+
onMethodChange: (key: string) => void;
|
|
21
|
+
storage: CredentialStorageState;
|
|
22
|
+
setStorage: (update: (current: CredentialStorageState) => CredentialStorageState) => void;
|
|
23
|
+
scopeOptions: ScopeOption[];
|
|
24
|
+
defaultScopes: string[];
|
|
25
|
+
scopeSelection: ScopeSelection;
|
|
26
|
+
setScopeSelection: (selection: string[]) => void;
|
|
27
|
+
callbackUrl: string;
|
|
28
|
+
requireVault: boolean;
|
|
29
|
+
canCreateVault: boolean;
|
|
30
|
+
errorMessage: string;
|
|
31
|
+
busy: boolean;
|
|
32
|
+
translate: Translator;
|
|
33
|
+
/** Namespaces this form's element ids. */
|
|
34
|
+
fieldId: (field: string) => string;
|
|
35
|
+
}
|
|
36
|
+
export declare const ConnectionFormTab: FC<ConnectionFormTabProps>;
|
|
37
|
+
//# sourceMappingURL=ConnectionFormTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionFormTab.d.ts","sourceRoot":"","sources":["../../src/connections/ConnectionFormTab.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAM5C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEhG,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACrD,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,sBAAsB,CAAC;IAChC,UAAU,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,KAAK,IAAI,CAAC;IAC1F,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,UAAU,CAAC;IACtB,0CAA0C;IAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAiPxD,CAAC"}
|