@actual-app/api 25.4.0-alpha.0 → 25.5.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/prefs/prefsSlice.d.ts +2 -0
- package/@types/loot-core/client/queries/queriesSlice.d.ts +1 -1
- package/@types/loot-core/mocks/util.d.ts +1 -0
- package/@types/loot-core/platform/server/asyncStorage/index.d.ts +2 -1
- package/@types/loot-core/server/accounts/sync.d.ts +1 -9
- package/@types/loot-core/server/budget/base.d.ts +1 -0
- package/@types/loot-core/server/budget/envelope.d.ts +3 -0
- package/@types/loot-core/server/budget/report.d.ts +4 -1
- package/@types/loot-core/server/budget/statements.d.ts +1 -1
- package/@types/loot-core/server/db/index.d.ts +2 -1
- package/@types/loot-core/server/encryption/encryption-internals.d.ts +0 -1
- package/@types/loot-core/server/main-app.d.ts +1 -1
- package/@types/loot-core/server/reports/app.d.ts +2 -2
- package/@types/loot-core/server/transactions/app.d.ts +4 -1
- package/@types/loot-core/server/transactions/import/ofx2json.d.ts +1 -0
- package/@types/loot-core/server/transactions/index.d.ts +1 -0
- package/@types/loot-core/server/transactions/merge.d.ts +2 -0
- package/@types/loot-core/server/transactions/transaction-rules.d.ts +1 -0
- package/@types/loot-core/server/transactions/transfer.d.ts +2 -2
- package/@types/loot-core/types/api-handlers.d.ts +170 -183
- package/@types/loot-core/types/budget.d.ts +6 -6
- package/@types/loot-core/types/file.d.ts +23 -36
- package/@types/loot-core/types/handlers.d.ts +2 -24
- package/@types/loot-core/types/models/bank-sync.d.ts +10 -17
- package/@types/loot-core/types/models/category-group.d.ts +7 -8
- package/@types/loot-core/types/models/category.d.ts +7 -8
- package/@types/loot-core/types/models/dashboard.d.ts +43 -88
- package/@types/loot-core/types/models/gocardless.d.ts +56 -71
- package/@types/loot-core/types/models/note.d.ts +2 -2
- package/@types/loot-core/types/models/openid.d.ts +6 -6
- package/@types/loot-core/types/models/payee.d.ts +6 -7
- package/@types/loot-core/types/models/reports.d.ts +98 -118
- package/@types/loot-core/types/models/rule.d.ts +62 -161
- package/@types/loot-core/types/models/schedule.d.ts +36 -38
- package/@types/loot-core/types/models/simplefin.d.ts +13 -17
- package/@types/loot-core/types/models/transaction-filter.d.ts +5 -6
- package/@types/loot-core/types/models/transaction.d.ts +29 -30
- package/@types/loot-core/types/prefs.d.ts +2 -0
- package/@types/loot-core/types/server-events.d.ts +42 -67
- package/@types/loot-core/types/server-handlers.d.ts +25 -22
- package/@types/loot-core/types/util.d.ts +7 -18
- package/@types/methods.d.ts +1 -1
- package/@types/vitest.config.d.ts +7 -0
- package/dist/app/bundle.api.js +826 -790
- package/dist/package.json +5 -7
- package/dist/vitest.config.js +11 -0
- package/package.json +5 -7
- package/@types/jest.config.d.ts +0 -9
- package/@types/loot-core/client/accounts/accountsSlice.d.ts +0 -175
- package/dist/jest.config.js +0 -22
|
@@ -41,6 +41,7 @@ export declare const savePrefs: import("@reduxjs/toolkit").AsyncThunk<void, Save
|
|
|
41
41
|
export declare const loadGlobalPrefs: import("@reduxjs/toolkit").AsyncThunk<Partial<{
|
|
42
42
|
floatingSidebar: boolean;
|
|
43
43
|
maxMonths: number;
|
|
44
|
+
categoryExpandedState: number;
|
|
44
45
|
keyId?: string;
|
|
45
46
|
language: string;
|
|
46
47
|
theme: import("../../types/prefs").Theme;
|
|
@@ -129,6 +130,7 @@ export declare const actions: {
|
|
|
129
130
|
loadGlobalPrefs: import("@reduxjs/toolkit").AsyncThunk<Partial<{
|
|
130
131
|
floatingSidebar: boolean;
|
|
131
132
|
maxMonths: number;
|
|
133
|
+
categoryExpandedState: number;
|
|
132
134
|
keyId?: string;
|
|
133
135
|
language: string;
|
|
134
136
|
theme: import("../../types/prefs").Theme;
|
|
@@ -214,7 +214,7 @@ export declare const moveCategory: import("@reduxjs/toolkit").AsyncThunk<void, M
|
|
|
214
214
|
}>;
|
|
215
215
|
type MoveCategoryGroupPayload = {
|
|
216
216
|
id: CategoryGroupEntity['id'];
|
|
217
|
-
targetId: CategoryGroupEntity['id'];
|
|
217
|
+
targetId: CategoryGroupEntity['id'] | null;
|
|
218
218
|
};
|
|
219
219
|
export declare const moveCategoryGroup: import("@reduxjs/toolkit").AsyncThunk<void, MoveCategoryGroupPayload, {
|
|
220
220
|
state: import("../store").RootState;
|
|
@@ -21,7 +21,8 @@ export type RemoveItem = typeof removeItem;
|
|
|
21
21
|
|
|
22
22
|
export function multiGet<K extends readonly (keyof GlobalPrefsJson)[]>(
|
|
23
23
|
keys: K,
|
|
24
|
-
): Promise<{ [P in
|
|
24
|
+
): Promise<{ [P in K[number]]: GlobalPrefsJson[P] }>;
|
|
25
|
+
|
|
25
26
|
export type MultiGet = typeof multiGet;
|
|
26
27
|
|
|
27
28
|
export function multiSet<K extends keyof GlobalPrefsJson>(
|
|
@@ -20,15 +20,7 @@ export declare function addTransactions(acctId: any, transactions: any, { runTra
|
|
|
20
20
|
runTransfers?: boolean;
|
|
21
21
|
learnCategories?: boolean;
|
|
22
22
|
}): Promise<any>;
|
|
23
|
-
export declare function syncAccount(userId: string | undefined, userKey: string | undefined, id: string, acctId: string, bankId: string): Promise<{
|
|
24
|
-
added: any[];
|
|
25
|
-
updated: string[];
|
|
26
|
-
updatedPreview: Array<{
|
|
27
|
-
transaction: TransactionEntity;
|
|
28
|
-
existing?: TransactionEntity;
|
|
29
|
-
ignored?: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
} | {
|
|
23
|
+
export declare function syncAccount(userId: string | undefined, userKey: string | undefined, id: string, acctId: string, bankId: string): Promise<ReconcileTransactionsResult | {
|
|
32
24
|
added: any[];
|
|
33
25
|
updated: any[];
|
|
34
26
|
}>;
|
|
@@ -4,6 +4,7 @@ export declare function getBudgetRange(start: string, end: string): {
|
|
|
4
4
|
end: string;
|
|
5
5
|
range: string[];
|
|
6
6
|
};
|
|
7
|
+
export declare function createCategory(cat: any, sheetName: any, prevSheetName: any, start: any, end: any): void;
|
|
7
8
|
export declare function triggerBudgetChanges(oldValues: any, newValues: any): void;
|
|
8
9
|
export declare function doTransfer(categoryIds: any, transferId: any): Promise<void>;
|
|
9
10
|
export declare function createBudget(months: any): Promise<void>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare function createBlankCategory(cat: any, months: any): void;
|
|
2
2
|
export declare function createCategory(cat: any, sheetName: any, prevSheetName: any): void;
|
|
3
|
+
export declare function createCategoryGroup(group: any, sheetName: any): void;
|
|
3
4
|
export declare function createSummary(groups: any, categories: any, prevSheetName: any, sheetName: any): void;
|
|
4
5
|
export declare function createBudget(meta: any, categories: any, months: any): void;
|
|
6
|
+
export declare function handleCategoryChange(months: any, oldValue: any, newValue: any): void;
|
|
7
|
+
export declare function handleCategoryGroupChange(months: any, oldValue: any, newValue: any): void;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare function createCategory(cat: any, sheetName: any, prevSheetName: any): Promise<void>;
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function createCategoryGroup(group: any, sheetName: any): void;
|
|
3
|
+
export declare function createSummary(groups: any, sheetName: any): void;
|
|
4
|
+
export declare function handleCategoryChange(months: any, oldValue: any, newValue: any): void;
|
|
5
|
+
export declare function handleCategoryGroupChange(months: any, oldValue: any, newValue: any): void;
|
|
@@ -6,4 +6,4 @@ export type CategoryWithTemplateNote = {
|
|
|
6
6
|
note: string;
|
|
7
7
|
};
|
|
8
8
|
export declare function getCategoriesWithTemplateNotes(): Promise<CategoryWithTemplateNote[]>;
|
|
9
|
-
export declare function getActiveSchedules(): Promise<Pick<db.DbSchedule, "id" | "
|
|
9
|
+
export declare function getActiveSchedules(): Promise<Pick<db.DbSchedule, "id" | "name" | "tombstone" | "rule" | "active" | "completed" | "posts_transaction">[]>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Database } from '@jlongster/sql.js';
|
|
2
|
+
import { TransactionEntity } from '../../types/models';
|
|
2
3
|
import { WithRequired } from '../../types/util';
|
|
3
4
|
import { DbAccount, DbBank, DbCategory, DbCategoryGroup, DbPayee, DbTransaction, DbViewTransaction } from './types';
|
|
4
5
|
export * from './types';
|
|
@@ -111,6 +112,6 @@ export declare function deleteAccount(account: any): Promise<void>;
|
|
|
111
112
|
export declare function moveAccount(id: DbAccount['id'], targetId: DbAccount['id'] | null): Promise<void>;
|
|
112
113
|
export declare function getTransaction(id: DbViewTransaction['id']): Promise<any>;
|
|
113
114
|
export declare function getTransactions(accountId: DbTransaction['acct']): Promise<any[]>;
|
|
114
|
-
export declare function insertTransaction(transaction: any): Promise<
|
|
115
|
+
export declare function insertTransaction(transaction: any): Promise<TransactionEntity['id']>;
|
|
115
116
|
export declare function updateTransaction(transaction: any): Promise<void>;
|
|
116
117
|
export declare function deleteTransaction(transaction: any): Promise<void>;
|
|
@@ -9,7 +9,7 @@ export declare const app: {
|
|
|
9
9
|
handlers: Handlers;
|
|
10
10
|
services: (() => () => void)[];
|
|
11
11
|
unlistenServices: (() => void)[];
|
|
12
|
-
method<Name extends "sync" | "load-budget" | "undo" | "redo" | "make-filters-from-conditions" | "query" | "get-server-version" | "get-server-url" | "set-server-url" | "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/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/copy-single-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/set-6month-avg" | "budget/set-12month-avg" | "budget/set-n-month-avg" | "budget/check-templates" | "budget/apply-goal-template" | "budget/apply-multiple-templates" | "budget/overwrite-goal-template" | "budget/apply-single-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" | "get-categories" | "get-budget-bounds" | "envelope-budget-month" | "tracking-budget-month" | "category-create" | "category-update" | "category-move" | "category-delete" | "get-category-groups" | "category-group-create" | "category-group-update" | "category-group-move" | "category-group-delete" | "must-category-transfer" | "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" | "get-earliest-transaction" | "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" | "pluggyai-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" | "pluggyai-status" | "simplefin-accounts" | "pluggyai-accounts" | "gocardless-get-banks" | "gocardless-create-web-token" | "accounts-bank-sync" | "simplefin-batch-sync" | "transactions-import" | "account-unlink" | "payee-create" | "common-payees-get" | "payees-get" | "payees-get-orphaned" | "payees-get-rule-counts" | "payees-merge" | "payees-batch-change" | "payees-check-orphaned" | "payees-get-rules" | "get-cell" | "get-cell-names" | "create-query" | "sync-reset" | "sync-repair" | "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" | "key-make" | "key-test" | "get-did-bootstrap" | "subscribe-needs-bootstrap" | "subscribe-bootstrap" | "subscribe-get-login-methods" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "subscribe-set-token" | "enable-openid" | "get-openid-config" | "enable-password">(name: Name, func: Handlers[Name]): void;
|
|
12
|
+
method<Name extends "sync" | "load-budget" | "undo" | "redo" | "make-filters-from-conditions" | "query" | "get-server-version" | "get-server-url" | "set-server-url" | "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/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/copy-single-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/set-6month-avg" | "budget/set-12month-avg" | "budget/set-n-month-avg" | "budget/check-templates" | "budget/apply-goal-template" | "budget/apply-multiple-templates" | "budget/overwrite-goal-template" | "budget/apply-single-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" | "get-categories" | "get-budget-bounds" | "envelope-budget-month" | "tracking-budget-month" | "category-create" | "category-update" | "category-move" | "category-delete" | "get-category-groups" | "category-group-create" | "category-group-update" | "category-group-move" | "category-group-delete" | "must-category-transfer" | "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" | "transactions-merge" | "get-earliest-transaction" | "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" | "pluggyai-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" | "pluggyai-status" | "simplefin-accounts" | "pluggyai-accounts" | "gocardless-get-banks" | "gocardless-create-web-token" | "accounts-bank-sync" | "simplefin-batch-sync" | "transactions-import" | "account-unlink" | "payee-create" | "common-payees-get" | "payees-get" | "payees-get-orphaned" | "payees-get-rule-counts" | "payees-merge" | "payees-batch-change" | "payees-check-orphaned" | "payees-get-rules" | "get-cell" | "get-cell-names" | "create-query" | "sync-reset" | "sync-repair" | "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" | "key-make" | "key-test" | "get-did-bootstrap" | "subscribe-needs-bootstrap" | "subscribe-bootstrap" | "subscribe-get-login-methods" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "subscribe-set-token" | "enable-openid" | "get-openid-config" | "enable-password">(name: Name, func: Handlers[Name]): void;
|
|
13
13
|
service(func: () => () => void): void;
|
|
14
14
|
combine(...apps: any[]): void;
|
|
15
15
|
startServices(): void;
|
|
@@ -22,7 +22,7 @@ export declare const reportModel: {
|
|
|
22
22
|
includeCurrentInterval: boolean;
|
|
23
23
|
graphType: string;
|
|
24
24
|
conditions: import("../../types/models").RuleConditionEntity[];
|
|
25
|
-
conditionsOp: "
|
|
25
|
+
conditionsOp: "or" | "and";
|
|
26
26
|
};
|
|
27
27
|
fromJS(report: CustomReportEntity): {
|
|
28
28
|
id: string;
|
|
@@ -43,7 +43,7 @@ export declare const reportModel: {
|
|
|
43
43
|
include_current: number;
|
|
44
44
|
graph_type: string;
|
|
45
45
|
conditions: import("../../types/models").RuleConditionEntity[];
|
|
46
|
-
conditions_op: "
|
|
46
|
+
conditions_op: "or" | "and";
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
declare function createReport(report: CustomReportEntity): Promise<string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { QueryState } from '../../shared/query';
|
|
2
2
|
import { AccountEntity, CategoryGroupEntity, PayeeEntity, TransactionEntity } from '../../types/models';
|
|
3
3
|
import { ParseFileOptions } from './import/parse-file';
|
|
4
|
+
import { mergeTransactions } from './merge';
|
|
4
5
|
import { batchUpdateTransactions } from '.';
|
|
5
6
|
export type TransactionHandlers = {
|
|
6
7
|
'transactions-batch-update': typeof handleBatchUpdateTransactions;
|
|
@@ -10,6 +11,7 @@ export type TransactionHandlers = {
|
|
|
10
11
|
'transactions-parse-file': typeof parseTransactionsFile;
|
|
11
12
|
'transactions-export': typeof exportTransactions;
|
|
12
13
|
'transactions-export-query': typeof exportTransactionsQuery;
|
|
14
|
+
'transactions-merge': typeof mergeTransactions;
|
|
13
15
|
'get-earliest-transaction': typeof getEarliestTransaction;
|
|
14
16
|
};
|
|
15
17
|
declare function handleBatchUpdateTransactions({ added, deleted, updated, learnCategories, }: Parameters<typeof batchUpdateTransactions>[0]): Promise<{
|
|
@@ -21,6 +23,7 @@ declare function handleBatchUpdateTransactions({ added, deleted, updated, learnC
|
|
|
21
23
|
id: any;
|
|
22
24
|
category: any;
|
|
23
25
|
})[];
|
|
26
|
+
deleted: TransactionEntity[];
|
|
24
27
|
}>;
|
|
25
28
|
declare function addTransaction(transaction: TransactionEntity): Promise<{}>;
|
|
26
29
|
declare function updateTransaction(transaction: TransactionEntity): Promise<{}>;
|
|
@@ -49,7 +52,7 @@ export declare const app: {
|
|
|
49
52
|
handlers: TransactionHandlers;
|
|
50
53
|
services: (() => () => void)[];
|
|
51
54
|
unlistenServices: (() => void)[];
|
|
52
|
-
method<Name extends "transactions-batch-update" | "transaction-add" | "transaction-update" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "get-earliest-transaction">(name: Name, func: TransactionHandlers[Name]): void;
|
|
55
|
+
method<Name extends "transactions-batch-update" | "transaction-add" | "transaction-update" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "transactions-merge" | "get-earliest-transaction">(name: Name, func: TransactionHandlers[Name]): void;
|
|
53
56
|
service(func: () => () => void): void;
|
|
54
57
|
combine(...apps: any[]): void;
|
|
55
58
|
startServices(): void;
|
|
@@ -37,6 +37,7 @@ export declare function applyActions(transactions: TransactionEntity[], actions:
|
|
|
37
37
|
id: any;
|
|
38
38
|
category: any;
|
|
39
39
|
})[];
|
|
40
|
+
deleted: TransactionEntity[];
|
|
40
41
|
}>;
|
|
41
42
|
export declare function getRulesForPayee(payeeId: any): Rule[];
|
|
42
43
|
export declare function updatePayeeRenameRule(fromNames: string[], to: string): Promise<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function addTransfer(transaction: any, transferredAccount: any): Promise<{
|
|
2
2
|
category?: any;
|
|
3
3
|
id: any;
|
|
4
|
-
transfer_id:
|
|
4
|
+
transfer_id: string;
|
|
5
5
|
}>;
|
|
6
6
|
export declare function removeTransfer(transaction: any): Promise<{
|
|
7
7
|
id: any;
|
|
@@ -14,7 +14,7 @@ export declare function updateTransfer(transaction: any, transferredAccount: any
|
|
|
14
14
|
export declare function onInsert(transaction: any): Promise<{
|
|
15
15
|
category?: any;
|
|
16
16
|
id: any;
|
|
17
|
-
transfer_id:
|
|
17
|
+
transfer_id: string;
|
|
18
18
|
}>;
|
|
19
19
|
export declare function onDelete(transaction: any): Promise<void>;
|
|
20
20
|
export declare function onUpdate(transaction: any): Promise<{
|
|
@@ -1,188 +1,175 @@
|
|
|
1
1
|
import { ImportTransactionsOpts } from '@actual-app/api';
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
APIAccountEntity,
|
|
5
|
-
APICategoryEntity,
|
|
6
|
-
APICategoryGroupEntity,
|
|
7
|
-
APIFileEntity,
|
|
8
|
-
APIPayeeEntity,
|
|
9
|
-
} from '../server/api-models';
|
|
2
|
+
import type { APIAccountEntity, APICategoryEntity, APICategoryGroupEntity, APIFileEntity, APIPayeeEntity } from '../server/api-models';
|
|
3
|
+
import { BudgetFileHandlers } from '../server/budgetfiles/app';
|
|
10
4
|
import { type batchUpdateTransactions } from '../server/transactions';
|
|
11
|
-
|
|
12
5
|
import type { NewRuleEntity, RuleEntity, TransactionEntity } from './models';
|
|
13
|
-
import { type ServerHandlers } from './server-handlers';
|
|
14
|
-
|
|
15
6
|
export interface ApiHandlers {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
'api/rule-update': (arg: { rule: RuleEntity }) => Promise<RuleEntity>;
|
|
186
|
-
|
|
187
|
-
'api/rule-delete': (id: string) => Promise<boolean>;
|
|
7
|
+
'api/batch-budget-start': () => Promise<unknown>;
|
|
8
|
+
'api/batch-budget-end': () => Promise<unknown>;
|
|
9
|
+
'api/load-budget': (...args: Parameters<BudgetFileHandlers['load-budget']>) => Promise<void>;
|
|
10
|
+
'api/download-budget': (arg: {
|
|
11
|
+
syncId: string;
|
|
12
|
+
password?: string;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
'api/get-budgets': () => Promise<APIFileEntity[]>;
|
|
15
|
+
'api/start-import': (arg: {
|
|
16
|
+
budgetName: string;
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
'api/finish-import': () => Promise<void>;
|
|
19
|
+
'api/abort-import': () => Promise<void>;
|
|
20
|
+
'api/query': (arg: {
|
|
21
|
+
query: any;
|
|
22
|
+
}) => Promise<unknown>;
|
|
23
|
+
'api/budget-months': () => Promise<string[]>;
|
|
24
|
+
'api/budget-month': (arg: {
|
|
25
|
+
month: any;
|
|
26
|
+
}) => Promise<{
|
|
27
|
+
month: string;
|
|
28
|
+
incomeAvailable: number;
|
|
29
|
+
lastMonthOverspent: number;
|
|
30
|
+
forNextMonth: number;
|
|
31
|
+
totalBudgeted: number;
|
|
32
|
+
toBudget: number;
|
|
33
|
+
fromLastMonth: number;
|
|
34
|
+
totalIncome: number;
|
|
35
|
+
totalSpent: number;
|
|
36
|
+
totalBalance: number;
|
|
37
|
+
categoryGroups: Record<string, unknown>[];
|
|
38
|
+
}>;
|
|
39
|
+
'api/budget-set-amount': (arg: {
|
|
40
|
+
month: string;
|
|
41
|
+
categoryId: string;
|
|
42
|
+
amount: number;
|
|
43
|
+
}) => Promise<void>;
|
|
44
|
+
'api/budget-set-carryover': (arg: {
|
|
45
|
+
month: string;
|
|
46
|
+
categoryId: string;
|
|
47
|
+
flag: boolean;
|
|
48
|
+
}) => Promise<void>;
|
|
49
|
+
'api/budget-hold-for-next-month': (arg: {
|
|
50
|
+
month: string;
|
|
51
|
+
amount: number;
|
|
52
|
+
}) => Promise<boolean>;
|
|
53
|
+
'api/budget-reset-hold': (arg: {
|
|
54
|
+
month: string;
|
|
55
|
+
}) => Promise<void>;
|
|
56
|
+
'api/transactions-export': (arg: {
|
|
57
|
+
transactions: any;
|
|
58
|
+
categoryGroups: any;
|
|
59
|
+
payees: any;
|
|
60
|
+
accounts: any;
|
|
61
|
+
}) => Promise<unknown>;
|
|
62
|
+
'api/transactions-import': (arg: {
|
|
63
|
+
accountId: any;
|
|
64
|
+
transactions: any;
|
|
65
|
+
isPreview?: any;
|
|
66
|
+
opts?: ImportTransactionsOpts;
|
|
67
|
+
}) => Promise<{
|
|
68
|
+
errors?: {
|
|
69
|
+
message: string;
|
|
70
|
+
}[];
|
|
71
|
+
added: any;
|
|
72
|
+
updated: any;
|
|
73
|
+
}>;
|
|
74
|
+
'api/transactions-add': (arg: {
|
|
75
|
+
accountId: any;
|
|
76
|
+
transactions: any;
|
|
77
|
+
runTransfers?: boolean;
|
|
78
|
+
learnCategories?: boolean;
|
|
79
|
+
}) => Promise<'ok'>;
|
|
80
|
+
'api/transactions-get': (arg: {
|
|
81
|
+
accountId?: string;
|
|
82
|
+
startDate?: string;
|
|
83
|
+
endDate?: string;
|
|
84
|
+
}) => Promise<TransactionEntity[]>;
|
|
85
|
+
'api/transaction-update': (arg: {
|
|
86
|
+
id: any;
|
|
87
|
+
fields: any;
|
|
88
|
+
}) => Promise<Awaited<ReturnType<typeof batchUpdateTransactions>>['updated']>;
|
|
89
|
+
'api/transaction-delete': (arg: {
|
|
90
|
+
id: any;
|
|
91
|
+
}) => Promise<Awaited<ReturnType<typeof batchUpdateTransactions>>['deleted']>;
|
|
92
|
+
'api/sync': () => Promise<void>;
|
|
93
|
+
'api/bank-sync': (arg?: {
|
|
94
|
+
accountId: string;
|
|
95
|
+
}) => Promise<void>;
|
|
96
|
+
'api/accounts-get': () => Promise<APIAccountEntity[]>;
|
|
97
|
+
'api/account-create': (arg: {
|
|
98
|
+
account: any;
|
|
99
|
+
initialBalance?: any;
|
|
100
|
+
}) => Promise<string>;
|
|
101
|
+
'api/account-update': (arg: {
|
|
102
|
+
id: any;
|
|
103
|
+
fields: any;
|
|
104
|
+
}) => Promise<void>;
|
|
105
|
+
'api/account-close': (arg: {
|
|
106
|
+
id: any;
|
|
107
|
+
transferAccountId: any;
|
|
108
|
+
transferCategoryId: any;
|
|
109
|
+
}) => Promise<unknown>;
|
|
110
|
+
'api/account-reopen': (arg: {
|
|
111
|
+
id: any;
|
|
112
|
+
}) => Promise<unknown>;
|
|
113
|
+
'api/account-delete': (arg: {
|
|
114
|
+
id: any;
|
|
115
|
+
}) => Promise<unknown>;
|
|
116
|
+
'api/account-balance': (arg: {
|
|
117
|
+
id: string;
|
|
118
|
+
cutoff?: Date;
|
|
119
|
+
}) => Promise<number>;
|
|
120
|
+
'api/categories-get': (arg: {
|
|
121
|
+
grouped: any;
|
|
122
|
+
}) => Promise<Array<APICategoryGroupEntity | APICategoryEntity>>;
|
|
123
|
+
'api/category-groups-get': () => Promise<APICategoryGroupEntity[]>;
|
|
124
|
+
'api/category-group-create': (arg: {
|
|
125
|
+
group: any;
|
|
126
|
+
}) => Promise<string>;
|
|
127
|
+
'api/category-group-update': (arg: {
|
|
128
|
+
id: any;
|
|
129
|
+
fields: any;
|
|
130
|
+
}) => Promise<unknown>;
|
|
131
|
+
'api/category-group-delete': (arg: {
|
|
132
|
+
id: any;
|
|
133
|
+
transferCategoryId: any;
|
|
134
|
+
}) => Promise<unknown>;
|
|
135
|
+
'api/category-create': (arg: {
|
|
136
|
+
category: any;
|
|
137
|
+
}) => Promise<string>;
|
|
138
|
+
'api/category-update': (arg: {
|
|
139
|
+
id: any;
|
|
140
|
+
fields: any;
|
|
141
|
+
}) => Promise<unknown>;
|
|
142
|
+
'api/category-delete': (arg: {
|
|
143
|
+
id: any;
|
|
144
|
+
transferCategoryId?: any;
|
|
145
|
+
}) => Promise<{
|
|
146
|
+
error?: string;
|
|
147
|
+
}>;
|
|
148
|
+
'api/payees-get': () => Promise<APIPayeeEntity[]>;
|
|
149
|
+
'api/common-payees-get': () => Promise<APIPayeeEntity[]>;
|
|
150
|
+
'api/payee-create': (arg: {
|
|
151
|
+
payee: any;
|
|
152
|
+
}) => Promise<string>;
|
|
153
|
+
'api/payee-update': (arg: {
|
|
154
|
+
id: any;
|
|
155
|
+
fields: any;
|
|
156
|
+
}) => Promise<unknown>;
|
|
157
|
+
'api/payee-delete': (arg: {
|
|
158
|
+
id: any;
|
|
159
|
+
}) => Promise<unknown>;
|
|
160
|
+
'api/payees-merge': (arg: {
|
|
161
|
+
targetId: string;
|
|
162
|
+
mergeIds: string[];
|
|
163
|
+
}) => Promise<void>;
|
|
164
|
+
'api/rules-get': () => Promise<RuleEntity[]>;
|
|
165
|
+
'api/payee-rules-get': (arg: {
|
|
166
|
+
id: string;
|
|
167
|
+
}) => Promise<RuleEntity[]>;
|
|
168
|
+
'api/rule-create': (arg: {
|
|
169
|
+
rule: NewRuleEntity;
|
|
170
|
+
}) => Promise<RuleEntity>;
|
|
171
|
+
'api/rule-update': (arg: {
|
|
172
|
+
rule: RuleEntity;
|
|
173
|
+
}) => Promise<RuleEntity>;
|
|
174
|
+
'api/rule-delete': (id: string) => Promise<boolean>;
|
|
188
175
|
}
|