@actual-app/api 25.2.1 → 25.3.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.
- package/@types/index.d.ts +0 -1
- package/@types/loot-core/client/state-types/modals.d.ts +8 -2
- package/@types/loot-core/client/state-types/notifications.d.ts +14 -12
- package/@types/loot-core/mocks/index.d.ts +1 -4
- package/@types/loot-core/platform/client/fetch/index.d.ts +15 -9
- package/@types/loot-core/platform/server/asyncStorage/index.d.ts +20 -6
- package/@types/loot-core/server/accounts/app.d.ts +149 -0
- package/@types/loot-core/server/accounts/payees.d.ts +3 -3
- package/@types/loot-core/server/accounts/sync.d.ts +19 -13
- package/@types/loot-core/server/aql/exec.d.ts +1 -1
- package/@types/loot-core/server/aql/schema/index.d.ts +6 -0
- package/@types/loot-core/server/budget/categoryTemplate.d.ts +3 -1
- package/@types/loot-core/server/budget/statements.d.ts +2 -2
- package/@types/loot-core/server/budget/types/templates.d.ts +2 -1
- package/@types/loot-core/server/db/index.d.ts +30 -24
- package/@types/loot-core/server/db/types/index.d.ts +259 -0
- package/@types/loot-core/server/errors.d.ts +11 -4
- package/@types/loot-core/server/importers/ynab5-types.d.ts +2 -0
- package/@types/loot-core/server/main-app.d.ts +1 -1
- package/@types/loot-core/server/main.d.ts +1 -0
- package/@types/loot-core/server/post.d.ts +1 -1
- package/@types/loot-core/server/preferences/app.d.ts +29 -2
- package/@types/loot-core/server/rules/types/handlers.d.ts +1 -1
- package/@types/loot-core/server/schedules/app.d.ts +1 -1
- package/@types/loot-core/server/transactions/app.d.ts +58 -0
- package/@types/loot-core/server/{accounts → transactions/import}/parse-file.d.ts +1 -1
- package/@types/loot-core/server/{accounts → transactions}/transaction-rules.d.ts +4 -3
- package/@types/loot-core/server/util/custom-sync-mapping.d.ts +4 -0
- package/@types/loot-core/shared/transactions.d.ts +4 -0
- package/@types/loot-core/shared/util.d.ts +3 -4
- package/@types/loot-core/types/api-handlers.d.ts +2 -1
- package/@types/loot-core/types/handlers.d.ts +6 -2
- package/@types/loot-core/types/models/account.d.ts +3 -0
- package/@types/loot-core/types/models/bank-sync.d.ts +2 -0
- package/@types/loot-core/types/models/bank.d.ts +6 -0
- package/@types/loot-core/types/models/gocardless.d.ts +8 -0
- package/@types/loot-core/types/models/simplefin.d.ts +8 -0
- package/@types/loot-core/types/models/transaction.d.ts +1 -0
- package/@types/loot-core/types/prefs.d.ts +26 -0
- package/@types/loot-core/types/server-handlers.d.ts +19 -169
- package/@types/methods.d.ts +12 -12
- package/dist/app/bundle.api.js +20819 -19585
- package/dist/index.js +1 -3
- package/dist/migrations/1739139550000_bank_sync_page.sql +7 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/@types/loot-core/server/db/types.d.ts +0 -9
- package/@types/loot-core/server/preferences/types/handlers.d.ts +0 -10
- /package/@types/loot-core/server/{accounts/rules.d.ts → rules/index.d.ts} +0 -0
- /package/@types/loot-core/server/{accounts → transactions/export}/export-to-csv.d.ts +0 -0
- /package/@types/loot-core/server/{accounts → transactions/import}/ofx2json.d.ts +0 -0
- /package/@types/loot-core/server/{accounts → transactions/import}/qif2json.d.ts +0 -0
- /package/@types/loot-core/server/{accounts → transactions/import}/xmlcamt2json.d.ts +0 -0
- /package/@types/loot-core/server/{accounts/transactions.d.ts → transactions/index.d.ts} +0 -0
- /package/@types/loot-core/server/{accounts → transactions}/transfer.d.ts +0 -0
- /package/dist/migrations/{1736640000000__custom_report_sorting.sql → 1736640000000_custom_report_sorting.sql} +0 -0
- /package/dist/migrations/{1738491452000__sorting_rename.sql → 1738491452000_sorting_rename.sql} +0 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
type JsonString = string;
|
|
2
|
+
export type DbAccount = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
offbudget: 1 | 0;
|
|
6
|
+
closed: 1 | 0;
|
|
7
|
+
tombstone: 1 | 0;
|
|
8
|
+
sort_order: number;
|
|
9
|
+
account_id?: string | null;
|
|
10
|
+
balance_current?: number | null;
|
|
11
|
+
balance_available?: number | null;
|
|
12
|
+
balance_limit?: number | null;
|
|
13
|
+
mask?: string | null;
|
|
14
|
+
official_name?: string | null;
|
|
15
|
+
type?: string | null;
|
|
16
|
+
subtype?: string | null;
|
|
17
|
+
bank?: string | null;
|
|
18
|
+
account_sync_source?: 'simpleFin' | 'goCardless' | null;
|
|
19
|
+
};
|
|
20
|
+
export type DbBank = {
|
|
21
|
+
id: string;
|
|
22
|
+
bank_id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
tombstone: 1 | 0;
|
|
25
|
+
};
|
|
26
|
+
export type DbCategory = {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
is_income: 1 | 0;
|
|
30
|
+
cat_group: DbCategoryGroup['id'];
|
|
31
|
+
sort_order: number;
|
|
32
|
+
hidden: 1 | 0;
|
|
33
|
+
goal_def?: JsonString | null;
|
|
34
|
+
tombstone: 1 | 0;
|
|
35
|
+
};
|
|
36
|
+
export type DbCategoryGroup = {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
is_income: 1 | 0;
|
|
40
|
+
sort_order: number;
|
|
41
|
+
hidden: 1 | 0;
|
|
42
|
+
tombstone: 1 | 0;
|
|
43
|
+
};
|
|
44
|
+
export type DbCategoryMapping = {
|
|
45
|
+
id: DbCategory['id'];
|
|
46
|
+
transferId: DbCategory['id'];
|
|
47
|
+
};
|
|
48
|
+
export type DbKvCache = {
|
|
49
|
+
key: string;
|
|
50
|
+
value: string;
|
|
51
|
+
};
|
|
52
|
+
export type DbKvCacheKey = {
|
|
53
|
+
id: number;
|
|
54
|
+
key: number;
|
|
55
|
+
};
|
|
56
|
+
export type DbClockMessage = {
|
|
57
|
+
id: string;
|
|
58
|
+
clock: string;
|
|
59
|
+
};
|
|
60
|
+
export type DbCrdtMessage = {
|
|
61
|
+
id: string;
|
|
62
|
+
timestamp: string;
|
|
63
|
+
dataset: string;
|
|
64
|
+
row: string;
|
|
65
|
+
column: string;
|
|
66
|
+
value: Uint8Array;
|
|
67
|
+
};
|
|
68
|
+
export type DbNote = {
|
|
69
|
+
id: string;
|
|
70
|
+
note: string;
|
|
71
|
+
};
|
|
72
|
+
export type DbPayeeMapping = {
|
|
73
|
+
id: DbPayee['id'];
|
|
74
|
+
targetId: DbPayee['id'];
|
|
75
|
+
};
|
|
76
|
+
export type DbPayee = {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
transfer_acct?: DbAccount['id'] | null;
|
|
80
|
+
favorite: 1 | 0;
|
|
81
|
+
learn_categories: 1 | 0;
|
|
82
|
+
tombstone: 1 | 0;
|
|
83
|
+
category?: string | null;
|
|
84
|
+
};
|
|
85
|
+
export type DbRule = {
|
|
86
|
+
id: string;
|
|
87
|
+
stage: string;
|
|
88
|
+
conditions: JsonString;
|
|
89
|
+
actions: JsonString;
|
|
90
|
+
tombstone: 1 | 0;
|
|
91
|
+
conditions_op: string;
|
|
92
|
+
};
|
|
93
|
+
export type DbSchedule = {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
rule: DbRule['id'];
|
|
97
|
+
active: 1 | 0;
|
|
98
|
+
completed: 1 | 0;
|
|
99
|
+
posts_transaction: 1 | 0;
|
|
100
|
+
tombstone: 1 | 0;
|
|
101
|
+
};
|
|
102
|
+
export type DbScheduleNextDate = {
|
|
103
|
+
id: string;
|
|
104
|
+
schedule_id: DbSchedule['id'];
|
|
105
|
+
local_next_date: number;
|
|
106
|
+
local_next_date_ts: number;
|
|
107
|
+
base_next_date: number;
|
|
108
|
+
base_next_date_ts: number;
|
|
109
|
+
};
|
|
110
|
+
export type DbTransaction = {
|
|
111
|
+
id: string;
|
|
112
|
+
isParent: 1 | 0;
|
|
113
|
+
isChild: 1 | 0;
|
|
114
|
+
date: number;
|
|
115
|
+
acct: DbAccount['id'];
|
|
116
|
+
amount: number;
|
|
117
|
+
sort_order: number;
|
|
118
|
+
parent_id?: DbTransaction['id'] | null;
|
|
119
|
+
category?: DbCategory['id'] | null;
|
|
120
|
+
description?: string | null;
|
|
121
|
+
notes?: string | null;
|
|
122
|
+
financial_id?: string | null;
|
|
123
|
+
error?: string | null;
|
|
124
|
+
imported_description?: string | null;
|
|
125
|
+
transferred_id?: DbTransaction['id'] | null;
|
|
126
|
+
schedule?: DbSchedule['id'] | null;
|
|
127
|
+
starting_balance_flag: 1 | 0;
|
|
128
|
+
tombstone: 1 | 0;
|
|
129
|
+
cleared: 1 | 0;
|
|
130
|
+
reconciled: 1 | 0;
|
|
131
|
+
pending?: 1 | 0 | null;
|
|
132
|
+
location?: string | null;
|
|
133
|
+
type?: string | null;
|
|
134
|
+
};
|
|
135
|
+
export type DbReflectBudget = {
|
|
136
|
+
id: string;
|
|
137
|
+
month: number;
|
|
138
|
+
category: string;
|
|
139
|
+
amount: number;
|
|
140
|
+
carryover: number;
|
|
141
|
+
goal: number;
|
|
142
|
+
long_goal: number;
|
|
143
|
+
};
|
|
144
|
+
export type DbZeroBudgetMonth = {
|
|
145
|
+
id: string;
|
|
146
|
+
buffered: number;
|
|
147
|
+
};
|
|
148
|
+
export type DbZeroBudget = {
|
|
149
|
+
id: string;
|
|
150
|
+
month: number;
|
|
151
|
+
category: string;
|
|
152
|
+
amount: number;
|
|
153
|
+
carryover: number;
|
|
154
|
+
goal: number;
|
|
155
|
+
long_goal: number;
|
|
156
|
+
};
|
|
157
|
+
export type DbTransactionFilter = {
|
|
158
|
+
id: string;
|
|
159
|
+
name: string;
|
|
160
|
+
conditions: JsonString;
|
|
161
|
+
conditions_op: string;
|
|
162
|
+
tombstone: 1 | 0;
|
|
163
|
+
};
|
|
164
|
+
export type DbPreference = {
|
|
165
|
+
id: string;
|
|
166
|
+
value: string;
|
|
167
|
+
};
|
|
168
|
+
export type DbCustomReport = {
|
|
169
|
+
id: string;
|
|
170
|
+
name: string;
|
|
171
|
+
start_date: string;
|
|
172
|
+
end_date: string;
|
|
173
|
+
date_static: number;
|
|
174
|
+
date_range: string;
|
|
175
|
+
mode: string;
|
|
176
|
+
group_by: string;
|
|
177
|
+
balance_type: string;
|
|
178
|
+
show_empty: 1 | 0;
|
|
179
|
+
show_offbudget: 1 | 0;
|
|
180
|
+
show_hidden: 1 | 0;
|
|
181
|
+
show_uncateogorized: 1 | 0;
|
|
182
|
+
selected_categories: string;
|
|
183
|
+
graph_type: string;
|
|
184
|
+
conditions: JsonString;
|
|
185
|
+
conditions_op: string;
|
|
186
|
+
metadata: JsonString;
|
|
187
|
+
interval: string;
|
|
188
|
+
color_scheme: string;
|
|
189
|
+
include_current: 1 | 0;
|
|
190
|
+
sort_by: string;
|
|
191
|
+
tombstone: 1 | 0;
|
|
192
|
+
};
|
|
193
|
+
export type DbDashboard = {
|
|
194
|
+
id: string;
|
|
195
|
+
type: string;
|
|
196
|
+
width: number;
|
|
197
|
+
height: number;
|
|
198
|
+
x: number;
|
|
199
|
+
y: number;
|
|
200
|
+
meta: JsonString;
|
|
201
|
+
tombstone: 1 | 0;
|
|
202
|
+
};
|
|
203
|
+
export type DbViewTransactionInternal = {
|
|
204
|
+
id: DbTransaction['id'];
|
|
205
|
+
is_parent: DbTransaction['isParent'];
|
|
206
|
+
is_child: DbTransaction['isChild'];
|
|
207
|
+
date: DbTransaction['date'];
|
|
208
|
+
account: DbAccount['id'];
|
|
209
|
+
amount: DbTransaction['amount'];
|
|
210
|
+
parent_id: DbTransaction['parent_id'] | null;
|
|
211
|
+
category: DbCategory['id'] | null;
|
|
212
|
+
payee: DbPayee['id'] | null;
|
|
213
|
+
notes: DbTransaction['notes'] | null;
|
|
214
|
+
imported_id: DbTransaction['financial_id'] | null;
|
|
215
|
+
error: DbTransaction['error'] | null;
|
|
216
|
+
imported_payee: DbTransaction['imported_description'] | null;
|
|
217
|
+
starting_balance_flag: DbTransaction['starting_balance_flag'] | null;
|
|
218
|
+
transfer_id: DbTransaction['transferred_id'] | null;
|
|
219
|
+
schedule: DbSchedule['id'] | null;
|
|
220
|
+
sort_order: DbTransaction['sort_order'];
|
|
221
|
+
cleared: DbTransaction['cleared'];
|
|
222
|
+
tombstone: DbTransaction['tombstone'];
|
|
223
|
+
reconciled: DbTransaction['reconciled'];
|
|
224
|
+
};
|
|
225
|
+
export type DbViewTransactionInternalAlive = DbViewTransactionInternal;
|
|
226
|
+
export type DbViewTransaction = DbViewTransactionInternalAlive;
|
|
227
|
+
export type DbViewCategory = {
|
|
228
|
+
id: DbCategory['id'];
|
|
229
|
+
name: DbCategory['name'];
|
|
230
|
+
is_income: DbCategory['is_income'];
|
|
231
|
+
hidden: DbCategory['hidden'];
|
|
232
|
+
group: DbCategoryGroup['id'];
|
|
233
|
+
sort_order: DbCategory['sort_order'];
|
|
234
|
+
tombstone: DbCategory['tombstone'];
|
|
235
|
+
};
|
|
236
|
+
export type DbViewPayee = {
|
|
237
|
+
id: DbPayee['id'];
|
|
238
|
+
name: DbAccount['name'] | DbPayee['name'];
|
|
239
|
+
transfer_acct: DbPayee['transfer_acct'];
|
|
240
|
+
tombstone: DbPayee['tombstone'];
|
|
241
|
+
};
|
|
242
|
+
export type DbViewSchedule = {
|
|
243
|
+
id: DbSchedule['id'];
|
|
244
|
+
name: DbSchedule['name'];
|
|
245
|
+
rule: DbSchedule['rule'];
|
|
246
|
+
next_date: DbScheduleNextDate['local_next_date_ts'] | DbScheduleNextDate['local_next_date'] | DbScheduleNextDate['base_next_date'];
|
|
247
|
+
active: DbSchedule['active'];
|
|
248
|
+
completed: DbSchedule['completed'];
|
|
249
|
+
posts_transaction: DbSchedule['posts_transaction'];
|
|
250
|
+
tombstone: DbSchedule['tombstone'];
|
|
251
|
+
_payee: DbPayeeMapping['targetId'];
|
|
252
|
+
_account: DbAccount['id'];
|
|
253
|
+
_amount: number;
|
|
254
|
+
_amountOp: string;
|
|
255
|
+
_date: JsonString;
|
|
256
|
+
_conditions: JsonString;
|
|
257
|
+
_actions: JsonString;
|
|
258
|
+
};
|
|
259
|
+
export {};
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
export declare class PostError extends Error {
|
|
2
|
-
meta
|
|
2
|
+
meta: {
|
|
3
3
|
meta: string;
|
|
4
|
-
};
|
|
4
|
+
} | undefined;
|
|
5
5
|
reason: string;
|
|
6
6
|
type: 'PostError';
|
|
7
7
|
constructor(reason: string, meta?: {
|
|
8
8
|
meta: string;
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
+
export declare class BankSyncError extends Error {
|
|
12
|
+
reason: string;
|
|
13
|
+
category: string;
|
|
14
|
+
code: string;
|
|
15
|
+
type: 'BankSyncError';
|
|
16
|
+
constructor(reason: string, category: string, code: string);
|
|
17
|
+
}
|
|
11
18
|
export declare class HTTPError extends Error {
|
|
12
19
|
statusCode: number;
|
|
13
20
|
responseBody: string;
|
|
14
21
|
constructor(code: number, body: string);
|
|
15
22
|
}
|
|
16
23
|
export declare class SyncError extends Error {
|
|
17
|
-
meta
|
|
24
|
+
meta: {
|
|
18
25
|
isMissingKey: boolean;
|
|
19
26
|
} | {
|
|
20
27
|
error: {
|
|
@@ -25,7 +32,7 @@ export declare class SyncError extends Error {
|
|
|
25
32
|
sql: string;
|
|
26
33
|
params: Array<string | number>;
|
|
27
34
|
};
|
|
28
|
-
};
|
|
35
|
+
} | undefined;
|
|
29
36
|
reason: string;
|
|
30
37
|
constructor(reason: string, meta?: {
|
|
31
38
|
isMissingKey: boolean;
|
|
@@ -30,6 +30,7 @@ export namespace YNAB5 {
|
|
|
30
30
|
id: string;
|
|
31
31
|
name: string;
|
|
32
32
|
deleted: boolean;
|
|
33
|
+
hidden: boolean;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
interface Category {
|
|
@@ -37,6 +38,7 @@ export namespace YNAB5 {
|
|
|
37
38
|
category_group_id: string;
|
|
38
39
|
name: string;
|
|
39
40
|
deleted: boolean;
|
|
41
|
+
hidden: boolean;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
interface Transaction {
|
|
@@ -9,7 +9,7 @@ export declare const app: {
|
|
|
9
9
|
handlers: Handlers;
|
|
10
10
|
services: (() => () => void)[];
|
|
11
11
|
unlistenServices: (() => void)[];
|
|
12
|
-
method<Name extends "
|
|
12
|
+
method<Name extends "sync" | "load-budget" | "undo" | "redo" | "get-categories" | "get-earliest-transaction" | "get-budget-bounds" | "envelope-budget-month" | "tracking-budget-month" | "category-create" | "category-update" | "category-move" | "category-delete" | "category-group-create" | "category-group-update" | "category-group-move" | "category-group-delete" | "must-category-transfer" | "payee-create" | "common-payees-get" | "payees-get" | "payees-get-rule-counts" | "payees-merge" | "payees-batch-change" | "payees-check-orphaned" | "payees-get-orphaned" | "payees-get-rules" | "make-filters-from-conditions" | "getCell" | "getCells" | "getCellNamesInSheet" | "debugCell" | "create-query" | "query" | "sync-reset" | "sync-repair" | "key-make" | "key-test" | "get-did-bootstrap" | "subscribe-needs-bootstrap" | "subscribe-get-login-methods" | "subscribe-bootstrap" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "subscribe-set-token" | "get-server-version" | "get-server-url" | "set-server-url" | "validate-budget-name" | "unique-budget-name" | "get-budgets" | "get-remote-files" | "get-user-file-info" | "reset-budget-cache" | "upload-budget" | "download-budget" | "sync-budget" | "create-demo-budget" | "close-budget" | "delete-budget" | "duplicate-budget" | "create-budget" | "import-budget" | "export-budget" | "upload-file-web" | "backups-get" | "backup-load" | "backup-make" | "get-last-opened-backup" | "app-focused" | "enable-openid" | "enable-password" | "get-openid-config" | "api/batch-budget-start" | "api/batch-budget-end" | "api/load-budget" | "api/download-budget" | "api/get-budgets" | "api/start-import" | "api/finish-import" | "api/abort-import" | "api/query" | "api/budget-months" | "api/budget-month" | "api/budget-set-amount" | "api/budget-set-carryover" | "api/budget-hold-for-next-month" | "api/budget-reset-hold" | "api/transactions-export" | "api/transactions-import" | "api/transactions-add" | "api/transactions-get" | "api/transaction-update" | "api/transaction-delete" | "api/sync" | "api/bank-sync" | "api/accounts-get" | "api/account-create" | "api/account-update" | "api/account-close" | "api/account-reopen" | "api/account-delete" | "api/account-balance" | "api/categories-get" | "api/category-groups-get" | "api/category-group-create" | "api/category-group-update" | "api/category-group-delete" | "api/category-create" | "api/category-update" | "api/category-delete" | "api/payees-get" | "api/common-payees-get" | "api/payee-create" | "api/payee-update" | "api/payee-delete" | "api/payees-merge" | "api/rules-get" | "api/payee-rules-get" | "api/rule-create" | "api/rule-update" | "api/rule-delete" | "budget/budget-amount" | "budget/copy-previous-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/set-6month-avg" | "budget/set-12month-avg" | "budget/check-templates" | "budget/apply-goal-template" | "budget/overwrite-goal-template" | "budget/cleanup-goal-template" | "budget/hold-for-next-month" | "budget/reset-hold" | "budget/cover-overspending" | "budget/transfer-available" | "budget/cover-overbudgeted" | "budget/transfer-category" | "budget/set-carryover" | "budget/apply-single-template" | "budget/set-n-month-avg" | "budget/copy-single-month" | "budget/apply-multiple-templates" | "dashboard-update" | "dashboard-update-widget" | "dashboard-reset" | "dashboard-add-widget" | "dashboard-remove-widget" | "dashboard-import" | "filter-create" | "filter-update" | "filter-delete" | "notes-save" | "preferences/save" | "preferences/get" | "save-global-prefs" | "load-global-prefs" | "save-prefs" | "load-prefs" | "report/create" | "report/update" | "report/delete" | "rule-validate" | "rule-add" | "rule-update" | "rule-delete" | "rule-delete-all" | "rule-apply-actions" | "rule-add-payee-rename" | "rules-get" | "rule-get" | "rules-run" | "schedule/create" | "schedule/update" | "schedule/delete" | "schedule/skip-next-date" | "schedule/post-transaction" | "schedule/force-run-service" | "schedule/discover" | "schedule/get-upcoming-dates" | "transactions-batch-update" | "transaction-add" | "transaction-update" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "users-get" | "user-delete-all" | "user-add" | "user-update" | "access-add" | "access-delete-all" | "access-get-available-users" | "transfer-ownership" | "owner-created" | "tools/fix-split-transactions" | "account-update" | "accounts-get" | "account-balance" | "account-properties" | "gocardless-accounts-link" | "simplefin-accounts-link" | "account-create" | "account-close" | "account-reopen" | "account-move" | "secret-set" | "secret-check" | "gocardless-poll-web-token" | "gocardless-poll-web-token-stop" | "gocardless-status" | "simplefin-status" | "simplefin-accounts" | "gocardless-get-banks" | "gocardless-create-web-token" | "accounts-bank-sync" | "simplefin-batch-sync" | "transactions-import" | "account-unlink">(name: Name, func: Handlers[Name]): void;
|
|
13
13
|
service(func: () => () => void): void;
|
|
14
14
|
combine(...apps: any[]): void;
|
|
15
15
|
startServices(): void;
|
|
@@ -4,6 +4,7 @@ import { q } from '../shared/query';
|
|
|
4
4
|
import { Handlers } from '../types/handlers';
|
|
5
5
|
import * as db from './db';
|
|
6
6
|
export declare let handlers: Handlers;
|
|
7
|
+
export declare function getDefaultDocumentDir(): string;
|
|
7
8
|
export declare function initApp(isDev: any, socketName: any): Promise<void>;
|
|
8
9
|
export type InitConfig = {
|
|
9
10
|
dataDir?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function post(url:
|
|
1
|
+
export declare function post(url: RequestInfo, data: unknown, headers?: {}, timeout?: number | null): Promise<any>;
|
|
2
2
|
export declare function del(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
|
|
3
3
|
export declare function patch(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
|
|
4
4
|
export declare function postBinary(url: any, data: any, headers: any): Promise<any>;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GlobalPrefs, MetadataPrefs, type SyncedPrefs } from '../../types/prefs';
|
|
2
|
+
export interface PreferencesHandlers {
|
|
3
|
+
'preferences/save': typeof saveSyncedPrefs;
|
|
4
|
+
'preferences/get': typeof getSyncedPrefs;
|
|
5
|
+
'save-global-prefs': typeof saveGlobalPrefs;
|
|
6
|
+
'load-global-prefs': typeof loadGlobalPrefs;
|
|
7
|
+
'save-prefs': typeof saveMetadataPrefs;
|
|
8
|
+
'load-prefs': typeof loadMetadataPrefs;
|
|
9
|
+
}
|
|
2
10
|
export declare const app: {
|
|
3
11
|
events: import("mitt").Emitter<{
|
|
4
12
|
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
@@ -9,9 +17,28 @@ export declare const app: {
|
|
|
9
17
|
handlers: PreferencesHandlers;
|
|
10
18
|
services: (() => () => void)[];
|
|
11
19
|
unlistenServices: (() => void)[];
|
|
12
|
-
method<Name extends "preferences/save" | "preferences/get">(name: Name, func: PreferencesHandlers[Name]): void;
|
|
20
|
+
method<Name extends "preferences/save" | "preferences/get" | "save-global-prefs" | "load-global-prefs" | "save-prefs" | "load-prefs">(name: Name, func: PreferencesHandlers[Name]): void;
|
|
13
21
|
service(func: () => () => void): void;
|
|
14
22
|
combine(...apps: any[]): void;
|
|
15
23
|
startServices(): void;
|
|
16
24
|
stopServices(): void;
|
|
17
25
|
};
|
|
26
|
+
declare function saveSyncedPrefs({ id, value, }: {
|
|
27
|
+
id: keyof SyncedPrefs;
|
|
28
|
+
value: string | undefined;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
declare function getSyncedPrefs(): Promise<SyncedPrefs>;
|
|
31
|
+
declare function saveGlobalPrefs(prefs: GlobalPrefs): Promise<string>;
|
|
32
|
+
declare function loadGlobalPrefs(): Promise<{
|
|
33
|
+
floatingSidebar: boolean;
|
|
34
|
+
maxMonths: number;
|
|
35
|
+
documentDir: string;
|
|
36
|
+
keyId: any;
|
|
37
|
+
language: string;
|
|
38
|
+
theme: import("../../types/prefs").Theme;
|
|
39
|
+
preferredDarkTheme: import("../../types/prefs").DarkTheme;
|
|
40
|
+
serverSelfSignedCert: string;
|
|
41
|
+
}>;
|
|
42
|
+
declare function saveMetadataPrefs(prefsToSet: MetadataPrefs): Promise<string>;
|
|
43
|
+
declare function loadMetadataPrefs(): Promise<MetadataPrefs>;
|
|
44
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type Action } from '..';
|
|
1
2
|
import { type RuleEntity, type TransactionEntity, type RuleActionEntity } from '../../../types/models';
|
|
2
|
-
import { type Action } from '../../accounts/rules';
|
|
3
3
|
type ValidationError = {
|
|
4
4
|
conditionErrors: string[];
|
|
5
5
|
actionErrors: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rule } from '../
|
|
1
|
+
import { Rule } from '../rules';
|
|
2
2
|
import { SchedulesHandlers } from './types/handlers';
|
|
3
3
|
export declare function updateConditions(conditions: any, newConditions: any): any;
|
|
4
4
|
export declare function getRuleForSchedule(id: string | null): Promise<Rule>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { QueryState } from '../../shared/query';
|
|
2
|
+
import { AccountEntity, CategoryGroupEntity, PayeeEntity, TransactionEntity } from '../../types/models';
|
|
3
|
+
import { ParseFileOptions } from './import/parse-file';
|
|
4
|
+
import { batchUpdateTransactions } from '.';
|
|
5
|
+
export type TransactionHandlers = {
|
|
6
|
+
'transactions-batch-update': typeof handleBatchUpdateTransactions;
|
|
7
|
+
'transaction-add': typeof addTransaction;
|
|
8
|
+
'transaction-update': typeof updateTransaction;
|
|
9
|
+
'transaction-delete': typeof deleteTransaction;
|
|
10
|
+
'transactions-parse-file': typeof parseTransactionsFile;
|
|
11
|
+
'transactions-export': typeof exportTransactions;
|
|
12
|
+
'transactions-export-query': typeof exportTransactionsQuery;
|
|
13
|
+
'get-earliest-transaction': typeof getEarliestTransaction;
|
|
14
|
+
};
|
|
15
|
+
declare function handleBatchUpdateTransactions({ added, deleted, updated, learnCategories, }: Parameters<typeof batchUpdateTransactions>[0]): Promise<{
|
|
16
|
+
added: TransactionEntity[];
|
|
17
|
+
updated: TransactionEntity[] | ({
|
|
18
|
+
id: any;
|
|
19
|
+
transfer_id: any;
|
|
20
|
+
} | {
|
|
21
|
+
id: any;
|
|
22
|
+
category: any;
|
|
23
|
+
})[];
|
|
24
|
+
}>;
|
|
25
|
+
declare function addTransaction(transaction: TransactionEntity): Promise<{}>;
|
|
26
|
+
declare function updateTransaction(transaction: TransactionEntity): Promise<{}>;
|
|
27
|
+
declare function deleteTransaction(transaction: Pick<TransactionEntity, 'id'>): Promise<{}>;
|
|
28
|
+
declare function parseTransactionsFile({ filepath, options, }: {
|
|
29
|
+
filepath: string;
|
|
30
|
+
options: ParseFileOptions;
|
|
31
|
+
}): Promise<import("./import/parse-file").ParseFileResult>;
|
|
32
|
+
declare function exportTransactions({ transactions, accounts, categoryGroups, payees, }: {
|
|
33
|
+
transactions: TransactionEntity[];
|
|
34
|
+
accounts: AccountEntity[];
|
|
35
|
+
categoryGroups: CategoryGroupEntity[];
|
|
36
|
+
payees: PayeeEntity[];
|
|
37
|
+
}): Promise<string>;
|
|
38
|
+
declare function exportTransactionsQuery({ query: queryState, }: {
|
|
39
|
+
query: QueryState;
|
|
40
|
+
}): Promise<string>;
|
|
41
|
+
declare function getEarliestTransaction(): Promise<any>;
|
|
42
|
+
export declare const app: {
|
|
43
|
+
events: import("mitt").Emitter<{
|
|
44
|
+
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
45
|
+
'load-budget': {
|
|
46
|
+
id: string;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
handlers: TransactionHandlers;
|
|
50
|
+
services: (() => () => void)[];
|
|
51
|
+
unlistenServices: (() => void)[];
|
|
52
|
+
method<Name extends "get-earliest-transaction" | "transactions-batch-update" | "transaction-add" | "transaction-update" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query">(name: Name, func: TransactionHandlers[Name]): void;
|
|
53
|
+
service(func: () => () => void): void;
|
|
54
|
+
combine(...apps: any[]): void;
|
|
55
|
+
startServices(): void;
|
|
56
|
+
stopServices(): void;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TransactionEntity, type RuleActionEntity, type RuleEntity, AccountEntity } from '../../types/models';
|
|
2
|
-
import { Action, Rule } from '
|
|
3
|
-
export { iterateIds } from '
|
|
2
|
+
import { Action, Rule } from '../rules';
|
|
3
|
+
export { iterateIds } from '../rules';
|
|
4
4
|
export declare function resetState(): void;
|
|
5
5
|
export declare function parseConditionsOrActions(str: any): any[];
|
|
6
6
|
export declare function serializeConditionsOrActions(arr: any): string;
|
|
@@ -20,8 +20,9 @@ export declare function insertRule(rule: Omit<RuleEntity, 'id'> & {
|
|
|
20
20
|
export declare function updateRule(rule: any): Promise<void>;
|
|
21
21
|
export declare function deleteRule(id: string): Promise<boolean>;
|
|
22
22
|
export declare function runRules(trans: any, accounts?: Map<string, AccountEntity> | null): Promise<TransactionEntity>;
|
|
23
|
-
export declare function conditionsToAQL(conditions: any, { recurDateBounds }?: {
|
|
23
|
+
export declare function conditionsToAQL(conditions: any, { recurDateBounds, applySpecialCases }?: {
|
|
24
24
|
recurDateBounds?: number;
|
|
25
|
+
applySpecialCases?: boolean;
|
|
25
26
|
}): {
|
|
26
27
|
filters: any;
|
|
27
28
|
errors: any[];
|
|
@@ -33,6 +33,7 @@ export declare function recalculateSplit(trans: TransactionEntity): {
|
|
|
33
33
|
subtransactions?: TransactionEntity[];
|
|
34
34
|
_unmatched?: boolean;
|
|
35
35
|
_deleted?: boolean;
|
|
36
|
+
raw_synced_data?: string | undefined;
|
|
36
37
|
};
|
|
37
38
|
export declare function ungroupTransactions(transactions: TransactionEntity[]): TransactionEntity[];
|
|
38
39
|
export declare function groupTransaction(split: TransactionEntity[]): {
|
|
@@ -64,6 +65,7 @@ export declare function groupTransaction(split: TransactionEntity[]): {
|
|
|
64
65
|
version: 1;
|
|
65
66
|
difference: number;
|
|
66
67
|
} | null;
|
|
68
|
+
raw_synced_data?: string | undefined;
|
|
67
69
|
};
|
|
68
70
|
export declare function ungroupTransaction(split: TransactionEntity | null): TransactionEntity[];
|
|
69
71
|
export declare function applyTransactionDiff(groupedTrans: Parameters<typeof ungroupTransaction>[0], diff: Parameters<typeof applyChanges>[0]): {
|
|
@@ -95,6 +97,7 @@ export declare function applyTransactionDiff(groupedTrans: Parameters<typeof ung
|
|
|
95
97
|
version: 1;
|
|
96
98
|
difference: number;
|
|
97
99
|
} | null;
|
|
100
|
+
raw_synced_data?: string | undefined;
|
|
98
101
|
};
|
|
99
102
|
export declare function addSplitTransaction(transactions: TransactionEntity[], id: string): {
|
|
100
103
|
data: TransactionEntity[];
|
|
@@ -148,6 +151,7 @@ export declare function makeAsNonChildTransactions(childTransactionsToUpdate: Tr
|
|
|
148
151
|
version: 1;
|
|
149
152
|
difference: number;
|
|
150
153
|
} | null;
|
|
154
|
+
raw_synced_data?: string | undefined;
|
|
151
155
|
}[];
|
|
152
156
|
};
|
|
153
157
|
export {};
|
|
@@ -50,10 +50,9 @@ export declare function getNumberFormat({ format, hideFraction, }?: {
|
|
|
50
50
|
hideFraction: boolean;
|
|
51
51
|
}): {
|
|
52
52
|
value: "comma-dot" | "dot-comma" | "space-comma" | "apostrophe-dot" | "comma-dot-in";
|
|
53
|
-
|
|
53
|
+
thousandsSeparator: any;
|
|
54
|
+
decimalSeparator: any;
|
|
54
55
|
formatter: Intl.NumberFormat;
|
|
55
|
-
regex: any;
|
|
56
|
-
separatorRegex: any;
|
|
57
56
|
};
|
|
58
57
|
/**
|
|
59
58
|
* The exact amount.
|
|
@@ -74,7 +73,7 @@ export declare function toRelaxedNumber(currencyAmount: CurrencyAmount): Amount;
|
|
|
74
73
|
export declare function integerToCurrency(integerAmount: IntegerAmount, formatter?: Intl.NumberFormat): string;
|
|
75
74
|
export declare function amountToCurrency(amount: Amount): CurrencyAmount;
|
|
76
75
|
export declare function amountToCurrencyNoDecimal(amount: Amount): CurrencyAmount;
|
|
77
|
-
export declare function currencyToAmount(currencyAmount:
|
|
76
|
+
export declare function currencyToAmount(currencyAmount: string): Amount | null;
|
|
78
77
|
export declare function currencyToInteger(currencyAmount: CurrencyAmount): IntegerAmount | null;
|
|
79
78
|
export declare function stringToInteger(str: string): number | null;
|
|
80
79
|
export declare function amountToInteger(amount: Amount): IntegerAmount;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ImportTransactionsOpts } from '@actual-app/api';
|
|
2
2
|
|
|
3
|
-
import { type batchUpdateTransactions } from '../server/accounts/transactions';
|
|
4
3
|
import type {
|
|
5
4
|
APIAccountEntity,
|
|
6
5
|
APICategoryEntity,
|
|
@@ -8,6 +7,7 @@ import type {
|
|
|
8
7
|
APIFileEntity,
|
|
9
8
|
APIPayeeEntity,
|
|
10
9
|
} from '../server/api-models';
|
|
10
|
+
import { type batchUpdateTransactions } from '../server/transactions';
|
|
11
11
|
|
|
12
12
|
import type { NewRuleEntity, RuleEntity, TransactionEntity } from './models';
|
|
13
13
|
import { type ServerHandlers } from './server-handlers';
|
|
@@ -76,6 +76,7 @@ export interface ApiHandlers {
|
|
|
76
76
|
transactions;
|
|
77
77
|
categoryGroups;
|
|
78
78
|
payees;
|
|
79
|
+
accounts;
|
|
79
80
|
}) => Promise<unknown>;
|
|
80
81
|
|
|
81
82
|
'api/transactions-import': (arg: {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import type { AccountHandlers } from '../server/accounts/app';
|
|
1
2
|
import type { AdminHandlers } from '../server/admin/types/handlers';
|
|
2
3
|
import type { BudgetHandlers } from '../server/budget/types/handlers';
|
|
3
4
|
import type { DashboardHandlers } from '../server/dashboard/types/handlers';
|
|
4
5
|
import type { FiltersHandlers } from '../server/filters/types/handlers';
|
|
5
6
|
import type { NotesHandlers } from '../server/notes/types/handlers';
|
|
6
|
-
import type { PreferencesHandlers } from '../server/preferences/
|
|
7
|
+
import type { PreferencesHandlers } from '../server/preferences/app';
|
|
7
8
|
import type { ReportsHandlers } from '../server/reports/types/handlers';
|
|
8
9
|
import type { RulesHandlers } from '../server/rules/types/handlers';
|
|
9
10
|
import type { SchedulesHandlers } from '../server/schedules/types/handlers';
|
|
10
11
|
import type { ToolsHandlers } from '../server/tools/types/handlers';
|
|
12
|
+
import type { TransactionHandlers } from '../server/transactions/app';
|
|
11
13
|
|
|
12
14
|
import type { ApiHandlers } from './api-handlers';
|
|
13
15
|
import type { ServerHandlers } from './server-handlers';
|
|
@@ -23,7 +25,9 @@ export interface Handlers
|
|
|
23
25
|
ReportsHandlers,
|
|
24
26
|
RulesHandlers,
|
|
25
27
|
SchedulesHandlers,
|
|
28
|
+
TransactionHandlers,
|
|
26
29
|
AdminHandlers,
|
|
27
|
-
ToolsHandlers
|
|
30
|
+
ToolsHandlers,
|
|
31
|
+
AccountHandlers {}
|
|
28
32
|
|
|
29
33
|
export type HandlerFunctions = Handlers[keyof Handlers];
|
|
@@ -10,12 +10,15 @@ export type AccountEntity = {
|
|
|
10
10
|
type _SyncFields<T> = {
|
|
11
11
|
account_id: T extends true ? string : null;
|
|
12
12
|
bank: T extends true ? string : null;
|
|
13
|
+
bankName: T extends true ? string : null;
|
|
14
|
+
bankId: T extends true ? number : null;
|
|
13
15
|
mask: T extends true ? string : null; // end of bank account number
|
|
14
16
|
official_name: T extends true ? string : null;
|
|
15
17
|
balance_current: T extends true ? number : null;
|
|
16
18
|
balance_available: T extends true ? number : null;
|
|
17
19
|
balance_limit: T extends true ? number : null;
|
|
18
20
|
account_sync_source: T extends true ? AccountSyncSource : null;
|
|
21
|
+
last_sync: T extends true ? string : null;
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
export type AccountSyncSource = 'simpleFin' | 'goCardless';
|