@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.
Files changed (47) hide show
  1. package/dist/brainyrich/BrainyRichRoot.js +13 -13
  2. package/dist/brainyrich/components/ActorName.js +38 -0
  3. package/dist/brainyrich/components/ActorName.js.map +1 -0
  4. package/dist/brainyrich/components/ConfirmDialog.js +25 -0
  5. package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
  6. package/dist/brainyrich/components/LoadMore.js +24 -0
  7. package/dist/brainyrich/components/LoadMore.js.map +1 -0
  8. package/dist/brainyrich/components/index.js +5 -0
  9. package/dist/brainyrich/components/notify.js +38 -0
  10. package/dist/brainyrich/components/notify.js.map +1 -0
  11. package/dist/brainyrich/components/pickers.js +232 -0
  12. package/dist/brainyrich/components/pickers.js.map +1 -0
  13. package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
  14. package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
  15. package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
  16. package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
  17. package/dist/brainyrich/components/reuse/TagField.js +206 -0
  18. package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
  19. package/dist/brainyrich/components/reuse/transport.js +24 -0
  20. package/dist/brainyrich/components/reuse/transport.js.map +1 -0
  21. package/dist/brainyrich/hooks/useBrainyRichApi.js +644 -372
  22. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
  23. package/dist/brainyrich/pages/AccountsPage.js +346 -293
  24. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  25. package/dist/brainyrich/pages/AiAssistantPage.js +339 -320
  26. package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
  27. package/dist/brainyrich/pages/AnalyticsPage.js +178 -164
  28. package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
  29. package/dist/brainyrich/pages/DashboardPage.js +195 -169
  30. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  31. package/dist/brainyrich/pages/FamilyPage.js +247 -198
  32. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  33. package/dist/brainyrich/pages/GoalsPage.js +478 -442
  34. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  35. package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
  36. package/dist/brainyrich/pages/PortfoliosPage.js +438 -396
  37. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  38. package/dist/brainyrich/pages/ReportsPage.js +246 -213
  39. package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
  40. package/dist/brainyrich/pages/RiskPage.js +321 -173
  41. package/dist/brainyrich/pages/RiskPage.js.map +1 -1
  42. package/dist/brainyrich/pages/TaxPage.js +258 -225
  43. package/dist/brainyrich/pages/TaxPage.js.map +1 -1
  44. package/dist/brainyrich/pages/_shared.js.map +1 -1
  45. package/dist/node_modules/sonner/dist/index.js +163 -0
  46. package/dist/node_modules/sonner/dist/index.js.map +1 -0
  47. package/package.json +3 -2
@@ -1,25 +1,36 @@
1
1
  import { useBrainyRich as e } from "../providers/BrainyRichProvider.js";
