@burdenoff/microfe-brainyrich 2026.1023.1 → 2026.1025.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brainyrich/components/AggregationPanel.d.ts +2 -0
- package/dist/brainyrich/components/AggregationPanel.d.ts.map +1 -0
- package/dist/brainyrich/components/AggregationPanel.js +173 -0
- package/dist/brainyrich/components/AggregationPanel.js.map +1 -0
- package/dist/brainyrich/components/notify.js +1 -1
- package/dist/brainyrich/hooks/useAggregation.d.ts +341 -0
- package/dist/brainyrich/hooks/useAggregation.d.ts.map +1 -0
- package/dist/brainyrich/hooks/useAggregation.js +96 -0
- package/dist/brainyrich/hooks/useAggregation.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +62 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.js +95 -85
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/types/bra.d.ts +38 -0
- package/dist/brainyrich/types/bra.d.ts.map +1 -1
- package/dist/brainyrich/utils/plaidLink.d.ts +63 -0
- package/dist/brainyrich/utils/plaidLink.d.ts.map +1 -0
- package/dist/brainyrich/utils/plaidLink.js +41 -0
- package/dist/brainyrich/utils/plaidLink.js.map +1 -0
- package/package.json +1 -1
- package/dist/node_modules/sonner/dist/index.js +0 -163
- package/dist/node_modules/sonner/dist/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AggregationPanel.d.ts","sourceRoot":"","sources":["../../../src/brainyrich/components/AggregationPanel.tsx"],"names":[],"mappings":"AA+CA,wBAAgB,gBAAgB,4CA+M/B"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { errorMessage as e, notify as t } from "./notify.js";
|
|
2
|
+
import { ConfirmDialog as n } from "./ConfirmDialog.js";
|
|
3
|
+
import { useTr as r } from "../hooks/useTr.js";
|
|
4
|
+
import { ErrorState as i, LoadingState as a, formatDate as o } from "../pages/_shared.js";
|
|
5
|
+
import { useAggregationLinks as s, useAggregationProviders as c, useCreatePlaidLinkToken as l, useExchangePlaidPublicToken as u, useRevokeAggregationLink as d, useSyncAggregationLink as f } from "../hooks/useAggregation.js";
|
|
6
|
+
import { openPlaidLink as p } from "../utils/plaidLink.js";
|
|
7
|
+
import { useState as m } from "react";
|
|
8
|
+
import { Building2 as h, Link2 as g, RefreshCw as _, ShieldCheck as v, Unlink as y } from "lucide-react";
|
|
9
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
10
|
+
import { Badge as S, Button as C, Card as w, CardContent as T, CardDescription as E, CardHeader as D, CardTitle as O } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
//#region src/brainyrich/components/AggregationPanel.tsx
|
|
12
|
+
var k = {
|
|
13
|
+
ACTIVE: "default",
|
|
14
|
+
PENDING: "secondary",
|
|
15
|
+
ERROR: "destructive",
|
|
16
|
+
REVOKED: "outline"
|
|
17
|
+
};
|
|
18
|
+
function A() {
|
|
19
|
+
let A = r(), j = c(), M = s(), N = l(), P = u(), F = f(), I = d(), [L, R] = m(!1), [z, B] = m(null), V = j.data.find((e) => e.provider === "PLAID"), H = !!V?.configured, U = L || N.isPending || P.isPending, W = async () => {
|
|
20
|
+
R(!0);
|
|
21
|
+
try {
|
|
22
|
+
let n = await N.mutateAsync().catch(() => null);
|
|
23
|
+
if (!n) return;
|
|
24
|
+
let r;
|
|
25
|
+
try {
|
|
26
|
+
r = await p(n.linkToken);
|
|
27
|
+
} catch (n) {
|
|
28
|
+
t.error(e(n));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
r.kind === "success" ? await P.mutateAsync({
|
|
32
|
+
publicToken: r.publicToken,
|
|
33
|
+
institutionId: r.institutionId,
|
|
34
|
+
institutionName: r.institutionName
|
|
35
|
+
}).catch(() => void 0) : r.message && t.info(A("brainyrich.aggregation.linkCancelled", "Linking was not completed"), r.message);
|
|
36
|
+
} finally {
|
|
37
|
+
R(!1);
|
|
38
|
+
}
|
|
39
|
+
}, G = () => {
|
|
40
|
+
z && I.mutate(z.id, { onSettled: () => B(null) });
|
|
41
|
+
}, K = M.data;
|
|
42
|
+
return /* @__PURE__ */ x(w, {
|
|
43
|
+
"data-testid": "brainyrich-aggregation-panel",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ x(D, {
|
|
46
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
47
|
+
children: [/* @__PURE__ */ x("div", {
|
|
48
|
+
className: "space-y-1.5",
|
|
49
|
+
children: [/* @__PURE__ */ x(O, {
|
|
50
|
+
className: "flex items-center gap-2",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ b(g, {
|
|
53
|
+
className: "h-5 w-5",
|
|
54
|
+
"aria-hidden": "true"
|
|
55
|
+
}),
|
|
56
|
+
A("brainyrich.aggregation.title", "Automatic account linking"),
|
|
57
|
+
H && V?.environment === "sandbox" ? /* @__PURE__ */ b(S, {
|
|
58
|
+
variant: "secondary",
|
|
59
|
+
"data-testid": "brainyrich-aggregation-sandbox-badge",
|
|
60
|
+
children: A("brainyrich.aggregation.sandbox", "Sandbox")
|
|
61
|
+
}) : null
|
|
62
|
+
]
|
|
63
|
+
}), /* @__PURE__ */ b(E, { children: A("brainyrich.aggregation.description", "Connect a bank or brokerage through Plaid to sync balances and transactions automatically. You sign in on your bank’s own screen; BrainyRich never sees your bank password.") })]
|
|
64
|
+
}), H ? /* @__PURE__ */ x(C, {
|
|
65
|
+
size: "sm",
|
|
66
|
+
onClick: W,
|
|
67
|
+
disabled: U,
|
|
68
|
+
"aria-busy": U,
|
|
69
|
+
"data-testid": "brainyrich-aggregation-link-button",
|
|
70
|
+
children: [/* @__PURE__ */ b(g, {
|
|
71
|
+
className: "size-4",
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
}), U ? A("brainyrich.aggregation.linking", "Linking…") : A("brainyrich.aggregation.link", "Link an institution")]
|
|
74
|
+
}) : null]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ x(T, {
|
|
77
|
+
className: "space-y-4",
|
|
78
|
+
children: [j.isLoading ? /* @__PURE__ */ b(a, { rows: 1 }) : j.isError ? /* @__PURE__ */ b(i, {
|
|
79
|
+
description: A("brainyrich.aggregation.providersError", "We could not check whether automatic linking is available. Please try again."),
|
|
80
|
+
onRetry: () => j.refetch()
|
|
81
|
+
}) : H ? null : /* @__PURE__ */ x("div", {
|
|
82
|
+
className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken p-4 text-sm",
|
|
83
|
+
"data-testid": "brainyrich-aggregation-unavailable",
|
|
84
|
+
children: [/* @__PURE__ */ b(v, {
|
|
85
|
+
className: "mt-0.5 size-4 shrink-0 text-text-secondary",
|
|
86
|
+
"aria-hidden": "true"
|
|
87
|
+
}), /* @__PURE__ */ b("p", {
|
|
88
|
+
className: "text-text-secondary",
|
|
89
|
+
children: A("brainyrich.aggregation.unavailable", "Automatic linking is not switched on for this workspace yet. Add accounts with “New account” — balances and transactions you enter count everywhere synced data does.")
|
|
90
|
+
})]
|
|
91
|
+
}), M.isLoading ? null : M.isError ? /* @__PURE__ */ b(i, { onRetry: () => M.refetch() }) : K.length > 0 ? /* @__PURE__ */ b("ul", {
|
|
92
|
+
className: "divide-y divide-border-subtle rounded-lg border border-border-subtle",
|
|
93
|
+
"data-testid": "brainyrich-aggregation-links",
|
|
94
|
+
children: K.map((e) => {
|
|
95
|
+
let t = e.status === "REVOKED", n = F.isPending && F.variables === e.id;
|
|
96
|
+
return /* @__PURE__ */ x("li", {
|
|
97
|
+
className: "flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
98
|
+
"data-testid": "brainyrich-aggregation-link-row",
|
|
99
|
+
children: [/* @__PURE__ */ x("div", {
|
|
100
|
+
className: "flex min-w-0 items-start gap-3",
|
|
101
|
+
children: [/* @__PURE__ */ b("div", {
|
|
102
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-text-secondary",
|
|
103
|
+
children: /* @__PURE__ */ b(h, {
|
|
104
|
+
className: "size-4",
|
|
105
|
+
"aria-hidden": "true"
|
|
106
|
+
})
|
|
107
|
+
}), /* @__PURE__ */ x("div", {
|
|
108
|
+
className: "min-w-0 space-y-1",
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ x("div", {
|
|
111
|
+
className: "flex flex-wrap items-center gap-2",
|
|
112
|
+
children: [/* @__PURE__ */ b("span", {
|
|
113
|
+
className: "font-medium text-text-primary",
|
|
114
|
+
children: e.institutionName ?? A("brainyrich.aggregation.unnamed", "Linked institution")
|
|
115
|
+
}), /* @__PURE__ */ b(S, {
|
|
116
|
+
variant: k[e.status],
|
|
117
|
+
children: e.status
|
|
118
|
+
})]
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ b("p", {
|
|
121
|
+
className: "text-xs text-text-secondary",
|
|
122
|
+
children: e.lastSyncedAt ? A("brainyrich.aggregation.lastSynced", "Last synced {{date}}", { date: o(e.lastSyncedAt) }) : A("brainyrich.aggregation.neverSynced", "Not synced yet")
|
|
123
|
+
}),
|
|
124
|
+
e.status === "ERROR" && e.lastSyncError ? /* @__PURE__ */ b("p", {
|
|
125
|
+
className: "break-words text-xs text-status-error-text",
|
|
126
|
+
children: e.lastSyncError
|
|
127
|
+
}) : null
|
|
128
|
+
]
|
|
129
|
+
})]
|
|
130
|
+
}), t ? null : /* @__PURE__ */ x("div", {
|
|
131
|
+
className: "flex shrink-0 gap-2",
|
|
132
|
+
children: [/* @__PURE__ */ x(C, {
|
|
133
|
+
size: "sm",
|
|
134
|
+
variant: "outline",
|
|
135
|
+
onClick: () => F.mutate(e.id),
|
|
136
|
+
disabled: F.isPending,
|
|
137
|
+
"aria-busy": n,
|
|
138
|
+
children: [/* @__PURE__ */ b(_, {
|
|
139
|
+
className: "size-4",
|
|
140
|
+
"aria-hidden": "true"
|
|
141
|
+
}), n ? A("brainyrich.aggregation.syncing", "Syncing…") : A("brainyrich.aggregation.sync", "Sync now")]
|
|
142
|
+
}), /* @__PURE__ */ x(C, {
|
|
143
|
+
size: "sm",
|
|
144
|
+
variant: "outline",
|
|
145
|
+
onClick: () => B(e),
|
|
146
|
+
children: [/* @__PURE__ */ b(y, {
|
|
147
|
+
className: "size-4",
|
|
148
|
+
"aria-hidden": "true"
|
|
149
|
+
}), A("brainyrich.aggregation.disconnect", "Disconnect")]
|
|
150
|
+
})]
|
|
151
|
+
})]
|
|
152
|
+
}, e.id);
|
|
153
|
+
})
|
|
154
|
+
}) : null]
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ b(n, {
|
|
157
|
+
open: z !== null,
|
|
158
|
+
onOpenChange: (e) => !e && B(null),
|
|
159
|
+
title: A("brainyrich.aggregation.disconnectTitle", "Disconnect this institution?"),
|
|
160
|
+
description: A("brainyrich.aggregation.disconnectDescription", "BrainyRich stops syncing and revokes its access at the provider. Accounts synced from it are marked closed; their history stays."),
|
|
161
|
+
confirmLabel: A("brainyrich.aggregation.disconnect", "Disconnect"),
|
|
162
|
+
pendingLabel: A("brainyrich.aggregation.disconnecting", "Disconnecting…"),
|
|
163
|
+
destructive: !0,
|
|
164
|
+
pending: I.isPending,
|
|
165
|
+
onConfirm: G
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
export { A as AggregationPanel };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=AggregationPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AggregationPanel.js","names":[],"sources":["../../../src/brainyrich/components/AggregationPanel.tsx"],"sourcesContent":["/**\n * AggregationPanel — \"Automatic account linking\" card on the Accounts page\n * (BOFF-4234).\n *\n * Offers \"Link an institution\" only when the backend reports a configured\n * provider (`braAggregationProviders`). Otherwise it says plainly that\n * accounts are added manually today, so the page never presents a button that\n * cannot work. Linked institutions are listed with their sync status and can\n * be re-synced or disconnected.\n */\nimport { useState } from 'react';\nimport {\n Badge,\n Button,\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { Building2, Link2, RefreshCw, ShieldCheck, Unlink } from 'lucide-react';\n\nimport {\n useAggregationLinks,\n useAggregationProviders,\n useCreatePlaidLinkToken,\n useExchangePlaidPublicToken,\n useRevokeAggregationLink,\n useSyncAggregationLink,\n} from '../hooks/useAggregation';\nimport { useTr } from '../hooks/useTr';\nimport type { BraAggregationLink, BraAggregationLinkStatus } from '../types/bra';\nimport { openPlaidLink, type PlaidLinkOutcome } from '../utils/plaidLink';\nimport { ErrorState, LoadingState, formatDate } from '../pages/_shared';\nimport { ConfirmDialog } from './ConfirmDialog';\nimport { errorMessage, notify } from './notify';\n\nconst STATUS_VARIANT: Record<\n BraAggregationLinkStatus,\n 'default' | 'secondary' | 'destructive' | 'outline'\n> = {\n ACTIVE: 'default',\n PENDING: 'secondary',\n ERROR: 'destructive',\n REVOKED: 'outline',\n};\n\nexport function AggregationPanel() {\n const tr = useTr();\n const providers = useAggregationProviders();\n const links = useAggregationLinks();\n const createToken = useCreatePlaidLinkToken();\n const exchange = useExchangePlaidPublicToken();\n const sync = useSyncAggregationLink();\n const revoke = useRevokeAggregationLink();\n\n const [linking, setLinking] = useState(false);\n const [revokeTarget, setRevokeTarget] = useState<BraAggregationLink | null>(null);\n\n const plaid = providers.data.find((p) => p.provider === 'PLAID');\n const canLink = Boolean(plaid?.configured);\n const busy = linking || createToken.isPending || exchange.isPending;\n\n const startLinking = async () => {\n setLinking(true);\n try {\n // Failures of the two backend calls are toasted by the hooks' own\n // feedback handlers, so they are only caught here to end the flow.\n const token = await createToken.mutateAsync().catch(() => null);\n if (!token) return;\n\n let outcome: PlaidLinkOutcome;\n try {\n outcome = await openPlaidLink(token.linkToken);\n } catch (err: unknown) {\n notify.error(errorMessage(err));\n return;\n }\n\n if (outcome.kind === 'success') {\n await exchange\n .mutateAsync({\n publicToken: outcome.publicToken,\n institutionId: outcome.institutionId,\n institutionName: outcome.institutionName,\n })\n .catch(() => undefined);\n } else if (outcome.message) {\n notify.info(\n tr('brainyrich.aggregation.linkCancelled', 'Linking was not completed'),\n outcome.message\n );\n }\n } finally {\n setLinking(false);\n }\n };\n\n const confirmRevoke = () => {\n if (!revokeTarget) return;\n revoke.mutate(revokeTarget.id, { onSettled: () => setRevokeTarget(null) });\n };\n\n const visibleLinks = links.data;\n\n return (\n <Card data-testid=\"brainyrich-aggregation-panel\">\n <CardHeader className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"space-y-1.5\">\n <CardTitle className=\"flex items-center gap-2\">\n <Link2 className=\"h-5 w-5\" aria-hidden=\"true\" />\n {tr('brainyrich.aggregation.title', 'Automatic account linking')}\n {canLink && plaid?.environment === 'sandbox' ? (\n <Badge variant=\"secondary\" data-testid=\"brainyrich-aggregation-sandbox-badge\">\n {tr('brainyrich.aggregation.sandbox', 'Sandbox')}\n </Badge>\n ) : null}\n </CardTitle>\n <CardDescription>\n {tr(\n 'brainyrich.aggregation.description',\n 'Connect a bank or brokerage through Plaid to sync balances and transactions automatically. You sign in on your bank’s own screen; BrainyRich never sees your bank password.'\n )}\n </CardDescription>\n </div>\n {canLink ? (\n <Button\n size=\"sm\"\n onClick={startLinking}\n disabled={busy}\n aria-busy={busy}\n data-testid=\"brainyrich-aggregation-link-button\"\n >\n <Link2 className=\"size-4\" aria-hidden=\"true\" />\n {busy\n ? tr('brainyrich.aggregation.linking', 'Linking…')\n : tr('brainyrich.aggregation.link', 'Link an institution')}\n </Button>\n ) : null}\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {providers.isLoading ? (\n <LoadingState rows={1} />\n ) : providers.isError ? (\n <ErrorState\n description={tr(\n 'brainyrich.aggregation.providersError',\n 'We could not check whether automatic linking is available. Please try again.'\n )}\n onRetry={() => providers.refetch()}\n />\n ) : !canLink ? (\n <div\n className=\"flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken p-4 text-sm\"\n data-testid=\"brainyrich-aggregation-unavailable\"\n >\n <ShieldCheck\n className=\"mt-0.5 size-4 shrink-0 text-text-secondary\"\n aria-hidden=\"true\"\n />\n <p className=\"text-text-secondary\">\n {tr(\n 'brainyrich.aggregation.unavailable',\n 'Automatic linking is not switched on for this workspace yet. Add accounts with “New account” — balances and transactions you enter count everywhere synced data does.'\n )}\n </p>\n </div>\n ) : null}\n\n {links.isLoading ? null : links.isError ? (\n <ErrorState onRetry={() => links.refetch()} />\n ) : visibleLinks.length > 0 ? (\n <ul\n className=\"divide-y divide-border-subtle rounded-lg border border-border-subtle\"\n data-testid=\"brainyrich-aggregation-links\"\n >\n {visibleLinks.map((link) => {\n const revoked = link.status === 'REVOKED';\n const syncingThis = sync.isPending && sync.variables === link.id;\n return (\n <li\n key={link.id}\n className=\"flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between\"\n data-testid=\"brainyrich-aggregation-link-row\"\n >\n <div className=\"flex min-w-0 items-start gap-3\">\n <div className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-text-secondary\">\n <Building2 className=\"size-4\" aria-hidden=\"true\" />\n </div>\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-medium text-text-primary\">\n {link.institutionName ??\n tr('brainyrich.aggregation.unnamed', 'Linked institution')}\n </span>\n <Badge variant={STATUS_VARIANT[link.status]}>{link.status}</Badge>\n </div>\n <p className=\"text-xs text-text-secondary\">\n {link.lastSyncedAt\n ? tr('brainyrich.aggregation.lastSynced', 'Last synced {{date}}', {\n date: formatDate(link.lastSyncedAt),\n })\n : tr('brainyrich.aggregation.neverSynced', 'Not synced yet')}\n </p>\n {link.status === 'ERROR' && link.lastSyncError ? (\n <p className=\"break-words text-xs text-status-error-text\">\n {link.lastSyncError}\n </p>\n ) : null}\n </div>\n </div>\n {revoked ? null : (\n <div className=\"flex shrink-0 gap-2\">\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => sync.mutate(link.id)}\n disabled={sync.isPending}\n aria-busy={syncingThis}\n >\n <RefreshCw className=\"size-4\" aria-hidden=\"true\" />\n {syncingThis\n ? tr('brainyrich.aggregation.syncing', 'Syncing…')\n : tr('brainyrich.aggregation.sync', 'Sync now')}\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={() => setRevokeTarget(link)}>\n <Unlink className=\"size-4\" aria-hidden=\"true\" />\n {tr('brainyrich.aggregation.disconnect', 'Disconnect')}\n </Button>\n </div>\n )}\n </li>\n );\n })}\n </ul>\n ) : null}\n </CardContent>\n\n <ConfirmDialog\n open={revokeTarget !== null}\n onOpenChange={(open) => !open && setRevokeTarget(null)}\n title={tr('brainyrich.aggregation.disconnectTitle', 'Disconnect this institution?')}\n description={tr(\n 'brainyrich.aggregation.disconnectDescription',\n 'BrainyRich stops syncing and revokes its access at the provider. Accounts synced from it are marked closed; their history stays.'\n )}\n confirmLabel={tr('brainyrich.aggregation.disconnect', 'Disconnect')}\n pendingLabel={tr('brainyrich.aggregation.disconnecting', 'Disconnecting…')}\n destructive\n pending={revoke.isPending}\n onConfirm={confirmRevoke}\n />\n </Card>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { BraAggregationLink, BraAggregationProviderStatus, BraAggregationSyncResult, BraPlaidLinkToken, Connection } from '../types/bra';
|
|
2
|
+
/** Provider availability for this deployment — drives whether linking is offered at all. */
|
|
3
|
+
export declare const useAggregationProviders: () => {
|
|
4
|
+
data: BraAggregationProviderStatus[];
|
|
5
|
+
error: Error;
|
|
6
|
+
isError: true;
|
|
7
|
+
isPending: false;
|
|
8
|
+
isLoading: false;
|
|
9
|
+
isLoadingError: false;
|
|
10
|
+
isRefetchError: true;
|
|
11
|
+
isSuccess: false;
|
|
12
|
+
isPlaceholderData: false;
|
|
13
|
+
status: "error";
|
|
14
|
+
dataUpdatedAt: number;
|
|
15
|
+
errorUpdatedAt: number;
|
|
16
|
+
failureCount: number;
|
|
17
|
+
failureReason: Error | null;
|
|
18
|
+
errorUpdateCount: number;
|
|
19
|
+
isFetched: boolean;
|
|
20
|
+
isFetchedAfterMount: boolean;
|
|
21
|
+
isFetching: boolean;
|
|
22
|
+
isInitialLoading: boolean;
|
|
23
|
+
isPaused: boolean;
|
|
24
|
+
isRefetching: boolean;
|
|
25
|
+
isStale: boolean;
|
|
26
|
+
isEnabled: boolean;
|
|
27
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<BraAggregationProviderStatus[], Error>>;
|
|
28
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
29
|
+
promise: Promise<BraAggregationProviderStatus[]>;
|
|
30
|
+
} | {
|
|
31
|
+
data: BraAggregationProviderStatus[];
|
|
32
|
+
error: null;
|
|
33
|
+
isError: false;
|
|
34
|
+
isPending: false;
|
|
35
|
+
isLoading: false;
|
|
36
|
+
isLoadingError: false;
|
|
37
|
+
isRefetchError: false;
|
|
38
|
+
isSuccess: true;
|
|
39
|
+
isPlaceholderData: false;
|
|
40
|
+
status: "success";
|
|
41
|
+
dataUpdatedAt: number;
|
|
42
|
+
errorUpdatedAt: number;
|
|
43
|
+
failureCount: number;
|
|
44
|
+
failureReason: Error | null;
|
|
45
|
+
errorUpdateCount: number;
|
|
46
|
+
isFetched: boolean;
|
|
47
|
+
isFetchedAfterMount: boolean;
|
|
48
|
+
isFetching: boolean;
|
|
49
|
+
isInitialLoading: boolean;
|
|
50
|
+
isPaused: boolean;
|
|
51
|
+
isRefetching: boolean;
|
|
52
|
+
isStale: boolean;
|
|
53
|
+
isEnabled: boolean;
|
|
54
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<BraAggregationProviderStatus[], Error>>;
|
|
55
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
56
|
+
promise: Promise<BraAggregationProviderStatus[]>;
|
|
57
|
+
} | {
|
|
58
|
+
data: BraAggregationProviderStatus[];
|
|
59
|
+
error: Error;
|
|
60
|
+
isError: true;
|
|
61
|
+
isPending: false;
|
|
62
|
+
isLoading: false;
|
|
63
|
+
isLoadingError: true;
|
|
64
|
+
isRefetchError: false;
|
|
65
|
+
isSuccess: false;
|
|
66
|
+
isPlaceholderData: false;
|
|
67
|
+
status: "error";
|
|
68
|
+
dataUpdatedAt: number;
|
|
69
|
+
errorUpdatedAt: number;
|
|
70
|
+
failureCount: number;
|
|
71
|
+
failureReason: Error | null;
|
|
72
|
+
errorUpdateCount: number;
|
|
73
|
+
isFetched: boolean;
|
|
74
|
+
isFetchedAfterMount: boolean;
|
|
75
|
+
isFetching: boolean;
|
|
76
|
+
isInitialLoading: boolean;
|
|
77
|
+
isPaused: boolean;
|
|
78
|
+
isRefetching: boolean;
|
|
79
|
+
isStale: boolean;
|
|
80
|
+
isEnabled: boolean;
|
|
81
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<BraAggregationProviderStatus[], Error>>;
|
|
82
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
83
|
+
promise: Promise<BraAggregationProviderStatus[]>;
|
|
84
|
+
} | {
|
|
85
|
+
data: BraAggregationProviderStatus[];
|
|
86
|
+
error: null;
|
|
87
|
+
isError: false;
|
|
88
|
+
isPending: true;
|
|
89
|
+
isLoading: true;
|
|
90
|
+
isLoadingError: false;
|
|
91
|
+
isRefetchError: false;
|
|
92
|
+
isSuccess: false;
|
|
93
|
+
isPlaceholderData: false;
|
|
94
|
+
status: "pending";
|
|
95
|
+
dataUpdatedAt: number;
|
|
96
|
+
errorUpdatedAt: number;
|
|
97
|
+
failureCount: number;
|
|
98
|
+
failureReason: Error | null;
|
|
99
|
+
errorUpdateCount: number;
|
|
100
|
+
isFetched: boolean;
|
|
101
|
+
isFetchedAfterMount: boolean;
|
|
102
|
+
isFetching: boolean;
|
|
103
|
+
isInitialLoading: boolean;
|
|
104
|
+
isPaused: boolean;
|
|
105
|
+
isRefetching: boolean;
|
|
106
|
+
isStale: boolean;
|
|
107
|
+
isEnabled: boolean;
|
|
108
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<BraAggregationProviderStatus[], Error>>;
|
|
109
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
110
|
+
promise: Promise<BraAggregationProviderStatus[]>;
|
|
111
|
+
} | {
|
|
112
|
+
data: BraAggregationProviderStatus[];
|
|
113
|
+
error: null;
|
|
114
|
+
isError: false;
|
|
115
|
+
isPending: true;
|
|
116
|
+
isLoadingError: false;
|
|
117
|
+
isRefetchError: false;
|
|
118
|
+
isSuccess: false;
|
|
119
|
+
isPlaceholderData: false;
|
|
120
|
+
status: "pending";
|
|
121
|
+
dataUpdatedAt: number;
|
|
122
|
+
errorUpdatedAt: number;
|
|
123
|
+
failureCount: number;
|
|
124
|
+
failureReason: Error | null;
|
|
125
|
+
errorUpdateCount: number;
|
|
126
|
+
isFetched: boolean;
|
|
127
|
+
isFetchedAfterMount: boolean;
|
|
128
|
+
isFetching: boolean;
|
|
129
|
+
isLoading: boolean;
|
|
130
|
+
isInitialLoading: boolean;
|
|
131
|
+
isPaused: boolean;
|
|
132
|
+
isRefetching: boolean;
|
|
133
|
+
isStale: boolean;
|
|
134
|
+
isEnabled: boolean;
|
|
135
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<BraAggregationProviderStatus[], Error>>;
|
|
136
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
137
|
+
promise: Promise<BraAggregationProviderStatus[]>;
|
|
138
|
+
} | {
|
|
139
|
+
data: BraAggregationProviderStatus[];
|
|
140
|
+
isError: false;
|
|
141
|
+
error: null;
|
|
142
|
+
isPending: false;
|
|
143
|
+
isLoading: false;
|
|
144
|
+
isLoadingError: false;
|
|
145
|
+
isRefetchError: false;
|
|
146
|
+
isSuccess: true;
|
|
147
|
+
isPlaceholderData: true;
|
|
148
|
+
status: "success";
|
|
149
|
+
dataUpdatedAt: number;
|
|
150
|
+
errorUpdatedAt: number;
|
|
151
|
+
failureCount: number;
|
|
152
|
+
failureReason: Error | null;
|
|
153
|
+
errorUpdateCount: number;
|
|
154
|
+
isFetched: boolean;
|
|
155
|
+
isFetchedAfterMount: boolean;
|
|
156
|
+
isFetching: boolean;
|
|
157
|
+
isInitialLoading: boolean;
|
|
158
|
+
isPaused: boolean;
|
|
159
|
+
isRefetching: boolean;
|
|
160
|
+
isStale: boolean;
|
|
161
|
+
isEnabled: boolean;
|
|
162
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<BraAggregationProviderStatus[], Error>>;
|
|
163
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
164
|
+
promise: Promise<BraAggregationProviderStatus[]>;
|
|
165
|
+
};
|
|
166
|
+
/** The caller's own linked institutions (links are personal, never shared). */
|
|
167
|
+
export declare const useAggregationLinks: () => {
|
|
168
|
+
data: BraAggregationLink[];
|
|
169
|
+
error: Error;
|
|
170
|
+
isError: true;
|
|
171
|
+
isPending: false;
|
|
172
|
+
isLoading: false;
|
|
173
|
+
isLoadingError: false;
|
|
174
|
+
isRefetchError: true;
|
|
175
|
+
isSuccess: false;
|
|
176
|
+
isPlaceholderData: false;
|
|
177
|
+
status: "error";
|
|
178
|
+
dataUpdatedAt: number;
|
|
179
|
+
errorUpdatedAt: number;
|
|
180
|
+
failureCount: number;
|
|
181
|
+
failureReason: Error | null;
|
|
182
|
+
errorUpdateCount: number;
|
|
183
|
+
isFetched: boolean;
|
|
184
|
+
isFetchedAfterMount: boolean;
|
|
185
|
+
isFetching: boolean;
|
|
186
|
+
isInitialLoading: boolean;
|
|
187
|
+
isPaused: boolean;
|
|
188
|
+
isRefetching: boolean;
|
|
189
|
+
isStale: boolean;
|
|
190
|
+
isEnabled: boolean;
|
|
191
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<Connection<BraAggregationLink>, Error>>;
|
|
192
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
193
|
+
promise: Promise<Connection<BraAggregationLink>>;
|
|
194
|
+
} | {
|
|
195
|
+
data: BraAggregationLink[];
|
|
196
|
+
error: null;
|
|
197
|
+
isError: false;
|
|
198
|
+
isPending: false;
|
|
199
|
+
isLoading: false;
|
|
200
|
+
isLoadingError: false;
|
|
201
|
+
isRefetchError: false;
|
|
202
|
+
isSuccess: true;
|
|
203
|
+
isPlaceholderData: false;
|
|
204
|
+
status: "success";
|
|
205
|
+
dataUpdatedAt: number;
|
|
206
|
+
errorUpdatedAt: number;
|
|
207
|
+
failureCount: number;
|
|
208
|
+
failureReason: Error | null;
|
|
209
|
+
errorUpdateCount: number;
|
|
210
|
+
isFetched: boolean;
|
|
211
|
+
isFetchedAfterMount: boolean;
|
|
212
|
+
isFetching: boolean;
|
|
213
|
+
isInitialLoading: boolean;
|
|
214
|
+
isPaused: boolean;
|
|
215
|
+
isRefetching: boolean;
|
|
216
|
+
isStale: boolean;
|
|
217
|
+
isEnabled: boolean;
|
|
218
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<Connection<BraAggregationLink>, Error>>;
|
|
219
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
220
|
+
promise: Promise<Connection<BraAggregationLink>>;
|
|
221
|
+
} | {
|
|
222
|
+
data: BraAggregationLink[];
|
|
223
|
+
error: Error;
|
|
224
|
+
isError: true;
|
|
225
|
+
isPending: false;
|
|
226
|
+
isLoading: false;
|
|
227
|
+
isLoadingError: true;
|
|
228
|
+
isRefetchError: false;
|
|
229
|
+
isSuccess: false;
|
|
230
|
+
isPlaceholderData: false;
|
|
231
|
+
status: "error";
|
|
232
|
+
dataUpdatedAt: number;
|
|
233
|
+
errorUpdatedAt: number;
|
|
234
|
+
failureCount: number;
|
|
235
|
+
failureReason: Error | null;
|
|
236
|
+
errorUpdateCount: number;
|
|
237
|
+
isFetched: boolean;
|
|
238
|
+
isFetchedAfterMount: boolean;
|
|
239
|
+
isFetching: boolean;
|
|
240
|
+
isInitialLoading: boolean;
|
|
241
|
+
isPaused: boolean;
|
|
242
|
+
isRefetching: boolean;
|
|
243
|
+
isStale: boolean;
|
|
244
|
+
isEnabled: boolean;
|
|
245
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<Connection<BraAggregationLink>, Error>>;
|
|
246
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
247
|
+
promise: Promise<Connection<BraAggregationLink>>;
|
|
248
|
+
} | {
|
|
249
|
+
data: BraAggregationLink[];
|
|
250
|
+
error: null;
|
|
251
|
+
isError: false;
|
|
252
|
+
isPending: true;
|
|
253
|
+
isLoading: true;
|
|
254
|
+
isLoadingError: false;
|
|
255
|
+
isRefetchError: false;
|
|
256
|
+
isSuccess: false;
|
|
257
|
+
isPlaceholderData: false;
|
|
258
|
+
status: "pending";
|
|
259
|
+
dataUpdatedAt: number;
|
|
260
|
+
errorUpdatedAt: number;
|
|
261
|
+
failureCount: number;
|
|
262
|
+
failureReason: Error | null;
|
|
263
|
+
errorUpdateCount: number;
|
|
264
|
+
isFetched: boolean;
|
|
265
|
+
isFetchedAfterMount: boolean;
|
|
266
|
+
isFetching: boolean;
|
|
267
|
+
isInitialLoading: boolean;
|
|
268
|
+
isPaused: boolean;
|
|
269
|
+
isRefetching: boolean;
|
|
270
|
+
isStale: boolean;
|
|
271
|
+
isEnabled: boolean;
|
|
272
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<Connection<BraAggregationLink>, Error>>;
|
|
273
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
274
|
+
promise: Promise<Connection<BraAggregationLink>>;
|
|
275
|
+
} | {
|
|
276
|
+
data: BraAggregationLink[];
|
|
277
|
+
error: null;
|
|
278
|
+
isError: false;
|
|
279
|
+
isPending: true;
|
|
280
|
+
isLoadingError: false;
|
|
281
|
+
isRefetchError: false;
|
|
282
|
+
isSuccess: false;
|
|
283
|
+
isPlaceholderData: false;
|
|
284
|
+
status: "pending";
|
|
285
|
+
dataUpdatedAt: number;
|
|
286
|
+
errorUpdatedAt: number;
|
|
287
|
+
failureCount: number;
|
|
288
|
+
failureReason: Error | null;
|
|
289
|
+
errorUpdateCount: number;
|
|
290
|
+
isFetched: boolean;
|
|
291
|
+
isFetchedAfterMount: boolean;
|
|
292
|
+
isFetching: boolean;
|
|
293
|
+
isLoading: boolean;
|
|
294
|
+
isInitialLoading: boolean;
|
|
295
|
+
isPaused: boolean;
|
|
296
|
+
isRefetching: boolean;
|
|
297
|
+
isStale: boolean;
|
|
298
|
+
isEnabled: boolean;
|
|
299
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<Connection<BraAggregationLink>, Error>>;
|
|
300
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
301
|
+
promise: Promise<Connection<BraAggregationLink>>;
|
|
302
|
+
} | {
|
|
303
|
+
data: BraAggregationLink[];
|
|
304
|
+
isError: false;
|
|
305
|
+
error: null;
|
|
306
|
+
isPending: false;
|
|
307
|
+
isLoading: false;
|
|
308
|
+
isLoadingError: false;
|
|
309
|
+
isRefetchError: false;
|
|
310
|
+
isSuccess: true;
|
|
311
|
+
isPlaceholderData: true;
|
|
312
|
+
status: "success";
|
|
313
|
+
dataUpdatedAt: number;
|
|
314
|
+
errorUpdatedAt: number;
|
|
315
|
+
failureCount: number;
|
|
316
|
+
failureReason: Error | null;
|
|
317
|
+
errorUpdateCount: number;
|
|
318
|
+
isFetched: boolean;
|
|
319
|
+
isFetchedAfterMount: boolean;
|
|
320
|
+
isFetching: boolean;
|
|
321
|
+
isInitialLoading: boolean;
|
|
322
|
+
isPaused: boolean;
|
|
323
|
+
isRefetching: boolean;
|
|
324
|
+
isStale: boolean;
|
|
325
|
+
isEnabled: boolean;
|
|
326
|
+
refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<Connection<BraAggregationLink>, Error>>;
|
|
327
|
+
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
328
|
+
promise: Promise<Connection<BraAggregationLink>>;
|
|
329
|
+
};
|
|
330
|
+
/** Mints a short-lived Plaid Link token. Imperative: only called when the user starts linking. */
|
|
331
|
+
export declare const useCreatePlaidLinkToken: () => import('@tanstack/react-query').UseMutationResult<BraPlaidLinkToken, unknown, void, unknown>;
|
|
332
|
+
export interface ExchangePlaidPublicTokenVars {
|
|
333
|
+
publicToken: string;
|
|
334
|
+
institutionId: string | null;
|
|
335
|
+
institutionName: string | null;
|
|
336
|
+
}
|
|
337
|
+
/** Exchanges the Plaid Link `public_token` server-side and runs the first sync. */
|
|
338
|
+
export declare const useExchangePlaidPublicToken: () => import('@tanstack/react-query').UseMutationResult<BraAggregationSyncResult, unknown, ExchangePlaidPublicTokenVars, unknown>;
|
|
339
|
+
export declare const useSyncAggregationLink: () => import('@tanstack/react-query').UseMutationResult<BraAggregationSyncResult, unknown, string, unknown>;
|
|
340
|
+
export declare const useRevokeAggregationLink: () => import('@tanstack/react-query').UseMutationResult<boolean, unknown, string, unknown>;
|
|
341
|
+
//# sourceMappingURL=useAggregation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAggregation.d.ts","sourceRoot":"","sources":["../../../src/brainyrich/hooks/useAggregation.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACX,MAAM,cAAc,CAAC;AAkBtB,4FAA4F;AAC5F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBnC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB/B,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,oGAkBnC,CAAC;AAkBF,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,mFAAmF;AACnF,eAAO,MAAM,2BAA2B,mIAuBvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,6GAqBlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,4FAmBpC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { useBrainyRich as e } from "../providers/BrainyRichProvider.js";
|
|
2
|
+
import { KEY as t, braMutate as n, braQuery as r, mutationFeedback as i } from "./useBrainyRichApi.js";
|
|
3
|
+
import { useMutation as a, useQuery as o, useQueryClient as s } from "@tanstack/react-query";
|
|
4
|
+
//#region src/brainyrich/hooks/useAggregation.ts
|
|
5
|
+
var c = {
|
|
6
|
+
providers: [
|
|
7
|
+
"brainyrich",
|
|
8
|
+
"aggregation",
|
|
9
|
+
"providers"
|
|
10
|
+
],
|
|
11
|
+
links: [
|
|
12
|
+
"brainyrich",
|
|
13
|
+
"aggregation",
|
|
14
|
+
"links"
|
|
15
|
+
]
|
|
16
|
+
}, l = "\n id workspaceId ownerId provider status institutionId institutionName\n lastSyncedAt lastSyncError createdAt updatedAt\n", u = `
|
|
17
|
+
link { ${l} }
|
|
18
|
+
accountsSynced transactionsSynced addedTransactions modifiedTransactions removedTransactions
|
|
19
|
+
`, d = () => {
|
|
20
|
+
let { apiGatewayUrl: t } = e(), n = o({
|
|
21
|
+
queryKey: c.providers,
|
|
22
|
+
staleTime: 5 * 6e4,
|
|
23
|
+
queryFn: async () => (await r("query BraAggregationProviders {\n braAggregationProviders { provider configured environment countryCodes }\n }", {}, t)).braAggregationProviders
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
...n,
|
|
27
|
+
data: n.data ?? []
|
|
28
|
+
};
|
|
29
|
+
}, f = () => {
|
|
30
|
+
let { apiGatewayUrl: t } = e(), n = o({
|
|
31
|
+
queryKey: c.links,
|
|
32
|
+
queryFn: async () => (await r(`query BraListAggregationLinks($pagination: PaginationInput) {
|
|
33
|
+
braListAggregationLinks(pagination: $pagination) {
|
|
34
|
+
items { ${l} }
|
|
35
|
+
pageInfo { cursor hasMore }
|
|
36
|
+
}
|
|
37
|
+
}`, { pagination: { limit: 50 } }, t)).braListAggregationLinks
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
...n,
|
|
41
|
+
data: n.data?.items ?? []
|
|
42
|
+
};
|
|
43
|
+
}, p = () => {
|
|
44
|
+
let { apiGatewayUrl: t } = e();
|
|
45
|
+
return a({
|
|
46
|
+
mutationFn: async () => (await n("query BraCreatePlaidLinkToken {\n braCreatePlaidLinkToken { linkToken expiration requestId }\n }", {}, t)).braCreatePlaidLinkToken,
|
|
47
|
+
...i({})
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
function m() {
|
|
51
|
+
let e = s();
|
|
52
|
+
return () => {
|
|
53
|
+
e.invalidateQueries({ queryKey: c.links }), e.invalidateQueries({ queryKey: t.accounts }), e.invalidateQueries({ queryKey: t.transactions }), e.invalidateQueries({ queryKey: t.netWorth });
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function h(e) {
|
|
57
|
+
return `Synced ${`${e.accountsSynced} account${e.accountsSynced === 1 ? "" : "s"}`} and ${`${e.transactionsSynced} transaction${e.transactionsSynced === 1 ? "" : "s"}`}`;
|
|
58
|
+
}
|
|
59
|
+
var g = () => {
|
|
60
|
+
let { apiGatewayUrl: t } = e();
|
|
61
|
+
return a({
|
|
62
|
+
mutationFn: async (e) => (await n(`mutation BraExchangePlaidPublicToken(
|
|
63
|
+
$publicToken: String!, $institutionId: String, $institutionName: String
|
|
64
|
+
) {
|
|
65
|
+
braExchangePlaidPublicToken(
|
|
66
|
+
publicToken: $publicToken, institutionId: $institutionId, institutionName: $institutionName
|
|
67
|
+
) { ${u} }
|
|
68
|
+
}`, { ...e }, t)).braExchangePlaidPublicToken,
|
|
69
|
+
...i({
|
|
70
|
+
success: (e) => `Institution linked. ${h(e)}.`,
|
|
71
|
+
onSuccess: m()
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}, _ = () => {
|
|
75
|
+
let { apiGatewayUrl: t } = e(), r = m();
|
|
76
|
+
return a({
|
|
77
|
+
mutationFn: async (e) => (await n(`mutation BraSyncAggregationLink($id: ID!) {
|
|
78
|
+
braSyncAggregationLink(id: $id) { ${u} }
|
|
79
|
+
}`, { id: e }, t)).braSyncAggregationLink,
|
|
80
|
+
...i({ success: (e) => `${h(e)}.` }),
|
|
81
|
+
onSettled: () => r()
|
|
82
|
+
});
|
|
83
|
+
}, v = () => {
|
|
84
|
+
let { apiGatewayUrl: t } = e();
|
|
85
|
+
return a({
|
|
86
|
+
mutationFn: async (e) => (await n("mutation BraRevokeAggregationLink($id: ID!) {\n braRevokeAggregationLink(id: $id)\n }", { id: e }, t)).braRevokeAggregationLink,
|
|
87
|
+
...i({
|
|
88
|
+
success: "Institution disconnected. Its synced accounts are now closed.",
|
|
89
|
+
onSuccess: m()
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { f as useAggregationLinks, d as useAggregationProviders, p as useCreatePlaidLinkToken, g as useExchangePlaidPublicToken, v as useRevokeAggregationLink, _ as useSyncAggregationLink };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=useAggregation.js.map
|