@actual-app/api 6.8.2 → 6.9.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/loot-core/client/constants.d.ts +1 -0
- package/@types/loot-core/client/state-types/modals.d.ts +9 -2
- package/@types/loot-core/client/state-types/queries.d.ts +8 -0
- package/@types/loot-core/server/accounts/sync.d.ts +12 -1
- package/@types/loot-core/server/api-models.d.ts +15 -0
- package/@types/loot-core/server/aql/schema/index.d.ts +15 -0
- package/@types/loot-core/server/budget/actions.d.ts +2 -1
- package/@types/loot-core/server/db/index.d.ts +1 -0
- package/@types/loot-core/server/main-app.d.ts +1 -1
- package/@types/loot-core/shared/normalisation.d.ts +1 -0
- package/@types/loot-core/shared/transactions.d.ts +4 -4
- package/@types/loot-core/shared/util.d.ts +1 -1
- package/@types/loot-core/types/api-handlers.d.ts +15 -0
- package/@types/loot-core/types/file.d.ts +2 -0
- package/@types/loot-core/types/models/payee.d.ts +1 -0
- package/@types/loot-core/types/models/reports.d.ts +10 -0
- package/@types/loot-core/types/prefs.d.ts +6 -4
- package/@types/loot-core/types/server-handlers.d.ts +8 -1
- package/@types/methods.d.ts +4 -0
- package/dist/app/bundle.api.js +952 -565
- package/dist/methods.js +17 -1
- package/dist/methods.test.js +15 -1
- package/dist/migrations/1720310586000_link_transfer_schedules.sql +19 -0
- package/dist/migrations/1720664867241_add_payee_favorite.sql +5 -0
- package/dist/migrations/1720665000000_goal_context.sql +6 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export declare const MARK_ACCOUNT_READ = "MARK_ACCOUNT_READ";
|
|
|
5
5
|
export declare const LOAD_ACCOUNTS = "LOAD_ACCOUNTS";
|
|
6
6
|
export declare const UPDATE_ACCOUNT = "UPDATE_ACCOUNT";
|
|
7
7
|
export declare const LOAD_CATEGORIES = "LOAD_CATEGORIES";
|
|
8
|
+
export declare const LOAD_COMMON_PAYEES = "LOAD_COMMON_PAYEES";
|
|
8
9
|
export declare const LOAD_PAYEES = "LOAD_PAYEES";
|
|
9
10
|
export declare const SET_PREFS = "SET_PREFS";
|
|
10
11
|
export declare const MERGE_LOCAL_PREFS = "MERGE_LOCAL_PREFS";
|
|
@@ -129,7 +129,6 @@ type FinanceModals = {
|
|
|
129
129
|
'schedules-discover': null;
|
|
130
130
|
|
|
131
131
|
'schedule-posts-offline-notification': null;
|
|
132
|
-
'switch-budget-type': { onSwitch: () => void };
|
|
133
132
|
'account-menu': {
|
|
134
133
|
accountId: string;
|
|
135
134
|
onSave: (account: AccountEntity) => void;
|
|
@@ -143,6 +142,7 @@ type FinanceModals = {
|
|
|
143
142
|
onSave: (category: CategoryEntity) => void;
|
|
144
143
|
onEditNotes: (id: string) => void;
|
|
145
144
|
onDelete: (categoryId: string) => void;
|
|
145
|
+
onToggleVisibility: (categoryId: string) => void;
|
|
146
146
|
onBudgetAction: (month: string, action: string, args?: unknown) => void;
|
|
147
147
|
onClose?: () => void;
|
|
148
148
|
};
|
|
@@ -168,6 +168,7 @@ type FinanceModals = {
|
|
|
168
168
|
onAddCategory: (groupId: string, isIncome: boolean) => void;
|
|
169
169
|
onEditNotes: (id: string) => void;
|
|
170
170
|
onDelete: (groupId: string) => void;
|
|
171
|
+
onToggleVisibility: (groupId: string) => void;
|
|
171
172
|
onClose?: () => void;
|
|
172
173
|
};
|
|
173
174
|
notes: {
|
|
@@ -237,7 +238,6 @@ type FinanceModals = {
|
|
|
237
238
|
onAddCategoryGroup: () => void;
|
|
238
239
|
onToggleHiddenCategories: () => void;
|
|
239
240
|
onSwitchBudgetFile: () => void;
|
|
240
|
-
onSwitchBudgetType: () => void;
|
|
241
241
|
};
|
|
242
242
|
'rollover-budget-month-menu': {
|
|
243
243
|
month: string;
|
|
@@ -252,6 +252,7 @@ type FinanceModals = {
|
|
|
252
252
|
'budget-list';
|
|
253
253
|
'confirm-transaction-edit': {
|
|
254
254
|
onConfirm: () => void;
|
|
255
|
+
onCancel?: () => void;
|
|
255
256
|
confirmReason: string;
|
|
256
257
|
};
|
|
257
258
|
'confirm-transaction-delete': {
|
|
@@ -293,3 +294,9 @@ export type ModalsState = {
|
|
|
293
294
|
modalStack: Modal[];
|
|
294
295
|
isHidden: boolean;
|
|
295
296
|
};
|
|
297
|
+
|
|
298
|
+
type Modal = {
|
|
299
|
+
name: string;
|
|
300
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
301
|
+
options?: any;
|
|
302
|
+
};
|
|
@@ -11,6 +11,8 @@ export type QueriesState = {
|
|
|
11
11
|
accountsLoaded: boolean;
|
|
12
12
|
categories: Awaited<ReturnType<Handlers['get-categories']>>;
|
|
13
13
|
categoriesLoaded: boolean;
|
|
14
|
+
commonPayeesLoaded: boolean;
|
|
15
|
+
commonPayees: Awaited<ReturnType<Handlers['common-payees-get']>>;
|
|
14
16
|
payees: Awaited<ReturnType<Handlers['payees-get']>>;
|
|
15
17
|
payeesLoaded: boolean;
|
|
16
18
|
earliestTransaction: unknown | null;
|
|
@@ -58,6 +60,11 @@ type LoadPayeesAction = {
|
|
|
58
60
|
payees: State['payees'];
|
|
59
61
|
};
|
|
60
62
|
|
|
63
|
+
type LoadCommonPayeesAction = {
|
|
64
|
+
type: typeof constants.LOAD_COMMON_PAYEES;
|
|
65
|
+
payees: State['common_payees'];
|
|
66
|
+
};
|
|
67
|
+
|
|
61
68
|
export type QueriesActions =
|
|
62
69
|
| SetNewTransactionsAction
|
|
63
70
|
| UpdateNewTransactionsAction
|
|
@@ -66,4 +73,5 @@ export type QueriesActions =
|
|
|
66
73
|
| LoadAccountsAction
|
|
67
74
|
| UpdateAccountAction
|
|
68
75
|
| LoadCategoriesAction
|
|
76
|
+
| LoadCommonPayeesAction
|
|
69
77
|
| LoadPayeesAction;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
export declare function getGoCardlessAccounts(userId: any, userKey: any, id: any): Promise<any>;
|
|
2
|
-
export declare function reconcileTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean): Promise<{
|
|
2
|
+
export declare function reconcileTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean, isPreview?: boolean): Promise<{
|
|
3
3
|
added: any[];
|
|
4
4
|
updated: any[];
|
|
5
|
+
updatedPreview: any[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare function matchTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean): Promise<{
|
|
8
|
+
payeesToCreate: Map<any, any>;
|
|
9
|
+
transactionsStep1: any[];
|
|
10
|
+
transactionsStep2: any[];
|
|
11
|
+
transactionsStep3: any[];
|
|
5
12
|
}>;
|
|
6
13
|
export declare function addTransactions(acctId: any, transactions: any, { runTransfers, learnCategories }?: {
|
|
7
14
|
runTransfers?: boolean;
|
|
@@ -10,4 +17,8 @@ export declare function addTransactions(acctId: any, transactions: any, { runTra
|
|
|
10
17
|
export declare function syncAccount(userId: string, userKey: string, id: string, acctId: string, bankId: string): Promise<{
|
|
11
18
|
added: any[];
|
|
12
19
|
updated: any[];
|
|
20
|
+
updatedPreview: any[];
|
|
21
|
+
} | {
|
|
22
|
+
added: any[];
|
|
23
|
+
updated: any[];
|
|
13
24
|
}>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Budget } from '../types/budget';
|
|
1
2
|
import type { AccountEntity, CategoryEntity, CategoryGroupEntity, PayeeEntity } from '../types/models';
|
|
3
|
+
import { RemoteFile } from './cloud-storage';
|
|
2
4
|
export type APIAccountEntity = Pick<AccountEntity, 'id' | 'name'> & {
|
|
3
5
|
offbudget: boolean;
|
|
4
6
|
closed: boolean;
|
|
@@ -64,3 +66,16 @@ export declare const payeeModel: {
|
|
|
64
66
|
update?: boolean;
|
|
65
67
|
}): PayeeEntity;
|
|
66
68
|
};
|
|
69
|
+
export type APIFileEntity = Omit<RemoteFile, 'deleted' | 'fileId'> & {
|
|
70
|
+
id?: string;
|
|
71
|
+
cloudFileId: string;
|
|
72
|
+
state?: 'remote';
|
|
73
|
+
};
|
|
74
|
+
export declare const remoteFileModel: {
|
|
75
|
+
toExternal(file: RemoteFile): APIFileEntity | null;
|
|
76
|
+
fromExternal(file: APIFileEntity): RemoteFile;
|
|
77
|
+
};
|
|
78
|
+
export declare const budgetModel: {
|
|
79
|
+
toExternal(file: Budget): APIFileEntity;
|
|
80
|
+
fromExternal(file: APIFileEntity): Budget;
|
|
81
|
+
};
|
|
@@ -75,6 +75,9 @@ export declare const schema: {
|
|
|
75
75
|
tombstone: {
|
|
76
76
|
type: string;
|
|
77
77
|
};
|
|
78
|
+
favorite: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
78
81
|
};
|
|
79
82
|
accounts: {
|
|
80
83
|
id: {
|
|
@@ -95,6 +98,12 @@ export declare const schema: {
|
|
|
95
98
|
tombstone: {
|
|
96
99
|
type: string;
|
|
97
100
|
};
|
|
101
|
+
account_id: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
official_name: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
98
107
|
account_sync_source: {
|
|
99
108
|
type: string;
|
|
100
109
|
};
|
|
@@ -318,6 +327,9 @@ export declare const schema: {
|
|
|
318
327
|
goal: {
|
|
319
328
|
type: string;
|
|
320
329
|
};
|
|
330
|
+
long_goal: {
|
|
331
|
+
type: string;
|
|
332
|
+
};
|
|
321
333
|
};
|
|
322
334
|
zero_budgets: {
|
|
323
335
|
id: {
|
|
@@ -338,6 +350,9 @@ export declare const schema: {
|
|
|
338
350
|
goal: {
|
|
339
351
|
type: string;
|
|
340
352
|
};
|
|
353
|
+
long_goal: {
|
|
354
|
+
type: string;
|
|
355
|
+
};
|
|
341
356
|
};
|
|
342
357
|
};
|
|
343
358
|
export declare const schemaConfig: SchemaConfig;
|
|
@@ -9,10 +9,11 @@ export declare function setBudget({ category, month, amount, }: {
|
|
|
9
9
|
month: string;
|
|
10
10
|
amount: unknown;
|
|
11
11
|
}): Promise<void>;
|
|
12
|
-
export declare function setGoal({ month, category, goal }: {
|
|
12
|
+
export declare function setGoal({ month, category, goal, long_goal }: {
|
|
13
13
|
month: any;
|
|
14
14
|
category: any;
|
|
15
15
|
goal: any;
|
|
16
|
+
long_goal: any;
|
|
16
17
|
}): Promise<void>;
|
|
17
18
|
export declare function setBuffer(month: string, amount: unknown): Promise<void>;
|
|
18
19
|
export declare function copyPreviousMonth({ month, }: {
|
|
@@ -85,6 +85,7 @@ export declare function deleteTransferPayee(payee: any): Promise<void>;
|
|
|
85
85
|
export declare function updatePayee(payee: any): Promise<void>;
|
|
86
86
|
export declare function mergePayees(target: string, ids: string[]): Promise<void>;
|
|
87
87
|
export declare function getPayees(): Promise<any>;
|
|
88
|
+
export declare function getCommonPayees(): Promise<any>;
|
|
88
89
|
export declare function syncGetOrphanedPayees(): Promise<any>;
|
|
89
90
|
export declare function getOrphanedPayees(): Promise<any>;
|
|
90
91
|
export declare function getPayeeByName(name: any): Promise<any>;
|
|
@@ -4,7 +4,7 @@ export declare const app: {
|
|
|
4
4
|
handlers: Handlers;
|
|
5
5
|
services: any;
|
|
6
6
|
unlistenServices: any;
|
|
7
|
-
method<Name extends "transaction-update" | "undo" | "redo" | "transactions-batch-update" | "transaction-add" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "get-categories" | "get-earliest-transaction" | "get-budget-bounds" | "rollover-budget-month" | "report-budget-month" | "budget-set-type" | "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" | "payees-get" | "payees-get-rule-counts" | "payees-merge" | "payees-batch-change" | "payees-check-orphaned" | "payees-get-rules" | "make-filters-from-conditions" | "getCell" | "getCells" | "getCellNamesInSheet" | "debugCell" | "create-query" | "
|
|
7
|
+
method<Name extends "sync" | "query" | "transaction-update" | "undo" | "redo" | "transactions-batch-update" | "transaction-add" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "get-categories" | "get-earliest-transaction" | "get-budget-bounds" | "rollover-budget-month" | "report-budget-month" | "budget-set-type" | "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-rules" | "make-filters-from-conditions" | "getCell" | "getCells" | "getCellNamesInSheet" | "debugCell" | "create-query" | "account-update" | "accounts-get" | "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-status" | "simplefin-status" | "simplefin-accounts" | "gocardless-get-banks" | "gocardless-poll-web-token-stop" | "gocardless-create-web-token" | "accounts-bank-sync" | "transactions-import" | "account-unlink" | "save-global-prefs" | "load-global-prefs" | "save-prefs" | "load-prefs" | "sync-reset" | "sync-repair" | "key-make" | "key-test" | "get-did-bootstrap" | "subscribe-needs-bootstrap" | "subscribe-bootstrap" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "get-server-version" | "get-server-url" | "set-server-url" | "get-budgets" | "get-remote-files" | "reset-budget-cache" | "upload-budget" | "download-budget" | "sync-budget" | "load-budget" | "create-demo-budget" | "close-budget" | "delete-budget" | "create-budget" | "import-budget" | "export-budget" | "upload-file-web" | "backups-get" | "backup-load" | "backup-make" | "get-last-opened-backup" | "app-focused" | "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/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/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" | "filter-create" | "filter-update" | "filter-delete" | "notes-save" | "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" | "tools/fix-split-transactions">(name: Name, func: Handlers[Name]): void;
|
|
8
8
|
service(func: any): void;
|
|
9
9
|
combine(...apps: any[]): void;
|
|
10
10
|
startServices(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNormalisedString(value: string): string;
|
|
@@ -73,8 +73,6 @@ export declare function realizeTempTransactions(transactions: TransactionEntity[
|
|
|
73
73
|
payee?: import("../types/models").PayeeEntity;
|
|
74
74
|
schedule?: import("../types/models").ScheduleEntity;
|
|
75
75
|
subtransactions?: TransactionEntity[];
|
|
76
|
-
sort_order?: number;
|
|
77
|
-
tombstone?: boolean;
|
|
78
76
|
imported_payee?: string;
|
|
79
77
|
date: string;
|
|
80
78
|
notes?: string;
|
|
@@ -87,6 +85,8 @@ export declare function realizeTempTransactions(transactions: TransactionEntity[
|
|
|
87
85
|
imported_id?: string;
|
|
88
86
|
starting_balance_flag?: boolean;
|
|
89
87
|
transfer_id?: string;
|
|
88
|
+
sort_order?: number;
|
|
89
|
+
tombstone?: boolean;
|
|
90
90
|
}[];
|
|
91
91
|
export declare function makeAsNonChildTransactions(childTransactionsToUpdate: TransactionEntity[], transactions: TransactionEntity[]): {
|
|
92
92
|
updated: TransactionEntity[];
|
|
@@ -98,8 +98,6 @@ export declare function makeAsNonChildTransactions(childTransactionsToUpdate: Tr
|
|
|
98
98
|
payee?: import("../types/models").PayeeEntity;
|
|
99
99
|
schedule?: import("../types/models").ScheduleEntity;
|
|
100
100
|
subtransactions?: TransactionEntity[];
|
|
101
|
-
sort_order?: number;
|
|
102
|
-
tombstone?: boolean;
|
|
103
101
|
imported_payee?: string;
|
|
104
102
|
date: string;
|
|
105
103
|
notes?: string;
|
|
@@ -111,6 +109,8 @@ export declare function makeAsNonChildTransactions(childTransactionsToUpdate: Tr
|
|
|
111
109
|
imported_id?: string;
|
|
112
110
|
starting_balance_flag?: boolean;
|
|
113
111
|
transfer_id?: string;
|
|
112
|
+
sort_order?: number;
|
|
113
|
+
tombstone?: boolean;
|
|
114
114
|
}[];
|
|
115
115
|
};
|
|
116
116
|
export {};
|
|
@@ -31,7 +31,7 @@ export declare function getIn(map: any, keys: any): any;
|
|
|
31
31
|
export declare function fastSetMerge<T>(set1: Set<T>, set2: Set<T>): Set<T>;
|
|
32
32
|
export declare function titleFirst(str: string): string;
|
|
33
33
|
export declare function appendDecimals(amountText: string, hideDecimals?: boolean): string;
|
|
34
|
-
type NumberFormats = 'comma-dot' | 'dot-comma' | 'space-comma' | '
|
|
34
|
+
type NumberFormats = 'comma-dot' | 'dot-comma' | 'space-comma' | 'apostrophe-dot' | 'comma-dot-in';
|
|
35
35
|
export declare const numberFormats: Array<{
|
|
36
36
|
value: NumberFormats;
|
|
37
37
|
label: string;
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
APIAccountEntity,
|
|
4
4
|
APICategoryEntity,
|
|
5
5
|
APICategoryGroupEntity,
|
|
6
|
+
APIFileEntity,
|
|
6
7
|
APIPayeeEntity,
|
|
7
8
|
} from '../server/api-models';
|
|
8
9
|
|
|
@@ -23,6 +24,8 @@ export interface ApiHandlers {
|
|
|
23
24
|
password?: string;
|
|
24
25
|
}) => Promise<void>;
|
|
25
26
|
|
|
27
|
+
'api/get-budgets': () => Promise<APIFileEntity[]>;
|
|
28
|
+
|
|
26
29
|
'api/start-import': (arg: { budgetName: string }) => Promise<void>;
|
|
27
30
|
|
|
28
31
|
'api/finish-import': () => Promise<void>;
|
|
@@ -114,6 +117,11 @@ export interface ApiHandlers {
|
|
|
114
117
|
|
|
115
118
|
'api/account-delete': (arg: { id }) => Promise<unknown>;
|
|
116
119
|
|
|
120
|
+
'api/account-balance': (arg: {
|
|
121
|
+
id: string;
|
|
122
|
+
cutoff?: Date;
|
|
123
|
+
}) => Promise<number>;
|
|
124
|
+
|
|
117
125
|
'api/categories-get': (arg: {
|
|
118
126
|
grouped;
|
|
119
127
|
}) => Promise<Array<APICategoryGroupEntity | APICategoryEntity>>;
|
|
@@ -140,12 +148,19 @@ export interface ApiHandlers {
|
|
|
140
148
|
|
|
141
149
|
'api/payees-get': () => Promise<APIPayeeEntity[]>;
|
|
142
150
|
|
|
151
|
+
'api/common-payees-get': () => Promise<APIPayeeEntity[]>;
|
|
152
|
+
|
|
143
153
|
'api/payee-create': (arg: { payee }) => Promise<string>;
|
|
144
154
|
|
|
145
155
|
'api/payee-update': (arg: { id; fields }) => Promise<unknown>;
|
|
146
156
|
|
|
147
157
|
'api/payee-delete': (arg: { id }) => Promise<unknown>;
|
|
148
158
|
|
|
159
|
+
'api/payees-merge': (arg: {
|
|
160
|
+
targetId: string;
|
|
161
|
+
mergeIds: string[];
|
|
162
|
+
}) => Promise<void>;
|
|
163
|
+
|
|
149
164
|
'api/rules-get': () => Promise<RuleEntity[]>;
|
|
150
165
|
|
|
151
166
|
'api/payee-rules-get': (arg: { id: string }) => Promise<RuleEntity[]>;
|
|
@@ -10,12 +10,14 @@ export type FileState =
|
|
|
10
10
|
|
|
11
11
|
export type LocalFile = Omit<Budget, 'cloudFileId' | 'groupId'> & {
|
|
12
12
|
state: 'local';
|
|
13
|
+
hasKey: boolean;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export type SyncableLocalFile = Budget & {
|
|
16
17
|
cloudFileId: string;
|
|
17
18
|
groupId: string;
|
|
18
19
|
state: 'broken' | 'unknown';
|
|
20
|
+
hasKey: boolean;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export type SyncedLocalFile = Budget & {
|
|
@@ -32,6 +32,14 @@ export type balanceTypeOpType =
|
|
|
32
32
|
| 'netAssets'
|
|
33
33
|
| 'netDebts';
|
|
34
34
|
|
|
35
|
+
export type spendingReportTimeType =
|
|
36
|
+
| 'average'
|
|
37
|
+
| 'thisMonth'
|
|
38
|
+
| 'lastMonth'
|
|
39
|
+
| 'twoMonthsPrevious'
|
|
40
|
+
| 'lastYear'
|
|
41
|
+
| 'lastYearPrevious';
|
|
42
|
+
|
|
35
43
|
export type SpendingMonthEntity = Record<
|
|
36
44
|
string | number,
|
|
37
45
|
{
|
|
@@ -57,7 +65,9 @@ export interface SpendingEntity {
|
|
|
57
65
|
average: number;
|
|
58
66
|
thisMonth: number;
|
|
59
67
|
lastMonth: number;
|
|
68
|
+
twoMonthsPrevious: number;
|
|
60
69
|
lastYear: number;
|
|
70
|
+
lastYearPrevious: number;
|
|
61
71
|
}[];
|
|
62
72
|
startDate?: string;
|
|
63
73
|
endDate?: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type numberFormats } from '../shared/util';
|
|
2
2
|
|
|
3
|
+
import { spendingReportTimeType } from './models/reports';
|
|
4
|
+
|
|
3
5
|
export type FeatureFlag =
|
|
4
6
|
| 'reportBudget'
|
|
5
7
|
| 'goalTemplatesEnabled'
|
|
@@ -18,8 +20,6 @@ export type LocalPrefs = Partial<
|
|
|
18
20
|
| 'dd.MM.yyyy';
|
|
19
21
|
numberFormat: (typeof numberFormats)[number]['value'];
|
|
20
22
|
hideFraction: boolean;
|
|
21
|
-
hideClosedAccounts: boolean;
|
|
22
|
-
hideMobileMessage: boolean;
|
|
23
23
|
isPrivacyEnabled: boolean;
|
|
24
24
|
budgetName: string;
|
|
25
25
|
'ui.showClosedAccounts': boolean;
|
|
@@ -40,7 +40,6 @@ export type LocalPrefs = Partial<
|
|
|
40
40
|
[key: `flip-amount-${string}-${'csv' | 'qif'}`]: boolean;
|
|
41
41
|
'flags.updateNotificationShownForVersion': string;
|
|
42
42
|
id: string;
|
|
43
|
-
isCached: boolean;
|
|
44
43
|
lastUploaded: string;
|
|
45
44
|
cloudFileId: string;
|
|
46
45
|
groupId: string;
|
|
@@ -53,6 +52,10 @@ export type LocalPrefs = Partial<
|
|
|
53
52
|
reportsViewLegend: boolean;
|
|
54
53
|
reportsViewSummary: boolean;
|
|
55
54
|
reportsViewLabel: boolean;
|
|
55
|
+
spendingReportFilter: string;
|
|
56
|
+
spendingReportTime: spendingReportTimeType;
|
|
57
|
+
spendingReportCompare: spendingReportTimeType;
|
|
58
|
+
sidebarWidth: number;
|
|
56
59
|
'mobile.showSpentColumn': boolean;
|
|
57
60
|
} & Record<`flags.${FeatureFlag}`, boolean>
|
|
58
61
|
>;
|
|
@@ -61,7 +64,6 @@ export type Theme = 'light' | 'dark' | 'auto' | 'midnight' | 'development';
|
|
|
61
64
|
export type GlobalPrefs = Partial<{
|
|
62
65
|
floatingSidebar: boolean;
|
|
63
66
|
maxMonths: number;
|
|
64
|
-
autoUpdate: boolean;
|
|
65
67
|
keyId?: string;
|
|
66
68
|
theme: Theme;
|
|
67
69
|
documentDir: string; // Electron only
|
|
@@ -105,6 +105,8 @@ export interface ServerHandlers {
|
|
|
105
105
|
|
|
106
106
|
'payee-create': (arg: { name }) => Promise<string>;
|
|
107
107
|
|
|
108
|
+
'common-payees-get': () => Promise<PayeeEntity[]>;
|
|
109
|
+
|
|
108
110
|
'payees-get': () => Promise<PayeeEntity[]>;
|
|
109
111
|
|
|
110
112
|
'payees-get-rule-counts': () => Promise<unknown>;
|
|
@@ -222,10 +224,15 @@ export interface ServerHandlers {
|
|
|
222
224
|
updatedAccounts;
|
|
223
225
|
}>;
|
|
224
226
|
|
|
225
|
-
'transactions-import': (arg: {
|
|
227
|
+
'transactions-import': (arg: {
|
|
228
|
+
accountId;
|
|
229
|
+
transactions;
|
|
230
|
+
isPreview;
|
|
231
|
+
}) => Promise<{
|
|
226
232
|
errors?: { message: string }[];
|
|
227
233
|
added;
|
|
228
234
|
updated;
|
|
235
|
+
updatedPreview;
|
|
229
236
|
}>;
|
|
230
237
|
|
|
231
238
|
'account-unlink': (arg: { id }) => Promise<'ok'>;
|
package/@types/methods.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare function loadBudget(budgetId: any): Promise<void>;
|
|
|
4
4
|
export declare function downloadBudget(syncId: any, { password }?: {
|
|
5
5
|
password?: any;
|
|
6
6
|
}): Promise<void>;
|
|
7
|
+
export declare function getBudgets(): Promise<import("./loot-core/server/api-models").APIFileEntity[]>;
|
|
7
8
|
export declare function sync(): Promise<void>;
|
|
8
9
|
export declare function runBankSync(args?: {
|
|
9
10
|
accountId: string;
|
|
@@ -64,6 +65,7 @@ export declare function updateAccount(id: any, fields: any): Promise<void>;
|
|
|
64
65
|
export declare function closeAccount(id: any, transferAccountId?: any, transferCategoryId?: any): Promise<unknown>;
|
|
65
66
|
export declare function reopenAccount(id: any): Promise<unknown>;
|
|
66
67
|
export declare function deleteAccount(id: any): Promise<unknown>;
|
|
68
|
+
export declare function getAccountBalance(id: any, cutoff?: any): Promise<number>;
|
|
67
69
|
export declare function getCategoryGroups(): Promise<import("./loot-core/server/api-models").APICategoryGroupEntity[]>;
|
|
68
70
|
export declare function createCategoryGroup(group: any): Promise<string>;
|
|
69
71
|
export declare function updateCategoryGroup(id: any, fields: any): Promise<unknown>;
|
|
@@ -74,10 +76,12 @@ export declare function updateCategory(id: any, fields: any): Promise<unknown>;
|
|
|
74
76
|
export declare function deleteCategory(id: any, transferCategoryId?: any): Promise<{
|
|
75
77
|
error?: string;
|
|
76
78
|
}>;
|
|
79
|
+
export declare function getCommonPayees(): Promise<import("./loot-core/server/api-models").APIPayeeEntity[]>;
|
|
77
80
|
export declare function getPayees(): Promise<import("./loot-core/server/api-models").APIPayeeEntity[]>;
|
|
78
81
|
export declare function createPayee(payee: any): Promise<string>;
|
|
79
82
|
export declare function updatePayee(id: any, fields: any): Promise<unknown>;
|
|
80
83
|
export declare function deletePayee(id: any): Promise<unknown>;
|
|
84
|
+
export declare function mergePayees(targetId: any, mergeIds: any): Promise<void>;
|
|
81
85
|
export declare function getRules(): Promise<import("./loot-core/types/models").RuleEntity[]>;
|
|
82
86
|
export declare function getPayeeRules(id: any): Promise<import("./loot-core/types/models").RuleEntity[]>;
|
|
83
87
|
export declare function createRule(rule: any): Promise<import("./loot-core/types/models").RuleEntity>;
|