@burdenoff/microfe-brainyrich 2026.705.1 → 2026.706.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brainyrich/BrainyRichRoot.js +13 -13
- package/dist/brainyrich/components/ActorName.js +38 -0
- package/dist/brainyrich/components/ActorName.js.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.js +25 -0
- package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
- package/dist/brainyrich/components/LoadMore.js +24 -0
- package/dist/brainyrich/components/LoadMore.js.map +1 -0
- package/dist/brainyrich/components/index.js +5 -0
- package/dist/brainyrich/components/notify.js +38 -0
- package/dist/brainyrich/components/notify.js.map +1 -0
- package/dist/brainyrich/components/pickers.js +232 -0
- package/dist/brainyrich/components/pickers.js.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
- package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.js +206 -0
- package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
- package/dist/brainyrich/components/reuse/transport.js +24 -0
- package/dist/brainyrich/components/reuse/transport.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +644 -372
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.js +346 -293
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +339 -320
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +178 -164
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +195 -169
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +247 -198
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +478 -442
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +438 -396
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +246 -213
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +321 -173
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +258 -225
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,25 +1,36 @@
|
|
|
1
1
|
import { useBrainyRich as e } from "../providers/BrainyRichProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { errorMessage as t, notify as n } from "../components/notify.js";
|
|
3
|
+
import { useInfiniteQuery as r, useMutation as i, useQuery as a, useQueryClient as o } from "@tanstack/react-query";
|
|
4
|
+
import { graphqlFetch as ee } from "@burdenoff/fe-libs/shared/graphql";
|
|
4
5
|
//#region src/brainyrich/hooks/useBrainyRichApi.ts
|
|
5
|
-
var
|
|
6
|
+
var te = () => {
|
|
6
7
|
let e = globalThis;
|
|
7
8
|
e.__graphqlFetchResponseCache?.clear(), e.__graphqlFetchPendingResponses?.clear(), e.__boffGraphQLResponseCache?.clear();
|
|
8
|
-
},
|
|
9
|
-
let
|
|
9
|
+
}, s = async (e, t, n, r) => {
|
|
10
|
+
let i = await ee({
|
|
10
11
|
gateway: "workspace",
|
|
11
12
|
baseUrl: n,
|
|
12
13
|
query: e,
|
|
13
14
|
variables: t,
|
|
14
|
-
workspaceToken: !0
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
workspaceToken: !0,
|
|
16
|
+
suppressGlobalErrorEvent: r?.suppressGlobalError ?? !1
|
|
17
|
+
});
|
|
18
|
+
if (i.errors?.length) throw Error(i.errors[0]?.message ?? "GraphQL request failed");
|
|
19
|
+
if (!i.data) throw Error("GraphQL response did not include data");
|
|
20
|
+
return i.data;
|
|
21
|
+
}, c = async (e, t, n) => {
|
|
22
|
+
let r = await s(e, t, n, { suppressGlobalError: !0 });
|
|
23
|
+
return te(), r;
|
|
24
|
+
};
|
|
25
|
+
function l(e) {
|
|
26
|
+
return {
|
|
27
|
+
onSuccess: (t, r) => {
|
|
28
|
+
e.onSuccess?.(t, r), e.success && n.success(typeof e.success == "function" ? e.success(t, r) : e.success);
|
|
29
|
+
},
|
|
30
|
+
onError: (e) => n.error(t(e))
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
var u = {
|
|
23
34
|
netWorth: ["brainyrich", "net-worth"],
|
|
24
35
|
accounts: ["brainyrich", "accounts"],
|
|
25
36
|
account: (e) => [
|
|
@@ -66,361 +77,418 @@ var ee = () => {
|
|
|
66
77
|
transactions: ["brainyrich", "transactions"],
|
|
67
78
|
rebalances: ["brainyrich", "rebalance-proposals"],
|
|
68
79
|
health: ["brainyrich", "health"]
|
|
69
|
-
},
|
|
70
|
-
let { apiGatewayUrl:
|
|
71
|
-
return
|
|
72
|
-
queryKey: [...
|
|
73
|
-
queryFn: async () => (await
|
|
74
|
-
braNetWorthSummary(ownerId: $ownerId) { ${
|
|
75
|
-
}`, { ownerId: t },
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
let { apiGatewayUrl:
|
|
79
|
-
queryKey: [...
|
|
80
|
-
queryFn: async () => (await
|
|
80
|
+
}, d = { limit: 100 }, f = "\n id workspaceId accountId portfolioId symbol name assetClass quantity lastPrice\n costBasis marketValue currency asOf createdAt updatedAt\n", p = "\n id workspaceId accountId holdingId type symbol quantity price amount fee currency\n tradeDate settleDate notes createdAt updatedAt\n", m = "\n id workspaceId ownerId householdId name type status institution accountMask\n cashBalance currency isManual createdAt updatedAt\n", h = "\n id workspaceId ownerId householdId name description status baseCurrency\n modelPortfolioId driftThresholdPct targetAllocation tags createdAt updatedAt\n", g = "\n id workspaceId modelPortfolioId assetClass targetPct createdAt updatedAt\n", _ = "\n id workspaceId name description riskProfile baseCurrency isActive createdAt updatedAt\n", v = "\n id workspaceId goalId accountId allocationPct fixedAmount createdAt updatedAt\n", y = "\n id workspaceId ownerId householdId name type status projection targetAmount\n targetDate monthlyContribution priority currency notes tags createdAt updatedAt\n", b = "\n id workspaceId name status riskProfile advisorId aum currency primaryContactName\n primaryContactEmail notes tags createdAt updatedAt\n", x = "\n id workspaceId ownerId type severity status title detail metrics subjectId\n subjectType acknowledgedById resolvedAt createdAt updatedAt\n", S = "\n id workspaceId portfolioId householdId status driftPct rationale trades\n proposedById approvedById executedAt createdAt updatedAt\n", ne = "\n workspaceId ownerId totalNetWorth totalMarketValue totalCash accountCount currency\n byAssetClass { assetClass marketValue }\n", re = (t) => {
|
|
81
|
+
let { apiGatewayUrl: n } = e();
|
|
82
|
+
return a({
|
|
83
|
+
queryKey: [...u.netWorth, t ?? "me"],
|
|
84
|
+
queryFn: async () => (await s(`query BraNetWorthSummary($ownerId: ID) {
|
|
85
|
+
braNetWorthSummary(ownerId: $ownerId) { ${ne} }
|
|
86
|
+
}`, { ownerId: t }, n)).braNetWorthSummary
|
|
87
|
+
});
|
|
88
|
+
}, C = (t = {}) => {
|
|
89
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
90
|
+
queryKey: [...u.accounts, t],
|
|
91
|
+
queryFn: async () => (await s(`query BraListAccounts($householdId: ID, $status: BraAccountStatus, $pagination: PaginationInput) {
|
|
81
92
|
braListAccounts(householdId: $householdId, status: $status, pagination: $pagination) {
|
|
82
|
-
items { ${
|
|
93
|
+
items { ${m} }
|
|
83
94
|
pageInfo { cursor hasMore }
|
|
84
95
|
}
|
|
85
96
|
}`, {
|
|
86
97
|
householdId: t.householdId,
|
|
87
98
|
status: t.status,
|
|
88
|
-
pagination: t.pagination ??
|
|
89
|
-
},
|
|
99
|
+
pagination: t.pagination ?? d
|
|
100
|
+
}, n)).braListAccounts
|
|
90
101
|
});
|
|
91
102
|
return {
|
|
92
|
-
...
|
|
93
|
-
data:
|
|
94
|
-
pageInfo:
|
|
103
|
+
...r,
|
|
104
|
+
data: r.data?.items ?? [],
|
|
105
|
+
pageInfo: r.data?.pageInfo
|
|
95
106
|
};
|
|
96
|
-
},
|
|
97
|
-
let { apiGatewayUrl:
|
|
98
|
-
return
|
|
99
|
-
queryKey:
|
|
107
|
+
}, w = (t) => {
|
|
108
|
+
let { apiGatewayUrl: n } = e();
|
|
109
|
+
return a({
|
|
110
|
+
queryKey: u.account(t ?? ""),
|
|
100
111
|
enabled: !!t,
|
|
101
|
-
queryFn: async () => (await
|
|
112
|
+
queryFn: async () => (await s(`query BraAccount($id: ID!) {
|
|
102
113
|
braAccount(id: $id) {
|
|
103
|
-
${
|
|
104
|
-
holdings { ${
|
|
105
|
-
transactions { ${
|
|
114
|
+
${m}
|
|
115
|
+
holdings { ${f} }
|
|
116
|
+
transactions { ${p} }
|
|
106
117
|
}
|
|
107
|
-
}`, { id: t },
|
|
108
|
-
});
|
|
109
|
-
}, w = () => {
|
|
110
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
111
|
-
return t({
|
|
112
|
-
mutationFn: async (e) => (await o(`mutation BraCreateAccount($input: BraCreateAccountInput!) {
|
|
113
|
-
braCreateAccount(input: $input) { ${d} }
|
|
114
|
-
}`, { input: e }, n)).braCreateAccount,
|
|
115
|
-
onSuccess: () => {
|
|
116
|
-
i.invalidateQueries({ queryKey: s.accounts }), i.invalidateQueries({ queryKey: s.netWorth });
|
|
117
|
-
}
|
|
118
|
+
}`, { id: t }, n)).braAccount
|
|
118
119
|
});
|
|
119
120
|
}, T = () => {
|
|
120
|
-
let { apiGatewayUrl:
|
|
121
|
-
return
|
|
122
|
-
mutationFn: async (e) => (await
|
|
123
|
-
|
|
124
|
-
}`, e,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
122
|
+
return i({
|
|
123
|
+
mutationFn: async (e) => (await c(`mutation BraCreateAccount($input: BraCreateAccountInput!) {
|
|
124
|
+
braCreateAccount(input: $input) { ${m} }
|
|
125
|
+
}`, { input: e }, t)).braCreateAccount,
|
|
126
|
+
...l({
|
|
127
|
+
success: "Account created",
|
|
128
|
+
onSuccess: () => {
|
|
129
|
+
n.invalidateQueries({ queryKey: u.accounts }), n.invalidateQueries({ queryKey: u.netWorth });
|
|
130
|
+
}
|
|
131
|
+
})
|
|
128
132
|
});
|
|
129
133
|
}, E = () => {
|
|
130
|
-
let { apiGatewayUrl:
|
|
131
|
-
return
|
|
132
|
-
mutationFn: async (e) => (await
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
135
|
+
return i({
|
|
136
|
+
mutationFn: async (e) => (await c(`mutation BraUpdateAccount($id: ID!, $input: BraUpdateAccountInput!) {
|
|
137
|
+
braUpdateAccount(id: $id, input: $input) { ${m} }
|
|
138
|
+
}`, e, t)).braUpdateAccount,
|
|
139
|
+
...l({
|
|
140
|
+
success: "Account updated",
|
|
141
|
+
onSuccess: (e) => {
|
|
142
|
+
n.invalidateQueries({ queryKey: u.accounts }), n.invalidateQueries({ queryKey: u.account(e.id) }), n.invalidateQueries({ queryKey: u.netWorth });
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
}, D = () => {
|
|
147
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
148
|
+
return i({
|
|
149
|
+
mutationFn: async (e) => (await c("mutation BraArchiveAccount($id: ID!) { braArchiveAccount(id: $id) }", { id: e }, t)).braArchiveAccount,
|
|
150
|
+
...l({
|
|
151
|
+
success: "Account archived",
|
|
152
|
+
onSuccess: () => {
|
|
153
|
+
n.invalidateQueries({ queryKey: u.accounts }), n.invalidateQueries({ queryKey: u.netWorth });
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
}, O = (t = {}) => {
|
|
158
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
159
|
+
queryKey: [...u.portfolios, t],
|
|
160
|
+
queryFn: async () => (await s(`query BraListPortfolios($householdId: ID, $status: BraPortfolioStatus, $pagination: PaginationInput) {
|
|
141
161
|
braListPortfolios(householdId: $householdId, status: $status, pagination: $pagination) {
|
|
142
|
-
items { ${
|
|
162
|
+
items { ${h} }
|
|
143
163
|
pageInfo { cursor hasMore }
|
|
144
164
|
}
|
|
145
165
|
}`, {
|
|
146
166
|
householdId: t.householdId,
|
|
147
167
|
status: t.status,
|
|
148
|
-
pagination: t.pagination ??
|
|
149
|
-
},
|
|
168
|
+
pagination: t.pagination ?? d
|
|
169
|
+
}, n)).braListPortfolios
|
|
150
170
|
});
|
|
151
171
|
return {
|
|
152
|
-
...
|
|
153
|
-
data:
|
|
154
|
-
pageInfo:
|
|
172
|
+
...r,
|
|
173
|
+
data: r.data?.items ?? [],
|
|
174
|
+
pageInfo: r.data?.pageInfo
|
|
155
175
|
};
|
|
156
|
-
},
|
|
157
|
-
let { apiGatewayUrl:
|
|
158
|
-
return
|
|
159
|
-
queryKey:
|
|
176
|
+
}, k = (t) => {
|
|
177
|
+
let { apiGatewayUrl: n } = e();
|
|
178
|
+
return a({
|
|
179
|
+
queryKey: u.portfolio(t ?? ""),
|
|
160
180
|
enabled: !!t,
|
|
161
|
-
queryFn: async () => (await
|
|
181
|
+
queryFn: async () => (await s(`query BraPortfolio($id: ID!) {
|
|
162
182
|
braPortfolio(id: $id) {
|
|
163
|
-
${
|
|
164
|
-
holdings { ${
|
|
183
|
+
${h}
|
|
184
|
+
holdings { ${f} }
|
|
165
185
|
}
|
|
166
|
-
}`, { id: t },
|
|
167
|
-
});
|
|
168
|
-
}, k = () => {
|
|
169
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
170
|
-
return t({
|
|
171
|
-
mutationFn: async (e) => (await o(`mutation BraCreatePortfolio($input: BraCreatePortfolioInput!) {
|
|
172
|
-
braCreatePortfolio(input: $input) { ${f} }
|
|
173
|
-
}`, { input: e }, n)).braCreatePortfolio,
|
|
174
|
-
onSuccess: () => i.invalidateQueries({ queryKey: s.portfolios })
|
|
186
|
+
}`, { id: t }, n)).braPortfolio
|
|
175
187
|
});
|
|
176
188
|
}, A = () => {
|
|
177
|
-
let { apiGatewayUrl:
|
|
178
|
-
return
|
|
179
|
-
mutationFn: async (e) => (await
|
|
180
|
-
|
|
181
|
-
}`, e,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
189
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
190
|
+
return i({
|
|
191
|
+
mutationFn: async (e) => (await c(`mutation BraCreatePortfolio($input: BraCreatePortfolioInput!) {
|
|
192
|
+
braCreatePortfolio(input: $input) { ${h} }
|
|
193
|
+
}`, { input: e }, t)).braCreatePortfolio,
|
|
194
|
+
...l({
|
|
195
|
+
success: "Portfolio created",
|
|
196
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.portfolios })
|
|
197
|
+
})
|
|
185
198
|
});
|
|
186
199
|
}, j = () => {
|
|
187
|
-
let { apiGatewayUrl:
|
|
188
|
-
return
|
|
189
|
-
mutationFn: async (e) => (await
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
201
|
+
return i({
|
|
202
|
+
mutationFn: async (e) => (await c(`mutation BraUpdatePortfolio($id: ID!, $input: BraUpdatePortfolioInput!) {
|
|
203
|
+
braUpdatePortfolio(id: $id, input: $input) { ${h} }
|
|
204
|
+
}`, e, t)).braUpdatePortfolio,
|
|
205
|
+
...l({
|
|
206
|
+
success: "Portfolio updated",
|
|
207
|
+
onSuccess: (e) => {
|
|
208
|
+
n.invalidateQueries({ queryKey: u.portfolios }), n.invalidateQueries({ queryKey: u.portfolio(e.id) });
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
});
|
|
212
|
+
}, M = () => {
|
|
213
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
214
|
+
return i({
|
|
215
|
+
mutationFn: async (e) => (await c("mutation BraArchivePortfolio($id: ID!) { braArchivePortfolio(id: $id) }", { id: e }, t)).braArchivePortfolio,
|
|
216
|
+
...l({
|
|
217
|
+
success: "Portfolio archived",
|
|
218
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.portfolios })
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
}, N = (t) => {
|
|
222
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
223
|
+
queryKey: [...u.holdings, t],
|
|
195
224
|
enabled: !!(t.accountId || t.portfolioId),
|
|
196
|
-
queryFn: async () => (await
|
|
197
|
-
braListHoldings(accountId: $accountId, portfolioId: $portfolioId) { ${
|
|
225
|
+
queryFn: async () => (await s(`query BraListHoldings($accountId: ID, $portfolioId: ID) {
|
|
226
|
+
braListHoldings(accountId: $accountId, portfolioId: $portfolioId) { ${f} }
|
|
198
227
|
}`, {
|
|
199
228
|
accountId: t.accountId,
|
|
200
229
|
portfolioId: t.portfolioId
|
|
201
|
-
},
|
|
230
|
+
}, n)).braListHoldings
|
|
202
231
|
});
|
|
203
232
|
return {
|
|
204
|
-
...
|
|
205
|
-
data:
|
|
233
|
+
...r,
|
|
234
|
+
data: r.data ?? []
|
|
206
235
|
};
|
|
207
|
-
}, N = () => {
|
|
208
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
209
|
-
return t({
|
|
210
|
-
mutationFn: async (e) => (await o(`mutation BraCreateHolding($input: BraCreateHoldingInput!) {
|
|
211
|
-
braCreateHolding(input: $input) { ${l} }
|
|
212
|
-
}`, { input: e }, n)).braCreateHolding,
|
|
213
|
-
onSuccess: (e) => {
|
|
214
|
-
i.invalidateQueries({ queryKey: s.holdings }), i.invalidateQueries({ queryKey: s.account(e.accountId) }), e.portfolioId && i.invalidateQueries({ queryKey: s.portfolio(e.portfolioId) }), i.invalidateQueries({ queryKey: s.netWorth });
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
236
|
}, P = () => {
|
|
218
|
-
let { apiGatewayUrl:
|
|
219
|
-
return
|
|
220
|
-
mutationFn: async (e) => (await
|
|
221
|
-
|
|
222
|
-
}`, e,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
237
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
238
|
+
return i({
|
|
239
|
+
mutationFn: async (e) => (await c(`mutation BraCreateHolding($input: BraCreateHoldingInput!) {
|
|
240
|
+
braCreateHolding(input: $input) { ${f} }
|
|
241
|
+
}`, { input: e }, t)).braCreateHolding,
|
|
242
|
+
...l({
|
|
243
|
+
success: "Holding added",
|
|
244
|
+
onSuccess: (e) => {
|
|
245
|
+
n.invalidateQueries({ queryKey: u.holdings }), n.invalidateQueries({ queryKey: u.account(e.accountId) }), e.portfolioId && n.invalidateQueries({ queryKey: u.portfolio(e.portfolioId) }), n.invalidateQueries({ queryKey: u.netWorth });
|
|
246
|
+
}
|
|
247
|
+
})
|
|
226
248
|
});
|
|
227
249
|
}, F = () => {
|
|
228
|
-
let { apiGatewayUrl:
|
|
229
|
-
return
|
|
230
|
-
mutationFn: async (e) => (await
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
250
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
251
|
+
return i({
|
|
252
|
+
mutationFn: async (e) => (await c(`mutation BraUpdateHolding($id: ID!, $input: BraUpdateHoldingInput!) {
|
|
253
|
+
braUpdateHolding(id: $id, input: $input) { ${f} }
|
|
254
|
+
}`, e, t)).braUpdateHolding,
|
|
255
|
+
...l({
|
|
256
|
+
success: "Holding updated",
|
|
257
|
+
onSuccess: (e) => {
|
|
258
|
+
n.invalidateQueries({ queryKey: u.holdings }), n.invalidateQueries({ queryKey: u.account(e.accountId) }), e.portfolioId && n.invalidateQueries({ queryKey: u.portfolio(e.portfolioId) }), n.invalidateQueries({ queryKey: u.netWorth });
|
|
259
|
+
}
|
|
260
|
+
})
|
|
234
261
|
});
|
|
235
262
|
}, I = () => {
|
|
236
|
-
let { apiGatewayUrl: t } = e(),
|
|
237
|
-
|
|
238
|
-
|
|
263
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
264
|
+
return i({
|
|
265
|
+
mutationFn: async (e) => (await c("mutation BraDeleteHolding($id: ID!) { braDeleteHolding(id: $id) }", { id: e }, t)).braDeleteHolding,
|
|
266
|
+
...l({
|
|
267
|
+
success: "Holding removed",
|
|
268
|
+
onSuccess: () => {
|
|
269
|
+
n.invalidateQueries({ queryKey: u.holdings }), n.invalidateQueries({ queryKey: u.accounts }), n.invalidateQueries({ queryKey: u.portfolios }), n.invalidateQueries({ queryKey: u.netWorth });
|
|
270
|
+
}
|
|
271
|
+
})
|
|
272
|
+
});
|
|
273
|
+
}, L = () => {
|
|
274
|
+
let { apiGatewayUrl: t } = e(), n = a({
|
|
275
|
+
queryKey: u.modelPortfolios,
|
|
276
|
+
queryFn: async () => (await s(`query BraListModelPortfolios {
|
|
239
277
|
braListModelPortfolios {
|
|
240
|
-
${
|
|
241
|
-
allocations { ${
|
|
278
|
+
${_}
|
|
279
|
+
allocations { ${g} }
|
|
242
280
|
}
|
|
243
281
|
}`, {}, t)).braListModelPortfolios
|
|
244
282
|
});
|
|
245
283
|
return {
|
|
246
|
-
...
|
|
247
|
-
data:
|
|
284
|
+
...n,
|
|
285
|
+
data: n.data ?? []
|
|
248
286
|
};
|
|
249
|
-
},
|
|
250
|
-
let { apiGatewayUrl:
|
|
251
|
-
return
|
|
252
|
-
queryKey:
|
|
287
|
+
}, R = (t) => {
|
|
288
|
+
let { apiGatewayUrl: n } = e();
|
|
289
|
+
return a({
|
|
290
|
+
queryKey: u.modelPortfolio(t ?? ""),
|
|
253
291
|
enabled: !!t,
|
|
254
|
-
queryFn: async () => (await
|
|
292
|
+
queryFn: async () => (await s(`query BraModelPortfolio($id: ID!) {
|
|
255
293
|
braModelPortfolio(id: $id) {
|
|
256
|
-
${
|
|
257
|
-
allocations { ${
|
|
294
|
+
${_}
|
|
295
|
+
allocations { ${g} }
|
|
258
296
|
}
|
|
259
|
-
}`, { id: t },
|
|
297
|
+
}`, { id: t }, n)).braModelPortfolio
|
|
260
298
|
});
|
|
261
|
-
},
|
|
262
|
-
let { apiGatewayUrl:
|
|
263
|
-
return
|
|
264
|
-
mutationFn: async (e) => (await
|
|
299
|
+
}, z = () => {
|
|
300
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
301
|
+
return i({
|
|
302
|
+
mutationFn: async (e) => (await c(`mutation BraCreateModelPortfolio($input: BraCreateModelPortfolioInput!) {
|
|
265
303
|
braCreateModelPortfolio(input: $input) {
|
|
266
|
-
${
|
|
267
|
-
allocations { ${
|
|
304
|
+
${_}
|
|
305
|
+
allocations { ${g} }
|
|
268
306
|
}
|
|
269
|
-
}`, { input: e },
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
307
|
+
}`, { input: e }, t)).braCreateModelPortfolio,
|
|
308
|
+
...l({
|
|
309
|
+
success: "Model portfolio created",
|
|
310
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.modelPortfolios })
|
|
311
|
+
})
|
|
312
|
+
});
|
|
313
|
+
}, B = (t = {}) => {
|
|
314
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
315
|
+
queryKey: [...u.goals, t],
|
|
316
|
+
queryFn: async () => (await s(`query BraListGoals($householdId: ID, $status: BraGoalStatus, $pagination: PaginationInput) {
|
|
276
317
|
braListGoals(householdId: $householdId, status: $status, pagination: $pagination) {
|
|
277
|
-
items { ${
|
|
318
|
+
items { ${y} }
|
|
278
319
|
pageInfo { cursor hasMore }
|
|
279
320
|
}
|
|
280
321
|
}`, {
|
|
281
322
|
householdId: t.householdId,
|
|
282
323
|
status: t.status,
|
|
283
|
-
pagination: t.pagination ??
|
|
284
|
-
},
|
|
324
|
+
pagination: t.pagination ?? d
|
|
325
|
+
}, n)).braListGoals
|
|
285
326
|
});
|
|
286
327
|
return {
|
|
287
|
-
...
|
|
288
|
-
data:
|
|
289
|
-
pageInfo:
|
|
328
|
+
...r,
|
|
329
|
+
data: r.data?.items ?? [],
|
|
330
|
+
pageInfo: r.data?.pageInfo
|
|
290
331
|
};
|
|
291
|
-
},
|
|
292
|
-
let { apiGatewayUrl:
|
|
293
|
-
return
|
|
294
|
-
queryKey:
|
|
332
|
+
}, V = (t) => {
|
|
333
|
+
let { apiGatewayUrl: n } = e();
|
|
334
|
+
return a({
|
|
335
|
+
queryKey: u.goal(t ?? ""),
|
|
295
336
|
enabled: !!t,
|
|
296
|
-
queryFn: async () => (await
|
|
337
|
+
queryFn: async () => (await s(`query BraGoal($id: ID!) {
|
|
297
338
|
braGoal(id: $id) {
|
|
298
|
-
${
|
|
299
|
-
fundings { ${
|
|
339
|
+
${y}
|
|
340
|
+
fundings { ${v} }
|
|
300
341
|
}
|
|
301
|
-
}`, { id: t },
|
|
342
|
+
}`, { id: t }, n)).braGoal
|
|
302
343
|
});
|
|
303
|
-
},
|
|
304
|
-
let { apiGatewayUrl:
|
|
305
|
-
queryKey:
|
|
344
|
+
}, H = (t) => {
|
|
345
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
346
|
+
queryKey: u.goalFundings(t ?? ""),
|
|
306
347
|
enabled: !!t,
|
|
307
|
-
queryFn: async () => (await
|
|
308
|
-
braListGoalFundings(goalId: $goalId) { ${
|
|
309
|
-
}`, { goalId: t },
|
|
348
|
+
queryFn: async () => (await s(`query BraListGoalFundings($goalId: ID!) {
|
|
349
|
+
braListGoalFundings(goalId: $goalId) { ${v} }
|
|
350
|
+
}`, { goalId: t }, n)).braListGoalFundings
|
|
310
351
|
});
|
|
311
352
|
return {
|
|
312
|
-
...
|
|
313
|
-
data:
|
|
353
|
+
...r,
|
|
354
|
+
data: r.data ?? []
|
|
314
355
|
};
|
|
315
|
-
}, V = () => {
|
|
316
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
317
|
-
return t({
|
|
318
|
-
mutationFn: async (e) => (await o(`mutation BraCreateGoal($input: BraCreateGoalInput!) {
|
|
319
|
-
braCreateGoal(input: $input) { ${g} }
|
|
320
|
-
}`, { input: e }, n)).braCreateGoal,
|
|
321
|
-
onSuccess: () => i.invalidateQueries({ queryKey: s.goals })
|
|
322
|
-
});
|
|
323
|
-
}, H = () => {
|
|
324
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
325
|
-
return t({
|
|
326
|
-
mutationFn: async (e) => (await o(`mutation BraUpdateGoal($id: ID!, $input: BraUpdateGoalInput!) {
|
|
327
|
-
braUpdateGoal(id: $id, input: $input) { ${g} }
|
|
328
|
-
}`, e, n)).braUpdateGoal,
|
|
329
|
-
onSuccess: (e) => {
|
|
330
|
-
i.invalidateQueries({ queryKey: s.goals }), i.invalidateQueries({ queryKey: s.goal(e.id) });
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
356
|
}, U = () => {
|
|
334
|
-
let { apiGatewayUrl:
|
|
335
|
-
return
|
|
336
|
-
mutationFn: async (e) => (await
|
|
337
|
-
|
|
357
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
358
|
+
return i({
|
|
359
|
+
mutationFn: async (e) => (await c(`mutation BraCreateGoal($input: BraCreateGoalInput!) {
|
|
360
|
+
braCreateGoal(input: $input) { ${y} }
|
|
361
|
+
}`, { input: e }, t)).braCreateGoal,
|
|
362
|
+
...l({
|
|
363
|
+
success: "Goal created",
|
|
364
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.goals })
|
|
365
|
+
})
|
|
338
366
|
});
|
|
339
367
|
}, W = () => {
|
|
340
|
-
let { apiGatewayUrl:
|
|
341
|
-
return
|
|
342
|
-
mutationFn: async (e) => (await
|
|
343
|
-
|
|
344
|
-
}`, e,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
368
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
369
|
+
return i({
|
|
370
|
+
mutationFn: async (e) => (await c(`mutation BraUpdateGoal($id: ID!, $input: BraUpdateGoalInput!) {
|
|
371
|
+
braUpdateGoal(id: $id, input: $input) { ${y} }
|
|
372
|
+
}`, e, t)).braUpdateGoal,
|
|
373
|
+
...l({
|
|
374
|
+
success: "Goal updated",
|
|
375
|
+
onSuccess: (e) => {
|
|
376
|
+
n.invalidateQueries({ queryKey: u.goals }), n.invalidateQueries({ queryKey: u.goal(e.id) });
|
|
377
|
+
}
|
|
378
|
+
})
|
|
348
379
|
});
|
|
349
380
|
}, G = () => {
|
|
350
|
-
let { apiGatewayUrl:
|
|
351
|
-
return
|
|
352
|
-
mutationFn: async (e) => (await
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
381
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
382
|
+
return i({
|
|
383
|
+
mutationFn: async (e) => (await c("mutation BraArchiveGoal($id: ID!) { braArchiveGoal(id: $id) }", { id: e }, t)).braArchiveGoal,
|
|
384
|
+
...l({
|
|
385
|
+
success: "Goal archived",
|
|
386
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.goals })
|
|
387
|
+
})
|
|
358
388
|
});
|
|
359
389
|
}, K = () => {
|
|
360
|
-
let { apiGatewayUrl:
|
|
361
|
-
return
|
|
362
|
-
mutationFn: async (e) => (await
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
390
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
391
|
+
return i({
|
|
392
|
+
mutationFn: async (e) => (await c(`mutation BraRecalcGoalProjection($id: ID!, $fundedAmount: Float!) {
|
|
393
|
+
braRecalcGoalProjection(id: $id, fundedAmount: $fundedAmount) { ${y} }
|
|
394
|
+
}`, e, t)).braRecalcGoalProjection,
|
|
395
|
+
...l({
|
|
396
|
+
success: "Projection recalculated",
|
|
397
|
+
onSuccess: (e) => {
|
|
398
|
+
n.invalidateQueries({ queryKey: u.goals }), n.invalidateQueries({ queryKey: u.goal(e.id) });
|
|
399
|
+
}
|
|
400
|
+
})
|
|
366
401
|
});
|
|
367
|
-
},
|
|
368
|
-
let { apiGatewayUrl:
|
|
369
|
-
|
|
370
|
-
|
|
402
|
+
}, ie = () => {
|
|
403
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
404
|
+
return i({
|
|
405
|
+
mutationFn: async (e) => (await c(`mutation BraLinkGoalFunding($input: BraLinkGoalFundingInput!) {
|
|
406
|
+
braLinkGoalFunding(input: $input) { ${v} }
|
|
407
|
+
}`, { input: e }, t)).braLinkGoalFunding,
|
|
408
|
+
...l({
|
|
409
|
+
success: "Funding linked",
|
|
410
|
+
onSuccess: (e) => {
|
|
411
|
+
n.invalidateQueries({ queryKey: u.goalFundings(e.goalId) }), n.invalidateQueries({ queryKey: u.goal(e.goalId) });
|
|
412
|
+
}
|
|
413
|
+
})
|
|
414
|
+
});
|
|
415
|
+
}, q = () => {
|
|
416
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
417
|
+
return i({
|
|
418
|
+
mutationFn: async (e) => (await c("mutation BraUnlinkGoalFunding($id: ID!) { braUnlinkGoalFunding(id: $id) }", { id: e }, t)).braUnlinkGoalFunding,
|
|
419
|
+
...l({
|
|
420
|
+
success: "Funding unlinked",
|
|
421
|
+
onSuccess: () => {
|
|
422
|
+
n.invalidateQueries({ queryKey: u.goals }), n.invalidateQueries({ queryKey: [...u.goals] }), n.invalidateQueries({ queryKey: ["brainyrich", "goal-fundings"] }), n.invalidateQueries({ queryKey: ["brainyrich", "goal"] });
|
|
423
|
+
}
|
|
424
|
+
})
|
|
425
|
+
});
|
|
426
|
+
}, J = (t = {}) => {
|
|
427
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
428
|
+
queryKey: [...u.households, t],
|
|
429
|
+
queryFn: async () => (await s(`query BraListHouseholds($status: BraHouseholdStatus, $pagination: PaginationInput) {
|
|
371
430
|
braListHouseholds(status: $status, pagination: $pagination) {
|
|
372
|
-
items { ${
|
|
431
|
+
items { ${b} }
|
|
373
432
|
pageInfo { cursor hasMore }
|
|
374
433
|
}
|
|
375
434
|
}`, {
|
|
376
435
|
status: t.status,
|
|
377
|
-
pagination: t.pagination ??
|
|
378
|
-
},
|
|
436
|
+
pagination: t.pagination ?? d
|
|
437
|
+
}, n)).braListHouseholds
|
|
379
438
|
});
|
|
380
439
|
return {
|
|
381
|
-
...
|
|
382
|
-
data:
|
|
383
|
-
pageInfo:
|
|
440
|
+
...r,
|
|
441
|
+
data: r.data?.items ?? [],
|
|
442
|
+
pageInfo: r.data?.pageInfo
|
|
384
443
|
};
|
|
385
|
-
},
|
|
386
|
-
let { apiGatewayUrl:
|
|
387
|
-
return
|
|
388
|
-
queryKey:
|
|
444
|
+
}, Y = (t) => {
|
|
445
|
+
let { apiGatewayUrl: n } = e();
|
|
446
|
+
return a({
|
|
447
|
+
queryKey: u.household(t ?? ""),
|
|
389
448
|
enabled: !!t,
|
|
390
|
-
queryFn: async () => (await
|
|
391
|
-
braHousehold(id: $id) { ${
|
|
392
|
-
}`, { id: t },
|
|
393
|
-
});
|
|
394
|
-
}, Y = () => {
|
|
395
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
396
|
-
return t({
|
|
397
|
-
mutationFn: async (e) => (await o(`mutation BraCreateHousehold($input: BraCreateHouseholdInput!) {
|
|
398
|
-
braCreateHousehold(input: $input) { ${_} }
|
|
399
|
-
}`, { input: e }, n)).braCreateHousehold,
|
|
400
|
-
onSuccess: () => i.invalidateQueries({ queryKey: s.households })
|
|
401
|
-
});
|
|
402
|
-
}, X = () => {
|
|
403
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
404
|
-
return t({
|
|
405
|
-
mutationFn: async (e) => (await o(`mutation BraUpdateHousehold($id: ID!, $input: BraUpdateHouseholdInput!) {
|
|
406
|
-
braUpdateHousehold(id: $id, input: $input) { ${_} }
|
|
407
|
-
}`, e, n)).braUpdateHousehold,
|
|
408
|
-
onSuccess: (e) => {
|
|
409
|
-
i.invalidateQueries({ queryKey: s.households }), i.invalidateQueries({ queryKey: s.household(e.id) });
|
|
410
|
-
}
|
|
449
|
+
queryFn: async () => (await s(`query BraHousehold($id: ID!) {
|
|
450
|
+
braHousehold(id: $id) { ${b} }
|
|
451
|
+
}`, { id: t }, n)).braHousehold
|
|
411
452
|
});
|
|
412
|
-
},
|
|
413
|
-
let { apiGatewayUrl:
|
|
414
|
-
return
|
|
415
|
-
mutationFn: async (e) => (await
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
453
|
+
}, ae = () => {
|
|
454
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
455
|
+
return i({
|
|
456
|
+
mutationFn: async (e) => (await c(`mutation BraCreateHousehold($input: BraCreateHouseholdInput!) {
|
|
457
|
+
braCreateHousehold(input: $input) { ${b} }
|
|
458
|
+
}`, { input: e }, t)).braCreateHousehold,
|
|
459
|
+
...l({
|
|
460
|
+
success: "Household created",
|
|
461
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.households })
|
|
462
|
+
})
|
|
463
|
+
});
|
|
464
|
+
}, oe = () => {
|
|
465
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
466
|
+
return i({
|
|
467
|
+
mutationFn: async (e) => (await c(`mutation BraUpdateHousehold($id: ID!, $input: BraUpdateHouseholdInput!) {
|
|
468
|
+
braUpdateHousehold(id: $id, input: $input) { ${b} }
|
|
469
|
+
}`, e, t)).braUpdateHousehold,
|
|
470
|
+
...l({
|
|
471
|
+
success: "Household updated",
|
|
472
|
+
onSuccess: (e) => {
|
|
473
|
+
n.invalidateQueries({ queryKey: u.households }), n.invalidateQueries({ queryKey: u.household(e.id) });
|
|
474
|
+
}
|
|
475
|
+
})
|
|
476
|
+
});
|
|
477
|
+
}, se = () => {
|
|
478
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
479
|
+
return i({
|
|
480
|
+
mutationFn: async (e) => (await c("mutation BraArchiveHousehold($id: ID!) { braArchiveHousehold(id: $id) }", { id: e }, t)).braArchiveHousehold,
|
|
481
|
+
...l({
|
|
482
|
+
success: "Household archived",
|
|
483
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.households })
|
|
484
|
+
})
|
|
485
|
+
});
|
|
486
|
+
}, ce = (t = {}) => {
|
|
487
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
488
|
+
queryKey: [...u.insights, t],
|
|
489
|
+
queryFn: async () => (await s(`query BraListInsights($severity: BraInsightSeverity, $status: BraInsightStatus, $subjectId: ID, $subjectType: String, $pagination: PaginationInput) {
|
|
422
490
|
braListInsights(severity: $severity, status: $status, subjectId: $subjectId, subjectType: $subjectType, pagination: $pagination) {
|
|
423
|
-
items { ${
|
|
491
|
+
items { ${x} }
|
|
424
492
|
pageInfo { cursor hasMore }
|
|
425
493
|
}
|
|
426
494
|
}`, {
|
|
@@ -428,116 +496,320 @@ var ee = () => {
|
|
|
428
496
|
status: t.status,
|
|
429
497
|
subjectId: t.subjectId,
|
|
430
498
|
subjectType: t.subjectType,
|
|
431
|
-
pagination: t.pagination ??
|
|
432
|
-
},
|
|
433
|
-
});
|
|
434
|
-
return {
|
|
435
|
-
...i,
|
|
436
|
-
data: i.data?.items ?? [],
|
|
437
|
-
pageInfo: i.data?.pageInfo
|
|
438
|
-
};
|
|
439
|
-
}, ne = () => {
|
|
440
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
441
|
-
return t({
|
|
442
|
-
mutationFn: async (e) => (await o(`mutation BraCreateInsight($input: BraCreateInsightInput!) {
|
|
443
|
-
braCreateInsight(input: $input) { ${v} }
|
|
444
|
-
}`, { input: e }, n)).braCreateInsight,
|
|
445
|
-
onSuccess: () => i.invalidateQueries({ queryKey: s.insights })
|
|
446
|
-
});
|
|
447
|
-
}, re = () => {
|
|
448
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
449
|
-
return t({
|
|
450
|
-
mutationFn: async (e) => (await o(`mutation BraAcknowledgeInsight($id: ID!) {
|
|
451
|
-
braAcknowledgeInsight(id: $id) { ${v} }
|
|
452
|
-
}`, { id: e }, n)).braAcknowledgeInsight,
|
|
453
|
-
onSuccess: (e) => {
|
|
454
|
-
i.invalidateQueries({ queryKey: s.insights }), i.invalidateQueries({ queryKey: s.insight(e.id) });
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
}, ie = () => {
|
|
458
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
459
|
-
return t({
|
|
460
|
-
mutationFn: async (e) => (await o(`mutation BraDismissInsight($id: ID!) {
|
|
461
|
-
braDismissInsight(id: $id) { ${v} }
|
|
462
|
-
}`, { id: e }, n)).braDismissInsight,
|
|
463
|
-
onSuccess: (e) => {
|
|
464
|
-
i.invalidateQueries({ queryKey: s.insights }), i.invalidateQueries({ queryKey: s.insight(e.id) });
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
}, ae = () => {
|
|
468
|
-
let { apiGatewayUrl: n } = e(), i = r();
|
|
469
|
-
return t({
|
|
470
|
-
mutationFn: async (e) => (await o(`mutation BraResolveInsight($id: ID!) {
|
|
471
|
-
braResolveInsight(id: $id) { ${v} }
|
|
472
|
-
}`, { id: e }, n)).braResolveInsight,
|
|
473
|
-
onSuccess: (e) => {
|
|
474
|
-
i.invalidateQueries({ queryKey: s.insights }), i.invalidateQueries({ queryKey: s.insight(e.id) });
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
}, oe = (t = {}) => {
|
|
478
|
-
let { apiGatewayUrl: r } = e(), i = n({
|
|
479
|
-
queryKey: [...s.transactions, t],
|
|
480
|
-
queryFn: async () => (await a(`query BraListTransactions($accountId: ID, $type: BraTransactionType, $pagination: PaginationInput) {
|
|
481
|
-
braListTransactions(accountId: $accountId, type: $type, pagination: $pagination) {
|
|
482
|
-
items { ${u} }
|
|
483
|
-
pageInfo { cursor hasMore }
|
|
484
|
-
}
|
|
485
|
-
}`, {
|
|
486
|
-
accountId: t.accountId,
|
|
487
|
-
type: t.type,
|
|
488
|
-
pagination: t.pagination ?? c
|
|
489
|
-
}, r)).braListTransactions
|
|
499
|
+
pagination: t.pagination ?? d
|
|
500
|
+
}, n)).braListInsights
|
|
490
501
|
});
|
|
491
502
|
return {
|
|
492
|
-
...
|
|
493
|
-
data:
|
|
494
|
-
pageInfo:
|
|
503
|
+
...r,
|
|
504
|
+
data: r.data?.items ?? [],
|
|
505
|
+
pageInfo: r.data?.pageInfo
|
|
495
506
|
};
|
|
496
|
-
},
|
|
497
|
-
let { apiGatewayUrl:
|
|
498
|
-
return
|
|
499
|
-
mutationFn: async (e) => (await
|
|
500
|
-
|
|
501
|
-
}`, { input: e },
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
507
|
+
}, le = () => {
|
|
508
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
509
|
+
return i({
|
|
510
|
+
mutationFn: async (e) => (await c(`mutation BraCreateInsight($input: BraCreateInsightInput!) {
|
|
511
|
+
braCreateInsight(input: $input) { ${x} }
|
|
512
|
+
}`, { input: e }, t)).braCreateInsight,
|
|
513
|
+
...l({
|
|
514
|
+
success: "Insight created",
|
|
515
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.insights })
|
|
516
|
+
})
|
|
517
|
+
});
|
|
518
|
+
}, ue = () => {
|
|
519
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
520
|
+
return i({
|
|
521
|
+
mutationFn: async (e) => (await c(`mutation BraAcknowledgeInsight($id: ID!) {
|
|
522
|
+
braAcknowledgeInsight(id: $id) { ${x} }
|
|
523
|
+
}`, { id: e }, t)).braAcknowledgeInsight,
|
|
524
|
+
...l({
|
|
525
|
+
success: "Insight acknowledged",
|
|
526
|
+
onSuccess: (e) => {
|
|
527
|
+
n.invalidateQueries({ queryKey: u.insights }), n.invalidateQueries({ queryKey: u.insight(e.id) });
|
|
528
|
+
}
|
|
529
|
+
})
|
|
530
|
+
});
|
|
531
|
+
}, de = () => {
|
|
532
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
533
|
+
return i({
|
|
534
|
+
mutationFn: async (e) => (await c(`mutation BraDismissInsight($id: ID!) {
|
|
535
|
+
braDismissInsight(id: $id) { ${x} }
|
|
536
|
+
}`, { id: e }, t)).braDismissInsight,
|
|
537
|
+
...l({
|
|
538
|
+
success: "Insight dismissed",
|
|
539
|
+
onSuccess: (e) => {
|
|
540
|
+
n.invalidateQueries({ queryKey: u.insights }), n.invalidateQueries({ queryKey: u.insight(e.id) });
|
|
541
|
+
}
|
|
542
|
+
})
|
|
543
|
+
});
|
|
544
|
+
}, fe = () => {
|
|
545
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
546
|
+
return i({
|
|
547
|
+
mutationFn: async (e) => (await c(`mutation BraResolveInsight($id: ID!) {
|
|
548
|
+
braResolveInsight(id: $id) { ${x} }
|
|
549
|
+
}`, { id: e }, t)).braResolveInsight,
|
|
550
|
+
...l({
|
|
551
|
+
success: "Insight resolved",
|
|
552
|
+
onSuccess: (e) => {
|
|
553
|
+
n.invalidateQueries({ queryKey: u.insights }), n.invalidateQueries({ queryKey: u.insight(e.id) });
|
|
554
|
+
}
|
|
555
|
+
})
|
|
556
|
+
});
|
|
557
|
+
}, pe = () => {
|
|
558
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
559
|
+
return i({
|
|
560
|
+
mutationFn: async (e) => (await c(`mutation BraRecordTransaction($input: BraCreateTransactionInput!) {
|
|
561
|
+
braRecordTransaction(input: $input) { ${p} }
|
|
562
|
+
}`, { input: e }, t)).braRecordTransaction,
|
|
563
|
+
...l({
|
|
564
|
+
success: "Transaction recorded",
|
|
565
|
+
onSuccess: (e) => {
|
|
566
|
+
n.invalidateQueries({ queryKey: u.transactions }), n.invalidateQueries({ queryKey: u.account(e.accountId) }), n.invalidateQueries({ queryKey: u.netWorth });
|
|
567
|
+
}
|
|
568
|
+
})
|
|
569
|
+
});
|
|
570
|
+
}, me = (t = {}) => {
|
|
571
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
572
|
+
queryKey: [...u.rebalances, t],
|
|
573
|
+
queryFn: async () => (await s(`query BraListRebalanceProposals($householdId: ID, $portfolioId: ID, $status: BraRebalanceStatus) {
|
|
510
574
|
braListRebalanceProposals(householdId: $householdId, portfolioId: $portfolioId, status: $status) {
|
|
511
|
-
${
|
|
575
|
+
${S}
|
|
512
576
|
}
|
|
513
577
|
}`, {
|
|
514
578
|
householdId: t.householdId,
|
|
515
579
|
portfolioId: t.portfolioId,
|
|
516
580
|
status: t.status
|
|
517
|
-
},
|
|
581
|
+
}, n)).braListRebalanceProposals
|
|
518
582
|
});
|
|
519
583
|
return {
|
|
520
|
-
...
|
|
521
|
-
data:
|
|
584
|
+
...r,
|
|
585
|
+
data: r.data ?? []
|
|
522
586
|
};
|
|
523
|
-
},
|
|
524
|
-
let { apiGatewayUrl:
|
|
525
|
-
return
|
|
526
|
-
mutationFn: async (e) => (await
|
|
527
|
-
braCreateRebalanceProposal(input: $input) { ${
|
|
528
|
-
}`, { input: e },
|
|
529
|
-
|
|
587
|
+
}, he = () => {
|
|
588
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
589
|
+
return i({
|
|
590
|
+
mutationFn: async (e) => (await c(`mutation BraCreateRebalanceProposal($input: BraCreateRebalanceProposalInput!) {
|
|
591
|
+
braCreateRebalanceProposal(input: $input) { ${S} }
|
|
592
|
+
}`, { input: e }, t)).braCreateRebalanceProposal,
|
|
593
|
+
...l({
|
|
594
|
+
success: "Rebalance proposal created",
|
|
595
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.rebalances })
|
|
596
|
+
})
|
|
597
|
+
});
|
|
598
|
+
}, ge = () => {
|
|
599
|
+
let { apiGatewayUrl: t } = e(), n = o();
|
|
600
|
+
return i({
|
|
601
|
+
mutationFn: async (e) => (await c(`mutation BraTransitionRebalanceProposal($id: ID!, $status: BraRebalanceStatus!) {
|
|
602
|
+
braTransitionRebalanceProposal(id: $id, status: $status) { ${S} }
|
|
603
|
+
}`, e, t)).braTransitionRebalanceProposal,
|
|
604
|
+
...l({
|
|
605
|
+
success: (e) => `Rebalance ${e.status.toLowerCase()}`,
|
|
606
|
+
onSuccess: () => n.invalidateQueries({ queryKey: u.rebalances })
|
|
607
|
+
})
|
|
530
608
|
});
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
609
|
+
};
|
|
610
|
+
function X(t) {
|
|
611
|
+
let { apiGatewayUrl: n } = e(), i = t.pageSize ?? d.limit ?? 100, a = r({
|
|
612
|
+
queryKey: t.queryKey,
|
|
613
|
+
enabled: t.enabled ?? !0,
|
|
614
|
+
initialPageParam: null,
|
|
615
|
+
queryFn: async ({ pageParam: e }) => {
|
|
616
|
+
let r = e ? {
|
|
617
|
+
limit: i,
|
|
618
|
+
cursor: e
|
|
619
|
+
} : { limit: i }, a = await s(t.query, t.buildVariables(r), n);
|
|
620
|
+
return t.select(a);
|
|
621
|
+
},
|
|
622
|
+
getNextPageParam: (e) => e.pageInfo.hasMore && e.pageInfo.cursor ? e.pageInfo.cursor : void 0
|
|
623
|
+
});
|
|
624
|
+
return {
|
|
625
|
+
items: (a.data?.pages ?? []).flatMap((e) => e.items),
|
|
626
|
+
hasMore: !!a.hasNextPage,
|
|
627
|
+
loadMore: () => {
|
|
628
|
+
a.fetchNextPage();
|
|
629
|
+
},
|
|
630
|
+
isLoading: a.isLoading,
|
|
631
|
+
isFetchingNextPage: a.isFetchingNextPage,
|
|
632
|
+
isError: a.isError,
|
|
633
|
+
refetch: () => {
|
|
634
|
+
a.refetch();
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
var _e = (e = {}) => X({
|
|
639
|
+
queryKey: [
|
|
640
|
+
...u.accounts,
|
|
641
|
+
"paged",
|
|
642
|
+
e
|
|
643
|
+
],
|
|
644
|
+
query: `query BraListAccounts($householdId: ID, $status: BraAccountStatus, $pagination: PaginationInput) {
|
|
645
|
+
braListAccounts(householdId: $householdId, status: $status, pagination: $pagination) {
|
|
646
|
+
items { ${m} }
|
|
647
|
+
pageInfo { cursor hasMore }
|
|
648
|
+
}
|
|
649
|
+
}`,
|
|
650
|
+
buildVariables: (t) => ({
|
|
651
|
+
householdId: e.householdId,
|
|
652
|
+
status: e.status,
|
|
653
|
+
pagination: t
|
|
654
|
+
}),
|
|
655
|
+
select: (e) => e.braListAccounts
|
|
656
|
+
}), ve = (e = {}) => X({
|
|
657
|
+
queryKey: [
|
|
658
|
+
...u.portfolios,
|
|
659
|
+
"paged",
|
|
660
|
+
e
|
|
661
|
+
],
|
|
662
|
+
query: `query BraListPortfolios($householdId: ID, $status: BraPortfolioStatus, $pagination: PaginationInput) {
|
|
663
|
+
braListPortfolios(householdId: $householdId, status: $status, pagination: $pagination) {
|
|
664
|
+
items { ${h} }
|
|
665
|
+
pageInfo { cursor hasMore }
|
|
666
|
+
}
|
|
667
|
+
}`,
|
|
668
|
+
buildVariables: (t) => ({
|
|
669
|
+
householdId: e.householdId,
|
|
670
|
+
status: e.status,
|
|
671
|
+
pagination: t
|
|
672
|
+
}),
|
|
673
|
+
select: (e) => e.braListPortfolios
|
|
674
|
+
}), Z = (e = {}) => X({
|
|
675
|
+
queryKey: [
|
|
676
|
+
...u.goals,
|
|
677
|
+
"paged",
|
|
678
|
+
e
|
|
679
|
+
],
|
|
680
|
+
query: `query BraListGoals($householdId: ID, $status: BraGoalStatus, $pagination: PaginationInput) {
|
|
681
|
+
braListGoals(householdId: $householdId, status: $status, pagination: $pagination) {
|
|
682
|
+
items { ${y} }
|
|
683
|
+
pageInfo { cursor hasMore }
|
|
684
|
+
}
|
|
685
|
+
}`,
|
|
686
|
+
buildVariables: (t) => ({
|
|
687
|
+
householdId: e.householdId,
|
|
688
|
+
status: e.status,
|
|
689
|
+
pagination: t
|
|
690
|
+
}),
|
|
691
|
+
select: (e) => e.braListGoals
|
|
692
|
+
}), ye = (e = {}) => X({
|
|
693
|
+
queryKey: [
|
|
694
|
+
...u.households,
|
|
695
|
+
"paged",
|
|
696
|
+
e
|
|
697
|
+
],
|
|
698
|
+
query: `query BraListHouseholds($status: BraHouseholdStatus, $pagination: PaginationInput) {
|
|
699
|
+
braListHouseholds(status: $status, pagination: $pagination) {
|
|
700
|
+
items { ${b} }
|
|
701
|
+
pageInfo { cursor hasMore }
|
|
702
|
+
}
|
|
703
|
+
}`,
|
|
704
|
+
buildVariables: (t) => ({
|
|
705
|
+
status: e.status,
|
|
706
|
+
pagination: t
|
|
707
|
+
}),
|
|
708
|
+
select: (e) => e.braListHouseholds
|
|
709
|
+
}), be = (e = {}) => X({
|
|
710
|
+
queryKey: [
|
|
711
|
+
...u.insights,
|
|
712
|
+
"paged",
|
|
713
|
+
e
|
|
714
|
+
],
|
|
715
|
+
query: `query BraListInsights($severity: BraInsightSeverity, $status: BraInsightStatus, $subjectId: ID, $subjectType: String, $pagination: PaginationInput) {
|
|
716
|
+
braListInsights(severity: $severity, status: $status, subjectId: $subjectId, subjectType: $subjectType, pagination: $pagination) {
|
|
717
|
+
items { ${x} }
|
|
718
|
+
pageInfo { cursor hasMore }
|
|
719
|
+
}
|
|
720
|
+
}`,
|
|
721
|
+
buildVariables: (t) => ({
|
|
722
|
+
severity: e.severity,
|
|
723
|
+
status: e.status,
|
|
724
|
+
subjectId: e.subjectId,
|
|
725
|
+
subjectType: e.subjectType,
|
|
726
|
+
pagination: t
|
|
727
|
+
}),
|
|
728
|
+
select: (e) => e.braListInsights
|
|
729
|
+
}), xe = (e = {}) => X({
|
|
730
|
+
queryKey: [
|
|
731
|
+
...u.transactions,
|
|
732
|
+
"paged",
|
|
733
|
+
e
|
|
734
|
+
],
|
|
735
|
+
query: `query BraListTransactions($accountId: ID, $type: BraTransactionType, $pagination: PaginationInput) {
|
|
736
|
+
braListTransactions(accountId: $accountId, type: $type, pagination: $pagination) {
|
|
737
|
+
items { ${p} }
|
|
738
|
+
pageInfo { cursor hasMore }
|
|
739
|
+
}
|
|
740
|
+
}`,
|
|
741
|
+
buildVariables: (t) => ({
|
|
742
|
+
accountId: e.accountId,
|
|
743
|
+
type: e.type,
|
|
744
|
+
pagination: t
|
|
745
|
+
}),
|
|
746
|
+
select: (e) => e.braListTransactions
|
|
747
|
+
});
|
|
748
|
+
async function Q(e, t = 200, n = 500) {
|
|
749
|
+
let r = [], i;
|
|
750
|
+
for (let a = 0; a < n; a++) {
|
|
751
|
+
let n = await e(i ? {
|
|
752
|
+
limit: t,
|
|
753
|
+
cursor: i
|
|
754
|
+
} : { limit: t });
|
|
755
|
+
if (r.push(...n.items), !n.pageInfo.hasMore || !n.pageInfo.cursor) break;
|
|
756
|
+
i = n.pageInfo.cursor;
|
|
757
|
+
}
|
|
758
|
+
return r;
|
|
759
|
+
}
|
|
760
|
+
async function Se(e, t = {}, n = 200) {
|
|
761
|
+
return Q(async (n) => (await s(`query BraListTransactions($accountId: ID, $type: BraTransactionType, $pagination: PaginationInput) {
|
|
762
|
+
braListTransactions(accountId: $accountId, type: $type, pagination: $pagination) {
|
|
763
|
+
items { ${p} }
|
|
764
|
+
pageInfo { cursor hasMore }
|
|
765
|
+
}
|
|
766
|
+
}`, {
|
|
767
|
+
accountId: t.accountId,
|
|
768
|
+
type: t.type,
|
|
769
|
+
pagination: n
|
|
770
|
+
}, e)).braListTransactions, n);
|
|
771
|
+
}
|
|
772
|
+
var Ce = (t = {}) => {
|
|
773
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
774
|
+
queryKey: [
|
|
775
|
+
...u.transactions,
|
|
776
|
+
"all",
|
|
777
|
+
t
|
|
778
|
+
],
|
|
779
|
+
queryFn: () => Se(n, t)
|
|
538
780
|
});
|
|
781
|
+
return {
|
|
782
|
+
...r,
|
|
783
|
+
data: r.data ?? []
|
|
784
|
+
};
|
|
785
|
+
};
|
|
786
|
+
async function $(e, t = {}, n = 200) {
|
|
787
|
+
return Q(async (n) => (await s(`query BraListAccounts($householdId: ID, $status: BraAccountStatus, $pagination: PaginationInput) {
|
|
788
|
+
braListAccounts(householdId: $householdId, status: $status, pagination: $pagination) {
|
|
789
|
+
items { ${m} }
|
|
790
|
+
pageInfo { cursor hasMore }
|
|
791
|
+
}
|
|
792
|
+
}`, {
|
|
793
|
+
householdId: t.householdId,
|
|
794
|
+
status: t.status,
|
|
795
|
+
pagination: n
|
|
796
|
+
}, e)).braListAccounts, n);
|
|
797
|
+
}
|
|
798
|
+
var we = (t = {}) => {
|
|
799
|
+
let { apiGatewayUrl: n } = e(), r = a({
|
|
800
|
+
queryKey: [
|
|
801
|
+
...u.accounts,
|
|
802
|
+
"all",
|
|
803
|
+
t
|
|
804
|
+
],
|
|
805
|
+
queryFn: () => $(n, t)
|
|
806
|
+
});
|
|
807
|
+
return {
|
|
808
|
+
...r,
|
|
809
|
+
data: r.data ?? []
|
|
810
|
+
};
|
|
539
811
|
};
|
|
540
812
|
//#endregion
|
|
541
|
-
export {
|
|
813
|
+
export { $ as fetchAllAccounts, w as useAccount, C as useAccounts, ue as useAcknowledgeInsight, we as useAllAccounts, Ce as useAllTransactions, D as useArchiveAccount, G as useArchiveGoal, se as useArchiveHousehold, M as useArchivePortfolio, T as useCreateAccount, U as useCreateGoal, P as useCreateHolding, ae as useCreateHousehold, le as useCreateInsight, z as useCreateModelPortfolio, A as useCreatePortfolio, he as useCreateRebalanceProposal, I as useDeleteHolding, de as useDismissInsight, V as useGoal, H as useGoalFundings, B as useGoals, N as useHoldings, Y as useHousehold, J as useHouseholds, ce as useInsights, ie as useLinkGoalFunding, R as useModelPortfolio, L as useModelPortfolios, re as useNetWorthSummary, _e as usePagedAccounts, Z as usePagedGoals, ye as usePagedHouseholds, be as usePagedInsights, ve as usePagedPortfolios, xe as usePagedTransactions, k as usePortfolio, O as usePortfolios, me as useRebalanceProposals, K as useRecalcGoalProjection, pe as useRecordTransaction, fe as useResolveInsight, ge as useTransitionRebalanceProposal, q as useUnlinkGoalFunding, E as useUpdateAccount, W as useUpdateGoal, F as useUpdateHolding, oe as useUpdateHousehold, j as useUpdatePortfolio };
|
|
542
814
|
|
|
543
815
|
//# sourceMappingURL=useBrainyRichApi.js.map
|