@mx-cartographer/experiences 7.0.20-alpha.mm12 → 7.0.20-alpha.mm13
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/{AccountStore-Cr3Kjpo4.mjs → AccountStore-xRAZ5q8q.mjs} +2 -2
- package/dist/{BeatApi-D4iZVGiY.mjs → BeatApi-bPKymk9s.mjs} +2 -2
- package/dist/{BeatStore-LPnzXtXQ.mjs → BeatStore-mnrkh3h6.mjs} +1 -1
- package/dist/{CategoryStore-CKS37_CH.mjs → CategoryStore-BlWkDwiZ.mjs} +2 -2
- package/dist/{Fetch-DV5XjBJP.mjs → Fetch-5yMqsiXO.mjs} +22 -22
- package/dist/{FinstrongStore-Cy--8F7E.mjs → FinstrongStore-ZIbHKDSr.mjs} +8 -8
- package/dist/{GoalStore-DcobIUfg.mjs → GoalStore-sMlO3voq.mjs} +2 -2
- package/dist/{MerchantStore-cn8kDyVN.mjs → MerchantStore-CR5dFLpL.mjs} +10 -10
- package/dist/{NotificationStore-CIJ8NbCF.mjs → NotificationStore-Bc_r-sfC.mjs} +11 -11
- package/dist/{RecurringTransactionsStore-JqhzbjvQ.mjs → RecurringTransactionsStore-DukrsYPV.mjs} +21 -21
- package/dist/{SettingsStore-CU9TOlLc.mjs → SettingsStore-C7rj4rLf.mjs} +6 -6
- package/dist/{TransactionApi-CD2A7dWt.mjs → TransactionApi-Dla2CTeC.mjs} +2 -2
- package/dist/{TransactionStore-DCQGlXOT.mjs → TransactionStore-DasHlGBB.mjs} +2 -2
- package/dist/{ViewMoreMicroCard-BWFVzUt8.mjs → ViewMoreMicroCard-CjPlvt2p.mjs} +2 -2
- package/dist/accounts/index.es.js +1 -1
- package/dist/cashflow/index.es.js +2 -2
- package/dist/categories/index.es.js +1 -1
- package/dist/common/index.es.js +84 -84
- package/dist/finstrong/index.es.js +1 -1
- package/dist/goals/index.es.js +2 -2
- package/dist/insights/index.es.js +1 -1
- package/dist/merchants/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/notifications/index.es.js +3 -3
- package/dist/recurringtransactions/index.es.js +2 -2
- package/dist/settings/index.es.js +1 -1
- package/dist/transactions/index.es.js +3 -3
- package/dist/trends/index.es.js +1 -1
- package/dist/{useCombineEvents-DHSTr2O0.mjs → useCombineEvents-DwW81wcc.mjs} +20 -20
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { makeAutoObservable as _, runInAction as a } from "mobx";
|
|
2
2
|
import { i as g } from "./User-CcPqTPbo.mjs";
|
|
3
|
-
import { F as f, A as i } from "./Fetch-
|
|
3
|
+
import { F as f, A as i } from "./Fetch-5yMqsiXO.mjs";
|
|
4
4
|
import { A as n, d as h, E as p, g as y, h as I } from "./ConnectDrawer-BbvIVdYR.mjs";
|
|
5
5
|
class l {
|
|
6
6
|
fetchInstance;
|
|
7
7
|
constructor(t, e, s) {
|
|
8
|
-
this.fetchInstance = new f(t, e,
|
|
8
|
+
this.fetchInstance = new f(t, e), console.log("API constructor onError:", s);
|
|
9
9
|
}
|
|
10
10
|
createAccount = async (t) => this.fetchInstance.post(i.ACCOUNTS, t).then((e) => e.account).catch((e) => e);
|
|
11
11
|
deleteAccount = async (t) => this.fetchInstance.delete(`${i.ACCOUNTS}/${t}`).catch((e) => e);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as c, A as s } from "./Fetch-
|
|
1
|
+
import { F as c, A as s } from "./Fetch-5yMqsiXO.mjs";
|
|
2
2
|
class i {
|
|
3
3
|
fetchInstance;
|
|
4
4
|
constructor(t, e, n) {
|
|
5
|
-
this.fetchInstance = new c(t, e,
|
|
5
|
+
this.fetchInstance = new c(t, e), console.log("API constructor onError:", n);
|
|
6
6
|
}
|
|
7
7
|
getBeats = async (t, e) => {
|
|
8
8
|
const n = `page=${t || 1}&per_page=${e || 5}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeAutoObservable as c, runInAction as r } from "mobx";
|
|
2
|
-
import { B as l } from "./BeatApi-
|
|
2
|
+
import { B as l } from "./BeatApi-bPKymk9s.mjs";
|
|
3
3
|
function d(t, e, s, i = "asc") {
|
|
4
4
|
const a = i === "desc" ? -1 : 1;
|
|
5
5
|
return [...t, ...e].sort((_, n) => _[s] < n[s] ? -1 * a : _[s] > n[s] ? 1 * a : 0);
|
|
@@ -4,12 +4,12 @@ import { subMonths as g } from "date-fns/subMonths";
|
|
|
4
4
|
import { startOfMonth as h } from "date-fns/startOfMonth";
|
|
5
5
|
import { endOfMonth as d } from "date-fns/endOfMonth";
|
|
6
6
|
import { a as T, g as m } from "./CategoryUtil-BR3H5i6n.mjs";
|
|
7
|
-
import { F as p, A as i } from "./Fetch-
|
|
7
|
+
import { F as p, A as i } from "./Fetch-5yMqsiXO.mjs";
|
|
8
8
|
import { b as f, c as w } from "./Category-CevNQ03n.mjs";
|
|
9
9
|
class y {
|
|
10
10
|
fetchInstance;
|
|
11
11
|
constructor(t, e, o) {
|
|
12
|
-
this.fetchInstance = new p(t, e,
|
|
12
|
+
this.fetchInstance = new p(t, e), console.log("API constructor onError:", o);
|
|
13
13
|
}
|
|
14
14
|
addCategory = async (t) => this.fetchInstance.post(i.CATEGORIES, t).then((e) => e.category);
|
|
15
15
|
getCategories = async () => this.fetchInstance.get(i.CATEGORIES).then((t) => t.categories);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
const
|
|
1
|
+
import { g as i } from "./Localization-2MODESHW.mjs";
|
|
2
|
+
const h = {
|
|
3
3
|
ACCOUNTS: "accounts",
|
|
4
4
|
ANALYTICS_EVENTS: "analytics_events",
|
|
5
5
|
ANALYTICS_FEATURE_VISITS: "feature_visits",
|
|
@@ -46,40 +46,40 @@ const S = {
|
|
|
46
46
|
USER_PROFILES: "user_profiles",
|
|
47
47
|
WIDGET_URLS: "widget_urls"
|
|
48
48
|
};
|
|
49
|
-
class
|
|
49
|
+
class E {
|
|
50
50
|
endpoint = "/";
|
|
51
51
|
headers;
|
|
52
52
|
onError;
|
|
53
|
-
constructor(
|
|
54
|
-
this.endpoint =
|
|
53
|
+
constructor(o, n, t, s) {
|
|
54
|
+
this.endpoint = o;
|
|
55
55
|
const e = {
|
|
56
56
|
Accept: "application/json",
|
|
57
|
-
"Accept-Language":
|
|
57
|
+
"Accept-Language": i(),
|
|
58
58
|
"Content-Type": "application/json",
|
|
59
59
|
"MD-Session-Token": n
|
|
60
60
|
};
|
|
61
|
-
this.headers = t || e, console.info("Fetch constructor onError:",
|
|
61
|
+
this.headers = t || e, this.onError = s, console.info("Fetch constructor onError:", s?.toString());
|
|
62
62
|
}
|
|
63
|
-
get = async (
|
|
63
|
+
get = async (o) => {
|
|
64
64
|
const n = {
|
|
65
65
|
method: "GET",
|
|
66
66
|
headers: this.headers
|
|
67
67
|
};
|
|
68
|
-
return fetch(`${this.endpoint}${
|
|
68
|
+
return fetch(`${this.endpoint}${o}`, n).then((t) => {
|
|
69
69
|
if (t.ok)
|
|
70
70
|
return t.text();
|
|
71
71
|
throw t;
|
|
72
72
|
}).then((t) => t.length ? JSON.parse(t) : {}).then((t) => t).catch((t) => {
|
|
73
|
-
throw t;
|
|
73
|
+
throw console.info("Fetch GET onError:", this.onError?.toString()), this.onError?.(t), t;
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
post = async (
|
|
77
|
-
const t = n ? JSON.stringify(n) : void 0,
|
|
76
|
+
post = async (o, n) => {
|
|
77
|
+
const t = n ? JSON.stringify(n) : void 0, s = {
|
|
78
78
|
method: "POST",
|
|
79
79
|
headers: this.headers,
|
|
80
80
|
body: t
|
|
81
81
|
};
|
|
82
|
-
return fetch(`${this.endpoint}${
|
|
82
|
+
return fetch(`${this.endpoint}${o}`, s).then((e) => {
|
|
83
83
|
if (!e.ok)
|
|
84
84
|
throw e;
|
|
85
85
|
return e.text();
|
|
@@ -87,31 +87,31 @@ class _ {
|
|
|
87
87
|
throw e;
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
|
-
put = async (
|
|
91
|
-
const t = JSON.stringify(n),
|
|
90
|
+
put = async (o, n) => {
|
|
91
|
+
const t = JSON.stringify(n), s = {
|
|
92
92
|
method: "PUT",
|
|
93
93
|
headers: this.headers,
|
|
94
94
|
body: t
|
|
95
95
|
};
|
|
96
|
-
return fetch(`${this.endpoint}${
|
|
97
|
-
throw new Error(
|
|
96
|
+
return fetch(`${this.endpoint}${o}`, s).then((e) => e.ok ? e.text() : e.text().then((r) => {
|
|
97
|
+
throw new Error(r);
|
|
98
98
|
})).then((e) => e.length ? JSON.parse(e) : {}).then((e) => e).catch((e) => {
|
|
99
99
|
throw e;
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
delete = async (
|
|
102
|
+
delete = async (o) => {
|
|
103
103
|
const n = {
|
|
104
104
|
method: "DELETE",
|
|
105
105
|
headers: this.headers
|
|
106
106
|
};
|
|
107
|
-
return fetch(`${this.endpoint}${
|
|
108
|
-
throw new Error(
|
|
107
|
+
return fetch(`${this.endpoint}${o}`, n).then((t) => t.ok ? t.text() : t.text().then((s) => {
|
|
108
|
+
throw new Error(s);
|
|
109
109
|
})).then((t) => t.length ? JSON.parse(t) : {}).then((t) => t).catch((t) => {
|
|
110
110
|
throw t;
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
export {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
h as A,
|
|
116
|
+
E as F
|
|
117
117
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { makeAutoObservable as l, runInAction as r } from "mobx";
|
|
2
2
|
import { format as i } from "date-fns/format";
|
|
3
3
|
import { fromUnixTime as g } from "date-fns/fromUnixTime";
|
|
4
|
-
import { getUnixTime as
|
|
4
|
+
import { getUnixTime as n } from "date-fns/getUnixTime";
|
|
5
5
|
import { subMonths as S } from "date-fns/subMonths";
|
|
6
|
-
import { F as m, A as o } from "./Fetch-
|
|
6
|
+
import { F as m, A as o } from "./Fetch-5yMqsiXO.mjs";
|
|
7
7
|
import { f as p, D as u } from "./Dialog-CWW597AF.mjs";
|
|
8
|
-
class
|
|
8
|
+
class s {
|
|
9
9
|
fetchInstance;
|
|
10
10
|
constructor(e, t, a) {
|
|
11
|
-
this.fetchInstance = new m(e, t,
|
|
11
|
+
this.fetchInstance = new m(e, t), console.log("API constructor onError:", a);
|
|
12
12
|
}
|
|
13
13
|
calculateHealthScore = async () => this.fetchInstance.post(`${o.HEALTH_SCORES}/calculate`).then((e) => e.health_score);
|
|
14
14
|
getAverageHealthScores = async () => this.fetchInstance.get(`${o.HEALTH_SCORES}/monthly_averages`).then((e) => e);
|
|
@@ -25,7 +25,7 @@ const y = (h) => h?.health_scores.map((e) => {
|
|
|
25
25
|
};
|
|
26
26
|
}).sort((e, t) => e.month - t.month).map((e) => ({ x: e.x, y: e.y }));
|
|
27
27
|
class v {
|
|
28
|
-
api = new
|
|
28
|
+
api = new s("/", "");
|
|
29
29
|
augmentedChartData = [];
|
|
30
30
|
averageHealthScores = [];
|
|
31
31
|
globalStore;
|
|
@@ -34,7 +34,7 @@ class v {
|
|
|
34
34
|
healthScoreChangeReports = [];
|
|
35
35
|
peerScore = null;
|
|
36
36
|
constructor(e) {
|
|
37
|
-
this.globalStore = e, this.api = new
|
|
37
|
+
this.globalStore = e, this.api = new s(e.endpoint, e.sessionToken, e.onError), l(this);
|
|
38
38
|
}
|
|
39
39
|
calculateHealthScore = async () => {
|
|
40
40
|
try {
|
|
@@ -60,7 +60,7 @@ class v {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
loadHealthScoreChangeReports = async () => {
|
|
63
|
-
const e =
|
|
63
|
+
const e = n(S(/* @__PURE__ */ new Date(), 2)), t = n(/* @__PURE__ */ new Date());
|
|
64
64
|
try {
|
|
65
65
|
const a = await this.api.getHealthScoreChangeReports(
|
|
66
66
|
e,
|
|
@@ -96,6 +96,6 @@ class v {
|
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
export {
|
|
99
|
-
|
|
99
|
+
s as F,
|
|
100
100
|
v as a
|
|
101
101
|
};
|
|
@@ -10,7 +10,7 @@ import { Text as A } from "@mxenabled/mxui";
|
|
|
10
10
|
import { j as y } from "./ConnectDrawer-BbvIVdYR.mjs";
|
|
11
11
|
import { m as b } from "./hooks-DP5qvbXf.mjs";
|
|
12
12
|
import { makeAutoObservable as D, runInAction as c } from "mobx";
|
|
13
|
-
import { F as v, A as i } from "./Fetch-
|
|
13
|
+
import { F as v, A as i } from "./Fetch-5yMqsiXO.mjs";
|
|
14
14
|
import { fromUnixTime as C } from "date-fns/fromUnixTime";
|
|
15
15
|
import { addYears as x } from "date-fns/addYears";
|
|
16
16
|
import { getUnixTime as K } from "date-fns/getUnixTime";
|
|
@@ -62,7 +62,7 @@ var a = /* @__PURE__ */ ((e) => (e[e.DEBT_TRACK = 1] = "DEBT_TRACK", e[e.SAVINGS
|
|
|
62
62
|
class R {
|
|
63
63
|
fetchInstance;
|
|
64
64
|
constructor(t, o, r) {
|
|
65
|
-
this.fetchInstance = new v(t, o,
|
|
65
|
+
this.fetchInstance = new v(t, o), console.log("API constructor onError:", r);
|
|
66
66
|
}
|
|
67
67
|
addGoal = async (t) => this.fetchInstance.post(i.GOALS, t).then((o) => o.goal);
|
|
68
68
|
addRetirementGoal = async (t) => this.fetchInstance.post(i.RETIREMENT_GOALS, t).then((o) => o.retirement_goal);
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { makeAutoObservable as m, runInAction as
|
|
2
|
-
import { F as p, A as
|
|
3
|
-
class
|
|
1
|
+
import { makeAutoObservable as m, runInAction as r } from "mobx";
|
|
2
|
+
import { F as p, A as c } from "./Fetch-5yMqsiXO.mjs";
|
|
3
|
+
class h {
|
|
4
4
|
fetchInstance;
|
|
5
5
|
constructor(t, n, s) {
|
|
6
|
-
this.fetchInstance = new p(t, n,
|
|
6
|
+
this.fetchInstance = new p(t, n), console.log("API constructor onError:", s);
|
|
7
7
|
}
|
|
8
8
|
getMerchants = async (t = [], n = [], s = 1, o = 25) => {
|
|
9
|
-
let a =
|
|
9
|
+
let a = c.MERCHANTS;
|
|
10
10
|
return a += `?page=${s}&per_page=${o}`, t.length && t.forEach((e) => a += `&fuzzy_name[]=${e}`), n.length && n.forEach((e) => a += `&guid[]=${e}`), this.fetchInstance.get(a).then((e) => e.merchants);
|
|
11
11
|
};
|
|
12
|
-
getMerchantByGuid = async (t) => this.fetchInstance.get(`${
|
|
12
|
+
getMerchantByGuid = async (t) => this.fetchInstance.get(`${c.MERCHANTS}/${t}`).then((n) => n.merchant);
|
|
13
13
|
}
|
|
14
14
|
class u {
|
|
15
15
|
globalStore;
|
|
16
|
-
api = new
|
|
16
|
+
api = new h("/", "");
|
|
17
17
|
merchant = null;
|
|
18
18
|
merchants = [];
|
|
19
19
|
isLoading = !1;
|
|
20
20
|
constructor(t) {
|
|
21
|
-
this.globalStore = t, this.api = new
|
|
21
|
+
this.globalStore = t, this.api = new h(t.endpoint, t.sessionToken, t.onError), m(this);
|
|
22
22
|
}
|
|
23
23
|
loadMerchants = async (t = "") => {
|
|
24
24
|
this.isLoading = !0;
|
|
25
25
|
const n = await this.api.getMerchants([t]);
|
|
26
|
-
|
|
26
|
+
r(() => {
|
|
27
27
|
this.merchants = n, this.isLoading = !1;
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
loadMerchantByGuid = async (t) => {
|
|
31
31
|
const n = await this.api.getMerchantByGuid(t);
|
|
32
|
-
|
|
32
|
+
r(() => this.merchant = n);
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { makeAutoObservable as c, observable as f, runInAction as h } from "mobx";
|
|
2
|
-
import { fromUnixTime as
|
|
3
|
-
import { F as l, A as
|
|
2
|
+
import { fromUnixTime as a, isSameDay as d } from "date-fns";
|
|
3
|
+
import { F as l, A as o } from "./Fetch-5yMqsiXO.mjs";
|
|
4
4
|
class s {
|
|
5
5
|
fetchInstance;
|
|
6
|
-
constructor(t, i,
|
|
7
|
-
this.fetchInstance = new l(t, i,
|
|
6
|
+
constructor(t, i, n) {
|
|
7
|
+
this.fetchInstance = new l(t, i), console.log("API constructor onError:", n);
|
|
8
8
|
}
|
|
9
|
-
getNotifications = () => this.fetchInstance.get(
|
|
9
|
+
getNotifications = () => this.fetchInstance.get(o.NOTIFICATIONS).then(
|
|
10
10
|
(t) => t.notifications.map((i) => i.notification)
|
|
11
11
|
).finally();
|
|
12
|
-
updateNotification = (t) => this.fetchInstance.put(`${
|
|
12
|
+
updateNotification = (t) => this.fetchInstance.put(`${o.NOTIFICATIONS}/${t.guid}`, {
|
|
13
13
|
guid: t.guid,
|
|
14
14
|
has_been_viewed: t.has_been_viewed
|
|
15
15
|
}).then((i) => i.notification).finally();
|
|
16
16
|
// Note: The notifications/mark_all_as_viewed endpoint is broken, but still returns 202.
|
|
17
17
|
// A bug ticket has been filed to fix it, but should not require any changes here.
|
|
18
|
-
markAllAsViewed = (t) => this.fetchInstance.put(`${
|
|
18
|
+
markAllAsViewed = (t) => this.fetchInstance.put(`${o.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
|
|
19
19
|
}
|
|
20
20
|
const w = (e, t) => {
|
|
21
|
-
const i =
|
|
22
|
-
return !d(i,
|
|
21
|
+
const i = a(t[e].delivered_at), n = a(t[e - 1]?.delivered_at);
|
|
22
|
+
return !d(i, n);
|
|
23
23
|
};
|
|
24
24
|
function u(e) {
|
|
25
25
|
const i = Math.floor(Date.now() / 1e3);
|
|
26
|
-
return e.filter((
|
|
27
|
-
const r =
|
|
26
|
+
return e.filter((n) => {
|
|
27
|
+
const r = n.delivered_at;
|
|
28
28
|
return i - r <= 604800;
|
|
29
29
|
});
|
|
30
30
|
}
|
package/dist/{RecurringTransactionsStore-JqhzbjvQ.mjs → RecurringTransactionsStore-DukrsYPV.mjs}
RENAMED
|
@@ -7,14 +7,14 @@ import { isWithinInterval as m } from "date-fns/isWithinInterval";
|
|
|
7
7
|
import { startOfMonth as S } from "date-fns/startOfMonth";
|
|
8
8
|
import { startOfToday as c } from "date-fns/startOfToday";
|
|
9
9
|
import { subDays as y } from "date-fns/subDays";
|
|
10
|
-
import { F as
|
|
11
|
-
import { b as
|
|
10
|
+
import { F as E, A as o } from "./Fetch-5yMqsiXO.mjs";
|
|
11
|
+
import { b as x, a as s, c as h, d as u } from "./RepeatingTransaction-BW4J-jeJ.mjs";
|
|
12
12
|
var A = /* @__PURE__ */ ((r) => (r.Small = "small", r.Medium = "medium", r.Large = "large", r))(A || {});
|
|
13
13
|
const U = 44;
|
|
14
|
-
class
|
|
14
|
+
class d {
|
|
15
15
|
fetchInstance;
|
|
16
16
|
constructor(e, t, n) {
|
|
17
|
-
this.fetchInstance = new
|
|
17
|
+
this.fetchInstance = new E(e, t), console.log("API constructor onError:", n);
|
|
18
18
|
}
|
|
19
19
|
addRepeatingTransaction = async (e) => this.fetchInstance.post(o.REPEATING_TRANSACTIONS, e).then((t) => t.repeating_transaction);
|
|
20
20
|
getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((e) => e.repeating_transactions);
|
|
@@ -24,17 +24,17 @@ class h {
|
|
|
24
24
|
).then((t) => t.repeating_transaction);
|
|
25
25
|
deleteRepeatingTransaction = async (e) => this.fetchInstance.delete(`${o.REPEATING_TRANSACTIONS}/${e}`).then((t) => t);
|
|
26
26
|
}
|
|
27
|
-
const l = (r, e) => m(e.expectedDate, r),
|
|
27
|
+
const l = (r, e) => m(e.expectedDate, r), a = (r, e) => r + e.amount;
|
|
28
28
|
class C {
|
|
29
29
|
globalStore;
|
|
30
|
-
api = new
|
|
30
|
+
api = new d("/", "");
|
|
31
31
|
transactions = [];
|
|
32
32
|
repeatingTransactions = [];
|
|
33
33
|
selectedDay;
|
|
34
34
|
dateRange = { start: S(c()), end: R(c()) };
|
|
35
35
|
isDataLoaded = !1;
|
|
36
36
|
constructor(e) {
|
|
37
|
-
this.globalStore = e, this.api = new
|
|
37
|
+
this.globalStore = e, this.api = new d(
|
|
38
38
|
e.endpoint,
|
|
39
39
|
e.sessionToken,
|
|
40
40
|
e.onError
|
|
@@ -45,14 +45,14 @@ class C {
|
|
|
45
45
|
*/
|
|
46
46
|
get recurrences() {
|
|
47
47
|
const e = this.globalStore.accountStore.visibleAccounts;
|
|
48
|
-
return
|
|
48
|
+
return x(this.repeatingTransactions, this.dateRange).filter((t) => e.some((n) => n.guid === t.accountGuid && !n.is_excluded_from_accounts)).filter((t) => m(t.expectedDate, this.dateRange));
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Returns all recurrences that have occurred in the past, including those that are paid or missed
|
|
52
52
|
*/
|
|
53
53
|
get pastRecurrences() {
|
|
54
54
|
return this.recurrences.filter(
|
|
55
|
-
(e) => e.status ===
|
|
55
|
+
(e) => e.status === s.Paid || e.status === s.Missed
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -61,7 +61,7 @@ class C {
|
|
|
61
61
|
*/
|
|
62
62
|
get upcomingRecurrences() {
|
|
63
63
|
return this.recurrences.filter(
|
|
64
|
-
(e) => p(e.expectedDate, y(c(), 3)) && I(e.expectedDate, this.dateRange.end) && e.status ===
|
|
64
|
+
(e) => p(e.expectedDate, y(c(), 3)) && I(e.expectedDate, this.dateRange.end) && e.status === s.Upcoming
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -69,7 +69,7 @@ class C {
|
|
|
69
69
|
*/
|
|
70
70
|
get expenses() {
|
|
71
71
|
return this.recurrences.filter(
|
|
72
|
-
(e) => e.type ===
|
|
72
|
+
(e) => e.type === h.Expense
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
@@ -77,7 +77,7 @@ class C {
|
|
|
77
77
|
*/
|
|
78
78
|
get upcomingExpenses() {
|
|
79
79
|
return this.expenses.filter(
|
|
80
|
-
(e) => e.status ===
|
|
80
|
+
(e) => e.status === s.Upcoming
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -85,7 +85,7 @@ class C {
|
|
|
85
85
|
*/
|
|
86
86
|
get income() {
|
|
87
87
|
return this.recurrences.filter(
|
|
88
|
-
(e) => e.type ===
|
|
88
|
+
(e) => e.type === h.Income
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
@@ -93,7 +93,7 @@ class C {
|
|
|
93
93
|
*/
|
|
94
94
|
get upcomingIncome() {
|
|
95
95
|
return this.income.filter(
|
|
96
|
-
(e) => e.status ===
|
|
96
|
+
(e) => e.status === s.Upcoming
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
get nextIncomeRecurrence() {
|
|
@@ -119,43 +119,43 @@ class C {
|
|
|
119
119
|
* Calculates the total amount of all expenses for the current month.
|
|
120
120
|
*/
|
|
121
121
|
get expenseTotal() {
|
|
122
|
-
return this.currentMonthExpenses.reduce(
|
|
122
|
+
return this.currentMonthExpenses.reduce(a, 0);
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* Calculates the total amount of all paid expenses for the current month.
|
|
126
126
|
*/
|
|
127
127
|
get paidExpenseTotal() {
|
|
128
|
-
return this.currentMonthExpenses.filter((e) => e.status ===
|
|
128
|
+
return this.currentMonthExpenses.filter((e) => e.status === s.Paid).reduce(a, 0);
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* Calculates the total amount of all missed expenses for the current month.
|
|
132
132
|
*/
|
|
133
133
|
get missedExpenseTotal() {
|
|
134
|
-
return this.currentMonthExpenses.filter((e) => e.status ===
|
|
134
|
+
return this.currentMonthExpenses.filter((e) => e.status === s.Missed).reduce(a, 0);
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Calculates the total amount of all upcoming expenses for the current month.
|
|
138
138
|
*/
|
|
139
139
|
get upcomingExpenseTotal() {
|
|
140
|
-
return this.currentMonthExpenses.filter((e) => e.status ===
|
|
140
|
+
return this.currentMonthExpenses.filter((e) => e.status === s.Upcoming).reduce(a, 0);
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* Calculates the total amount of all income for the current month.
|
|
144
144
|
*/
|
|
145
145
|
get incomeTotal() {
|
|
146
|
-
return this.currentMonthIncome.reduce(
|
|
146
|
+
return this.currentMonthIncome.reduce(a, 0);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Calculates the total amount of all paid income for the current month.
|
|
150
150
|
*/
|
|
151
151
|
get paidIncomeTotal() {
|
|
152
|
-
return this.currentMonthIncome.filter((e) => e.status ===
|
|
152
|
+
return this.currentMonthIncome.filter((e) => e.status === s.Paid).reduce(a, 0);
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Calculates the total amount of all upcoming income for the current month.
|
|
156
156
|
*/
|
|
157
157
|
get upcomingIncomeTotal() {
|
|
158
|
-
return this.currentMonthIncome.filter((e) => e.status ===
|
|
158
|
+
return this.currentMonthIncome.filter((e) => e.status === s.Upcoming).reduce(a, 0);
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Get the recurrences for the currently selected day.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { makeAutoObservable as N, runInAction as l } from "mobx";
|
|
2
|
-
import { F as D, A as r } from "./Fetch-
|
|
2
|
+
import { F as D, A as r } from "./Fetch-5yMqsiXO.mjs";
|
|
3
3
|
import { B as f, A as n, I as i } from "./Notification-ByMBpJ5u.mjs";
|
|
4
|
-
import { T as m } from "./TransactionApi-
|
|
4
|
+
import { T as m } from "./TransactionApi-Dla2CTeC.mjs";
|
|
5
5
|
class y {
|
|
6
6
|
fetchInstance;
|
|
7
7
|
constructor(e, t, o) {
|
|
8
|
-
this.fetchInstance = new D(e, t,
|
|
8
|
+
this.fetchInstance = new D(e, t), console.log("API constructor onError:", o);
|
|
9
9
|
}
|
|
10
10
|
deleteDevice = async (e) => this.fetchInstance.delete(`${r.DEVICES}/${e}`).then((t) => t);
|
|
11
11
|
generateDeviceToken = async () => this.fetchInstance.get(`${r.USER}/mobile_token`).then((e) => e.mobile_token);
|
|
@@ -59,15 +59,15 @@ const v = "PARENT-ENTITY", C = (s, e) => ({
|
|
|
59
59
|
sms_notifications_enabled: P,
|
|
60
60
|
push_notifications_enabled: T
|
|
61
61
|
} = e, {
|
|
62
|
-
opted_out_of_email_notifications:
|
|
63
|
-
opted_out_of_sms_notifications:
|
|
62
|
+
opted_out_of_email_notifications: E,
|
|
63
|
+
opted_out_of_sms_notifications: b,
|
|
64
64
|
opted_out_of_push_notifications: A
|
|
65
65
|
} = d;
|
|
66
66
|
for (const a of o.filter((u) => u.entity_guid === v)) {
|
|
67
67
|
const u = C(a.notification_type, t), S = o.filter(
|
|
68
68
|
(c) => c.entity_guid !== v && c.notification_type === a.notification_type && s.some((h) => h.guid === c.entity_guid)
|
|
69
69
|
), _ = [];
|
|
70
|
-
I && !
|
|
70
|
+
I && !E && a.email_channel && p.email && _.push(t.delivery_method_email_label), P && !b && a.sms_channel && p.phone && _.push(t.delivery_method_sms_label), T && !A && a.push_channel && _.push(t.delivery_method_push_label), g.push({
|
|
71
71
|
...a,
|
|
72
72
|
children: S.map((c) => ({
|
|
73
73
|
...c,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as T, A as e } from "./Fetch-
|
|
1
|
+
import { F as T, A as e } from "./Fetch-5yMqsiXO.mjs";
|
|
2
2
|
class u {
|
|
3
3
|
fetchInstance;
|
|
4
4
|
constructor(t, n, a) {
|
|
5
|
-
this.fetchInstance = new T(t, n,
|
|
5
|
+
this.fetchInstance = new T(t, n), console.log("API constructor onError:", a);
|
|
6
6
|
}
|
|
7
7
|
addTag = async (t) => this.fetchInstance.post(e.TAGS, t).then((n) => n.tag);
|
|
8
8
|
addTagging = async (t) => this.fetchInstance.post(e.TAGGINGS, t).then((n) => n.tagging);
|
|
@@ -14,13 +14,13 @@ import { startOfMonth as R } from "date-fns/startOfMonth";
|
|
|
14
14
|
import { startOfToday as G } from "date-fns/startOfToday";
|
|
15
15
|
import { subDays as Y } from "date-fns/subDays";
|
|
16
16
|
import { O as n, a as b, T as F } from "./User-CcPqTPbo.mjs";
|
|
17
|
-
import { T as p } from "./TransactionApi-
|
|
17
|
+
import { T as p } from "./TransactionApi-Dla2CTeC.mjs";
|
|
18
18
|
import { b as W } from "./Category-CevNQ03n.mjs";
|
|
19
19
|
import { f as z } from "./exportTransactionsToCSV-DsY4Aap_.mjs";
|
|
20
20
|
import { format as k } from "date-fns/format";
|
|
21
21
|
import { f as g, D as O, O as $ } from "./Dialog-CWW597AF.mjs";
|
|
22
22
|
import { endOfMonth as X } from "date-fns/endOfMonth";
|
|
23
|
-
import { B as f } from "./BeatApi-
|
|
23
|
+
import { B as f } from "./BeatApi-bPKymk9s.mjs";
|
|
24
24
|
const j = ({
|
|
25
25
|
checked: N = !1,
|
|
26
26
|
label: t,
|
|
@@ -18,8 +18,8 @@ import { css as qe } from "@mxenabled/cssinjs";
|
|
|
18
18
|
import { b as Je } from "./Localization-2MODESHW.mjs";
|
|
19
19
|
import et from "@mui/material/CircularProgress";
|
|
20
20
|
import { makeAutoObservable as ce, runInAction as Te } from "mobx";
|
|
21
|
-
import { G as pe, a as tt, u as it, b as ot } from "./useCombineEvents-
|
|
22
|
-
import { B as _e } from "./BeatApi-
|
|
21
|
+
import { G as pe, a as tt, u as it, b as ot } from "./useCombineEvents-DwW81wcc.mjs";
|
|
22
|
+
import { B as _e } from "./BeatApi-bPKymk9s.mjs";
|
|
23
23
|
import rt from "@mui/material/Card";
|
|
24
24
|
import lt from "@mui/material/CardActions";
|
|
25
25
|
import nt from "@mui/material/CardContent";
|
|
@@ -24,7 +24,7 @@ import X from "@mui/material/ListItem";
|
|
|
24
24
|
import { M as U } from "../MiniWidgetContainer-xsVrqac5.mjs";
|
|
25
25
|
import e1 from "@mui/material/Stack";
|
|
26
26
|
import { g as U1, a as j1 } from "../AccountFields-dth_TzXr.mjs";
|
|
27
|
-
import { A as G1, a as K1 } from "../AccountStore-
|
|
27
|
+
import { A as G1, a as K1 } from "../AccountStore-xRAZ5q8q.mjs";
|
|
28
28
|
const t1 = () => {
|
|
29
29
|
const [c, L] = d.useState(""), { accounts: o } = g(), { selectedAccounts: l } = y(), { setSelectedAccount: u, setSelectedMember: r } = K(), { members: s } = O(), { onEvent: p } = N(), a = [...new Set(l.map((t) => t.account_type))], H = l.find((t) => c === t.guid), h = d.useMemo(
|
|
30
30
|
() => l.filter((t) => t.is_hidden),
|
|
@@ -45,7 +45,7 @@ import { F as mt, R as Ie, e as De } from "../RepeatingTransaction-BW4J-jeJ.mjs"
|
|
|
45
45
|
import { h as ut } from "../DateUtil-BcuH7ErC.mjs";
|
|
46
46
|
import { endOfToday as ht } from "date-fns/endOfToday";
|
|
47
47
|
import { W as ve, A as Ae } from "../WidgetContainer-DPzZyq22.mjs";
|
|
48
|
-
import { F as pt, A as B } from "../Fetch-
|
|
48
|
+
import { F as pt, A as B } from "../Fetch-5yMqsiXO.mjs";
|
|
49
49
|
const K = () => {
|
|
50
50
|
if (!m.useContext(Ye))
|
|
51
51
|
throw new Error("useCashflowUiStore() must be used within the GlobalDataContext");
|
|
@@ -1076,7 +1076,7 @@ const _t = ({ recurrence: i }) => /* @__PURE__ */ o(P, { children: [
|
|
|
1076
1076
|
class kn {
|
|
1077
1077
|
fetchInstance;
|
|
1078
1078
|
constructor(n, t, s) {
|
|
1079
|
-
this.fetchInstance = new pt(n, t,
|
|
1079
|
+
this.fetchInstance = new pt(n, t), console.log("API constructor onError:", s);
|
|
1080
1080
|
}
|
|
1081
1081
|
addCashflowEvent = async (n) => this.fetchInstance.post(B.CASHFLOW_EVENTS, { ...n }).then((t) => t);
|
|
1082
1082
|
addCashflowSequence = async (n) => this.fetchInstance.post(B.CASHFLOW_SEQUENCES, { ...n }).then((t) => t.cashflow_sequence);
|