@burdenoff/fe-libs 2026.930.3 → 2026.930.5
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/chrome/globalSearch/AdvancedFiltersPanel.js +2 -2
- package/dist/chrome/notificationCenter/NotificationFilters.js +1 -1
- 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/ui/AssistantLanguageMenu.js +2 -2
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +1 -1
- package/dist/shared/assistant/ui/composer/AssistantLanguageSelector.js +1 -1
- package/dist/shared/assistant/ui/composer/AssistantVoiceSelector.js +1 -1
- package/dist/shared/assistant/writeReplyBinder.d.ts +1 -1
- package/dist/shared/pages/searchPage/FiltersPanel.js +1 -1
- package/dist/shared/pages/searchPage/SearchToolbar.js +1 -1
- package/dist/sharing/ShareDialog.js +2 -2
- package/dist/storage/StorageFolderPicker.js +1 -1
- package/package.json +11 -2
- package/src/shared/tokens/build/semantic.css +131 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connecting a workspace to an integration provider — shared by every surface
|
|
3
|
+
* that does it (the integrations screens and the workflow builder).
|
|
4
|
+
*
|
|
5
|
+
* `ConnectionDialog` is the whole flow. The pieces are exported for screens
|
|
6
|
+
* that show providers or reuse part of it (a provider card's icon, the
|
|
7
|
+
* standalone vault picker), so none of them keeps a private copy again.
|
|
8
|
+
*/
|
|
9
|
+
export { ConnectionDialog, type ConnectionDialogProps } from './ConnectionDialog';
|
|
10
|
+
export { CONNECTION_DIALOG_FRAME_CLASSES, type ConnectionDialogPresentation } from './frame';
|
|
11
|
+
export { ProviderIcon, type ProviderIconProps } from './ProviderIcon';
|
|
12
|
+
export { CredentialStorageSelector } from './CredentialStorageSelector';
|
|
13
|
+
export { compatibleSecrets, EMPTY_STORAGE } from './storage';
|
|
14
|
+
export { groupByCategory, pickableProviders } from './picker';
|
|
15
|
+
export { ScopePicker } from './ScopePicker';
|
|
16
|
+
export { createConnectionsApi, mapProvider, normalizeAuthType, type ConnectionRecord, type ConnectionsApi, type ConnectionsApiOptions, type CreateConnectionInput, } from './api';
|
|
17
|
+
export { buildCreateInput, collectsOwnClientId, flowForAuthType, resolveFlow, resolveMethod, resolveSchema, submitConnection, submittedValues, validateDraft, type ConnectionDraft, type FlowStep, } from './connectionFlow';
|
|
18
|
+
export { waitForOAuthCompletion, isOAuthCallbackMessage } from './oauthPopup';
|
|
19
|
+
export { getProviderAccent, getProviderIconName, getProviderImageSource, getProviderTextIcon, normalizeProviderCategory, type ProviderIdentity, } from './providerIdentity';
|
|
20
|
+
export { isScopeChecked, parseScopeOptions, requestedScopes, toggleScope, type ScopeOption, type ScopeSelection, } from './scopes';
|
|
21
|
+
export { authTypeLabel, categoryLabel } from './labels';
|
|
22
|
+
export type { ConnectionAuthMethod, ConnectionDialogEvent, ConnectionProvider, CreatedConnection, CredentialStorageState, ProviderAuthType, ProviderCategory, VaultSecretSummary, VaultSummary, } from './types';
|
|
23
|
+
export type { Translator } from '../credentials/translate';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,+BAA+B,EAAE,KAAK,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,OAAO,CAAC;AACf,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,QAAQ,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Translator } from '../credentials/translate';
|
|
2
|
+
import { ProviderAuthType, ProviderCategory } from './types';
|
|
3
|
+
export declare function categoryLabel(category: ProviderCategory, translate: Translator): string;
|
|
4
|
+
export declare function authTypeLabel(authType: ProviderAuthType, translate: Translator): string;
|
|
5
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/connections/labels.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA+BlE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,GAAG,MAAM,CAEvF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,GAAG,MAAM,CAEvF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/connections/labels.ts
|
|
2
|
+
var e = {
|
|
3
|
+
communication: "Communication",
|
|
4
|
+
project_management: "Project Management",
|
|
5
|
+
cloud_storage: "Cloud Storage",
|
|
6
|
+
crm: "CRM",
|
|
7
|
+
analytics: "Analytics",
|
|
8
|
+
developer_tools: "Developer Tools",
|
|
9
|
+
marketing: "Marketing",
|
|
10
|
+
finance: "Finance",
|
|
11
|
+
hr: "Human Resources",
|
|
12
|
+
support: "Support",
|
|
13
|
+
social: "Social",
|
|
14
|
+
ai: "AI & ML",
|
|
15
|
+
email: "Email",
|
|
16
|
+
calendar: "Calendar",
|
|
17
|
+
productivity: "Productivity",
|
|
18
|
+
other: "Other"
|
|
19
|
+
}, t = {
|
|
20
|
+
oauth2: "OAuth 2.0",
|
|
21
|
+
api_key: "API Key",
|
|
22
|
+
basic_auth: "Basic Auth",
|
|
23
|
+
bearer_token: "Bearer Token",
|
|
24
|
+
service_account: "Service Account",
|
|
25
|
+
workspace_app_token: "Workspace App Token",
|
|
26
|
+
custom: "Custom Config"
|
|
27
|
+
};
|
|
28
|
+
function n(t, n) {
|
|
29
|
+
return n(`integrations.category.${t}`, e[t]);
|
|
30
|
+
}
|
|
31
|
+
function r(e, n) {
|
|
32
|
+
return n(`integrations.authType.${e}`, t[e]);
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { r as authTypeLabel, n as categoryLabel };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wait for an OAuth popup to finish, however the result arrives.
|
|
3
|
+
*
|
|
4
|
+
* The callback page reports back three ways — `postMessage` to the opener, a
|
|
5
|
+
* `BroadcastChannel`, and a `localStorage` write — but none is reliable on its
|
|
6
|
+
* own: a provider sending `Cross-Origin-Opener-Policy` (Google does) severs the
|
|
7
|
+
* opener, and the channel and storage are scoped to the callback's origin,
|
|
8
|
+
* which is the API gateway rather than the app. So the connection's status is
|
|
9
|
+
* also polled, and whichever signal comes first settles the wait.
|
|
10
|
+
*
|
|
11
|
+
* Previously the integrations screens only listened and the workflow builder
|
|
12
|
+
* only polled; each missed the cases the other handled.
|
|
13
|
+
*/
|
|
14
|
+
/** What the callback page posts. */
|
|
15
|
+
interface OAuthCallbackMessage {
|
|
16
|
+
type: 'OAUTH_CALLBACK';
|
|
17
|
+
success: boolean;
|
|
18
|
+
connectionId?: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
}
|
|
21
|
+
/** The part of a connection this wait needs. */
|
|
22
|
+
export interface OAuthConnectionStatus {
|
|
23
|
+
status?: string | null;
|
|
24
|
+
errorMessage?: string | null;
|
|
25
|
+
}
|
|
26
|
+
type EventSource = Pick<Window, 'addEventListener' | 'removeEventListener'>;
|
|
27
|
+
export interface WaitForOAuthOptions<T extends OAuthConnectionStatus> {
|
|
28
|
+
connectionId: string;
|
|
29
|
+
popup: Pick<Window, 'close' | 'closed'>;
|
|
30
|
+
/** Reads the connection fresh from the service. */
|
|
31
|
+
fetchConnection: () => Promise<T | null | undefined>;
|
|
32
|
+
onSuccess: (connection: T) => void;
|
|
33
|
+
onError: (message: string) => void;
|
|
34
|
+
/** Always called exactly once, after success, error or timeout. */
|
|
35
|
+
onSettled: () => void;
|
|
36
|
+
pollIntervalMs?: number;
|
|
37
|
+
timeoutMs?: number;
|
|
38
|
+
/** Where messages and storage events arrive; the window by default. */
|
|
39
|
+
eventSource?: EventSource | null;
|
|
40
|
+
}
|
|
41
|
+
export declare function isOAuthCallbackMessage(value: unknown): value is OAuthCallbackMessage;
|
|
42
|
+
/**
|
|
43
|
+
* Start waiting. Returns a cancel function that stops every listener and timer
|
|
44
|
+
* without reporting an outcome — for when the dialog closes mid-wait.
|
|
45
|
+
*/
|
|
46
|
+
export declare function waitForOAuthCompletion<T extends OAuthConnectionStatus>({ connectionId, popup, fetchConnection, onSuccess, onError, onSettled, pollIntervalMs, timeoutMs, eventSource, }: WaitForOAuthOptions<T>): () => void;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=oauthPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthPopup.d.ts","sourceRoot":"","sources":["../../src/connections/oauthPopup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,oCAAoC;AACpC,UAAU,oBAAoB;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gDAAgD;AAChD,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,KAAK,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,qBAAqB,CAAC,CAAC;AAE5E,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,qBAAqB;IAClE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IACxC,mDAAmD;IACnD,eAAe,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACrD,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,CAAC;IACnC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mEAAmE;IACnE,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC;AAQD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAQpF;AAYD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,qBAAqB,EAAE,EACtE,YAAY,EACZ,KAAK,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,SAAS,EACT,cAAqB,EACrB,SAAmB,EACnB,WAA2D,GAC5D,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAgGrC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/connections/oauthPopup.ts
|
|
2
|
+
var e = "PENDING_AUTH";
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e == "object" && !!e;
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return t(e) && e.type === "OAUTH_CALLBACK" && typeof e.success == "boolean" && (e.connectionId === void 0 || typeof e.connectionId == "string") && (e.error === void 0 || typeof e.error == "string");
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
if (!e) return null;
|
|
11
|
+
try {
|
|
12
|
+
let t = JSON.parse(e);
|
|
13
|
+
return n(t) ? t : null;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function i({ connectionId: t, popup: i, fetchConnection: a, onSuccess: o, onError: s, onSettled: c, pollIntervalMs: l = 2e3, timeoutMs: u = 3e5, eventSource: d = typeof window > "u" ? null : window }) {
|
|
19
|
+
let f = !1, p = null, m = null, h = null, g = () => {
|
|
20
|
+
m && clearInterval(m), h && clearTimeout(h), m = null, h = null, d?.removeEventListener("message", b), d?.removeEventListener("storage", x), p?.close(), p = null;
|
|
21
|
+
}, _ = (e) => {
|
|
22
|
+
if (!f) {
|
|
23
|
+
f = !0, g(), i.closed || i.close();
|
|
24
|
+
try {
|
|
25
|
+
e();
|
|
26
|
+
} finally {
|
|
27
|
+
c();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, v = (e) => {
|
|
31
|
+
e ? e.status === "ACTIVE" ? o(e) : s(e.errorMessage || "OAuth authorization failed") : s("Connection not found. It may have been deleted.");
|
|
32
|
+
}, y = async (e) => {
|
|
33
|
+
if (f || e.connectionId && e.connectionId !== t) return;
|
|
34
|
+
if (!e.success) {
|
|
35
|
+
_(() => s(e.error || "OAuth authorization failed"));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let n;
|
|
39
|
+
try {
|
|
40
|
+
n = await a();
|
|
41
|
+
} catch (e) {
|
|
42
|
+
_(() => s(e instanceof Error ? e.message : "OAuth authorization failed"));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
_(() => v(n));
|
|
46
|
+
};
|
|
47
|
+
function b(e) {
|
|
48
|
+
let t = e.data;
|
|
49
|
+
n(t) && y(t);
|
|
50
|
+
}
|
|
51
|
+
function x(e) {
|
|
52
|
+
let t = e;
|
|
53
|
+
if (t.key !== "oauth_callback_result") return;
|
|
54
|
+
let n = r(t.newValue);
|
|
55
|
+
n && y(n);
|
|
56
|
+
}
|
|
57
|
+
return d?.addEventListener("message", b), d?.addEventListener("storage", x), typeof BroadcastChannel < "u" && (p = new BroadcastChannel("oauth_callback"), p.onmessage = (e) => {
|
|
58
|
+
n(e.data) && y(e.data);
|
|
59
|
+
}), m = setInterval(() => {
|
|
60
|
+
a().then((t) => {
|
|
61
|
+
!t?.status || t.status === e || _(() => v(t));
|
|
62
|
+
}).catch(() => void 0);
|
|
63
|
+
}, l), h = setTimeout(() => {
|
|
64
|
+
_(() => s("OAuth authorization timed out"));
|
|
65
|
+
}, u), () => {
|
|
66
|
+
f || (f = !0, g());
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { n as isOAuthCallbackMessage, i as waitForOAuthCompletion };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Translator } from '../credentials/translate';
|
|
2
|
+
import { ConnectionProvider } from './types';
|
|
3
|
+
/** The providers the picker offers, filtered by the search query. */
|
|
4
|
+
export declare function pickableProviders(providers: ConnectionProvider[], source: 'installed' | 'catalog', query: string, translate: Translator): ConnectionProvider[];
|
|
5
|
+
/** Providers grouped by category, in first-seen order. */
|
|
6
|
+
export declare function groupByCategory(providers: ConnectionProvider[]): Array<[ConnectionProvider['category'], ConnectionProvider[]]>;
|
|
7
|
+
//# sourceMappingURL=picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../src/connections/picker.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,qEAAqE;AACrE,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,kBAAkB,EAAE,EAC/B,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,UAAU,GACpB,kBAAkB,EAAE,CAatB;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAC7B,SAAS,EAAE,kBAAkB,EAAE,GAC9B,KAAK,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAQ/D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { categoryLabel as e } from "./labels.js";
|
|
2
|
+
//#region src/connections/picker.ts
|
|
3
|
+
function t(t, n, r, i) {
|
|
4
|
+
let a = t.filter((e) => e.isEnabled && (n === "catalog" || e.pluginStatus === "installed")), o = r.trim().toLowerCase();
|
|
5
|
+
return o ? a.filter((t) => t.name.toLowerCase().includes(o) || t.description.toLowerCase().includes(o) || t.key.toLowerCase().includes(o) || e(t.category, i).toLowerCase().includes(o)) : a;
|
|
6
|
+
}
|
|
7
|
+
function n(e) {
|
|
8
|
+
let t = /* @__PURE__ */ new Map();
|
|
9
|
+
for (let n of e) {
|
|
10
|
+
let e = t.get(n.category);
|
|
11
|
+
e ? e.push(n) : t.set(n.category, [n]);
|
|
12
|
+
}
|
|
13
|
+
return [...t.entries()];
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as groupByCategory, t as pickableProviders };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ProviderCategory } from './types';
|
|
2
|
+
/** Only the fields identity depends on, so any provider shape can be passed. */
|
|
3
|
+
export interface ProviderIdentity {
|
|
4
|
+
key: string;
|
|
5
|
+
icon?: string | null;
|
|
6
|
+
category?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function normalizeProviderCategory(value: unknown): ProviderCategory;
|
|
9
|
+
/** The label for a named tile, or undefined when the provider has a mark. */
|
|
10
|
+
export declare function getProviderTextIcon(provider: Pick<ProviderIdentity, 'key' | 'icon'>): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* An image to render: an absolute/relative URL or inline image the catalog
|
|
13
|
+
* supplied, or one of the bundled first-party marks.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getProviderImageSource(provider: Pick<ProviderIdentity, 'icon'>, bundledIcons: Readonly<Record<string, string>>): string | undefined;
|
|
16
|
+
/** The Iconify name to render when there is no tile or image. */
|
|
17
|
+
export declare function getProviderIconName(provider: ProviderIdentity): string;
|
|
18
|
+
/** Tile colours by category, from semantic tokens only. */
|
|
19
|
+
export declare function getProviderAccent(category: unknown): {
|
|
20
|
+
surface: string;
|
|
21
|
+
icon: string;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=providerIdentity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providerIdentity.d.ts","sourceRoot":"","sources":["../../src/connections/providerIdentity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAoGD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAG1E;AA4DD,6EAA6E;AAC7E,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAC/C,MAAM,GAAG,SAAS,CAQpB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,EACxC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC7C,MAAM,GAAG,SAAS,CAOpB;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAmBtE;AAkBD,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAoBA"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
//#region src/connections/providerIdentity.ts
|
|
2
|
+
var e = {
|
|
3
|
+
"google-gmail": "logos:google-gmail",
|
|
4
|
+
"google-drive": "logos:google-drive",
|
|
5
|
+
"google-calendar": "logos:google-calendar",
|
|
6
|
+
"google-sheets": "thesvg-color:google-sheets",
|
|
7
|
+
"google-docs": "thesvg-color:google-docs",
|
|
8
|
+
"google-chat": "thesvg-color:google-chat",
|
|
9
|
+
"google-forms": "simple-icons:googleforms",
|
|
10
|
+
"google-workspace-admin": "thesvg-color:google-workspace-admin",
|
|
11
|
+
"google-workspace-admin-domain-wide-delegation": "thesvg-color:google-workspace-admin",
|
|
12
|
+
"microsoft-outlook": "thesvg-color:microsoft-outlook",
|
|
13
|
+
"microsoft-onedrive": "logos:microsoft-onedrive",
|
|
14
|
+
"microsoft-teams": "logos:microsoft-teams",
|
|
15
|
+
"microsoft-excel": "thesvg-color:microsoft-excel",
|
|
16
|
+
github: "mdi:github",
|
|
17
|
+
slack: "logos:slack-icon",
|
|
18
|
+
salesforce: "logos:salesforce",
|
|
19
|
+
notion: "simple-icons:notion",
|
|
20
|
+
airtable: "logos:airtable",
|
|
21
|
+
linear: "simple-icons:linear",
|
|
22
|
+
facebook: "logos:facebook",
|
|
23
|
+
instagram: "logos:instagram-icon",
|
|
24
|
+
twitter: "simple-icons:x",
|
|
25
|
+
linkedin: "simple-icons:linkedin",
|
|
26
|
+
youtube: "logos:youtube-icon",
|
|
27
|
+
tiktok: "logos:tiktok-icon",
|
|
28
|
+
pinterest: "logos:pinterest",
|
|
29
|
+
snapchat: "simple-icons:snapchat",
|
|
30
|
+
"google-ads": "logos:google-ads",
|
|
31
|
+
"linkedin-ads": "simple-icons:linkedin",
|
|
32
|
+
quickbooks: "simple-icons:quickbooks",
|
|
33
|
+
"g2-data-feed": "thesvg-color:g2",
|
|
34
|
+
openai: "simple-icons:openai",
|
|
35
|
+
anthropic: "simple-icons:anthropic",
|
|
36
|
+
sendgrid: "simple-icons:sendgrid",
|
|
37
|
+
twilio: "logos:twilio-icon",
|
|
38
|
+
stripe: "logos:stripe",
|
|
39
|
+
postgres: "logos:postgresql",
|
|
40
|
+
mysql: "logos:mysql",
|
|
41
|
+
mongodb: "logos:mongodb-icon",
|
|
42
|
+
redis: "logos:redis",
|
|
43
|
+
aws: "logos:aws",
|
|
44
|
+
gcp: "logos:google-cloud",
|
|
45
|
+
azure: "logos:azure-icon",
|
|
46
|
+
"generic-oauth2": "mdi:key-chain",
|
|
47
|
+
"generic-api-key": "mdi:key-variant",
|
|
48
|
+
"generic-basic-auth": "mdi:lock-outline"
|
|
49
|
+
}, t = {
|
|
50
|
+
communication: "mdi:message-text-outline",
|
|
51
|
+
project_management: "mdi:view-dashboard-outline",
|
|
52
|
+
cloud_storage: "mdi:cloud-outline",
|
|
53
|
+
crm: "mdi:account-group-outline",
|
|
54
|
+
analytics: "mdi:chart-bar",
|
|
55
|
+
developer_tools: "mdi:code-braces",
|
|
56
|
+
finance: "mdi:currency-usd",
|
|
57
|
+
support: "mdi:headset",
|
|
58
|
+
social: "mdi:share-variant-outline",
|
|
59
|
+
ai: "mdi:brain",
|
|
60
|
+
email: "mdi:email-outline",
|
|
61
|
+
calendar: "mdi:calendar-outline",
|
|
62
|
+
productivity: "mdi:file-document-outline",
|
|
63
|
+
marketing: "mdi:bullhorn-outline",
|
|
64
|
+
hr: "mdi:account-tie-outline",
|
|
65
|
+
other: "mdi:puzzle-outline"
|
|
66
|
+
}, n = {
|
|
67
|
+
COMMUNICATION: "communication",
|
|
68
|
+
PROJECT_MANAGEMENT: "project_management",
|
|
69
|
+
CLOUD_STORAGE: "cloud_storage",
|
|
70
|
+
CRM: "crm",
|
|
71
|
+
ANALYTICS: "analytics",
|
|
72
|
+
DEVELOPMENT: "developer_tools",
|
|
73
|
+
DEVELOPER_TOOLS: "developer_tools",
|
|
74
|
+
MARKETING: "marketing",
|
|
75
|
+
PAYMENT: "finance",
|
|
76
|
+
FINANCE: "finance",
|
|
77
|
+
HR: "hr",
|
|
78
|
+
SUPPORT: "support",
|
|
79
|
+
SOCIAL: "social",
|
|
80
|
+
AI: "ai",
|
|
81
|
+
EMAIL: "email",
|
|
82
|
+
CALENDAR: "calendar",
|
|
83
|
+
PRODUCTIVITY: "productivity",
|
|
84
|
+
CUSTOM: "other",
|
|
85
|
+
OTHER: "other"
|
|
86
|
+
};
|
|
87
|
+
function r(e) {
|
|
88
|
+
return s(n, String(e ?? "").toUpperCase()) ?? "other";
|
|
89
|
+
}
|
|
90
|
+
var i = {
|
|
91
|
+
bamboohr: "BambooHR",
|
|
92
|
+
"meta-ads": "Meta Ads",
|
|
93
|
+
pgvector: "pgvector",
|
|
94
|
+
"apple-app-store-connect": "Connect",
|
|
95
|
+
"freshdesk-api": "Freshdesk",
|
|
96
|
+
hubspot: "HubSpot",
|
|
97
|
+
pinecone: "Pinecone",
|
|
98
|
+
ramp: "Ramp",
|
|
99
|
+
tally: "TallyPrime",
|
|
100
|
+
woocommerce: "WooCommerce",
|
|
101
|
+
"zoho-books": "Zoho Books"
|
|
102
|
+
}, a = {
|
|
103
|
+
bamboohr: "simple-icons:bamboohr",
|
|
104
|
+
"meta-ads": "meta-ads",
|
|
105
|
+
pgvector: "iconify:logos:postgresql",
|
|
106
|
+
"apple-app-store-connect": "simple-icons:appstore",
|
|
107
|
+
"freshdesk-api": "simple-icons:freshworks",
|
|
108
|
+
hubspot: "hubspot",
|
|
109
|
+
pinecone: "iconify:mdi:database-search",
|
|
110
|
+
ramp: "mdi:credit-card-outline",
|
|
111
|
+
tally: "tally",
|
|
112
|
+
woocommerce: "simple-icons:woocommerce",
|
|
113
|
+
"zoho-books": "zoho-books"
|
|
114
|
+
}, o = { pipedrive: {
|
|
115
|
+
icon: "simple-icons:pipedrive",
|
|
116
|
+
replacement: "thesvg-color:pipedrive"
|
|
117
|
+
} };
|
|
118
|
+
function s(e, t) {
|
|
119
|
+
return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
120
|
+
}
|
|
121
|
+
function c(e) {
|
|
122
|
+
return t[typeof e == "string" && Object.prototype.hasOwnProperty.call(t, e) ? e : r(e)];
|
|
123
|
+
}
|
|
124
|
+
function l(e) {
|
|
125
|
+
let t = e.icon ?? "", n = t.startsWith("text:"), r = n ? t.slice(5) : e.key;
|
|
126
|
+
if (n || t === s(a, e.key)) return s(i, r);
|
|
127
|
+
}
|
|
128
|
+
function u(e, t) {
|
|
129
|
+
let n = e.icon ?? "";
|
|
130
|
+
if (n) return /^https?:\/\//i.test(n) || n.startsWith("/") || n.startsWith("data:image/") ? n : s(t, n.startsWith("brand:") ? n.slice(6) : n);
|
|
131
|
+
}
|
|
132
|
+
function d(t) {
|
|
133
|
+
let n = t.icon ?? "", r = c(t.category), i = s(o, t.key);
|
|
134
|
+
return i && n === i.icon ? i.replacement : n.startsWith("iconify:") ? n.slice(8) : n.startsWith("text:") ? r : /^[a-z0-9-]+:[a-z0-9-]+$/i.test(n) && !n.startsWith("brand:") ? n : n === "key" && t.key.startsWith("generic-") ? s(e, t.key) ?? r : s(e, n) ?? (n ? r : s(e, t.key) ?? r);
|
|
135
|
+
}
|
|
136
|
+
var f = {
|
|
137
|
+
primary: {
|
|
138
|
+
surface: "bg-action-primary-bg/10",
|
|
139
|
+
icon: "text-primary"
|
|
140
|
+
},
|
|
141
|
+
success: {
|
|
142
|
+
surface: "bg-status-success-bg-subtle",
|
|
143
|
+
icon: "text-status-success-text"
|
|
144
|
+
},
|
|
145
|
+
warning: {
|
|
146
|
+
surface: "bg-status-warning-bg-subtle",
|
|
147
|
+
icon: "text-status-warning-text"
|
|
148
|
+
},
|
|
149
|
+
info: {
|
|
150
|
+
surface: "bg-status-info-bg-subtle",
|
|
151
|
+
icon: "text-status-info-text"
|
|
152
|
+
},
|
|
153
|
+
neutral: {
|
|
154
|
+
surface: "bg-bg-sunken",
|
|
155
|
+
icon: "text-text-primary"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
function p(e) {
|
|
159
|
+
switch (r(e)) {
|
|
160
|
+
case "communication":
|
|
161
|
+
case "social":
|
|
162
|
+
case "support": return f.info;
|
|
163
|
+
case "crm":
|
|
164
|
+
case "hr": return f.success;
|
|
165
|
+
case "finance":
|
|
166
|
+
case "calendar":
|
|
167
|
+
case "productivity": return f.warning;
|
|
168
|
+
case "ai":
|
|
169
|
+
case "email":
|
|
170
|
+
case "marketing": return f.neutral;
|
|
171
|
+
default: return f.primary;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
export { p as getProviderAccent, d as getProviderIconName, u as getProviderImageSource, l as getProviderTextIcon, r as normalizeProviderCategory };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth scope options, read from the service rather than hardcoded.
|
|
3
|
+
*
|
|
4
|
+
* Per-provider forms used to carry their scope lists in React (Gmail's five,
|
|
5
|
+
* with English labels). The service seeds the same list on the provider and on
|
|
6
|
+
* each auth method, so it is read here and a new scope needs no frontend
|
|
7
|
+
* change.
|
|
8
|
+
*/
|
|
9
|
+
export interface ScopeOption {
|
|
10
|
+
scope: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Always granted — shown as fixed rather than as a choice. */
|
|
13
|
+
required: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Narrow the service's `availableScopes` JSON to options, discarding anything
|
|
17
|
+
* malformed rather than rendering a broken row.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseScopeOptions(raw: unknown): ScopeOption[];
|
|
20
|
+
/**
|
|
21
|
+
* The user's scope choice. `null` means untouched: the connection requests the
|
|
22
|
+
* method's defaults, and the service chooses them.
|
|
23
|
+
*/
|
|
24
|
+
export type ScopeSelection = string[] | null;
|
|
25
|
+
/** Whether an optional scope reads as ticked. */
|
|
26
|
+
export declare function isScopeChecked(scope: string, selection: ScopeSelection, defaultScopes: readonly string[]): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Toggle one scope, starting from what is currently shown — so the first click
|
|
29
|
+
* on an untouched picker keeps the ticked defaults instead of discarding them.
|
|
30
|
+
*/
|
|
31
|
+
export declare function toggleScope(scope: string, selection: ScopeSelection, defaultScopes: readonly string[], options: readonly ScopeOption[]): string[];
|
|
32
|
+
/**
|
|
33
|
+
* The scopes to send, or undefined to let the service use the method's
|
|
34
|
+
* defaults.
|
|
35
|
+
*
|
|
36
|
+
* The service treats a sent list as the whole request — it does not add the
|
|
37
|
+
* required scopes back. The picker promises those are "always included", so a
|
|
38
|
+
* user's choice is sent together with them; sending the choice alone dropped
|
|
39
|
+
* them.
|
|
40
|
+
*/
|
|
41
|
+
export declare function requestedScopes(selection: ScopeSelection, options: readonly ScopeOption[]): string[] | undefined;
|
|
42
|
+
//# sourceMappingURL=scopes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../../src/connections/scopes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,EAAE,CAkB7D;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;AAE7C,iDAAiD;AACjD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,cAAc,EACzB,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,cAAc,EACzB,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,OAAO,EAAE,SAAS,WAAW,EAAE,GAC9B,MAAM,EAAE,CAQV;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,SAAS,WAAW,EAAE,GAC9B,MAAM,EAAE,GAAG,SAAS,CAItB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/connections/scopes.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return Array.isArray(e) ? e.flatMap((e) => {
|
|
4
|
+
if (typeof e == "string") return e ? [{
|
|
5
|
+
scope: e,
|
|
6
|
+
required: !1
|
|
7
|
+
}] : [];
|
|
8
|
+
if (!e || typeof e != "object") return [];
|
|
9
|
+
let t = e, n = t.scope ?? t.value;
|
|
10
|
+
return typeof n != "string" || !n ? [] : [{
|
|
11
|
+
scope: n,
|
|
12
|
+
description: typeof t.description == "string" ? t.description : typeof t.label == "string" ? t.label : void 0,
|
|
13
|
+
required: t.required === !0
|
|
14
|
+
}];
|
|
15
|
+
}) : [];
|
|
16
|
+
}
|
|
17
|
+
function t(e, t, n) {
|
|
18
|
+
return t === null ? n.includes(e) : t.includes(e);
|
|
19
|
+
}
|
|
20
|
+
function n(e, t, n, r) {
|
|
21
|
+
let i = new Set(n), a = t ?? r.filter((e) => !e.required && i.has(e.scope)).map((e) => e.scope);
|
|
22
|
+
return a.includes(e) ? a.filter((t) => t !== e) : [...a, e];
|
|
23
|
+
}
|
|
24
|
+
function r(e, t) {
|
|
25
|
+
if (e === null) return;
|
|
26
|
+
let n = t.filter((e) => e.required).map((e) => e.scope);
|
|
27
|
+
return [...new Set([...n, ...e])];
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { t as isScopeChecked, e as parseScopeOptions, r as requestedScopes, n as toggleScope };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CredentialStorageState, ProviderAuthType, VaultSecretSummary } from './types';
|
|
2
|
+
export declare const EMPTY_STORAGE: CredentialStorageState;
|
|
3
|
+
/**
|
|
4
|
+
* Secrets that can hold this kind of credential. An OAuth or basic-auth
|
|
5
|
+
* connection needs a structured secret; a key or token fits a plain one.
|
|
6
|
+
*/
|
|
7
|
+
export declare function compatibleSecrets(secrets: VaultSecretSummary[], authType: ProviderAuthType): VaultSecretSummary[];
|
|
8
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/connections/storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE5F,eAAO,MAAM,aAAa,EAAE,sBAK3B,CAAC;AAKF;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,kBAAkB,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,GACzB,kBAAkB,EAAE,CAQtB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/connections/storage.ts
|
|
2
|
+
var e = {
|
|
3
|
+
mode: "managed",
|
|
4
|
+
vaultId: "",
|
|
5
|
+
secretId: "",
|
|
6
|
+
managedSecretName: ""
|
|
7
|
+
}, t = new Set([
|
|
8
|
+
"TOKEN",
|
|
9
|
+
"CREDENTIAL",
|
|
10
|
+
"STRUCTURED_DATA"
|
|
11
|
+
]), n = new Set([
|
|
12
|
+
"API_KEY",
|
|
13
|
+
"TOKEN",
|
|
14
|
+
"TEXT",
|
|
15
|
+
"STRUCTURED_DATA"
|
|
16
|
+
]);
|
|
17
|
+
function r(e, r) {
|
|
18
|
+
return r === "oauth2" || r === "basic_auth" ? e.filter((e) => t.has(e.type)) : r === "api_key" || r === "bearer_token" ? e.filter((e) => n.has(e.type)) : e;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as EMPTY_STORAGE, r as compatibleSecrets };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AuthMethodFlow } from '../credentials/types';
|
|
2
|
+
export type ProviderCategory = 'communication' | 'project_management' | 'cloud_storage' | 'crm' | 'analytics' | 'developer_tools' | 'marketing' | 'finance' | 'hr' | 'support' | 'social' | 'ai' | 'email' | 'calendar' | 'productivity' | 'other';
|
|
3
|
+
export type ProviderAuthType = 'oauth2' | 'api_key' | 'basic_auth' | 'bearer_token' | 'service_account' | 'workspace_app_token' | 'custom';
|
|
4
|
+
/** One way of authenticating against a provider. */
|
|
5
|
+
export interface ConnectionAuthMethod {
|
|
6
|
+
key: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
authType: ProviderAuthType;
|
|
10
|
+
flow: AuthMethodFlow;
|
|
11
|
+
defaultScopes: string[];
|
|
12
|
+
/** Raw `availableScopes` JSON; narrowed by `parseScopeOptions`. */
|
|
13
|
+
availableScopes: unknown;
|
|
14
|
+
configSchema: Record<string, unknown> | null;
|
|
15
|
+
/** False when this environment lacks the credentials the method needs. */
|
|
16
|
+
isConfigured: boolean;
|
|
17
|
+
isEnabled: boolean;
|
|
18
|
+
displayOrder: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ConnectionProvider {
|
|
21
|
+
id: string;
|
|
22
|
+
key: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
category: ProviderCategory;
|
|
26
|
+
authType: ProviderAuthType;
|
|
27
|
+
icon: string;
|
|
28
|
+
website: string;
|
|
29
|
+
docsUrl: string;
|
|
30
|
+
isEnabled: boolean;
|
|
31
|
+
/** `installed` for providers a workspace has installed from the catalog. */
|
|
32
|
+
pluginStatus: string;
|
|
33
|
+
defaultScopes: string[];
|
|
34
|
+
availableScopes: unknown;
|
|
35
|
+
configSchema: Record<string, unknown> | null;
|
|
36
|
+
authMethods: ConnectionAuthMethod[];
|
|
37
|
+
}
|
|
38
|
+
/** What the dialog hands back once a connection is usable. */
|
|
39
|
+
export interface CreatedConnection {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
/** The service's status enum, e.g. `ACTIVE`. */
|
|
43
|
+
status: string;
|
|
44
|
+
provider: ConnectionProvider;
|
|
45
|
+
}
|
|
46
|
+
/** Where a new connection's credential is kept. */
|
|
47
|
+
export interface CredentialStorageState {
|
|
48
|
+
/**
|
|
49
|
+
* `managed` — a new secret, in `vaultId` when one is chosen, otherwise held
|
|
50
|
+
* by the integrations service itself. `existing` — reference `secretId`.
|
|
51
|
+
*/
|
|
52
|
+
mode: 'managed' | 'existing';
|
|
53
|
+
vaultId: string;
|
|
54
|
+
secretId: string;
|
|
55
|
+
managedSecretName: string;
|
|
56
|
+
}
|
|
57
|
+
export interface VaultSummary {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
secretCount: number;
|
|
61
|
+
}
|
|
62
|
+
export interface VaultSecretSummary {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
type: string;
|
|
66
|
+
}
|
|
67
|
+
/** Lifecycle events a host may want to mirror onto its own event bus. */
|
|
68
|
+
export type ConnectionDialogEvent = {
|
|
69
|
+
type: 'connection-created';
|
|
70
|
+
connectionId: string;
|
|
71
|
+
providerKey: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: 'oauth-started';
|
|
74
|
+
connectionId: string;
|
|
75
|
+
providerKey: string;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'oauth-failed';
|
|
78
|
+
connectionId: string;
|
|
79
|
+
providerKey: string;
|
|
80
|
+
error: string;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/connections/types.ts"],"names":[],"mappings":"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"}
|