@actual-app/api 25.3.1 → 25.4.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 (101) hide show
  1. package/@types/loot-core/client/accounts/accountsSlice.d.ts +175 -0
  2. package/@types/loot-core/client/app/appSlice.d.ts +175 -0
  3. package/@types/loot-core/client/budgets/budgetsSlice.d.ts +401 -0
  4. package/@types/loot-core/client/modals/modalsSlice.d.ts +486 -0
  5. package/@types/loot-core/client/notifications/notificationsSlice.d.ts +47 -0
  6. package/@types/loot-core/client/platform.d.ts +1 -0
  7. package/@types/loot-core/client/prefs/prefsSlice.d.ts +186 -0
  8. package/@types/loot-core/client/queries/queriesSlice.d.ts +692 -0
  9. package/@types/loot-core/client/redux.d.ts +18546 -0
  10. package/@types/loot-core/client/store/index.d.ts +133 -0
  11. package/@types/loot-core/client/users/usersSlice.d.ts +89 -0
  12. package/@types/loot-core/platform/client/fetch/index.d.ts +1 -10
  13. package/@types/loot-core/platform/client/undo/index.d.ts +19 -31
  14. package/@types/loot-core/platform/exceptions/index.d.ts +2 -5
  15. package/@types/loot-core/platform/server/connection/index.d.ts +0 -3
  16. package/@types/loot-core/platform/server/fetch/index.d.ts +1 -4
  17. package/@types/loot-core/platform/server/log/index.d.ts +4 -6
  18. package/@types/loot-core/server/accounts/app.d.ts +19 -5
  19. package/@types/loot-core/server/accounts/link.d.ts +6 -1
  20. package/@types/loot-core/server/admin/app.d.ts +54 -1
  21. package/@types/loot-core/server/api-models.d.ts +22 -22
  22. package/@types/loot-core/server/aql/exec.d.ts +1 -1
  23. package/@types/loot-core/server/aql/schema/index.d.ts +9 -0
  24. package/@types/loot-core/server/budget/actions.d.ts +6 -5
  25. package/@types/loot-core/server/budget/app.d.ts +103 -2
  26. package/@types/loot-core/server/budget/cleanup-template.d.ts +1 -1
  27. package/@types/loot-core/server/budget/goaltemplates.d.ts +1 -1
  28. package/@types/loot-core/server/budget/statements.d.ts +2 -2
  29. package/@types/loot-core/server/budget/template-notes.d.ts +1 -1
  30. package/@types/loot-core/server/budget/types/templates.d.ts +2 -1
  31. package/@types/loot-core/server/cloud-storage.d.ts +1 -1
  32. package/@types/loot-core/server/dashboard/app.d.ts +35 -1
  33. package/@types/loot-core/server/db/index.d.ts +38 -31
  34. package/@types/loot-core/server/db/sort.d.ts +1 -1
  35. package/@types/loot-core/server/encryption-internals.d.ts +5 -5
  36. package/@types/loot-core/server/encryption-internals.web.d.ts +2 -2
  37. package/@types/loot-core/server/encryption.d.ts +3 -3
  38. package/@types/loot-core/server/filters/app.d.ts +10 -1
  39. package/@types/loot-core/server/main-app.d.ts +1 -1
  40. package/@types/loot-core/server/models.d.ts +24 -23
  41. package/@types/loot-core/server/notes/app.d.ts +6 -1
  42. package/@types/loot-core/server/payees/app.d.ts +48 -0
  43. package/@types/loot-core/server/preferences/app.d.ts +1 -10
  44. package/@types/loot-core/server/reports/app.d.ts +9 -1
  45. package/@types/loot-core/server/rules/app.d.ts +50 -1
  46. package/@types/loot-core/server/schedules/app.d.ts +25 -2
  47. package/@types/loot-core/server/schedules/find-schedules.d.ts +1 -1
  48. package/@types/loot-core/server/server-config.d.ts +1 -0
  49. package/@types/loot-core/server/sheet.d.ts +1 -1
  50. package/@types/loot-core/server/spreadsheet/app.d.ts +38 -0
  51. package/@types/loot-core/server/spreadsheet/graph-data-structure.d.ts +4 -4
  52. package/@types/loot-core/server/spreadsheet/spreadsheet.d.ts +3 -2
  53. package/@types/loot-core/server/sync/app.d.ts +38 -0
  54. package/@types/loot-core/server/sync/make-test-message.d.ts +1 -1
  55. package/@types/loot-core/server/tools/app.d.ts +13 -1
  56. package/@types/loot-core/server/transactions/transaction-rules.d.ts +5 -4
  57. package/@types/loot-core/server/undo.d.ts +1 -1
  58. package/@types/loot-core/shared/async.d.ts +4 -3
  59. package/@types/loot-core/shared/locale.d.ts +1 -0
  60. package/@types/loot-core/shared/months.d.ts +2 -2
  61. package/@types/loot-core/shared/schedules.d.ts +5 -3
  62. package/@types/loot-core/shared/util.d.ts +4 -1
  63. package/@types/loot-core/types/handlers.d.ts +16 -10
  64. package/@types/loot-core/types/models/account.d.ts +2 -1
  65. package/@types/loot-core/types/models/bank-sync.d.ts +1 -1
  66. package/@types/loot-core/types/models/index.d.ts +5 -1
  67. package/@types/loot-core/types/models/openid.d.ts +2 -1
  68. package/@types/loot-core/types/models/payee.d.ts +2 -2
  69. package/@types/loot-core/types/models/pluggyai.d.ts +18 -0
  70. package/@types/loot-core/types/models/user-access.d.ts +10 -0
  71. package/@types/loot-core/types/models/user.d.ts +17 -18
  72. package/@types/loot-core/types/prefs.d.ts +13 -1
  73. package/@types/loot-core/types/server-handlers.d.ts +0 -99
  74. package/@types/loot-core/types/util.d.ts +7 -0
  75. package/dist/app/bundle.api.js +93474 -49655
  76. package/dist/index.js +17 -7
  77. package/dist/jest.config.js +0 -2
  78. package/dist/methods.js +17 -7
  79. package/dist/migrations/1740506588539_add_last_reconciled_at.sql +5 -0
  80. package/dist/package.json +8 -8
  81. package/dist/validateNodeVersion.js +17 -7
  82. package/package.json +8 -8
  83. package/@types/loot-core/client/constants.d.ts +0 -21
  84. package/@types/loot-core/client/state-types/budgets.d.ts +0 -36
  85. package/@types/loot-core/client/state-types/index.d.ts +0 -27
  86. package/@types/loot-core/client/state-types/modals.d.ts +0 -392
  87. package/@types/loot-core/client/state-types/notifications.d.ts +0 -57
  88. package/@types/loot-core/client/state-types/prefs.d.ts +0 -40
  89. package/@types/loot-core/client/state-types/user.d.ts +0 -13
  90. package/@types/loot-core/server/admin/types/handlers.d.ts +0 -43
  91. package/@types/loot-core/server/budget/types/handlers.d.ts +0 -91
  92. package/@types/loot-core/server/dashboard/types/handlers.d.ts +0 -24
  93. package/@types/loot-core/server/filters/types/handlers.d.ts +0 -7
  94. package/@types/loot-core/server/notes/types/handlers.d.ts +0 -3
  95. package/@types/loot-core/server/reports/types/handlers.d.ts +0 -6
  96. package/@types/loot-core/server/rules/types/handlers.d.ts +0 -40
  97. package/@types/loot-core/server/schedules/types/handlers.d.ts +0 -31
  98. package/@types/loot-core/server/tools/types/handlers.d.ts +0 -11
  99. package/@types/loot-core/types/models/userAccess.d.ts +0 -9
  100. package/dist/methods.test.js +0 -541
  101. /package/@types/{methods.test.d.ts → loot-core/server/api.test.d.ts} +0 -0
