@mx-cartographer/experiences 7.2.23-alpha.sms1 → 7.2.23

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.
@@ -1,7 +1,7 @@
1
1
  import { makeAutoObservable as N, runInAction as l } from "mobx";
2
2
  import { F as D, A as r } from "./Fetch-87LIQbEA.mjs";
3
3
  import { B as f, A as n, I as i } from "./ToggleListItem-r0Kx56wF.mjs";
4
- import { T as m } from "./TransactionApi-C4V0XJEk.mjs";
4
+ import { T as m } from "./TransactionApi-B3Tksf7L.mjs";
5
5
  class y {
6
6
  fetchInstance;
7
7
  constructor(e, t, o) {
@@ -0,0 +1,86 @@
1
+ import { F as T, A as e } from "./Fetch-87LIQbEA.mjs";
2
+ class u {
3
+ fetchInstance;
4
+ constructor(t, n, a) {
5
+ this.fetchInstance = new T(t, n, void 0, a);
6
+ }
7
+ addTag = async (t) => this.fetchInstance.post(e.TAGS, t).then((n) => n.tag);
8
+ addTagging = async (t) => this.fetchInstance.post(e.TAGGINGS, t).then((n) => n.tagging);
9
+ addTransaction = async (t) => this.fetchInstance.post(e.TRANSACTIONS, t).then((n) => n.transaction);
10
+ addTransactionRule = async (t) => this.fetchInstance.post(e.TRANSACTION_RULES, t).then((n) => n);
11
+ getTaggings = async () => this.fetchInstance.get(e.TAGGINGS).then((t) => t.map((n) => n.tagging));
12
+ getTags = async () => this.fetchInstance.get(e.TAGS).then((t) => t.map((n) => n.tag));
13
+ getTransactionRules = async () => this.fetchInstance.get(e.TRANSACTION_RULES).then((t) => t.transaction_rules);
14
+ getTransactionsByDateRange = async (t, n) => this.fetchInstance.get(`${e.TRANSACTIONS}/by_date/${t}/${n}`).then((a) => a.map((s) => s.transaction));
15
+ // DEPRECATED
16
+ getTransactionsByAccountsAndDateRange = async (t, n, a) => {
17
+ console.warn("DEPRECATED: getTransactionsByAccountsAndDateRange will be removed");
18
+ const s = t.reduce(
19
+ (o, c, r) => `${o}account_guids[]=${c}${r !== t.length - 1 ? "&" : ""}`,
20
+ ""
21
+ );
22
+ return this.fetchInstance.get(`${e.TRANSACTIONS}/by_date/${n}/${a}?${s}`).then((o) => o.map((c) => c.transaction));
23
+ };
24
+ // DEPRECATED
25
+ getTransactionsByGuids = async (t) => (console.warn("DEPRECATED: getTransactionsByGuids will be removed"), this.fetchInstance.post(`${e.TRANSACTIONS}/by_guids`, { guids: t.join("+") }).then((n) => n.map((a) => a.transaction)));
26
+ // DEPRECATED
27
+ getTransactionsByCategoryAndDate = async (t, n, a) => (console.warn("DEPRECATED: getTransactionsByCategoryAndDate will be removed"), this.fetchInstance.get(
28
+ `${e.TRANSACTIONS}/by_category_guid/${t}/by_date/${n}/${a}`
29
+ ).then((s) => s.map((o) => o.transaction)));
30
+ // DEPRECATED
31
+ getTransactionsByCategoryDateAndAccounts = async (t, n, a, s) => {
32
+ console.warn("DEPRECATED: getTransactionsByCategoryDateAndAccounts will be removed");
33
+ const o = s.reduce(
34
+ (c, r, i) => `${c}account_guids[]=${r}${i !== s.length - 1 ? "&" : ""}`,
35
+ ""
36
+ );
37
+ return this.fetchInstance.get(
38
+ `${e.TRANSACTIONS}/by_category_guid/${t}/by_date/${n}/${a}?${o}`
39
+ ).then((c) => c.map((r) => r.transaction));
40
+ };
41
+ // DEPRECATED
42
+ getTransactionsByCategoriesDateAndAccounts = async (t, n, a, s) => {
43
+ console.warn("DEPRECATED: getTransactionsByCategoriesDateAndAccounts will be removed");
44
+ const o = s.reduce(
45
+ (c, r, i) => `${c}account_guids[]=${r}${i !== s.length - 1 ? "&" : ""}`,
46
+ ""
47
+ );
48
+ return this.fetchInstance.get(
49
+ `${e.TRANSACTIONS}/by_category_guids/${t.join(
50
+ "+"
51
+ )}/by_date/${n}/${a}?${o}`
52
+ ).then((c) => c.map((r) => r.transaction));
53
+ };
54
+ /**
55
+ * DEPRECATED
56
+ * Get all transactions by the top level category, between begin date and end date, and optionally
57
+ * filtered by accounts
58
+ * @param categoryGuid The top level category guid
59
+ * @param beginDate the start date
60
+ * @param endDate the end date
61
+ * @param accountGuids an optional list of account guids
62
+ */
63
+ getTransactionsByTopLevelCategoryAndDate = async (t, n, a, s = []) => {
64
+ console.warn("DEPRECATED: getTransactionsByTopLevelCategoryAndDate will be removed");
65
+ let o = `${e.TRANSACTIONS}/by_top_level_category_guid/${t}/by_date/${n}/${a}`;
66
+ if (s.length > 0) {
67
+ const c = s.reduce(
68
+ (r, i, g) => `${r}account_guids[]=${i}${g !== s.length - 1 ? "&" : ""}`,
69
+ ""
70
+ );
71
+ o += `?${c}`;
72
+ }
73
+ return this.fetchInstance.get(o).then((c) => c.map((r) => r.transaction));
74
+ };
75
+ removeTag = async (t) => this.fetchInstance.delete(`${e.TAGS}/${t}`).then((n) => n);
76
+ removeTagging = async (t) => this.fetchInstance.delete(`${e.TAGGINGS}/${t}`).then((n) => n);
77
+ removeTransaction = async (t) => this.fetchInstance.delete(`${e.TRANSACTIONS}/${t}`).then((n) => n);
78
+ removeTransactionRule = async (t) => this.fetchInstance.delete(`${e.TRANSACTION_RULES}/${t}`);
79
+ removeTransactionSplit = async (t) => this.fetchInstance.delete(`${e.TRANSACTIONS}/${t}/unsplit`).then((n) => n);
80
+ updateTransactionRule = async (t) => this.fetchInstance.put(`${e.TRANSACTION_RULES}/${t.guid}`, t).then((n) => n);
81
+ updateTag = async (t) => this.fetchInstance.put(`${e.TAGS}/${t.guid}`, t).then((n) => n.tag);
82
+ updateTransaction = async (t) => this.fetchInstance.put(`${e.TRANSACTIONS}/${t.guid}`, t).then((n) => n.transaction);
83
+ }
84
+ export {
85
+ u as T
86
+ };
@@ -14,7 +14,7 @@ import { startOfMonth as R } from "date-fns/startOfMonth";
14
14
  import { startOfToday as b } from "date-fns/startOfToday";
15
15
  import { subDays as F } from "date-fns/subDays";
16
16
  import { O as n, a as G, T as w } from "./User-BQUxBeZV.mjs";
17
- import { T as p } from "./TransactionApi-C4V0XJEk.mjs";
17
+ import { T as p } from "./TransactionApi-B3Tksf7L.mjs";
18
18
  import { b as W } from "./Category-CevNQ03n.mjs";
19
19
  import { f as z } from "./exportTransactionsToCSV-BwwmL4pM.mjs";
20
20
  import { format as k } from "date-fns/format";
@@ -18,8 +18,8 @@ import { C as Qs } from "../CurrencyInput-DUsQbkXb.mjs";
18
18
  import { L as Xs } from "../Loader-DUaFpDGv.mjs";
19
19
  import { R as Ks } from "../ResponsiveButton-DZFp78fJ.mjs";
20
20
  import { S as Zs } from "../SearchBox-B2_zLv8-.mjs";
21
- import { T as at } from "../TransactionStore-FeuQE_RH.mjs";
22
- import { S as tr } from "../TransactionStore-FeuQE_RH.mjs";
21
+ import { T as at } from "../TransactionStore-hfOsBbDt.mjs";
22
+ import { S as tr } from "../TransactionStore-hfOsBbDt.mjs";
23
23
  import { T as sr } from "../TabContentContainer-j01JYR_7.mjs";
24
24
  import { I as or } from "../IconBacking-B9oC6uL2.mjs";
25
25
  import { D as nr, F as ir, a as cr, c as dr, R as lr, S as ur } from "../RecurringTransactions-ej39mgA6.mjs";
@@ -68,7 +68,7 @@ import { a as vt } from "../FinstrongStore-F2c607dj.mjs";
68
68
  import { A as Dt, m as At, a as Et, b as Tt } from "../InvestmentUtil-jOyOgzIB.mjs";
69
69
  import { M as Bt } from "../MerchantStore-DrFvsUyy.mjs";
70
70
  import { N as It } from "../NetWorthStore-D1NiDUcc.mjs";
71
- import { a as Nt } from "../SettingsStore-DneARj4W.mjs";
71
+ import { a as Nt } from "../SettingsStore-BcgS_Ohv.mjs";
72
72
  import { addMonths as Mt } from "date-fns/addMonths";
73
73
  import { getMonth as T } from "date-fns/getMonth";
74
74
  import { i as ia } from "../DateUtil-BcuH7ErC.mjs";
@@ -1,4 +1,4 @@
1
- import { S as Kt, a as Xt } from "../SettingsStore-DneARj4W.mjs";
1
+ import { S as Kt, a as Xt } from "../SettingsStore-BcgS_Ohv.mjs";
2
2
  import { jsxs as c, Fragment as q, jsx as e } from "react/jsx-runtime";
3
3
  import u from "react";
4
4
  import { observer as D } from "mobx-react-lite";
@@ -1,10 +1,10 @@
1
- import { T as Ta } from "../TransactionApi-C4V0XJEk.mjs";
1
+ import { T as Ta } from "../TransactionApi-B3Tksf7L.mjs";
2
2
  import { u as P, C as Pe, D as $e, M as Ve, d as We, c as Ge, T as Ue, a as Fe } from "../TransactionDetails-Cscyr17P.mjs";
3
3
  import { B as Sa, e as xa, b as wa } from "../TransactionDetails-Cscyr17P.mjs";
4
4
  import { T as M } from "../User-BQUxBeZV.mjs";
5
5
  import { O as va } from "../User-BQUxBeZV.mjs";
6
- import { S as ae, D as ze } from "../TransactionStore-FeuQE_RH.mjs";
7
- import { T as Na } from "../TransactionStore-FeuQE_RH.mjs";
6
+ import { S as ae, D as ze } from "../TransactionStore-hfOsBbDt.mjs";
7
+ import { T as Na } from "../TransactionStore-hfOsBbDt.mjs";
8
8
  import { e as Ke } from "../exportTransactionsToCSV-BwwmL4pM.mjs";
9
9
  import { E as Oa } from "../ExportCsvAction-DTO_UotC.mjs";
10
10
  import { jsxs as _, jsx as e } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.2.23-alpha.sms1",
3
+ "version": "7.2.23",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,86 +0,0 @@
1
- import { F as g, A as e } from "./Fetch-87LIQbEA.mjs";
2
- class u {
3
- fetchInstance;
4
- constructor(n, t, a) {
5
- this.fetchInstance = new g(n, t, void 0, a);
6
- }
7
- addTag = async (n) => this.fetchInstance.post(e.TAGS, n).then((t) => t.tag).catch((t) => t);
8
- addTagging = async (n) => this.fetchInstance.post(e.TAGGINGS, n).then((t) => t.tagging).catch((t) => t);
9
- addTransaction = async (n) => this.fetchInstance.post(e.TRANSACTIONS, n).then((t) => t.transaction).catch((t) => t);
10
- addTransactionRule = async (n) => this.fetchInstance.post(e.TRANSACTION_RULES, n).then((t) => t).catch((t) => t);
11
- getTaggings = async () => this.fetchInstance.get(e.TAGGINGS).then((n) => n.map((t) => t.tagging));
12
- getTags = async () => this.fetchInstance.get(e.TAGS).then((n) => n.map((t) => t.tag));
13
- getTransactionRules = async () => this.fetchInstance.get(e.TRANSACTION_RULES).then((n) => n.transaction_rules);
14
- getTransactionsByDateRange = async (n, t) => this.fetchInstance.get(`${e.TRANSACTIONS}/by_date/${n}/${t}`).then((a) => a.map((c) => c.transaction));
15
- // DEPRECATED
16
- getTransactionsByAccountsAndDateRange = async (n, t, a) => {
17
- console.warn("DEPRECATED: getTransactionsByAccountsAndDateRange will be removed");
18
- const c = n.reduce(
19
- (o, s, r) => `${o}account_guids[]=${s}${r !== n.length - 1 ? "&" : ""}`,
20
- ""
21
- );
22
- return this.fetchInstance.get(`${e.TRANSACTIONS}/by_date/${t}/${a}?${c}`).then((o) => o.map((s) => s.transaction));
23
- };
24
- // DEPRECATED
25
- getTransactionsByGuids = async (n) => (console.warn("DEPRECATED: getTransactionsByGuids will be removed"), this.fetchInstance.post(`${e.TRANSACTIONS}/by_guids`, { guids: n.join("+") }).then((t) => t.map((a) => a.transaction)));
26
- // DEPRECATED
27
- getTransactionsByCategoryAndDate = async (n, t, a) => (console.warn("DEPRECATED: getTransactionsByCategoryAndDate will be removed"), this.fetchInstance.get(
28
- `${e.TRANSACTIONS}/by_category_guid/${n}/by_date/${t}/${a}`
29
- ).then((c) => c.map((o) => o.transaction)));
30
- // DEPRECATED
31
- getTransactionsByCategoryDateAndAccounts = async (n, t, a, c) => {
32
- console.warn("DEPRECATED: getTransactionsByCategoryDateAndAccounts will be removed");
33
- const o = c.reduce(
34
- (s, r, i) => `${s}account_guids[]=${r}${i !== c.length - 1 ? "&" : ""}`,
35
- ""
36
- );
37
- return this.fetchInstance.get(
38
- `${e.TRANSACTIONS}/by_category_guid/${n}/by_date/${t}/${a}?${o}`
39
- ).then((s) => s.map((r) => r.transaction));
40
- };
41
- // DEPRECATED
42
- getTransactionsByCategoriesDateAndAccounts = async (n, t, a, c) => {
43
- console.warn("DEPRECATED: getTransactionsByCategoriesDateAndAccounts will be removed");
44
- const o = c.reduce(
45
- (s, r, i) => `${s}account_guids[]=${r}${i !== c.length - 1 ? "&" : ""}`,
46
- ""
47
- );
48
- return this.fetchInstance.get(
49
- `${e.TRANSACTIONS}/by_category_guids/${n.join(
50
- "+"
51
- )}/by_date/${t}/${a}?${o}`
52
- ).then((s) => s.map((r) => r.transaction));
53
- };
54
- /**
55
- * DEPRECATED
56
- * Get all transactions by the top level category, between begin date and end date, and optionally
57
- * filtered by accounts
58
- * @param categoryGuid The top level category guid
59
- * @param beginDate the start date
60
- * @param endDate the end date
61
- * @param accountGuids an optional list of account guids
62
- */
63
- getTransactionsByTopLevelCategoryAndDate = async (n, t, a, c = []) => {
64
- console.warn("DEPRECATED: getTransactionsByTopLevelCategoryAndDate will be removed");
65
- let o = `${e.TRANSACTIONS}/by_top_level_category_guid/${n}/by_date/${t}/${a}`;
66
- if (c.length > 0) {
67
- const s = c.reduce(
68
- (r, i, h) => `${r}account_guids[]=${i}${h !== c.length - 1 ? "&" : ""}`,
69
- ""
70
- );
71
- o += `?${s}`;
72
- }
73
- return this.fetchInstance.get(o).then((s) => s.map((r) => r.transaction));
74
- };
75
- removeTag = async (n) => this.fetchInstance.delete(`${e.TAGS}/${n}`).then((t) => t).catch((t) => t);
76
- removeTagging = async (n) => this.fetchInstance.delete(`${e.TAGGINGS}/${n}`).then((t) => t).catch((t) => t);
77
- removeTransaction = async (n) => this.fetchInstance.delete(`${e.TRANSACTIONS}/${n}`).then((t) => t);
78
- removeTransactionRule = async (n) => this.fetchInstance.delete(`${e.TRANSACTION_RULES}/${n}`).catch((t) => t);
79
- removeTransactionSplit = async (n) => this.fetchInstance.delete(`${e.TRANSACTIONS}/${n}/unsplit`).then((t) => t).catch((t) => t);
80
- updateTransactionRule = async (n) => this.fetchInstance.put(`${e.TRANSACTION_RULES}/${n.guid}`, n).then((t) => t).catch((t) => t);
81
- updateTag = async (n) => this.fetchInstance.put(`${e.TAGS}/${n.guid}`, n).then((t) => t.tag).catch((t) => t);
82
- updateTransaction = async (n) => this.fetchInstance.put(`${e.TRANSACTIONS}/${n.guid}`, n).then((t) => t.transaction).catch((t) => t);
83
- }
84
- export {
85
- u as T
86
- };