@burdenoff/microfe-integrations 2026.1109.1 → 2026.1109.3
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/integrations/hooks/useProviders.d.ts +30 -2
- package/dist/integrations/hooks/useProviders.js +71 -22
- package/dist/integrations/hooks/useProviders.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +144 -151
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,12 +4,40 @@ interface ProviderFilterOptions {
|
|
|
4
4
|
pluginStatus?: PluginStatus;
|
|
5
5
|
search?: string;
|
|
6
6
|
}
|
|
7
|
+
/** The service caps one getProviders page at 100 rows. */
|
|
8
|
+
export declare const PROVIDER_PAGE_SIZE = 100;
|
|
9
|
+
type ProvidersPage = {
|
|
10
|
+
getProviders: {
|
|
11
|
+
items: ReadonlyArray<{
|
|
12
|
+
id: string;
|
|
13
|
+
}>;
|
|
14
|
+
total: number;
|
|
15
|
+
hasMore: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Appends a fetched page to the providers loaded so far. Rows already present
|
|
20
|
+
* (by id) are skipped so a catalog that shifts between pages never shows a
|
|
21
|
+
* provider twice, and a page that adds nothing ends paging so a stale
|
|
22
|
+
* `hasMore` cannot loop.
|
|
23
|
+
*/
|
|
24
|
+
export declare function mergeProviderPages<T extends ProvidersPage>(previous: T, next: T | undefined): T;
|
|
25
|
+
/**
|
|
26
|
+
* Loads every provider the filter matches. The catalog has grown past one
|
|
27
|
+
* page (BOFF-11224: providers seeded after the first 100 by display order,
|
|
28
|
+
* such as ClickSend, never reached the catalog or the add-connection wizard,
|
|
29
|
+
* whose search runs on the loaded rows), so the hook keeps fetching pages
|
|
30
|
+
* until the service reports no more.
|
|
31
|
+
*/
|
|
7
32
|
export declare function useProviders(filter?: ProviderFilterOptions): {
|
|
8
33
|
providers: IntegrationProvider[];
|
|
9
|
-
total:
|
|
34
|
+
total: any;
|
|
10
35
|
loading: boolean;
|
|
11
36
|
error: import('@apollo/client').ErrorLike | undefined;
|
|
12
|
-
refetch:
|
|
37
|
+
refetch: () => Promise<{
|
|
38
|
+
data: any;
|
|
39
|
+
error?: import('@apollo/client').ErrorLike;
|
|
40
|
+
}>;
|
|
13
41
|
};
|
|
14
42
|
export declare function useProvider(id: string): {
|
|
15
43
|
provider: IntegrationProvider | null;
|
|
@@ -1,26 +1,75 @@
|
|
|
1
1
|
import { useDeleteProviderAuthMethodMutation as e, useDisableProviderMutation as t, useEnableProviderMutation as n, useGetProviderByKeyQuery as r, useGetProviderQuery as i, useGetProvidersQuery as a, useInstallProviderPluginMutation as o, useUninstallProviderPluginMutation as s, useUpdateProviderPluginMutation as c, useUpsertProviderAuthMethodMutation as l } from "../../generated/wspace-operations.js";
|
|
2
2
|
import { mapProvider as u } from "../utils/mappers.js";
|
|
3
3
|
import { useIntegrations as d } from "../providers/IntegrationsProvider.js";
|
|
4
|
-
import { useCallback as f,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let
|
|
4
|
+
import { useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
5
|
+
function _(e, t) {
|
|
6
|
+
if (!t?.getProviders) return e;
|
|
7
|
+
let n = new Set(e.getProviders.items.map((e) => e.id)), r = t.getProviders.items.filter((e) => !n.has(e.id));
|
|
8
|
+
return {
|
|
9
|
+
...e,
|
|
10
|
+
getProviders: {
|
|
11
|
+
...t.getProviders,
|
|
12
|
+
items: [...e.getProviders.items, ...r],
|
|
13
|
+
hasMore: r.length > 0 && t.getProviders.hasMore
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function v(e) {
|
|
18
|
+
let { workspaceId: t } = d(), n = JSON.stringify(e ?? {}), r = m(() => n === "{}" ? void 0 : JSON.parse(n), [n]), { data: i, loading: o, error: s, refetch: c, fetchMore: l } = a({
|
|
8
19
|
variables: {
|
|
9
|
-
filter:
|
|
10
|
-
pagination: {
|
|
20
|
+
filter: r,
|
|
21
|
+
pagination: {
|
|
22
|
+
limit: 100,
|
|
23
|
+
offset: 0
|
|
24
|
+
}
|
|
11
25
|
},
|
|
12
26
|
skip: !t,
|
|
13
27
|
errorPolicy: "all"
|
|
14
|
-
}),
|
|
28
|
+
}), [v, y] = g(null), b = h(null), [x, S] = g(0), C = h(!0);
|
|
29
|
+
p(() => (C.current = !0, () => {
|
|
30
|
+
C.current = !1;
|
|
31
|
+
}), []);
|
|
32
|
+
let w = i?.getProviders?.items?.length ?? 0, T = i?.getProviders?.hasMore === !0 && w > 0;
|
|
33
|
+
p(() => {
|
|
34
|
+
if (o || !T || v || b.current !== null) return;
|
|
35
|
+
let e = w;
|
|
36
|
+
b.current = e;
|
|
37
|
+
let t = (e) => {
|
|
38
|
+
C.current && y(e instanceof Error ? e : Error(String(e)));
|
|
39
|
+
};
|
|
40
|
+
l({
|
|
41
|
+
variables: {
|
|
42
|
+
filter: r,
|
|
43
|
+
pagination: {
|
|
44
|
+
limit: 100,
|
|
45
|
+
offset: e
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
updateQuery: (e, { fetchMoreResult: t }) => _(e, t)
|
|
49
|
+
}).then((e) => {
|
|
50
|
+
(e.error || !e.data?.getProviders) && t(e.error ?? /* @__PURE__ */ Error("A providers page came back empty"));
|
|
51
|
+
}).catch(t).finally(() => {
|
|
52
|
+
b.current === e && (b.current = null), C.current && S((e) => e + 1);
|
|
53
|
+
});
|
|
54
|
+
}, [
|
|
55
|
+
o,
|
|
56
|
+
T,
|
|
57
|
+
w,
|
|
58
|
+
l,
|
|
59
|
+
r,
|
|
60
|
+
v,
|
|
61
|
+
x
|
|
62
|
+
]);
|
|
63
|
+
let E = f(() => (b.current = null, y(null), c()), [c]), D = m(() => (i?.getProviders?.items ?? []).map((e) => u(e)), [i]), O = T && !v;
|
|
15
64
|
return {
|
|
16
|
-
providers:
|
|
17
|
-
total:
|
|
18
|
-
loading:
|
|
19
|
-
error:
|
|
20
|
-
refetch:
|
|
65
|
+
providers: D,
|
|
66
|
+
total: i?.getProviders?.total ?? D.length,
|
|
67
|
+
loading: o || O,
|
|
68
|
+
error: s ?? v ?? void 0,
|
|
69
|
+
refetch: E
|
|
21
70
|
};
|
|
22
71
|
}
|
|
23
|
-
function
|
|
72
|
+
function y(e) {
|
|
24
73
|
let { workspaceId: t } = d(), { data: n, loading: r, error: a, refetch: o } = i({
|
|
25
74
|
variables: { id: e },
|
|
26
75
|
skip: !t || !e,
|
|
@@ -33,7 +82,7 @@ function h(e) {
|
|
|
33
82
|
refetch: o
|
|
34
83
|
};
|
|
35
84
|
}
|
|
36
|
-
function
|
|
85
|
+
function b(e) {
|
|
37
86
|
let { workspaceId: t } = d(), { data: n, loading: i, error: a, refetch: o } = r({
|
|
38
87
|
variables: { key: e },
|
|
39
88
|
skip: !t || !e,
|
|
@@ -46,7 +95,7 @@ function g(e) {
|
|
|
46
95
|
refetch: o
|
|
47
96
|
};
|
|
48
97
|
}
|
|
49
|
-
function
|
|
98
|
+
function x() {
|
|
50
99
|
let [e, { loading: t }] = o({ refetchQueries: [
|
|
51
100
|
"GetProviders",
|
|
52
101
|
"GetProvider",
|
|
@@ -57,7 +106,7 @@ function _() {
|
|
|
57
106
|
loading: t
|
|
58
107
|
};
|
|
59
108
|
}
|
|
60
|
-
function
|
|
109
|
+
function S() {
|
|
61
110
|
let [e, { loading: t }] = c({ refetchQueries: [
|
|
62
111
|
"GetProviders",
|
|
63
112
|
"GetProvider",
|
|
@@ -71,7 +120,7 @@ function v() {
|
|
|
71
120
|
loading: t
|
|
72
121
|
};
|
|
73
122
|
}
|
|
74
|
-
function
|
|
123
|
+
function C() {
|
|
75
124
|
let [e, { loading: t }] = s({ refetchQueries: [
|
|
76
125
|
"GetProviders",
|
|
77
126
|
"GetProvider",
|
|
@@ -82,21 +131,21 @@ function y() {
|
|
|
82
131
|
loading: t
|
|
83
132
|
};
|
|
84
133
|
}
|
|
85
|
-
function
|
|
134
|
+
function w() {
|
|
86
135
|
let [e, { loading: t }] = n({ refetchQueries: ["GetProviders", "GetProvider"] });
|
|
87
136
|
return {
|
|
88
137
|
enableProvider: f(async (t) => (await e({ variables: { id: t } })).data?.enableProvider, [e]),
|
|
89
138
|
loading: t
|
|
90
139
|
};
|
|
91
140
|
}
|
|
92
|
-
function
|
|
141
|
+
function T() {
|
|
93
142
|
let [e, { loading: n }] = t({ refetchQueries: ["GetProviders", "GetProvider"] });
|
|
94
143
|
return {
|
|
95
144
|
disableProvider: f(async (t) => (await e({ variables: { id: t } })).data?.disableProvider, [e]),
|
|
96
145
|
loading: n
|
|
97
146
|
};
|
|
98
147
|
}
|
|
99
|
-
function
|
|
148
|
+
function E() {
|
|
100
149
|
let [e, { loading: t }] = l({ refetchQueries: ["GetProvider", "GetProviders"] });
|
|
101
150
|
return {
|
|
102
151
|
upsertAuthMethod: f(async (t, n) => (await e({ variables: {
|
|
@@ -106,7 +155,7 @@ function S() {
|
|
|
106
155
|
loading: t
|
|
107
156
|
};
|
|
108
157
|
}
|
|
109
|
-
function
|
|
158
|
+
function D() {
|
|
110
159
|
let [t, { loading: n }] = e({ refetchQueries: ["GetProvider", "GetProviders"] });
|
|
111
160
|
return {
|
|
112
161
|
deleteAuthMethod: f(async (e, n) => (await t({ variables: {
|
|
@@ -116,6 +165,6 @@ function C() {
|
|
|
116
165
|
loading: n
|
|
117
166
|
};
|
|
118
167
|
}
|
|
119
|
-
export {
|
|
168
|
+
export { _ as mergeProviderPages, D as useDeleteAuthMethod, T as useDisableProvider, w as useEnableProvider, x as useInstallPlugin, y as useProvider, b as useProviderByKey, v as useProviders, C as useUninstallPlugin, S as useUpdatePlugin, E as useUpsertAuthMethod };
|
|
120
169
|
|
|
121
170
|
//# sourceMappingURL=useProviders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProviders.js","names":["useProviders","useIntegrations","useGetProvidersQuery","workspaceId","providers","useMemo","data","mapProvider","item","useProvider","useGetProviderQuery","id","useProviderByKey","useGetProviderByKeyQuery","key","useInstallPlugin","mutate","useInstallProviderPluginMutation","useCallback","useUpdatePlugin","useUpdateProviderPluginMutation","useUninstallPlugin","useUninstallProviderPluginMutation","useEnableProvider","useEnableProviderMutation","useDisableProvider","useDisableProviderMutation","useUpsertAuthMethod","useUpsertProviderAuthMethodMutation","useDeleteAuthMethod","useDeleteProviderAuthMethodMutation"],"sources":["../../../src/integrations/hooks/useProviders.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for providers.\n *\n * These hooks provide a stable API surface regardless of whether the\n * generated operations exist yet. Until codegen runs, they return\n * empty/loading state so the UI can render without errors.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n useGetProvidersQuery,\n useGetProviderQuery,\n useGetProviderByKeyQuery,\n useInstallProviderPluginMutation,\n useUpdateProviderPluginMutation,\n useUninstallProviderPluginMutation,\n useEnableProviderMutation,\n useDisableProviderMutation,\n useUpsertProviderAuthMethodMutation,\n useDeleteProviderAuthMethodMutation,\n} from '../../generated/wspace-operations';\nimport { mapProvider } from '../utils/mappers';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport type { IntegrationProvider, ProviderCategory, PluginStatus } from '../types';\n\n// ─── Hooks ──────────────────────────────────────────────────────────────────\n\ninterface ProviderFilterOptions {\n category?: ProviderCategory;\n pluginStatus?: PluginStatus;\n search?: string;\n}\n\nexport function useProviders(filter?: ProviderFilterOptions) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetProvidersQuery({\n variables: { filter, pagination: { limit: 100 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n\n // Memoized so the array reference is stable across renders (avoids re-running\n // downstream memos/effects keyed on `providers`).\n const providers = useMemo<IntegrationProvider[]>(() => {\n const all: IntegrationProvider[] = (data?.getProviders?.items ?? []).map(\n (item: Record<string, unknown>) => mapProvider(item)\n );\n // No frontend allowlist: visibility is `isEnabled` on the provider row, which\n // the admin console owns. See the note where VISIBLE_PROVIDER_KEYS used to be.\n return all;\n }, [data]);\n\n // NOTE: `total` is the returned count, not the server total. Safe today (no\n // consumer paginates on it; the query is capped at limit:100 and `hasMore` is\n // unused). Revisit if real pagination is added against this hook.\n return { providers, total: providers.length, loading, error, refetch };\n}\n\nexport function useProvider(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetProviderQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n const provider: IntegrationProvider | null = data?.getProvider\n ? mapProvider(data.getProvider as Record<string, unknown>)\n : null;\n\n return { provider, loading, error, refetch };\n}\n\nexport function useProviderByKey(key: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetProviderByKeyQuery({\n variables: { key },\n skip: !workspaceId || !key,\n errorPolicy: 'all',\n });\n\n const provider: IntegrationProvider | null = data?.getProviderByKey\n ? mapProvider(data.getProviderByKey as Record<string, unknown>)\n : null;\n\n return { provider, loading, error, refetch };\n}\n\nexport function useInstallPlugin() {\n const [mutate, { loading }] = useInstallProviderPluginMutation({\n refetchQueries: ['GetProviders', 'GetProvider', 'GetProviderCatalog'],\n });\n\n const installPlugin = useCallback(\n async (input: {\n key: string;\n name: string;\n description?: string;\n category: string;\n authType: string;\n icon?: string;\n color?: string;\n website?: string;\n docsUrl?: string;\n oauthConfig?: Record<string, unknown>;\n defaultScopes?: string[];\n availableScopes?: Record<string, unknown>;\n baseUrl?: string;\n apiVersion?: string;\n rateLimitConfig?: Record<string, unknown>;\n pluginVersion?: string;\n pluginAuthor?: string;\n pluginRepository?: string;\n displayOrder?: number;\n supportedFeatures?: string[];\n configSchema?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n return result.data?.installProviderPlugin;\n },\n [mutate]\n );\n\n return { installPlugin, loading };\n}\n\nexport function useUpdatePlugin() {\n const [mutate, { loading }] = useUpdateProviderPluginMutation({\n refetchQueries: ['GetProviders', 'GetProvider', 'GetProviderCatalog'],\n });\n\n const updatePlugin = useCallback(\n async (\n id: string,\n input: {\n name?: string;\n description?: string;\n icon?: string;\n color?: string;\n website?: string;\n docsUrl?: string;\n oauthConfig?: Record<string, unknown>;\n defaultScopes?: string[];\n availableScopes?: Record<string, unknown>;\n baseUrl?: string;\n apiVersion?: string;\n rateLimitConfig?: Record<string, unknown>;\n pluginVersion?: string;\n pluginAuthor?: string;\n pluginRepository?: string;\n displayOrder?: number;\n supportedFeatures?: string[];\n configSchema?: Record<string, unknown>;\n isEnabled?: boolean;\n }\n ) => {\n const result = await mutate({ variables: { id, input } });\n return result.data?.updateProviderPlugin;\n },\n [mutate]\n );\n\n return { updatePlugin, loading };\n}\n\nexport function useUninstallPlugin() {\n const [mutate, { loading }] = useUninstallProviderPluginMutation({\n refetchQueries: ['GetProviders', 'GetProvider', 'GetProviderCatalog'],\n });\n\n const uninstallPlugin = useCallback(\n async (id: string) => {\n const result = await mutate({ variables: { id } });\n return result.data?.uninstallProviderPlugin as boolean;\n },\n [mutate]\n );\n\n return { uninstallPlugin, loading };\n}\n\nexport function useEnableProvider() {\n const [mutate, { loading }] = useEnableProviderMutation({\n refetchQueries: ['GetProviders', 'GetProvider'],\n });\n\n const enableProvider = useCallback(\n async (id: string) => {\n const result = await mutate({ variables: { id } });\n return result.data?.enableProvider;\n },\n [mutate]\n );\n\n return { enableProvider, loading };\n}\n\nexport function useDisableProvider() {\n const [mutate, { loading }] = useDisableProviderMutation({\n refetchQueries: ['GetProviders', 'GetProvider'],\n });\n\n const disableProvider = useCallback(\n async (id: string) => {\n const result = await mutate({ variables: { id } });\n return result.data?.disableProvider;\n },\n [mutate]\n );\n\n return { disableProvider, loading };\n}\n\n/**\n * Create or update one of a provider's authentication methods.\n *\n * This is what makes multi-auth an admin action rather than a code change: the\n * method's display name, type and field schema are all data, so offering a new\n * way to authenticate against an existing provider needs no deploy.\n */\nexport function useUpsertAuthMethod() {\n const [mutate, { loading }] = useUpsertProviderAuthMethodMutation({\n refetchQueries: ['GetProvider', 'GetProviders'],\n });\n\n const upsertAuthMethod = useCallback(\n async (\n providerId: string,\n input: {\n key: string;\n displayName: string;\n description?: string;\n authType: string;\n flow?: string;\n configSchema?: Record<string, unknown> | null;\n oauthConfig?: Record<string, unknown> | null;\n defaultScopes?: string[];\n isDefault?: boolean;\n isEnabled?: boolean;\n displayOrder?: number;\n }\n ) => {\n const result = await mutate({ variables: { providerId, input } });\n return result.data?.upsertProviderAuthMethod;\n },\n [mutate]\n );\n\n return { upsertAuthMethod, loading };\n}\n\nexport function useDeleteAuthMethod() {\n const [mutate, { loading }] = useDeleteProviderAuthMethodMutation({\n refetchQueries: ['GetProvider', 'GetProviders'],\n });\n\n const deleteAuthMethod = useCallback(\n async (providerId: string, key: string) => {\n const result = await mutate({ variables: { providerId, key } });\n return result.data?.deleteProviderAuthMethod;\n },\n [mutate]\n );\n\n return { deleteAuthMethod, loading };\n}\n"],"mappings":";;;;;AAiCA,SAAgBA,EAAa,GAAgC;CAC3D,IAAM,EAAE,mBAAgBC,EAAgB,GAClC,EAAE,SAAM,YAAS,UAAO,eAAYC,EAAqB;EAC7D,WAAW;GAAE;GAAQ,YAAY,EAAE,OAAO,IAAI;EAAE;EAChD,MAAM,CAACC;EACP,aAAa;CACf,CAAC,GAIKC,IAAYC,SACoBC,GAAM,cAAc,SAAS,CAAC,EAAA,CAAG,KAClE,MAAkCC,EAAYC,CAAI,CAI9C,GACN,CAACF,CAAI,CAAC;CAKT,OAAO;EAAE;EAAW,OAAOF,EAAU;EAAQ;EAAS;EAAO;CAAQ;AACvE;AAEA,SAAgBK,EAAY,GAAY;CACtC,IAAM,EAAE,mBAAgBR,EAAgB,GAClC,EAAE,SAAM,YAAS,UAAO,eAAYS,EAAoB;EAC5D,WAAW,EAAE,MAAG;EAChB,MAAM,CAACP,KAAe,CAACQ;EACvB,aAAa;CACf,CAAC;CAMD,OAAO;EAAE,UAJoCL,GAAM,cAC/CC,EAAYD,EAAK,WAAsC,IACvD;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AaQ,EAA0B,EACtD,gBAAgB,CAAC,gBAAgB,aAAa,EAChD,CAAC;CAUD,OAAO;EAAE,gBARcN,EACrB,OAAO,OAEE,MADcF,EAAO,EAAE,WAAW,EAAE,MAAG,EAAE,CAAC,EAAA,CACnC,MAAM,gBAEtB,CAACA,CAAM,CAGA;EAAgB;CAAQ;AACnC;AAEA,SAAgBS,IAAqB;CACnC,IAAM,CAACT,GAAQ,EAAE,gBAAaU,EAA2B,EACvD,gBAAgB,CAAC,gBAAgB,aAAa,EAChD,CAAC;CAUD,OAAO;EAAE,iBAReR,EACtB,OAAO,OAEE,MADcF,EAAO,EAAE,WAAW,EAAE,MAAG,EAAE,CAAC,EAAA,CACnC,MAAM,iBAEtB,CAACA,CAAM,CAGA;EAAiB;CAAQ;AACpC;AASA,SAAgBW,IAAsB;CACpC,IAAM,CAACX,GAAQ,EAAE,gBAAaY,EAAoC,EAChE,gBAAgB,CAAC,eAAe,cAAc,EAChD,CAAC;CAyBD,OAAO;EAAE,kBAvBgBV,EACvB,OACE,GACA,OAeO,MADcF,EAAO,EAAE,WAAW;GAAE;GAAY;EAAM,EAAE,CAAC,EAAA,CAClD,MAAM,0BAEtB,CAACA,CAAM,CAGA;EAAkB;CAAQ;AACrC;AAEA,SAAgBa,IAAsB;CACpC,IAAM,CAACb,GAAQ,EAAE,gBAAac,EAAoC,EAChE,gBAAgB,CAAC,eAAe,cAAc,EAChD,CAAC;CAUD,OAAO;EAAE,kBARgBZ,EACvB,OAAO,GAAoB,OAElB,MADcF,EAAO,EAAE,WAAW;GAAE;GAAY;EAAI,EAAE,CAAC,EAAA,CAChD,MAAM,0BAEtB,CAACA,CAAM,CAGA;EAAkB;CAAQ;AACrC"}
|
|
1
|
+
{"version":3,"file":"useProviders.js","names":["mergeProviderPages","next","previous","seen","item","added","useProviders","useIntegrations","filterKey","filter","stableFilter","useMemo","useGetProvidersQuery","workspaceId","pagingError","setPagingError","useState","inFlightOffset","useRef","settledPages","setSettledPages","mounted","loadedCount","data","hasMore","loading","offset","fail","err","fetchMoreResult","result","n","fetchMore","refetchAll","useCallback","refetch","providers","mapProvider","stillPaging","error","useProvider","useGetProviderQuery","id","useProviderByKey","useGetProviderByKeyQuery","key","useInstallPlugin","mutate","useInstallProviderPluginMutation","useUpdatePlugin","useUpdateProviderPluginMutation","useUninstallPlugin","useUninstallProviderPluginMutation","useEnableProvider","useEnableProviderMutation","useDisableProvider","useDisableProviderMutation","useUpsertAuthMethod","useUpsertProviderAuthMethodMutation","useDeleteAuthMethod","useDeleteProviderAuthMethodMutation"],"sources":["../../../src/integrations/hooks/useProviders.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for providers.\n *\n * These hooks provide a stable API surface regardless of whether the\n * generated operations exist yet. Until codegen runs, they return\n * empty/loading state so the UI can render without errors.\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n useGetProvidersQuery,\n useGetProviderQuery,\n useGetProviderByKeyQuery,\n useInstallProviderPluginMutation,\n useUpdateProviderPluginMutation,\n useUninstallProviderPluginMutation,\n useEnableProviderMutation,\n useDisableProviderMutation,\n useUpsertProviderAuthMethodMutation,\n useDeleteProviderAuthMethodMutation,\n} from '../../generated/wspace-operations';\nimport { mapProvider } from '../utils/mappers';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport type { IntegrationProvider, ProviderCategory, PluginStatus } from '../types';\n\n// ─── Hooks ──────────────────────────────────────────────────────────────────\n\ninterface ProviderFilterOptions {\n category?: ProviderCategory;\n pluginStatus?: PluginStatus;\n search?: string;\n}\n\n/** The service caps one getProviders page at 100 rows. */\nexport const PROVIDER_PAGE_SIZE = 100;\n\ntype ProvidersPage = {\n getProviders: { items: ReadonlyArray<{ id: string }>; total: number; hasMore: boolean };\n};\n\n/**\n * Appends a fetched page to the providers loaded so far. Rows already present\n * (by id) are skipped so a catalog that shifts between pages never shows a\n * provider twice, and a page that adds nothing ends paging so a stale\n * `hasMore` cannot loop.\n */\nexport function mergeProviderPages<T extends ProvidersPage>(previous: T, next: T | undefined): T {\n if (!next?.getProviders) return previous;\n const seen = new Set(previous.getProviders.items.map((item) => item.id));\n const added = next.getProviders.items.filter((item) => !seen.has(item.id));\n return {\n ...previous,\n getProviders: {\n ...next.getProviders,\n items: [...previous.getProviders.items, ...added],\n hasMore: added.length > 0 && next.getProviders.hasMore,\n },\n };\n}\n\n/**\n * Loads every provider the filter matches. The catalog has grown past one\n * page (BOFF-11224: providers seeded after the first 100 by display order,\n * such as ClickSend, never reached the catalog or the add-connection wizard,\n * whose search runs on the loaded rows), so the hook keeps fetching pages\n * until the service reports no more.\n */\nexport function useProviders(filter?: ProviderFilterOptions) {\n const { workspaceId } = useIntegrations();\n // Callers may pass a fresh object each render; key paging on its content.\n // The cast is safe: filterKey was serialised from a ProviderFilterOptions.\n const filterKey = JSON.stringify(filter ?? {});\n const stableFilter = useMemo<ProviderFilterOptions | undefined>(\n () => (filterKey === '{}' ? undefined : (JSON.parse(filterKey) as ProviderFilterOptions)),\n [filterKey]\n );\n const { data, loading, error, refetch, fetchMore } = useGetProvidersQuery({\n variables: { filter: stableFilter, pagination: { limit: PROVIDER_PAGE_SIZE, offset: 0 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n const [pagingError, setPagingError] = useState<Error | null>(null);\n // The offset of the page being fetched. fetchMore flips `loading`, which\n // re-runs the effect below; this ref, not the effect's lifetime, decides\n // whether a page is already on its way, so one page is never asked twice\n // and a failure is always recorded.\n const inFlightOffset = useRef<number | null>(null);\n // Bumped when a page settles, so the effect runs again even if the merged\n // result rendered before the request's promise chain finished.\n const [settledPages, setSettledPages] = useState(0);\n const mounted = useRef(true);\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const loadedCount = data?.getProviders?.items?.length ?? 0;\n const hasMore = data?.getProviders?.hasMore === true && loadedCount > 0;\n\n useEffect(() => {\n if (loading || !hasMore || pagingError || inFlightOffset.current !== null) return;\n const offset = loadedCount;\n inFlightOffset.current = offset;\n const fail = (err: unknown) => {\n if (mounted.current) setPagingError(err instanceof Error ? err : new Error(String(err)));\n };\n fetchMore({\n variables: { filter: stableFilter, pagination: { limit: PROVIDER_PAGE_SIZE, offset } },\n // The generated query type is structurally a ProvidersPage with more\n // fields; the merge only reads ids and spreads the rest through, so the\n // casts in and back out are lossless.\n updateQuery: (previous, { fetchMoreResult }) =>\n mergeProviderPages(\n previous as ProvidersPage,\n fetchMoreResult as ProvidersPage | undefined\n ) as typeof previous,\n })\n .then((result) => {\n // errorPolicy 'all' resolves a failed page instead of rejecting. Stop\n // paging until an explicit refetch rather than asking for it again.\n if (result.error || !result.data?.getProviders) {\n fail(result.error ?? new Error('A providers page came back empty'));\n }\n })\n .catch(fail)\n .finally(() => {\n if (inFlightOffset.current === offset) inFlightOffset.current = null;\n if (mounted.current) setSettledPages((n) => n + 1);\n });\n }, [loading, hasMore, loadedCount, fetchMore, stableFilter, pagingError, settledPages]);\n\n const refetchAll = useCallback(() => {\n inFlightOffset.current = null;\n setPagingError(null);\n return refetch();\n }, [refetch]);\n\n // Memoized so the array reference is stable across renders (avoids re-running\n // downstream memos/effects keyed on `providers`).\n const providers = useMemo<IntegrationProvider[]>(() => {\n const all: IntegrationProvider[] = (data?.getProviders?.items ?? []).map(\n (item: Record<string, unknown>) => mapProvider(item)\n );\n // No frontend allowlist: visibility is `isEnabled` on the provider row, which\n // the admin console owns. See the note where VISIBLE_PROVIDER_KEYS used to be.\n return all;\n }, [data]);\n\n // Report loading until every page is in, so client-side search and the\n // empty state never judge a partial catalog. A failed later page keeps the\n // rows already loaded and surfaces the error.\n const stillPaging = hasMore && !pagingError;\n return {\n providers,\n total: data?.getProviders?.total ?? providers.length,\n loading: loading || stillPaging,\n error: error ?? pagingError ?? undefined,\n refetch: refetchAll,\n };\n}\n\nexport function useProvider(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetProviderQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n const provider: IntegrationProvider | null = data?.getProvider\n ? mapProvider(data.getProvider as Record<string, unknown>)\n : null;\n\n return { provider, loading, error, refetch };\n}\n\nexport function useProviderByKey(key: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetProviderByKeyQuery({\n variables: { key },\n skip: !workspaceId || !key,\n errorPolicy: 'all',\n });\n\n const provider: IntegrationProvider | null = data?.getProviderByKey\n ? mapProvider(data.getProviderByKey as Record<string, unknown>)\n : null;\n\n return { provider, loading, error, refetch };\n}\n\nexport function useInstallPlugin() {\n const [mutate, { loading }] = useInstallProviderPluginMutation({\n refetchQueries: ['GetProviders', 'GetProvider', 'GetProviderCatalog'],\n });\n\n const installPlugin = useCallback(\n async (input: {\n key: string;\n name: string;\n description?: string;\n category: string;\n authType: string;\n icon?: string;\n color?: string;\n website?: string;\n docsUrl?: string;\n oauthConfig?: Record<string, unknown>;\n defaultScopes?: string[];\n availableScopes?: Record<string, unknown>;\n baseUrl?: string;\n apiVersion?: string;\n rateLimitConfig?: Record<string, unknown>;\n pluginVersion?: string;\n pluginAuthor?: string;\n pluginRepository?: string;\n displayOrder?: number;\n supportedFeatures?: string[];\n configSchema?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n return result.data?.installProviderPlugin;\n },\n [mutate]\n );\n\n return { installPlugin, loading };\n}\n\nexport function useUpdatePlugin() {\n const [mutate, { loading }] = useUpdateProviderPluginMutation({\n refetchQueries: ['GetProviders', 'GetProvider', 'GetProviderCatalog'],\n });\n\n const updatePlugin = useCallback(\n async (\n id: string,\n input: {\n name?: string;\n description?: string;\n icon?: string;\n color?: string;\n website?: string;\n docsUrl?: string;\n oauthConfig?: Record<string, unknown>;\n defaultScopes?: string[];\n availableScopes?: Record<string, unknown>;\n baseUrl?: string;\n apiVersion?: string;\n rateLimitConfig?: Record<string, unknown>;\n pluginVersion?: string;\n pluginAuthor?: string;\n pluginRepository?: string;\n displayOrder?: number;\n supportedFeatures?: string[];\n configSchema?: Record<string, unknown>;\n isEnabled?: boolean;\n }\n ) => {\n const result = await mutate({ variables: { id, input } });\n return result.data?.updateProviderPlugin;\n },\n [mutate]\n );\n\n return { updatePlugin, loading };\n}\n\nexport function useUninstallPlugin() {\n const [mutate, { loading }] = useUninstallProviderPluginMutation({\n refetchQueries: ['GetProviders', 'GetProvider', 'GetProviderCatalog'],\n });\n\n const uninstallPlugin = useCallback(\n async (id: string) => {\n const result = await mutate({ variables: { id } });\n return result.data?.uninstallProviderPlugin as boolean;\n },\n [mutate]\n );\n\n return { uninstallPlugin, loading };\n}\n\nexport function useEnableProvider() {\n const [mutate, { loading }] = useEnableProviderMutation({\n refetchQueries: ['GetProviders', 'GetProvider'],\n });\n\n const enableProvider = useCallback(\n async (id: string) => {\n const result = await mutate({ variables: { id } });\n return result.data?.enableProvider;\n },\n [mutate]\n );\n\n return { enableProvider, loading };\n}\n\nexport function useDisableProvider() {\n const [mutate, { loading }] = useDisableProviderMutation({\n refetchQueries: ['GetProviders', 'GetProvider'],\n });\n\n const disableProvider = useCallback(\n async (id: string) => {\n const result = await mutate({ variables: { id } });\n return result.data?.disableProvider;\n },\n [mutate]\n );\n\n return { disableProvider, loading };\n}\n\n/**\n * Create or update one of a provider's authentication methods.\n *\n * This is what makes multi-auth an admin action rather than a code change: the\n * method's display name, type and field schema are all data, so offering a new\n * way to authenticate against an existing provider needs no deploy.\n */\nexport function useUpsertAuthMethod() {\n const [mutate, { loading }] = useUpsertProviderAuthMethodMutation({\n refetchQueries: ['GetProvider', 'GetProviders'],\n });\n\n const upsertAuthMethod = useCallback(\n async (\n providerId: string,\n input: {\n key: string;\n displayName: string;\n description?: string;\n authType: string;\n flow?: string;\n configSchema?: Record<string, unknown> | null;\n oauthConfig?: Record<string, unknown> | null;\n defaultScopes?: string[];\n isDefault?: boolean;\n isEnabled?: boolean;\n displayOrder?: number;\n }\n ) => {\n const result = await mutate({ variables: { providerId, input } });\n return result.data?.upsertProviderAuthMethod;\n },\n [mutate]\n );\n\n return { upsertAuthMethod, loading };\n}\n\nexport function useDeleteAuthMethod() {\n const [mutate, { loading }] = useDeleteProviderAuthMethodMutation({\n refetchQueries: ['GetProvider', 'GetProviders'],\n });\n\n const deleteAuthMethod = useCallback(\n async (providerId: string, key: string) => {\n const result = await mutate({ variables: { providerId, key } });\n return result.data?.deleteProviderAuthMethod;\n },\n [mutate]\n );\n\n return { deleteAuthMethod, loading };\n}\n"],"mappings":";;;;AA8CA,SAAgBA,EAA4C,GAAa,GAAwB;CAC/F,IAAI,CAACC,GAAM,cAAc,OAAOC;CAChC,IAAMC,IAAO,IAAI,IAAID,EAAS,aAAa,MAAM,KAAK,MAASE,EAAK,EAAE,CAAC,GACjEC,IAAQJ,EAAK,aAAa,MAAM,QAAQ,MAAS,CAACE,EAAK,IAAIC,EAAK,EAAE,CAAC;CACzE,OAAO;EACL,GAAGF;EACH,cAAc;GACZ,GAAGD,EAAK;GACR,OAAO,CAAC,GAAGC,EAAS,aAAa,OAAO,GAAGG,CAAK;GAChD,SAASA,EAAM,SAAS,KAAKJ,EAAK,aAAa;EACjD;CACF;AACF;AASA,SAAgBK,EAAa,GAAgC;CAC3D,IAAM,EAAE,mBAAgBC,EAAgB,GAGlCC,IAAY,KAAK,UAAUC,KAAU,CAAC,CAAC,GACvCC,IAAeC,QACZH,MAAc,OAAO,KAAA,IAAa,KAAK,MAAMA,CAAS,GAC7D,CAACA,CAAS,CACZ,GACM,EAAE,SAAM,YAAS,UAAO,YAAS,iBAAcI,EAAqB;EACxE,WAAW;GAAE,QAAQF;GAAc,YAAY;IAAE,OAAA;IAA2B,QAAQ;GAAE;EAAE;EACxF,MAAM,CAACG;EACP,aAAa;CACf,CAAC,GACK,CAACC,GAAaC,KAAkBC,EAAuB,IAAI,GAK3DC,IAAiBC,EAAsB,IAAI,GAG3C,CAACC,GAAcC,KAAmBJ,EAAS,CAAC,GAC5CK,IAAUH,EAAO,EAAI;CAC3B,SACE,EAAQ,UAAU,UACL;E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AY;EAAI,EAAE,CAAC,EAAA,CAChD,MAAM,0BAEtB,CAACA,CAAM,CAGA;EAAkB;CAAQ;AACrC"}
|
|
@@ -8,41 +8,27 @@ import { getStatusDotColor as o } from "../utils/integrationsHelpers.js";
|
|
|
8
8
|
import { useFormatLastUsed as s } from "../hooks/useFormatLastUsed.js";
|
|
9
9
|
import { AddConnectionDialog as c } from "../components/AddConnectionDialog.js";
|
|
10
10
|
import { getAccentClasses as l } from "../utils/appearance.js";
|
|
11
|
-
import { mapConnection as u
|
|
12
|
-
import { useMemo as
|
|
13
|
-
import { AlertCircle as
|
|
14
|
-
import { gql as
|
|
15
|
-
import { useQuery as
|
|
16
|
-
import { usePermissions as
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { AuroraBackground as
|
|
11
|
+
import { mapConnection as u } from "../utils/mappers.js";
|
|
12
|
+
import { useMemo as d } from "react";
|
|
13
|
+
import { AlertCircle as f, ArrowRight as p, CheckCircle2 as m, Clock as h, LayoutDashboard as g, Link2 as _, Loader2 as v, Plug as y, Plus as b, RefreshCw as x, Store as S, XCircle as C } from "lucide-react";
|
|
14
|
+
import { gql as w } from "@apollo/client";
|
|
15
|
+
import { useQuery as T } from "@apollo/client/react";
|
|
16
|
+
import { usePermissions as E } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
17
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
18
|
+
import { AuroraBackground as k, Button as A, EmphasisPanel as j, GlassCard as M, GradientText as N, IllustratedEmptyState as P, NextSteps as F, PagePurpose as I } from "@burdenoff/fe-libs/ui";
|
|
19
19
|
// src/integrations/pages/IntegrationsOverview.tsx
|
|
20
|
-
var
|
|
20
|
+
var L = w`
|
|
21
21
|
query IntegrationsOverviewQuery {
|
|
22
|
-
|
|
22
|
+
# The overview only shows provider counts. The catalog is larger than one
|
|
23
|
+
# page, so both counts come from the service totals, not loaded rows.
|
|
24
|
+
getProviders(pagination: { limit: 1 }) {
|
|
25
|
+
total
|
|
26
|
+
}
|
|
27
|
+
installedProviders: getProviders(
|
|
28
|
+
filter: { pluginStatus: INSTALLED }
|
|
29
|
+
pagination: { limit: 1 }
|
|
30
|
+
) {
|
|
23
31
|
total
|
|
24
|
-
items {
|
|
25
|
-
id
|
|
26
|
-
key
|
|
27
|
-
name
|
|
28
|
-
description
|
|
29
|
-
category
|
|
30
|
-
authType
|
|
31
|
-
icon
|
|
32
|
-
color
|
|
33
|
-
website
|
|
34
|
-
docsUrl
|
|
35
|
-
pluginStatus
|
|
36
|
-
pluginVersion
|
|
37
|
-
pluginAuthor
|
|
38
|
-
isBuiltIn
|
|
39
|
-
isEnabled
|
|
40
|
-
displayOrder
|
|
41
|
-
supportedFeatures
|
|
42
|
-
connectionCount
|
|
43
|
-
createdAt
|
|
44
|
-
updatedAt
|
|
45
|
-
}
|
|
46
32
|
}
|
|
47
33
|
getConnections(pagination: { limit: 100 }) {
|
|
48
34
|
total
|
|
@@ -89,23 +75,26 @@ var R = T`
|
|
|
89
75
|
}
|
|
90
76
|
}
|
|
91
77
|
`;
|
|
92
|
-
function
|
|
93
|
-
let { data: e, loading: t, error: n, refetch: r } =
|
|
78
|
+
function R() {
|
|
79
|
+
let { data: e, loading: t, error: n, refetch: r } = T(L, {
|
|
94
80
|
errorPolicy: "all",
|
|
95
81
|
fetchPolicy: "cache-first",
|
|
96
82
|
nextFetchPolicy: "cache-first"
|
|
97
83
|
});
|
|
98
84
|
return {
|
|
99
|
-
|
|
85
|
+
providerTotals: {
|
|
86
|
+
total: e?.getProviders?.total ?? 0,
|
|
87
|
+
installed: e?.installedProviders?.total ?? 0
|
|
88
|
+
},
|
|
100
89
|
connections: (e?.getConnections?.items ?? []).map((e) => u(e)),
|
|
101
90
|
loading: t,
|
|
102
91
|
error: n,
|
|
103
92
|
refetch: r
|
|
104
93
|
};
|
|
105
94
|
}
|
|
106
|
-
function
|
|
95
|
+
function z({ label: t, value: n, icon: r, tone: i = "primary", onClick: a, glow: o = !1 }) {
|
|
107
96
|
let s = l(i);
|
|
108
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ D(M, {
|
|
109
98
|
treatment: "metric",
|
|
110
99
|
glow: o,
|
|
111
100
|
className: e("border-border-seam p-5", a && "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"),
|
|
@@ -115,89 +104,93 @@ function B({ label: t, value: n, icon: r, tone: i = "primary", onClick: a, glow:
|
|
|
115
104
|
onKeyDown: a ? (e) => {
|
|
116
105
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
|
|
117
106
|
} : void 0,
|
|
118
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ O("div", {
|
|
119
108
|
className: "flex items-center justify-between",
|
|
120
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
121
110
|
className: "text-sm font-medium text-text-secondary",
|
|
122
111
|
children: t
|
|
123
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ D("p", {
|
|
124
113
|
className: "text-3xl font-bold text-text-primary mt-1 tabular-nums",
|
|
125
114
|
children: n
|
|
126
|
-
})] }), /* @__PURE__ */
|
|
115
|
+
})] }), /* @__PURE__ */ D("div", {
|
|
127
116
|
className: e("p-3 rounded-xl", s.surface),
|
|
128
117
|
children: r
|
|
129
118
|
})]
|
|
130
119
|
})
|
|
131
120
|
});
|
|
132
121
|
}
|
|
133
|
-
function
|
|
134
|
-
let { basePath: l = "/", navigate: u } = n(),
|
|
135
|
-
totalProviders:
|
|
136
|
-
installedProviders:
|
|
122
|
+
function B() {
|
|
123
|
+
let { basePath: l = "/", navigate: u } = n(), w = t(), T = s(), { addConnectionDialogOpen: M, openAddConnectionDialog: L, closeAddConnectionDialog: B } = i(), { hasPermission: V, isLoading: H } = E(), U = !H && V(r.CONNECTION_CREATE), { providerTotals: W, connections: G, loading: K, error: q, refetch: J } = R(), Y = d(() => ({
|
|
124
|
+
totalProviders: W.total,
|
|
125
|
+
installedProviders: W.installed,
|
|
137
126
|
activeConnections: (G ?? []).filter((e) => e.status === "active").length,
|
|
138
127
|
pendingAuth: (G ?? []).filter((e) => e.status === "pending_auth").length,
|
|
139
128
|
errorConnections: (G ?? []).filter((e) => e.status === "error").length
|
|
140
|
-
}), [
|
|
129
|
+
}), [
|
|
130
|
+
W.total,
|
|
131
|
+
W.installed,
|
|
132
|
+
G
|
|
133
|
+
]), X = d(() => [...G ?? []].sort((e, t) => new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime()).slice(0, 5), [G]), Z = (e) => {
|
|
141
134
|
u && u(a(l, e));
|
|
142
135
|
}, Q = [
|
|
143
136
|
{
|
|
144
137
|
id: "browse-providers",
|
|
145
|
-
label:
|
|
146
|
-
description:
|
|
147
|
-
icon: /* @__PURE__ */
|
|
138
|
+
label: w("integrations.overview.nextSteps.browse.label", "Browse the provider catalog"),
|
|
139
|
+
description: w("integrations.overview.nextSteps.browse.description", "See which services you can connect to — Slack, Google Drive, GitHub and more."),
|
|
140
|
+
icon: /* @__PURE__ */ D(S, { size: 16 }),
|
|
148
141
|
onClick: () => Z("providers"),
|
|
149
142
|
done: Y.installedProviders > 0
|
|
150
143
|
},
|
|
151
144
|
...U ? [{
|
|
152
145
|
id: "add-connection",
|
|
153
|
-
label:
|
|
154
|
-
description:
|
|
155
|
-
icon: /* @__PURE__ */
|
|
156
|
-
onClick: () =>
|
|
146
|
+
label: w("integrations.overview.nextSteps.connect.label", "Add your first connection"),
|
|
147
|
+
description: w("integrations.overview.nextSteps.connect.description", "Authenticate a provider so your workspace can start exchanging data with it."),
|
|
148
|
+
icon: /* @__PURE__ */ D(b, { size: 16 }),
|
|
149
|
+
onClick: () => L(),
|
|
157
150
|
done: (G ?? []).length > 0
|
|
158
151
|
}] : [],
|
|
159
152
|
{
|
|
160
153
|
id: "review-activity",
|
|
161
|
-
label:
|
|
162
|
-
description:
|
|
163
|
-
icon: /* @__PURE__ */
|
|
154
|
+
label: w("integrations.overview.nextSteps.logs.label", "Review activity logs"),
|
|
155
|
+
description: w("integrations.overview.nextSteps.logs.description", "Track requests and troubleshoot any connection that reports an error."),
|
|
156
|
+
icon: /* @__PURE__ */ D(h, { size: 16 }),
|
|
164
157
|
onClick: () => Z("logs"),
|
|
165
158
|
done: Y.errorConnections === 0 && Y.activeConnections > 0
|
|
166
159
|
}
|
|
167
160
|
];
|
|
168
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ O("div", {
|
|
169
162
|
className: "space-y-6 p-6 max-w-7xl mx-auto",
|
|
170
163
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ O("div", {
|
|
172
165
|
className: "relative overflow-hidden rounded-xl border border-border-seam bg-accent-wash p-6",
|
|
173
166
|
"data-tour": "integrations-overview-header",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ D(k, { intensity: "subtle" }), /* @__PURE__ */ O("div", {
|
|
175
168
|
className: "flex items-center justify-between gap-3",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ O("div", {
|
|
177
170
|
className: "flex items-center gap-3",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ D("div", {
|
|
179
172
|
className: "p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
180
|
-
children: /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ D(g, {
|
|
181
174
|
size: 24,
|
|
182
175
|
className: "text-primary"
|
|
183
176
|
})
|
|
184
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("h1", {
|
|
185
178
|
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
}), /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ D(N, { children: w("integrations.overview.title", "Integrations") })
|
|
180
|
+
}), /* @__PURE__ */ D("p", {
|
|
188
181
|
className: "text-sm text-text-secondary mt-0.5",
|
|
189
|
-
children:
|
|
182
|
+
children: w("integrations.overview.subtitle", "Connect your workspace to external services and tools")
|
|
190
183
|
})] })]
|
|
191
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ D("div", {
|
|
192
185
|
className: "flex items-center gap-2",
|
|
193
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ D(A, {
|
|
194
187
|
variant: "ghost",
|
|
195
188
|
size: "icon",
|
|
196
189
|
onClick: () => {
|
|
197
190
|
J();
|
|
198
191
|
},
|
|
199
|
-
"aria-label":
|
|
200
|
-
children: /* @__PURE__ */
|
|
192
|
+
"aria-label": w("integrations.overview.actions.refreshAriaLabel", "Refresh"),
|
|
193
|
+
children: /* @__PURE__ */ D(x, {
|
|
201
194
|
size: 18,
|
|
202
195
|
className: "text-text-secondary"
|
|
203
196
|
})
|
|
@@ -205,80 +198,80 @@ function V() {
|
|
|
205
198
|
})]
|
|
206
199
|
})]
|
|
207
200
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
icon: /* @__PURE__ */
|
|
210
|
-
children:
|
|
201
|
+
/* @__PURE__ */ D(I, {
|
|
202
|
+
icon: /* @__PURE__ */ D(y, { size: 16 }),
|
|
203
|
+
children: w("integrations.overview.purpose", "Integrations let your workspace talk to outside tools — sending messages to Slack, syncing files with Google Drive, opening issues in GitHub, and more. Install a provider, add a connection by authenticating once, and the rest of the platform can reuse it. This dashboard summarizes what is connected and what needs attention.")
|
|
211
204
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ D(F, {
|
|
213
206
|
storageKey: "integrations-overview",
|
|
214
207
|
steps: Q
|
|
215
208
|
}),
|
|
216
|
-
q && /* @__PURE__ */
|
|
209
|
+
q && /* @__PURE__ */ O("div", {
|
|
217
210
|
className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ D("div", {
|
|
219
212
|
className: "p-2.5 rounded-lg bg-status-error-bg-subtle",
|
|
220
|
-
children: /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ D(f, {
|
|
221
214
|
size: 24,
|
|
222
215
|
className: "text-status-error-text"
|
|
223
216
|
})
|
|
224
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ O("div", {
|
|
225
218
|
className: "flex-1",
|
|
226
219
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ D("h3", {
|
|
228
221
|
className: "font-semibold text-status-error-text mb-1",
|
|
229
|
-
children:
|
|
222
|
+
children: w("integrations.overview.error.title", "Failed to load integrations data")
|
|
230
223
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ D("p", {
|
|
232
225
|
className: "text-sm text-status-error-text mb-3",
|
|
233
226
|
children: q.message
|
|
234
227
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ O("button", {
|
|
236
229
|
type: "button",
|
|
237
230
|
onClick: () => {
|
|
238
231
|
J();
|
|
239
232
|
},
|
|
240
233
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ D(x, { size: 14 }), w("integrations.overview.error.retry", "Try Again")]
|
|
242
235
|
})
|
|
243
236
|
]
|
|
244
237
|
})]
|
|
245
238
|
}),
|
|
246
|
-
K && !q && /* @__PURE__ */
|
|
239
|
+
K && !q && /* @__PURE__ */ D("div", {
|
|
247
240
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
248
241
|
children: [...[
|
|
249
242
|
,
|
|
250
243
|
,
|
|
251
244
|
,
|
|
252
245
|
,
|
|
253
|
-
]].map((e, t) => /* @__PURE__ */
|
|
246
|
+
]].map((e, t) => /* @__PURE__ */ D("div", {
|
|
254
247
|
className: "rounded-xl border border-border-seam bg-bg-surface p-5",
|
|
255
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ O("div", {
|
|
256
249
|
className: "flex items-center justify-between",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ O("div", {
|
|
258
251
|
className: "space-y-2",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
260
|
-
}), /* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ D("div", { className: "h-3 w-20 bg-bg-sunken rounded animate-vc-shimmer" }), /* @__PURE__ */ D("div", { className: "h-8 w-12 bg-bg-sunken rounded animate-vc-shimmer" })]
|
|
253
|
+
}), /* @__PURE__ */ D("div", { className: "size-12 bg-bg-sunken rounded-xl animate-vc-shimmer" })]
|
|
261
254
|
})
|
|
262
255
|
}, t))
|
|
263
256
|
}),
|
|
264
|
-
!K && !q && /* @__PURE__ */
|
|
257
|
+
!K && !q && /* @__PURE__ */ O("div", {
|
|
265
258
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
266
259
|
"data-tour": "integrations-stats-cards",
|
|
267
260
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
label:
|
|
261
|
+
/* @__PURE__ */ D(z, {
|
|
262
|
+
label: w("integrations.overview.stats.installedProviders", "Installed Providers"),
|
|
270
263
|
value: Y.installedProviders,
|
|
271
|
-
icon: /* @__PURE__ */
|
|
264
|
+
icon: /* @__PURE__ */ D(S, {
|
|
272
265
|
size: 24,
|
|
273
266
|
className: "text-primary"
|
|
274
267
|
}),
|
|
275
268
|
tone: "primary",
|
|
276
269
|
onClick: () => Z("providers")
|
|
277
270
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
label:
|
|
271
|
+
/* @__PURE__ */ D(z, {
|
|
272
|
+
label: w("integrations.overview.stats.activeConnections", "Active Connections"),
|
|
280
273
|
value: Y.activeConnections,
|
|
281
|
-
icon: /* @__PURE__ */
|
|
274
|
+
icon: /* @__PURE__ */ D(m, {
|
|
282
275
|
size: 24,
|
|
283
276
|
className: "text-status-success-text"
|
|
284
277
|
}),
|
|
@@ -286,20 +279,20 @@ function V() {
|
|
|
286
279
|
glow: !0,
|
|
287
280
|
onClick: () => Z("connections")
|
|
288
281
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
label:
|
|
282
|
+
/* @__PURE__ */ D(z, {
|
|
283
|
+
label: w("integrations.overview.stats.pendingAuth", "Pending Auth"),
|
|
291
284
|
value: Y.pendingAuth,
|
|
292
|
-
icon: /* @__PURE__ */
|
|
285
|
+
icon: /* @__PURE__ */ D(h, {
|
|
293
286
|
size: 24,
|
|
294
287
|
className: "text-status-warning-text"
|
|
295
288
|
}),
|
|
296
289
|
tone: "warning",
|
|
297
290
|
onClick: () => Z("connections")
|
|
298
291
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
label:
|
|
292
|
+
/* @__PURE__ */ D(z, {
|
|
293
|
+
label: w("integrations.overview.stats.errors", "Errors"),
|
|
301
294
|
value: Y.errorConnections,
|
|
302
|
-
icon: /* @__PURE__ */
|
|
295
|
+
icon: /* @__PURE__ */ D(C, {
|
|
303
296
|
size: 24,
|
|
304
297
|
className: "text-status-error-text"
|
|
305
298
|
}),
|
|
@@ -308,106 +301,106 @@ function V() {
|
|
|
308
301
|
})
|
|
309
302
|
]
|
|
310
303
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ O("div", {
|
|
312
305
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
313
306
|
"data-tour": "integrations-quick-actions",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
307
|
+
children: [/* @__PURE__ */ O("button", {
|
|
315
308
|
type: "button",
|
|
316
309
|
onClick: () => Z("providers"),
|
|
317
310
|
className: e("flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface", "hover:border-border-strong hover:shadow-[var(--shadow-pop)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "text-left transition-[box-shadow,border-color] duration-200 group"),
|
|
318
311
|
children: [
|
|
319
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ D("div", {
|
|
320
313
|
className: "p-3 rounded-xl bg-action-primary-bg/10",
|
|
321
|
-
children: /* @__PURE__ */
|
|
314
|
+
children: /* @__PURE__ */ D(S, {
|
|
322
315
|
size: 24,
|
|
323
316
|
className: "text-primary"
|
|
324
317
|
})
|
|
325
318
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ O("div", {
|
|
327
320
|
className: "flex-1",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
329
322
|
className: "font-semibold text-text-primary",
|
|
330
|
-
children:
|
|
331
|
-
}), /* @__PURE__ */
|
|
323
|
+
children: w("integrations.overview.quickActions.browseProviders.title", "Browse Providers")
|
|
324
|
+
}), /* @__PURE__ */ D("p", {
|
|
332
325
|
className: "text-sm text-text-secondary mt-0.5",
|
|
333
|
-
children:
|
|
326
|
+
children: w("integrations.overview.quickActions.browseProviders.description", "Discover and install integration plugins")
|
|
334
327
|
})]
|
|
335
328
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ D(p, {
|
|
337
330
|
size: 18,
|
|
338
331
|
className: "text-text-secondary group-hover:text-primary transition-colors"
|
|
339
332
|
})
|
|
340
333
|
]
|
|
341
|
-
}), U && /* @__PURE__ */
|
|
334
|
+
}), U && /* @__PURE__ */ O("button", {
|
|
342
335
|
type: "button",
|
|
343
|
-
onClick: () =>
|
|
336
|
+
onClick: () => L(),
|
|
344
337
|
className: e("flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface", "hover:border-border-strong hover:shadow-[var(--shadow-pop)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "text-left transition-[box-shadow,border-color] duration-200 group"),
|
|
345
338
|
children: [
|
|
346
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ D("div", {
|
|
347
340
|
className: "p-3 rounded-xl bg-status-success-bg-subtle",
|
|
348
|
-
children: /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ D(b, {
|
|
349
342
|
size: 24,
|
|
350
343
|
className: "text-status-success-text"
|
|
351
344
|
})
|
|
352
345
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ O("div", {
|
|
354
347
|
className: "flex-1",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
356
349
|
className: "font-semibold text-text-primary",
|
|
357
|
-
children:
|
|
358
|
-
}), /* @__PURE__ */
|
|
350
|
+
children: w("integrations.overview.quickActions.addConnection.title", "Add Connection")
|
|
351
|
+
}), /* @__PURE__ */ D("p", {
|
|
359
352
|
className: "text-sm text-text-secondary mt-0.5",
|
|
360
|
-
children:
|
|
353
|
+
children: w("integrations.overview.quickActions.addConnection.description", "Connect to an external service")
|
|
361
354
|
})]
|
|
362
355
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ D(p, {
|
|
364
357
|
size: 18,
|
|
365
358
|
className: "text-text-secondary group-hover:text-primary transition-colors"
|
|
366
359
|
})
|
|
367
360
|
]
|
|
368
361
|
})]
|
|
369
362
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ O(j, {
|
|
371
364
|
className: "overflow-hidden p-0",
|
|
372
365
|
"data-tour": "integrations-recent-connections",
|
|
373
366
|
children: [
|
|
374
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ O("div", {
|
|
375
368
|
className: "flex items-center justify-between p-5 border-b border-border-seam",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ O("div", {
|
|
377
370
|
className: "flex items-center gap-2",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ D(_, {
|
|
379
372
|
size: 18,
|
|
380
373
|
className: "text-primary"
|
|
381
|
-
}), /* @__PURE__ */
|
|
374
|
+
}), /* @__PURE__ */ D("h2", {
|
|
382
375
|
className: "font-semibold text-text-primary",
|
|
383
|
-
children:
|
|
376
|
+
children: w("integrations.overview.recentConnections.title", "Recent Connections")
|
|
384
377
|
})]
|
|
385
|
-
}), /* @__PURE__ */
|
|
378
|
+
}), /* @__PURE__ */ D("button", {
|
|
386
379
|
type: "button",
|
|
387
380
|
onClick: () => Z("connections"),
|
|
388
381
|
className: "text-sm text-primary hover:underline",
|
|
389
|
-
children:
|
|
382
|
+
children: w("integrations.overview.recentConnections.viewAll", "View all")
|
|
390
383
|
})]
|
|
391
384
|
}),
|
|
392
|
-
K && /* @__PURE__ */
|
|
385
|
+
K && /* @__PURE__ */ D("div", {
|
|
393
386
|
className: "flex items-center justify-center py-12",
|
|
394
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ D(v, {
|
|
395
388
|
size: 24,
|
|
396
389
|
className: "animate-spin text-text-secondary"
|
|
397
390
|
})
|
|
398
391
|
}),
|
|
399
|
-
!K && X.length === 0 && /* @__PURE__ */
|
|
392
|
+
!K && X.length === 0 && /* @__PURE__ */ D(P, {
|
|
400
393
|
illustration: "empty-data",
|
|
401
|
-
title:
|
|
402
|
-
description: U ?
|
|
403
|
-
action: U ? /* @__PURE__ */
|
|
404
|
-
onClick: () =>
|
|
405
|
-
children: [/* @__PURE__ */
|
|
394
|
+
title: w("integrations.overview.empty.title", "No connections yet"),
|
|
395
|
+
description: U ? w("integrations.overview.empty.canCreateDescription", "Create your first connection to start integrating with external services.") : w("integrations.overview.empty.readOnlyDescription", "No connections have been configured yet."),
|
|
396
|
+
action: U ? /* @__PURE__ */ O(A, {
|
|
397
|
+
onClick: () => L(),
|
|
398
|
+
children: [/* @__PURE__ */ D(b, { size: 16 }), w("integrations.overview.actions.addConnection", "Add Connection")]
|
|
406
399
|
}) : void 0
|
|
407
400
|
}),
|
|
408
|
-
!K && X.length > 0 && /* @__PURE__ */
|
|
401
|
+
!K && X.length > 0 && /* @__PURE__ */ D("div", {
|
|
409
402
|
className: "divide-y divide-border-seam",
|
|
410
|
-
children: X.map((t) => /* @__PURE__ */
|
|
403
|
+
children: X.map((t) => /* @__PURE__ */ O("div", {
|
|
411
404
|
className: "flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors",
|
|
412
405
|
onClick: () => Z(`connections/${t.id}`),
|
|
413
406
|
role: "button",
|
|
@@ -416,26 +409,26 @@ function V() {
|
|
|
416
409
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), Z(`connections/${t.id}`));
|
|
417
410
|
},
|
|
418
411
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ D("div", {
|
|
420
413
|
className: "size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10",
|
|
421
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ D(y, {
|
|
422
415
|
size: 16,
|
|
423
416
|
className: "text-primary"
|
|
424
417
|
})
|
|
425
418
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ O("div", {
|
|
427
420
|
className: "flex-1 min-w-0",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ D("p", {
|
|
429
422
|
className: "text-sm font-medium text-text-primary truncate",
|
|
430
423
|
children: t.name
|
|
431
|
-
}), /* @__PURE__ */
|
|
424
|
+
}), /* @__PURE__ */ D("p", {
|
|
432
425
|
className: "text-xs text-text-secondary truncate",
|
|
433
426
|
children: t.provider.name
|
|
434
427
|
})]
|
|
435
428
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ O("div", {
|
|
437
430
|
className: "flex items-center gap-2 flex-shrink-0",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ D("span", { className: e("size-2 rounded-full", o(t.status), t.status === "active" && "motion-safe:animate-vc-glow-pulse") }), /* @__PURE__ */ D("span", {
|
|
439
432
|
className: "text-xs text-text-secondary",
|
|
440
433
|
children: T(t.lastUsedAt)
|
|
441
434
|
})]
|
|
@@ -445,9 +438,9 @@ function V() {
|
|
|
445
438
|
})
|
|
446
439
|
]
|
|
447
440
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
open:
|
|
450
|
-
onClose:
|
|
441
|
+
/* @__PURE__ */ D(c, {
|
|
442
|
+
open: M,
|
|
443
|
+
onClose: B,
|
|
451
444
|
onConnectionCreated: () => {
|
|
452
445
|
J();
|
|
453
446
|
}
|
|
@@ -455,6 +448,6 @@ function V() {
|
|
|
455
448
|
]
|
|
456
449
|
});
|
|
457
450
|
}
|
|
458
|
-
export {
|
|
451
|
+
export { B as IntegrationsOverview };
|
|
459
452
|
|
|
460
453
|
//# sourceMappingURL=IntegrationsOverview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsOverview.js","names":["OVERVIEW_QUERY","useOverviewData","useQuery","data","mapProvider","item","mapConnection","StatCard","accent","getAccentClasses","tone","GlassCard","cn","onClick","label","value","icon","IntegrationsOverview","useIntegrations","tr","useTr","formatLastUsed","useFormatLastUsed","useIntegrationsStore","permissionsLoading","usePermissions","canCreateConnection","hasPermission","INTEGRATION_PERMISSIONS","stats","useMemo","providers","p","connections","c","recentConnections","b","a","handleNavigate","navigate","joinPath","basePath","path","nextSteps","Store","Plus","openAddConnectionDialog","Clock","AuroraBackground","LayoutDashboard","GradientText","Button","RefreshCw","PagePurpose","Plug","NextSteps","error","AlertCircle","loading","i","CheckCircle2","XCircle","ArrowRight","EmphasisPanel","Link2","Loader2","IllustratedEmptyState","conn","getStatusDotColor","AddConnectionDialog","addConnectionDialogOpen","closeAddConnectionDialog"],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { getStatusDotColor } from '../utils/integrationsHelpers';\nimport { useFormatLastUsed } from '../hooks/useFormatLastUsed';\nimport type { IntegrationConnection, IntegrationProvider } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection, mapProvider } from '../utils/mappers';\nimport {\n Button,\n GlassCard,\n EmphasisPanel,\n AuroraBackground,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n type NextStep,\n} from '@burdenoff/fe-libs/ui';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n getProviders(pagination: { limit: 100 }) {\n total\n items {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number; items?: Array<Record<string, unknown>> };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providers = (data?.getProviders?.items ?? []).map((item: Record<string, unknown>) =>\n mapProvider(item)\n );\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providers,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n glow = false,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n glow?: boolean;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className={cn(\n 'border-border-seam p-5',\n onClick &&\n 'cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-secondary\">{label}</p>\n <p className=\"text-3xl font-bold text-text-primary mt-1 tabular-nums\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n </GlassCard>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const tr = useTr();\n const formatLastUsed = useFormatLastUsed();\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providers, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = (providers ?? []).length;\n const installedProviders = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed'\n ).length;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providers, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n const nextSteps: NextStep[] = [\n {\n id: 'browse-providers',\n label: tr('integrations.overview.nextSteps.browse.label', 'Browse the provider catalog'),\n description: tr(\n 'integrations.overview.nextSteps.browse.description',\n 'See which services you can connect to — Slack, Google Drive, GitHub and more.'\n ),\n icon: <Store size={16} />,\n onClick: () => handleNavigate('providers'),\n done: stats.installedProviders > 0,\n },\n ...(canCreateConnection\n ? [\n {\n id: 'add-connection',\n label: tr('integrations.overview.nextSteps.connect.label', 'Add your first connection'),\n description: tr(\n 'integrations.overview.nextSteps.connect.description',\n 'Authenticate a provider so your workspace can start exchanging data with it.'\n ),\n icon: <Plus size={16} />,\n onClick: () => openAddConnectionDialog(),\n done: (connections ?? []).length > 0,\n } satisfies NextStep,\n ]\n : []),\n {\n id: 'review-activity',\n label: tr('integrations.overview.nextSteps.logs.label', 'Review activity logs'),\n description: tr(\n 'integrations.overview.nextSteps.logs.description',\n 'Track requests and troubleshoot any connection that reports an error.'\n ),\n icon: <Clock size={16} />,\n onClick: () => handleNavigate('logs'),\n done: stats.errorConnections === 0 && stats.activeConnections > 0,\n },\n ];\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-overview-header\"\n >\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n <GradientText>{tr('integrations.overview.title', 'Integrations')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => {\n void refetch();\n }}\n aria-label={tr('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-text-secondary\" />\n </Button>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Plug size={16} />}>\n {tr(\n 'integrations.overview.purpose',\n 'Integrations let your workspace talk to outside tools — sending messages to Slack, syncing files with Google Drive, opening issues in GitHub, and more. Install a provider, add a connection by authenticating once, and the rest of the platform can reuse it. This dashboard summarizes what is connected and what needs attention.'\n )}\n </PagePurpose>\n\n {/* Next steps — onboarding guidance for new users */}\n <NextSteps storageKey=\"integrations-overview\" steps={nextSteps} />\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tr('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-8 w-12 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n <div className=\"size-12 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tr('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tr('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n glow\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tr('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tr('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-action-primary-bg/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <EmphasisPanel className=\"overflow-hidden p-0\" data-tour=\"integrations-recent-connections\">\n <div className=\"flex items-center justify-between p-5 border-b border-border-seam\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tr('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('integrations.overview.empty.title', 'No connections yet')}\n description={\n canCreateConnection\n ? tr(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tr(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )\n }\n action={\n canCreateConnection ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tr('integrations.overview.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border-seam\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{conn.name}</p>\n <p className=\"text-xs text-text-secondary truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span\n className={cn(\n 'size-2 rounded-full',\n getStatusDotColor(conn.status),\n conn.status === 'active' && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n <span className=\"text-xs text-text-secondary\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </EmphasisPanel>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,IAAMA,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E1B,SAASC,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAYC,EAA4BF,GAAgB;EACpF,aAAa;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,KACtC,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAAA,EAAkB,KAAK,MACtB,kBAAC,OAAD;OAEE,WAAU;OACV,eAAeG,EAAe,eAAe6B,EAAK,IAAI;OACtD,MAAK;OACL,UAAU;OACV,YAAY,MAAM;QAChB,CAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,eAAe,GACjB7B,EAAe,eAAe6B,EAAK,IAAI;OAE3C;OAXF,UAAA;QAaE,kBAAC,OAAD;SAAK,WAAU;SACb,UAAA,kBAACb,GAAD;UAAM,MAAM;UAAI,WAAU;SAAgB,CAAA;QACvC,CAAA;QACL,kBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,kBAAC,KAAD;UAAG,WAAU;UAAkD,UAAAa,EAAK;SAAQ,CAAA,GAC5E,kBAAC,KAAD;UAAG,WAAU;UAAwC,UAAAA,EAAK,SAAS;SAAQ,CAAA,CACxE;;QACL,kBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,kBAAC,QAAD,EACE,WAAWvD,EACT,uBACAwD,EAAkBD,EAAK,MAAM,GAC7BA,EAAK,WAAW,YAAY,mCAC9B,EACD,CAAA,GACD,kBAAC,QAAD;UAAM,WAAU;UACb,UAAA9C,EAAe8C,EAAK,UAAU;SAC3B,CAAA,CACH;;OACF;MA/BE,GAAAA,EAAK,EA+BP,CACN;KACE,CAAA;IAEM;;GAGf,kBAACE,GAAD;IACE,MAAMC;IACN,SAASC;IACT,2BAA2B;KACzB,EAAa;IACf;GACD,CAAA;EACE;;AAET"}
|
|
1
|
+
{"version":3,"file":"IntegrationsOverview.js","names":["OVERVIEW_QUERY","useOverviewData","useQuery","data","mapConnection","item","StatCard","accent","getAccentClasses","tone","GlassCard","cn","onClick","label","value","icon","IntegrationsOverview","useIntegrations","tr","useTr","formatLastUsed","useFormatLastUsed","useIntegrationsStore","permissionsLoading","usePermissions","canCreateConnection","hasPermission","INTEGRATION_PERMISSIONS","stats","useMemo","providerTotals","connections","c","recentConnections","b","a","handleNavigate","navigate","joinPath","basePath","path","nextSteps","Store","Plus","openAddConnectionDialog","Clock","AuroraBackground","LayoutDashboard","GradientText","Button","RefreshCw","PagePurpose","Plug","NextSteps","error","AlertCircle","loading","i","CheckCircle2","XCircle","ArrowRight","EmphasisPanel","Link2","Loader2","IllustratedEmptyState","conn","getStatusDotColor","AddConnectionDialog","addConnectionDialogOpen","closeAddConnectionDialog"],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { getStatusDotColor } from '../utils/integrationsHelpers';\nimport { useFormatLastUsed } from '../hooks/useFormatLastUsed';\nimport type { IntegrationConnection } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection } from '../utils/mappers';\nimport {\n Button,\n GlassCard,\n EmphasisPanel,\n AuroraBackground,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n type NextStep,\n} from '@burdenoff/fe-libs/ui';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n # The overview only shows provider counts. The catalog is larger than one\n # page, so both counts come from the service totals, not loaded rows.\n getProviders(pagination: { limit: 1 }) {\n total\n }\n installedProviders: getProviders(\n filter: { pluginStatus: INSTALLED }\n pagination: { limit: 1 }\n ) {\n total\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number };\n installedProviders?: { total?: number };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providerTotals = {\n total: data?.getProviders?.total ?? 0,\n installed: data?.installedProviders?.total ?? 0,\n };\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providerTotals,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n glow = false,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n glow?: boolean;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className={cn(\n 'border-border-seam p-5',\n onClick &&\n 'cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-secondary\">{label}</p>\n <p className=\"text-3xl font-bold text-text-primary mt-1 tabular-nums\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n </GlassCard>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const tr = useTr();\n const formatLastUsed = useFormatLastUsed();\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providerTotals, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = providerTotals.total;\n const installedProviders = providerTotals.installed;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providerTotals.total, providerTotals.installed, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n const nextSteps: NextStep[] = [\n {\n id: 'browse-providers',\n label: tr('integrations.overview.nextSteps.browse.label', 'Browse the provider catalog'),\n description: tr(\n 'integrations.overview.nextSteps.browse.description',\n 'See which services you can connect to — Slack, Google Drive, GitHub and more.'\n ),\n icon: <Store size={16} />,\n onClick: () => handleNavigate('providers'),\n done: stats.installedProviders > 0,\n },\n ...(canCreateConnection\n ? [\n {\n id: 'add-connection',\n label: tr('integrations.overview.nextSteps.connect.label', 'Add your first connection'),\n description: tr(\n 'integrations.overview.nextSteps.connect.description',\n 'Authenticate a provider so your workspace can start exchanging data with it.'\n ),\n icon: <Plus size={16} />,\n onClick: () => openAddConnectionDialog(),\n done: (connections ?? []).length > 0,\n } satisfies NextStep,\n ]\n : []),\n {\n id: 'review-activity',\n label: tr('integrations.overview.nextSteps.logs.label', 'Review activity logs'),\n description: tr(\n 'integrations.overview.nextSteps.logs.description',\n 'Track requests and troubleshoot any connection that reports an error.'\n ),\n icon: <Clock size={16} />,\n onClick: () => handleNavigate('logs'),\n done: stats.errorConnections === 0 && stats.activeConnections > 0,\n },\n ];\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-overview-header\"\n >\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n <GradientText>{tr('integrations.overview.title', 'Integrations')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => {\n void refetch();\n }}\n aria-label={tr('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-text-secondary\" />\n </Button>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Plug size={16} />}>\n {tr(\n 'integrations.overview.purpose',\n 'Integrations let your workspace talk to outside tools — sending messages to Slack, syncing files with Google Drive, opening issues in GitHub, and more. Install a provider, add a connection by authenticating once, and the rest of the platform can reuse it. This dashboard summarizes what is connected and what needs attention.'\n )}\n </PagePurpose>\n\n {/* Next steps — onboarding guidance for new users */}\n <NextSteps storageKey=\"integrations-overview\" steps={nextSteps} />\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tr('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-8 w-12 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n <div className=\"size-12 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tr('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tr('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n glow\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tr('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tr('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-action-primary-bg/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <EmphasisPanel className=\"overflow-hidden p-0\" data-tour=\"integrations-recent-connections\">\n <div className=\"flex items-center justify-between p-5 border-b border-border-seam\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tr('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('integrations.overview.empty.title', 'No connections yet')}\n description={\n canCreateConnection\n ? tr(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tr(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )\n }\n action={\n canCreateConnection ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tr('integrations.overview.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border-seam\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{conn.name}</p>\n <p className=\"text-xs text-text-secondary truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span\n className={cn(\n 'size-2 rounded-full',\n getStatusDotColor(conn.status),\n conn.status === 'active' && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n <span className=\"text-xs text-text-secondary\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </EmphasisPanel>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,IAAMA,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiE1B,SAASC,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAYC,EA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