@actual-app/api 25.1.0 → 25.2.0

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 (61) hide show
  1. package/@types/loot-core/client/constants.d.ts +0 -11
  2. package/@types/loot-core/client/state-types/index.d.ts +0 -14
  3. package/@types/loot-core/client/state-types/modals.d.ts +7 -2
  4. package/@types/loot-core/mocks/index.d.ts +9 -20
  5. package/@types/loot-core/platform/client/fetch/index.d.ts +10 -1
  6. package/@types/loot-core/platform/client/undo/index.d.ts +8 -4
  7. package/@types/loot-core/platform/server/connection/index.d.ts +1 -1
  8. package/@types/loot-core/server/accounts/sync.d.ts +1 -1
  9. package/@types/loot-core/server/accounts/transaction-rules.d.ts +0 -3
  10. package/@types/loot-core/server/accounts/transactions.d.ts +0 -3
  11. package/@types/loot-core/server/accounts/transfer.d.ts +0 -11
  12. package/@types/loot-core/server/admin/app.d.ts +9 -4
  13. package/@types/loot-core/server/admin/types/handlers.d.ts +4 -2
  14. package/@types/loot-core/server/app.d.ts +14 -4
  15. package/@types/loot-core/server/aql/compiler.d.ts +4 -6
  16. package/@types/loot-core/server/aql/schema/index.d.ts +3 -0
  17. package/@types/loot-core/server/budget/actions.d.ts +6 -0
  18. package/@types/loot-core/server/budget/app.d.ts +10 -5
  19. package/@types/loot-core/server/budget/types/handlers.d.ts +4 -0
  20. package/@types/loot-core/server/dashboard/app.d.ts +9 -4
  21. package/@types/loot-core/server/filters/app.d.ts +9 -4
  22. package/@types/loot-core/server/importers/ynab4-types.d.ts +0 -2
  23. package/@types/loot-core/server/importers/ynab5-types.d.ts +0 -2
  24. package/@types/loot-core/server/main-app.d.ts +10 -5
  25. package/@types/loot-core/server/main.d.ts +2 -2
  26. package/@types/loot-core/server/notes/app.d.ts +9 -4
  27. package/@types/loot-core/server/preferences/app.d.ts +9 -4
  28. package/@types/loot-core/server/reports/app.d.ts +11 -4
  29. package/@types/loot-core/server/rules/app.d.ts +9 -4
  30. package/@types/loot-core/server/rules/types/handlers.d.ts +4 -4
  31. package/@types/loot-core/server/schedules/app.d.ts +10 -7
  32. package/@types/loot-core/server/schedules/types/handlers.d.ts +5 -5
  33. package/@types/loot-core/server/tools/app.d.ts +9 -4
  34. package/@types/loot-core/server/tools/types/handlers.d.ts +2 -1
  35. package/@types/loot-core/shared/schedules.d.ts +5 -31
  36. package/@types/loot-core/shared/transactions.d.ts +101 -17
  37. package/@types/loot-core/shared/util.d.ts +23 -9
  38. package/@types/loot-core/types/api-handlers.d.ts +3 -0
  39. package/@types/loot-core/types/models/dashboard.d.ts +1 -1
  40. package/@types/loot-core/types/models/payee.d.ts +1 -0
  41. package/@types/loot-core/types/models/reports.d.ts +4 -0
  42. package/@types/loot-core/types/models/rule.d.ts +6 -4
  43. package/@types/loot-core/types/models/schedule.d.ts +5 -18
  44. package/@types/loot-core/types/models/simplefin.d.ts +2 -0
  45. package/@types/loot-core/types/models/transaction.d.ts +6 -0
  46. package/@types/loot-core/types/prefs.d.ts +3 -2
  47. package/@types/loot-core/types/server-events.d.ts +80 -17
  48. package/@types/loot-core/types/server-handlers.d.ts +19 -7
  49. package/@types/loot-core/types/util.d.ts +5 -0
  50. package/@types/methods.d.ts +4 -4
  51. package/dist/app/bundle.api.js +334 -187
  52. package/dist/methods.js +4 -1
  53. package/dist/migrations/1736640000000__custom_report_sorting.sql +7 -0
  54. package/dist/migrations/1737158400000_add_learn_categories_to_payees.sql +5 -0
  55. package/dist/migrations/1738491452000__sorting_rename.sql +13 -0
  56. package/dist/package.json +1 -1
  57. package/package.json +1 -1
  58. package/@types/loot-core/client/actions/types.d.ts +0 -6
  59. package/@types/loot-core/client/state-types/account.d.ts +0 -27
  60. package/@types/loot-core/client/state-types/app.d.ts +0 -42
  61. package/@types/loot-core/client/state-types/queries.d.ts +0 -76