2
- import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
3
- import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
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 ee = () => {
6
+ var te = () => {
6
7
  let e = globalThis;
7
8
  e.__graphqlFetchResponseCache?.clear(), e.__graphqlFetchPendingResponses?.clear(), e.__boffGraphQLResponseCache?.clear();
8
- }, a = async (e, t, n) => {
9
- let r = await i({
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
- if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
17
- if (!r.data) throw Error("GraphQL response did not include data");
18
- return r.data;
19
- }, o = async (e, t, n) => {
20
- let r = await a(e, t, n);
21
- return ee(), r;
22
- }, s = {
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
- }, c = { limit: 100 }, l = "\n id workspaceId accountId portfolioId symbol name assetClass quantity lastPrice\n costBasis marketValue currency asOf createdAt updatedAt\n", u = "\n id workspaceId accountId holdingId type symbol quantity price amount fee currency\n tradeDate settleDate notes createdAt updatedAt\n", d = "\n id workspaceId ownerId householdId name type status institution accountMask\n cashBalance currency isManual createdAt updatedAt\n", f = "\n id workspaceId ownerId householdId name description status baseCurrency\n modelPortfolioId driftThresholdPct targetAllocation tags createdAt updatedAt\n", p = "\n id workspaceId modelPortfolioId assetClass targetPct createdAt updatedAt\n", m = "\n id workspaceId name description riskProfile baseCurrency isActive createdAt updatedAt\n", h = "\n id workspaceId goalId accountId allocationPct fixedAmount createdAt updatedAt\n", g = "\n id workspaceId ownerId householdId name type status projection targetAmount\n targetDate monthlyContribution priority currency notes tags createdAt updatedAt\n", _ = "\n id workspaceId name status riskProfile advisorId aum currency primaryContactName\n primaryContactEmail notes tags createdAt updatedAt\n", v = "\n id workspaceId ownerId type severity status title detail metrics subjectId\n subjectType acknowledgedById resolvedAt createdAt updatedAt\n", y = "\n id workspaceId portfolioId householdId status driftPct rationale trades\n proposedById approvedById executedAt createdAt updatedAt\n", b = "\n workspaceId ownerId totalNetWorth totalMarketValue totalCash accountCount currency\n byAssetClass { assetClass marketValue }\n", x = (t) => {
70
- let { apiGatewayUrl: r } = e();
71
- return n({
72
- queryKey: [...s.netWorth, t ?? "me"],
73
- queryFn: async () => (await a(`query BraNetWorthSummary($ownerId: ID) {
74
- braNetWorthSummary(ownerId: $ownerId) { ${b} }
75
- }`, { ownerId: t }, r)).braNetWorthSummary
76
- });
77
- }, S = (t = {}) => {
78
- let { apiGatewayUrl: r } = e(), i = n({
79
- queryKey: [...s.accounts, t],
80
- queryFn: async () => (await a(`query BraListAccounts($householdId: ID, $status: BraAccountStatus, $pagination: PaginationInput) {
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 { ${d} }
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 ?? c
89
- }, r)).braListAccounts
99
+ pagination: t.pagination ?? d
100
+ }, n)).braListAccounts
90
101
  });
91
102
  return {
92
- ...i,
93
- data: i.data?.items ?? [],
94
- pageInfo: i.data?.pageInfo
103
+ ...r,
104
+ data: r.data?.items ?? [],
105
+ pageInfo: r.data?.pageInfo
95
106
  };
96
- }, C = (t) => {
97
- let { apiGatewayUrl: r } = e();
98
- return n({
99
- queryKey: s.account(t ?? ""),
107
+ }, w = (t) => {
108
+ let { apiGatewayUrl: n } = e();
109
+ return a({
110
+ queryKey: u.account(t ?? ""),
100
111
  enabled: !!t,
101
- queryFn: async () => (await a(`query BraAccount($id: ID!) {
112
+ queryFn: async () => (await s(`query BraAccount($id: ID!) {
102
113
  braAccount(id: $id) {
103
- ${d}
104
- holdings { ${l} }
105
- transactions { ${u} }
114
+ ${m}
115
+ holdings { ${f} }
116
+ transactions { ${p} }
106
117
  }
107
- }`, { id: t }, r)).braAccount
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: n } = e(), i = r();
121
- return t({
122
- mutationFn: async (e) => (await o(`mutation BraUpdateAccount($id: ID!, $input: BraUpdateAccountInput!) {
123
- braUpdateAccount(id: $id, input: $input) { ${d} }
124
- }`, e, n)).braUpdateAccount,
125
- onSuccess: (e) => {
126
- i.invalidateQueries({ queryKey: s.accounts }), i.invalidateQueries({ queryKey: s.account(e.id) }), i.invalidateQueries({ queryKey: s.netWorth });
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: n } = e(), i = r();
131
- return t({
132
- mutationFn: async (e) => (await o("mutation BraArchiveAccount($id: ID!) { braArchiveAccount(id: $id) }", { id: e }, n)).braArchiveAccount,
133
- onSuccess: () => {
134
- i.invalidateQueries({ queryKey: s.accounts }), i.invalidateQueries({ queryKey: s.netWorth });
135
- }
136
- });
137
- }, D = (t = {}) => {
138
- let { apiGatewayUrl: r } = e(), i = n({
139
- queryKey: [...s.portfolios, t],
140
- queryFn: async () => (await a(`query BraListPortfolios($householdId: ID, $status: BraPortfolioStatus, $pagination: PaginationInput) {
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 { ${f} }
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 ?? c
149
- }, r)).braListPortfolios
168
+ pagination: t.pagination ?? d
169
+ }, n)).braListPortfolios
150
170
  });
151
171
  return {
152
- ...i,
153
- data: i.data?.items ?? [],
154
- pageInfo: i.data?.pageInfo
172
+ ...r,
173
+ data: r.data?.items ?? [],
174
+ pageInfo: r.data?.pageInfo
155
175
  };
156
- }, O = (t) => {
157
- let { apiGatewayUrl: r } = e();
158
- return n({
159
- queryKey: s.portfolio(t ?? ""),
176
+ }, k = (t) => {
177
+ let { apiGatewayUrl: n } = e();
178
+ return a({
179
+ queryKey: u.portfolio(t ?? ""),
160
180
  enabled: !!t,
161
- queryFn: async () => (await a(`query BraPortfolio($id: ID!) {
181
+ queryFn: async () => (await s(`query BraPortfolio($id: ID!) {
162
182
  braPortfolio(id: $id) {
163
- ${f}
164
- holdings { ${l} }
183
+ ${h}
184
+ holdings { ${f} }
165
185
  }
166
- }`, { id: t }, r)).braPortfolio
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: n } = e(), i = r();
178
- return t({
179
- mutationFn: async (e) => (await o(`mutation BraUpdatePortfolio($id: ID!, $input: BraUpdatePortfolioInput!) {
180
- braUpdatePortfolio(id: $id, input: $input) { ${f} }
181
- }`, e, n)).braUpdatePortfolio,
182
- onSuccess: (e) => {
183
- i.invalidateQueries({ queryKey: s.portfolios }), i.invalidateQueries({ queryKey: s.portfolio(e.id) });
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: n } = e(), i = r();
188
- return t({
189
- mutationFn: async (e) => (await o("mutation BraArchivePortfolio($id: ID!) { braArchivePortfolio(id: $id) }", { id: e }, n)).braArchivePortfolio,
190
- onSuccess: () => i.invalidateQueries({ queryKey: s.portfolios })
191
- });
192
- }, M = (t) => {
193
- let { apiGatewayUrl: r } = e(), i = n({
194
- queryKey: [...s.holdings, t],
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 a(`query BraListHoldings($accountId: ID, $portfolioId: ID) {
197
- braListHoldings(accountId: $accountId, portfolioId: $portfolioId) { ${l} }
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
- }, r)).braListHoldings
230
+ }, n)).braListHoldings
202
231
  });
203
232
  return {
204
- ...i,
205
- data: i.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: n } = e(), i = r();
219
- return t({
220
- mutationFn: async (e) => (await o(`mutation BraUpdateHolding($id: ID!, $input: BraUpdateHoldingInput!) {
221
- braUpdateHolding(id: $id, input: $input) { ${l} }
222
- }`, e, n)).braUpdateHolding,
223
- onSuccess: (e) => {
224
- 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 });
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: n } = e(), i = r();
229
- return t({
230
- mutationFn: async (e) => (await o("mutation BraDeleteHolding($id: ID!) { braDeleteHolding(id: $id) }", { id: e }, n)).braDeleteHolding,
231
- onSuccess: () => {
232
- i.invalidateQueries({ queryKey: s.holdings }), i.invalidateQueries({ queryKey: s.accounts }), i.invalidateQueries({ queryKey: s.portfolios }), i.invalidateQueries({ queryKey: s.netWorth });
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(), r = n({
237
- queryKey: s.modelPortfolios,
238
- queryFn: async () => (await a(`query BraListModelPortfolios {
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
- ${m}
241
- allocations { ${p} }
278
+ ${_}
279
+ allocations { ${g} }
242
280
  }
243
281
  }`, {}, t)).braListModelPortfolios
244
282
  });
245
283
  return {
246
- ...r,
247
- data: r.data ?? []
284
+ ...n,
285
+ data: n.data ?? []
248
286
  };
249
- }, L = (t) => {
250
- let { apiGatewayUrl: r } = e();
251
- return n({
252
- queryKey: s.modelPortfolio(t ?? ""),
287
+ }, R = (t) => {
288
+ let { apiGatewayUrl: n } = e();
289
+ return a({
290
+ queryKey: u.modelPortfolio(t ?? ""),
253
291
  enabled: !!t,
254
- queryFn: async () => (await a(`query BraModelPortfolio($id: ID!) {
292
+ queryFn: async () => (await s(`query BraModelPortfolio($id: ID!) {
255
293
  braModelPortfolio(id: $id) {
256
- ${m}
257
- allocations { ${p} }
294
+ ${_}
295
+ allocations { ${g} }
258
296
  }
259
- }`, { id: t }, r)).braModelPortfolio
297
+ }`, { id: t }, n)).braModelPortfolio
260
298
  });
261
- }, R = () => {
262
- let { apiGatewayUrl: n } = e(), i = r();
263
- return t({
264
- mutationFn: async (e) => (await o(`mutation BraCreateModelPortfolio($input: BraCreateModelPortfolioInput!) {
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
- ${m}
267
- allocations { ${p} }
304
+ ${_}
305
+ allocations { ${g} }
268
306
  }
269
- }`, { input: e }, n)).braCreateModelPortfolio,
270
- onSuccess: () => i.invalidateQueries({ queryKey: s.modelPortfolios })
271
- });
272
- }, z = (t = {}) => {
273
- let { apiGatewayUrl: r } = e(), i = n({
274
- queryKey: [...s.goals, t],
275
- queryFn: async () => (await a(`query BraListGoals($householdId: ID, $status: BraGoalStatus, $pagination: PaginationInput) {
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 { ${g} }
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 ?? c
284
- }, r)).braListGoals
324
+ pagination: t.pagination ?? d
325
+ }, n)).braListGoals
285
326
  });
286
327
  return {
287
- ...i,
288
- data: i.data?.items ?? [],
289
- pageInfo: i.data?.pageInfo
328
+ ...r,
329
+ data: r.data?.items ?? [],
330
+ pageInfo: r.data?.pageInfo
290
331
  };
291
- }, te = (t) => {
292
- let { apiGatewayUrl: r } = e();
293
- return n({
294
- queryKey: s.goal(t ?? ""),
332
+ }, V = (t) => {
333
+ let { apiGatewayUrl: n } = e();
334
+ return a({
335
+ queryKey: u.goal(t ?? ""),
295
336
  enabled: !!t,
296
- queryFn: async () => (await a(`query BraGoal($id: ID!) {
337
+ queryFn: async () => (await s(`query BraGoal($id: ID!) {
297
338
  braGoal(id: $id) {
298
- ${g}
299
- fundings { ${h} }
339
+ ${y}
340
+ fundings { ${v} }
300
341
  }
301
- }`, { id: t }, r)).braGoal
342
+ }`, { id: t }, n)).braGoal
302
343
  });
303
- }, B = (t) => {
304
- let { apiGatewayUrl: r } = e(), i = n({
305
- queryKey: s.goalFundings(t ?? ""),
344
+ }, H = (t) => {
345
+ let { apiGatewayUrl: n } = e(), r = a({
346
+ queryKey: u.goalFundings(t ?? ""),
306
347
  enabled: !!t,
307
- queryFn: async () => (await a(`query BraListGoalFundings($goalId: ID!) {
308
- braListGoalFundings(goalId: $goalId) { ${h} }
309
- }`, { goalId: t }, r)).braListGoalFundings
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
- ...i,
313
- data: i.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: n } = e(), i = r();
335
- return t({
336
- mutationFn: async (e) => (await o("mutation BraArchiveGoal($id: ID!) { braArchiveGoal(id: $id) }", { id: e }, n)).braArchiveGoal,
337
- onSuccess: () => i.invalidateQueries({ queryKey: s.goals })
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: n } = e(), i = r();
341
- return t({
342
- mutationFn: async (e) => (await o(`mutation BraRecalcGoalProjection($id: ID!, $fundedAmount: Float!) {
343
- braRecalcGoalProjection(id: $id, fundedAmount: $fundedAmount) { ${g} }
344
- }`, e, n)).braRecalcGoalProjection,
345
- onSuccess: (e) => {
346
- i.invalidateQueries({ queryKey: s.goals }), i.invalidateQueries({ queryKey: s.goal(e.id) });
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: n } = e(), i = r();
351
- return t({
352
- mutationFn: async (e) => (await o(`mutation BraLinkGoalFunding($input: BraLinkGoalFundingInput!) {
353
- braLinkGoalFunding(input: $input) { ${h} }
354
- }`, { input: e }, n)).braLinkGoalFunding,
355
- onSuccess: (e) => {
356
- i.invalidateQueries({ queryKey: s.goalFundings(e.goalId) }), i.invalidateQueries({ queryKey: s.goal(e.goalId) });
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: n } = e(), i = r();
361
- return t({
362
- mutationFn: async (e) => (await o("mutation BraUnlinkGoalFunding($id: ID!) { braUnlinkGoalFunding(id: $id) }", { id: e }, n)).braUnlinkGoalFunding,
363
- onSuccess: () => {
364
- i.invalidateQueries({ queryKey: s.goals }), i.invalidateQueries({ queryKey: [...s.goals] }), i.invalidateQueries({ queryKey: ["brainyrich", "goal-fundings"] }), i.invalidateQueries({ queryKey: ["brainyrich", "goal"] });
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
- }, q = (t = {}) => {
368
- let { apiGatewayUrl: r } = e(), i = n({
369
- queryKey: [...s.households, t],
370
- queryFn: async () => (await a(`query BraListHouseholds($status: BraHouseholdStatus, $pagination: PaginationInput) {
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 ?? c
378
- }, r)).braListHouseholds
436
+ pagination: t.pagination ?? d
437
+ }, n)).braListHouseholds
379
438
  });
380
439
  return {
381
- ...i,
382
- data: i.data?.items ?? [],
383
- pageInfo: i.data?.pageInfo
440
+ ...r,
441
+ data: r.data?.items ?? [],
442
+ pageInfo: r.data?.pageInfo
384
443
  };
385
- }, J = (t) => {
386
- let { apiGatewayUrl: r } = e();
387
- return n({
388
- queryKey: s.household(t ?? ""),
444
+ }, Y = (t) => {
445
+ let { apiGatewayUrl: n } = e();
446
+ return a({
447
+ queryKey: u.household(t ?? ""),
389
448
  enabled: !!t,
390
- queryFn: async () => (await a(`query BraHousehold($id: ID!) {
391
- braHousehold(id: $id) { ${_} }
392
- }`, { id: t }, r)).braHousehold
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
- }, Z = () => {
413
- let { apiGatewayUrl: n } = e(), i = r();
414
- return t({
415
- mutationFn: async (e) => (await o("mutation BraArchiveHousehold($id: ID!) { braArchiveHousehold(id: $id) }", { id: e }, n)).braArchiveHousehold,
416
- onSuccess: () => i.invalidateQueries({ queryKey: s.households })
417
- });
418
- }, Q = (t = {}) => {
419
- let { apiGatewayUrl: r } = e(), i = n({
420
- queryKey: [...s.insights, t],
421
- queryFn: async () => (await a(`query BraListInsights($severity: BraInsightSeverity, $status: BraInsightStatus, $subjectId: ID, $subjectType: String, $pagination: PaginationInput) {
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 { ${v} }
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 ?? c
432
- }, r)).braListInsights
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
- ...i,
493
- data: i.data?.items ?? [],
494
- pageInfo: i.data?.pageInfo
503
+ ...r,
504
+ data: r.data?.items ?? [],
505
+ pageInfo: r.data?.pageInfo
495
506
  };
496
- }, $ = () => {
497
- let { apiGatewayUrl: n } = e(), i = r();
498
- return t({
499
- mutationFn: async (e) => (await o(`mutation BraRecordTransaction($input: BraCreateTransactionInput!) {
500
- braRecordTransaction(input: $input) { ${u} }
501
- }`, { input: e }, n)).braRecordTransaction,
502
- onSuccess: (e) => {
503
- i.invalidateQueries({ queryKey: s.transactions }), i.invalidateQueries({ queryKey: s.account(e.accountId) }), i.invalidateQueries({ queryKey: s.netWorth });
504
- }
505
- });
506
- }, se = (t = {}) => {
507
- let { apiGatewayUrl: r } = e(), i = n({
508
- queryKey: [...s.rebalances, t],
509
- queryFn: async () => (await a(`query BraListRebalanceProposals($householdId: ID, $portfolioId: ID, $status: BraRebalanceStatus) {
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
- ${y}
575
+ ${S}
512
576
  }
513
577
  }`, {
514
578
  householdId: t.householdId,
515
579
  portfolioId: t.portfolioId,
516
580
  status: t.status
517
- }, r)).braListRebalanceProposals
581
+ }, n)).braListRebalanceProposals
518
582
  });
519
583
  return {
520
- ...i,
521
- data: i.data ?? []
584
+ ...r,
585
+ data: r.data ?? []
522
586
  };
523
- }, ce = () => {
524
- let { apiGatewayUrl: n } = e(), i = r();
525
- return t({
526
- mutationFn: async (e) => (await o(`mutation BraCreateRebalanceProposal($input: BraCreateRebalanceProposalInput!) {
527
- braCreateRebalanceProposal(input: $input) { ${y} }
528
- }`, { input: e }, n)).braCreateRebalanceProposal,
529
- onSuccess: () => i.invalidateQueries({ queryKey: s.rebalances })
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
- }, le = () => {
532
- let { apiGatewayUrl: n } = e(), i = r();
533
- return t({
534
- mutationFn: async (e) => (await o(`mutation BraTransitionRebalanceProposal($id: ID!, $status: BraRebalanceStatus!) {
535
- braTransitionRebalanceProposal(id: $id, status: $status) { ${y} }
536
- }`, e, n)).braTransitionRebalanceProposal,
537
- onSuccess: () => i.invalidateQueries({ queryKey: s.rebalances })
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 { C as useAccount, S as useAccounts, re as useAcknowledgeInsight, E as useArchiveAccount, U as useArchiveGoal, Z as useArchiveHousehold, j as useArchivePortfolio, w as useCreateAccount, V as useCreateGoal, N as useCreateHolding, Y as useCreateHousehold, ne as useCreateInsight, R as useCreateModelPortfolio, k as useCreatePortfolio, ce as useCreateRebalanceProposal, F as useDeleteHolding, ie as useDismissInsight, te as useGoal, B as useGoalFundings, z as useGoals, M as useHoldings, J as useHousehold, q as useHouseholds, Q as useInsights, G as useLinkGoalFunding, L as useModelPortfolio, I as useModelPortfolios, x as useNetWorthSummary, O as usePortfolio, D as usePortfolios, se as useRebalanceProposals, W as useRecalcGoalProjection, $ as useRecordTransaction, ae as useResolveInsight, oe as useTransactions, le as useTransitionRebalanceProposal, K as useUnlinkGoalFunding, T as useUpdateAccount, H as useUpdateGoal, P as useUpdateHolding, X as useUpdateHousehold, A as useUpdatePortfolio };
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