@@ -1,57 +0,0 @@
1
- import type * as constants from '../constants';
2
-
3
- export type Notification = {
4
- id?: string | undefined;
5
- // 'warning' is unhandled??
6
- type?: 'message' | 'error' | 'warning';
7
- pre?: string | undefined;
8
- title?: string | undefined;
9
- message: string;
10
- sticky?: boolean | undefined;
11
- timeout?: number | undefined;
12
- button?:
13
- | {
14
- title: string;
15
- action: () => void | Promise<void>;
16
- }
17
- | undefined;
18
- messageActions?: Record<string, () => void> | undefined;
19
- onClose?: (() => void) | undefined;
20
- internal?: string | undefined;
21
- };
22
- type NotificationWithId = Notification & { id: string };
23
-
24
- export type NotificationsState = {
25
- notifications: NotificationWithId[];
26
- inset?: {
27
- bottom?: number;
28
- top?: number;
29
- right?: number;
30
- left?: number;
31
- };
32
- };
33
-
34
- type AddNotificationAction = {
35
- type: typeof constants.ADD_NOTIFICATION;
36
- notification: NotificationWithId;
37
- };
38
-
39
- type RemoveNotificationAction = {
40
- type: typeof constants.REMOVE_NOTIFICATION;
41
- id: string;
42
- };
43
-
44
- type SetNotificationInsetAction = {
45
- type: typeof constants.SET_NOTIFICATION_INSET;
46
- inset: {
47
- bottom?: number;
48
- top?: number;
49
- right?: number;
50
- left?: number;
51
- };
52
- };
53
-
54
- export type NotificationsActions =
55
- | AddNotificationAction
56
- | RemoveNotificationAction
57
- | SetNotificationInsetAction;
@@ -1,40 +0,0 @@
1
- import type {
2
- GlobalPrefs,
3
- MetadataPrefs,
4
- SyncedPrefs,
5
- } from '../../types/prefs';
6
- import type * as constants from '../constants';
7
-
8
- export type PrefsState = {
9
- local: MetadataPrefs;
10
- global: GlobalPrefs;
11
- synced: SyncedPrefs;
12
- };
13
-
14
- export type SetPrefsAction = {
15
- type: typeof constants.SET_PREFS;
16
- prefs: MetadataPrefs;
17
- globalPrefs: GlobalPrefs;
18
- syncedPrefs: SyncedPrefs;
19
- };
20
-
21
- export type MergeLocalPrefsAction = {
22
- type: typeof constants.MERGE_LOCAL_PREFS;
23
- prefs: MetadataPrefs;
24
- };
25
-
26
- export type MergeGlobalPrefsAction = {
27
- type: typeof constants.MERGE_GLOBAL_PREFS;
28
- globalPrefs: GlobalPrefs;
29
- };
30
-
31
- export type MergeSyncedPrefsAction = {
32
- type: typeof constants.MERGE_SYNCED_PREFS;
33
- syncedPrefs: SyncedPrefs;
34
- };
35
-
36
- export type PrefsActions =
37
- | SetPrefsAction
38
- | MergeLocalPrefsAction
39
- | MergeGlobalPrefsAction
40
- | MergeSyncedPrefsAction;
@@ -1,13 +0,0 @@
1
- import type { Handlers } from '../../types/handlers';
2
- import type * as constants from '../constants';
3
-
4
- export type UserState = {
5
- data: Awaited<ReturnType<Handlers['subscribe-get-user']>>;
6
- };
7
-
8
- export type GetUserDataAction = {
9
- type: typeof constants.GET_USER_DATA;
10
- data: State['data'];
11
- };
12
-
13
- export type UserActions = GetUserDataAction;
@@ -1,43 +0,0 @@
1
- import { UserAvailable, UserEntity } from '../../../types/models/user';
2
- import { NewUserAccessEntity } from '../../../types/models/userAccess';
3
- export interface AdminHandlers {
4
- 'users-get': () => Promise<UserEntity[] | null | {
5
- error: string;
6
- }>;
7
- 'user-delete-all': (ids: string[]) => Promise<{
8
- someDeletionsFailed: boolean;
9
- ids?: number[];
10
- } | {
11
- error: string;
12
- }>;
13
- 'user-add': (user: Omit<UserEntity, 'id'>) => Promise<{
14
- error: string;
15
- } | {
16
- id: string;
17
- }>;
18
- 'user-update': (user: Omit<UserEntity, 'id'>) => Promise<{
19
- error: string;
20
- } | {
21
- id: string;
22
- }>;
23
- 'access-add': (user: NewUserAccessEntity) => Promise<{
24
- error?: string;
25
- } | Record<string, never>>;
26
- 'access-delete-all': ({ fileId, ids, }: {
27
- fileId: string;
28
- ids: string[];
29
- }) => Promise<{
30
- someDeletionsFailed: boolean;
31
- ids?: number[];
32
- }>;
33
- 'access-get-available-users': (fileId: string) => Promise<UserAvailable[] | {
34
- error: string;
35
- }>;
36
- 'transfer-ownership': ({ fileId, newUserId, }: {
37
- fileId: string;
38
- newUserId: string;
39
- }) => Promise<{
40
- error?: string;
41
- } | Record<string, never>>;
42
- 'owner-created': () => Promise<boolean>;
43
- }
@@ -1,91 +0,0 @@
1
- import type { Notification } from '../../../client/state-types/notifications';
2
-
3
- export interface BudgetHandlers {
4
- 'budget/budget-amount': (arg: {
5
- category: string /* category id */;
6
- month: string;
7
- amount: number;
8
- }) => Promise<void>;
9
-
10
- 'budget/copy-previous-month': (arg: { month: string }) => Promise<void>;
11
-
12
- 'budget/set-zero': (arg: { month: string }) => Promise<void>;
13
-
14
- 'budget/set-3month-avg': (arg: { month: string }) => Promise<void>;
15
-
16
- 'budget/set-6month-avg': (arg: { month: string }) => Promise<void>;
17
-
18
- 'budget/set-12month-avg': (arg: { month: string }) => Promise<void>;
19
-
20
- 'budget/check-templates': () => Promise<Notification>;
21
-
22
- 'budget/apply-goal-template': (arg: {
23
- month: string;
24
- }) => Promise<Notification>;
25
-
26
- 'budget/overwrite-goal-template': (arg: {
27
- month: string;
28
- }) => Promise<Notification>;
29
-
30
- 'budget/cleanup-goal-template': (arg: {
31
- month: string;
32
- }) => Promise<Notification>;
33
-
34
- 'budget/hold-for-next-month': (arg: {
35
- month: string;
36
- amount: number;
37
- }) => Promise<boolean>;
38
-
39
- 'budget/reset-hold': (arg: { month: string }) => Promise<void>;
40
-
41
- 'budget/cover-overspending': (arg: {
42
- month: string;
43
- to: string;
44
- from: string;
45
- }) => Promise<void>;
46
-
47
- 'budget/transfer-available': (arg: {
48
- month: string;
49
- amount: number;
50
- category: string;
51
- }) => Promise<void>;
52
-
53
- 'budget/cover-overbudgeted': (arg: {
54
- month: string;
55
- category: string;
56
- }) => Promise<void>;
57
-
58
- 'budget/transfer-category': (arg: {
59
- month: string;
60
- amount: number;
61
- to: string;
62
- from: string;
63
- }) => Promise<void>;
64
-
65
- 'budget/set-carryover': (arg: {
66
- startMonth: string;
67
- category: string;
68
- flag: boolean;
69
- }) => Promise<void>;
70
-
71
- 'budget/apply-single-template': (arg: {
72
- month: string;
73
- category: string; //category id
74
- }) => Promise<Notification>;
75
-
76
- 'budget/set-n-month-avg': (arg: {
77
- month: string;
78
- N: number;
79
- category: string; //category id
80
- }) => Promise<void>;
81
-
82
- 'budget/copy-single-month': (arg: {
83
- month: string;
84
- category: string; //category id
85
- }) => Promise<void>;
86
-
87
- 'budget/apply-multiple-templates': (arg: {
88
- month: string;
89
- categoryIds: string[];
90
- }) => Promise<Notification>;
91
- }
@@ -1,24 +0,0 @@
1
- import { type Widget } from '../../../types/models';
2
- import { type EverythingButIdOptional } from '../../../types/util';
3
-
4
- export interface DashboardHandlers {
5
- 'dashboard-update': (
6
- widgets: EverythingButIdOptional<Omit<Widget, 'tombstone'>>[],
7
- ) => Promise<void>;
8
- 'dashboard-update-widget': (
9
- widget: EverythingButIdOptional<Omit<Widget, 'tombstone'>>,
10
- ) => Promise<void>;
11
- 'dashboard-reset': () => Promise<void>;
12
- 'dashboard-add-widget': (
13
- widget: Omit<Widget, 'id' | 'x' | 'y' | 'tombstone'> &
14
- Partial<Pick<Widget, 'x' | 'y'>>,
15
- ) => Promise<void>;
16
- 'dashboard-remove-widget': (widgetId: string) => Promise<void>;
17
- 'dashboard-import': (args: {
18
- filepath: string;
19
- }) => Promise<
20
- | { status: 'ok' }
21
- | { error: 'json-parse-error' | 'internal-error' }
22
- | { error: 'validation-error'; message: string }
23
- >;
24
- }
@@ -1,7 +0,0 @@
1
- export interface FiltersHandlers {
2
- 'filter-create': (filter: object) => Promise<string>;
3
-
4
- 'filter-update': (filter: object) => Promise<void>;
5
-
6
- 'filter-delete': (id: string) => Promise<void>;
7
- }
@@ -1,3 +0,0 @@
1
- export interface NotesHandlers {
2
- 'notes-save': (arg: { id; note }) => Promise<unknown>;
3
- }
@@ -1,6 +0,0 @@
1
- import { type CustomReportEntity } from '../../../types/models';
2
- export interface ReportsHandlers {
3
- 'report/create': (report: CustomReportEntity) => Promise<string>;
4
- 'report/update': (report: CustomReportEntity) => Promise<void>;
5
- 'report/delete': (id: string) => Promise<void>;
6
- }
@@ -1,40 +0,0 @@
1
- import { type Action } from '..';
2
- import { type RuleEntity, type TransactionEntity, type RuleActionEntity } from '../../../types/models';
3
- type ValidationError = {
4
- conditionErrors: string[];
5
- actionErrors: string[];
6
- };
7
- export interface RulesHandlers {
8
- 'rule-validate': (rule: Partial<RuleEntity>) => Promise<{
9
- error: ValidationError | null;
10
- }>;
11
- 'rule-add': (rule: Omit<RuleEntity, 'id'>) => Promise<{
12
- error: ValidationError;
13
- } | RuleEntity>;
14
- 'rule-update': <PartialRule extends Partial<Omit<RuleEntity, 'id'>> & Pick<RuleEntity, 'id'>>(rule: PartialRule) => Promise<{
15
- error: ValidationError;
16
- } | PartialRule>;
17
- 'rule-delete': (id: string) => Promise<boolean>;
18
- 'rule-delete-all': (ids: string[]) => Promise<{
19
- someDeletionsFailed: boolean;
20
- }>;
21
- 'rule-apply-actions': (arg: {
22
- transactions: TransactionEntity[];
23
- actions: Array<Action | RuleActionEntity>;
24
- }) => Promise<null | {
25
- added: TransactionEntity[];
26
- updated: unknown[];
27
- }>;
28
- 'rule-add-payee-rename': (arg: {
29
- fromNames: string[];
30
- to: string;
31
- }) => Promise<string>;
32
- 'rules-get': () => Promise<RuleEntity[]>;
33
- 'rule-get': (arg: {
34
- id: RuleEntity['id'];
35
- }) => Promise<RuleEntity>;
36
- 'rules-run': (arg: {
37
- transaction: TransactionEntity;
38
- }) => Promise<TransactionEntity>;
39
- }
40
- export {};
@@ -1,31 +0,0 @@
1
- import { DiscoverScheduleEntity, ScheduleEntity } from '../../../types/models';
2
- export interface SchedulesHandlers {
3
- 'schedule/create': (arg: {
4
- schedule: {
5
- id?: string;
6
- name?: string;
7
- posts_transaction?: boolean;
8
- };
9
- conditions: unknown[];
10
- }) => Promise<string>;
11
- 'schedule/update': (schedule: {
12
- schedule: any;
13
- conditions?: any;
14
- resetNextDate?: boolean;
15
- }) => Promise<ScheduleEntity['id']>;
16
- 'schedule/delete': (arg: {
17
- id: ScheduleEntity['id'];
18
- }) => Promise<void>;
19
- 'schedule/skip-next-date': (arg: {
20
- id: ScheduleEntity['id'];
21
- }) => Promise<void>;
22
- 'schedule/post-transaction': (arg: {
23
- id: ScheduleEntity['id'];
24
- }) => Promise<void>;
25
- 'schedule/force-run-service': () => Promise<unknown>;
26
- 'schedule/discover': () => Promise<DiscoverScheduleEntity[]>;
27
- 'schedule/get-upcoming-dates': (arg: {
28
- config: any;
29
- count: number;
30
- }) => Promise<string[]>;
31
- }
@@ -1,11 +0,0 @@
1
- import { TransactionEntity } from '../../../types/models';
2
-
3
- export interface ToolsHandlers {
4
- 'tools/fix-split-transactions': () => Promise<{
5
- numBlankPayees: number;
6
- numCleared: number;
7
- numDeleted: number;
8
- numTransfersFixed: number;
9
- mismatchedSplits: TransactionEntity[];
10
- }>;
11
- }
@@ -1,9 +0,0 @@
1
- export interface NewUserAccessEntity {
2
- fileId: string;
3
- userId: string;
4
- }
5
- export interface UserAccessEntity extends NewUserAccessEntity {
6
- displayName: string;
7
- userName: string;
8
- fileName: string;
9
- }