package/dist/methods.js CHANGED
@@ -133,10 +133,13 @@ function addTransactions(accountId, transactions, { learnCategories = false, run
133
133
  runTransfers,
134
134
  });
135
135
  }
136
- function importTransactions(accountId, transactions) {
136
+ function importTransactions(accountId, transactions, opts = {
137
+ defaultCleared: true,
138
+ }) {
137
139
  return send('api/transactions-import', {
138
140
  accountId,
139
141
  transactions,
142
+ opts,
140
143
  });
141
144
  }
142
145
  function getTransactions(accountId, startDate, endDate) {
@@ -0,0 +1,7 @@
1
+ BEGIN TRANSACTION;
2
+
3
+ ALTER TABLE custom_reports ADD COLUMN sort_by TEXT DEFAULT 'Descending';
4
+ UPDATE custom_reports SET sort_by = 'Descending';
5
+ UPDATE custom_reports SET sort_by = 'Budget' where graph_type = 'TableGraph';
6
+
7
+ COMMIT;
@@ -0,0 +1,5 @@
1
+ BEGIN TRANSACTION;
2
+
3
+ ALTER TABLE payees ADD COLUMN learn_categories BOOLEAN DEFAULT 1;
4
+
5
+ COMMIT;
@@ -0,0 +1,13 @@
1
+ BEGIN TRANSACTION;
2
+
3
+ ALTER TABLE custom_reports RENAME COLUMN sort_by TO sort_by_old;
4
+ ALTER TABLE custom_reports ADD COLUMN sort_by TEXT DEFAULT 'desc';
5
+
6
+ UPDATE custom_reports SET sort_by = 'desc' where sort_by_old = 'Descending';
7
+ UPDATE custom_reports SET sort_by = 'asc' where sort_by_old = 'Ascending';
8
+ UPDATE custom_reports SET sort_by = 'budget' where sort_by_old = 'Budget';
9
+ UPDATE custom_reports SET sort_by = 'name' where sort_by_old = 'Name';
10
+
11
+ ALTER TABLE custom_reports DROP COLUMN sort_by_old;
12
+
13
+ COMMIT;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actual-app/api",
3
- "version": "25.1.0",
3
+ "version": "25.2.0",
4
4
  "license": "MIT",
5
5
  "description": "An API for Actual",
6
6
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actual-app/api",
3
- "version": "25.1.0",
3
+ "version": "25.2.0",
4
4
  "license": "MIT",
5
5
  "description": "An API for Actual",
6
6
  "engines": {
@@ -1,6 +0,0 @@
1
- import type { ThunkDispatch } from 'redux-thunk';
2
-
3
- import type { State, Action } from '../state-types';
4
-
5
- export type Dispatch = ThunkDispatch<State, never, Action>;
6
- export type GetState = () => State;
@@ -1,27 +0,0 @@
1
- import type * as constants from '../constants';
2
-
3
- export type AccountState = {
4
- failedAccounts: Map<string, { type: string; code: string }>;
5
- accountsSyncing: string[];
6
- };
7
-
8
- export type SetAccountsSyncingAction = {
9
- type: typeof constants.SET_ACCOUNTS_SYNCING;
10
- ids: string[];
11
- };
12
-
13
- export type AccountSyncStatusAction = {
14
- type: typeof constants.ACCOUNT_SYNC_STATUS;
15
- id: string;
16
- } & (
17
- | {
18
- failed: false;
19
- }
20
- | {
21
- failed: true;
22
- errorType: string;
23
- errorCode: string;
24
- }
25
- );
26
-
27
- export type AccountActions = SetAccountsSyncingAction | AccountSyncStatusAction;
@@ -1,42 +0,0 @@
1
- import type { UndoState } from '../../server/undo';
2
- import type * as constants from '../constants';
3
-
4
- export type SplitMode = 'collapse' | 'expand';
5
- export type SplitState = {
6
- ids: Set<string>;
7
- mode: SplitMode;
8
- transitionId: string | null;
9
- };
10
-
11
- export type AppState = {
12
- loadingText: string | null;
13
- updateInfo: {
14
- version: string;
15
- releaseDate: string;
16
- releaseNotes: string;
17
- } | null;
18
- showUpdateNotification: boolean;
19
- managerHasInitialized: boolean;
20
- lastUndoState: { current: UndoState | null };
21
- lastSplitState: { current: SplitState | null };
22
- };
23
-
24
- export type SetAppStateAction = {
25
- type: typeof constants.SET_APP_STATE;
26
- state: Partial<AppState>;
27
- };
28
-
29
- export type SetLastUndoStateAction = {
30
- type: typeof constants.SET_LAST_UNDO_STATE;
31
- undoState: UndoState | null;
32
- };
33
-
34
- export type SetLastSplitStateAction = {
35
- type: typeof constants.SET_LAST_SPLIT_STATE;
36
- splitState: SplitState | null;
37
- };
38
-
39
- export type AppActions =
40
- | SetAppStateAction
41
- | SetLastUndoStateAction
42
- | SetLastSplitStateAction;
@@ -1,76 +0,0 @@
1
- import type { Handlers } from '../../types/handlers';
2
- import { type TransactionEntity, type AccountEntity } from '../../types/models';
3
- import type * as constants from '../constants';
4
-
5
- export type QueriesState = {
6
- newTransactions: Array<TransactionEntity['id']>;
7
- matchedTransactions: Array<TransactionEntity['id']>;
8
- lastTransaction: TransactionEntity | null;
9
- updatedAccounts: Array<AccountEntity['id']>;
10
- accounts: AccountEntity[];
11
- accountsLoaded: boolean;
12
- categories: Awaited<ReturnType<Handlers['get-categories']>>;
13
- categoriesLoaded: boolean;
14
- commonPayeesLoaded: boolean;
15
- commonPayees: Awaited<ReturnType<Handlers['common-payees-get']>>;
16
- payees: Awaited<ReturnType<Handlers['payees-get']>>;
17
- payeesLoaded: boolean;
18
- };
19
-
20
- type SetNewTransactionsAction = {
21
- type: typeof constants.SET_NEW_TRANSACTIONS;
22
- newTransactions?: Array<TransactionEntity['id']>;
23
- matchedTransactions?: Array<TransactionEntity['id']>;
24
- updatedAccounts?: Array<AccountEntity['id']>;
25
- };
26
-
27
- type UpdateNewTransactionsAction = {
28
- type: typeof constants.UPDATE_NEW_TRANSACTIONS;
29
- changedId: string;
30
- };
31
-
32
- type SetLastTransactionAction = {
33
- type: typeof constants.SET_LAST_TRANSACTION;
34
- transaction: TransactionEntity;
35
- };
36
-
37
- type MarkAccountReadAction = {
38
- type: typeof constants.MARK_ACCOUNT_READ;
39
- accountId: string;
40
- };
41
-
42
- type LoadAccountsAction = {
43
- type: typeof constants.LOAD_ACCOUNTS;
44
- accounts: AccountEntity[];
45
- };
46
-
47
- type UpdateAccountAction = {
48
- type: typeof constants.UPDATE_ACCOUNT;
49
- account: AccountEntity;
50
- };
51
-
52
- type LoadCategoriesAction = {
53
- type: typeof constants.LOAD_CATEGORIES;
54
- categories: State['categories'];
55
- };
56
-
57
- type LoadPayeesAction = {
58
- type: typeof constants.LOAD_PAYEES;
59
- payees: State['payees'];
60
- };
61
-
62
- type LoadCommonPayeesAction = {
63
- type: typeof constants.LOAD_COMMON_PAYEES;
64
- payees: State['common_payees'];
65
- };
66
-
67
- export type QueriesActions =
68
- | SetNewTransactionsAction
69
- | UpdateNewTransactionsAction
70
- | SetLastTransactionAction
71
- | MarkAccountReadAction
72
- | LoadAccountsAction
73
- | UpdateAccountAction
74
- | LoadCategoriesAction
75
- | LoadCommonPayeesAction
76
- | LoadPayeesAction;