@actual-app/api 25.4.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/app/bundle.api.d.ts +1 -5
- package/@types/loot-core/client/budgets/budgetsSlice.d.ts +6 -2
- package/@types/loot-core/client/modals/modalsSlice.d.ts +5 -1
- package/@types/loot-core/client/prefs/prefsSlice.d.ts +2 -8
- package/@types/loot-core/client/queries/queriesSlice.d.ts +1 -1
- package/@types/loot-core/client/users/usersSlice.d.ts +28 -12
- package/@types/loot-core/mocks/index.d.ts +5 -2
- package/@types/loot-core/mocks/util.d.ts +1 -0
- package/@types/loot-core/platform/server/asyncStorage/index.d.ts +7 -6
- package/@types/loot-core/platform/server/indexeddb/index.d.ts +15 -24
- package/@types/loot-core/server/accounts/sync.d.ts +1 -9
- package/@types/loot-core/server/api-models.d.ts +2 -10
- package/@types/loot-core/server/aql/schema/executors.d.ts +2 -0
- package/@types/loot-core/server/auth/app.d.ts +142 -0
- package/@types/loot-core/server/budget/base.d.ts +2 -1
- 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/budgetfiles/app.d.ts +139 -0
- package/@types/loot-core/server/cloud-storage.d.ts +2 -2
- package/@types/loot-core/server/db/index.d.ts +3 -2
- package/@types/loot-core/server/encryption/app.d.ts +40 -0
- package/@types/loot-core/server/{encryption-internals.d.ts → encryption/encryption-internals.d.ts} +0 -1
- package/@types/loot-core/server/errors.d.ts +4 -0
- package/@types/loot-core/server/importers/index.d.ts +1 -2
- 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/spreadsheet/spreadsheet.d.ts +9 -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/import/parse-file.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/shared/errors.d.ts +4 -4
- 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 +5 -21
- package/@types/loot-core/types/models/bank-sync.d.ts +10 -17
- package/@types/loot-core/types/models/category-group.d.ts +8 -13
- 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 -4
- package/@types/loot-core/types/server-events.d.ts +43 -68
- package/@types/loot-core/types/server-handlers.d.ts +26 -198
- 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 +17541 -110891
- 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/@types/loot-core/server/backups.test.d.ts +0 -1
- package/@types/loot-core/server/encryption-internals.web.d.ts +0 -23
- package/@types/loot-core/server/encryption.test.d.ts +0 -1
- package/dist/jest.config.js +0 -22
- /package/@types/loot-core/server/{backups.d.ts → budgetfiles/backups.d.ts} +0 -0
- /package/@types/loot-core/server/{encryption.d.ts → encryption/index.d.ts} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Budget } from '../../types/budget';
|
|
2
|
+
export type EncryptionHandlers = {
|
|
3
|
+
'key-make': typeof keyMake;
|
|
4
|
+
'key-test': typeof keyTest;
|
|
5
|
+
};
|
|
6
|
+
export declare const app: {
|
|
7
|
+
events: import("mitt").Emitter<{
|
|
8
|
+
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
9
|
+
'load-budget': {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
handlers: EncryptionHandlers;
|
|
14
|
+
services: (() => () => void)[];
|
|
15
|
+
unlistenServices: (() => void)[];
|
|
16
|
+
method<Name extends "key-make" | "key-test">(name: Name, func: EncryptionHandlers[Name]): void;
|
|
17
|
+
service(func: () => () => void): void;
|
|
18
|
+
combine(...apps: any[]): void;
|
|
19
|
+
startServices(): void;
|
|
20
|
+
stopServices(): void;
|
|
21
|
+
};
|
|
22
|
+
declare function keyMake({ password }: {
|
|
23
|
+
password: string;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
error?: {
|
|
26
|
+
reason: string;
|
|
27
|
+
meta?: unknown;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
declare function keyTest({ cloudFileId, password, }: {
|
|
31
|
+
cloudFileId?: Budget['cloudFileId'];
|
|
32
|
+
password: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
error: {
|
|
35
|
+
reason: string;
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
error?: undefined;
|
|
39
|
+
}>;
|
|
40
|
+
export {};
|
|
@@ -63,12 +63,16 @@ export declare function APIError(msg: string, meta?: Record<string, any>): {
|
|
|
63
63
|
export declare function FileDownloadError(reason: string, meta?: {
|
|
64
64
|
fileId?: string;
|
|
65
65
|
isMissingKey?: boolean;
|
|
66
|
+
name?: string;
|
|
67
|
+
id?: string;
|
|
66
68
|
}): {
|
|
67
69
|
type: string;
|
|
68
70
|
reason: string;
|
|
69
71
|
meta: {
|
|
70
72
|
fileId?: string;
|
|
71
73
|
isMissingKey?: boolean;
|
|
74
|
+
name?: string;
|
|
75
|
+
id?: string;
|
|
72
76
|
};
|
|
73
77
|
};
|
|
74
78
|
export declare function FileUploadError(reason: string, meta?: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
type ImportableBudgetType = 'ynab4' | 'ynab5' | 'actual';
|
|
1
|
+
export type ImportableBudgetType = 'ynab4' | 'ynab5' | 'actual';
|
|
2
2
|
export declare function handleBudgetImport(type: ImportableBudgetType, filepath: string, buffer: Buffer): Promise<{
|
|
3
3
|
error: any;
|
|
4
4
|
}>;
|
|
5
|
-
export {};
|
|
@@ -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" | "
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import { QueryState } from '../../shared/query';
|
|
2
|
+
import { BudgetType } from '../prefs';
|
|
2
3
|
export type Node = {
|
|
3
4
|
name: string;
|
|
4
5
|
expr: string | number | boolean;
|
|
@@ -16,7 +17,10 @@ export type Node = {
|
|
|
16
17
|
_dependencies?: string[];
|
|
17
18
|
};
|
|
18
19
|
export declare class Spreadsheet {
|
|
19
|
-
_meta:
|
|
20
|
+
_meta: {
|
|
21
|
+
createdMonths: Set<string>;
|
|
22
|
+
budgetType: BudgetType;
|
|
23
|
+
};
|
|
20
24
|
cacheBarrier: any;
|
|
21
25
|
computeQueue: any;
|
|
22
26
|
dirtyCells: any;
|
|
@@ -28,7 +32,10 @@ export declare class Spreadsheet {
|
|
|
28
32
|
setCacheStatus: any;
|
|
29
33
|
transactionDepth: any;
|
|
30
34
|
constructor(saveCache?: unknown, setCacheStatus?: unknown);
|
|
31
|
-
meta():
|
|
35
|
+
meta(): {
|
|
36
|
+
createdMonths: Set<string>;
|
|
37
|
+
budgetType: BudgetType;
|
|
38
|
+
};
|
|
32
39
|
setMeta(meta: any): void;
|
|
33
40
|
_getNode(name: string): Node;
|
|
34
41
|
getNode(name: any): Node;
|
|
@@ -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 "
|
|
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;
|
|
@@ -11,6 +11,7 @@ export type ParseFileOptions = {
|
|
|
11
11
|
delimiter?: string;
|
|
12
12
|
fallbackMissingPayeeToMemo?: boolean;
|
|
13
13
|
skipLines?: number;
|
|
14
|
+
importNotes?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare function parseFile(filepath: string, options?: ParseFileOptions): Promise<ParseFileResult>;
|
|
16
17
|
export {};
|
|
@@ -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<{
|
|
@@ -2,10 +2,10 @@ export declare function getUploadError({ reason, meta, }: {
|
|
|
2
2
|
reason: string;
|
|
3
3
|
meta?: unknown;
|
|
4
4
|
}): string;
|
|
5
|
-
export declare function getDownloadError({ reason, meta, fileName }: {
|
|
6
|
-
reason:
|
|
7
|
-
meta
|
|
8
|
-
fileName
|
|
5
|
+
export declare function getDownloadError({ reason, meta, fileName, }: {
|
|
6
|
+
reason: string;
|
|
7
|
+
meta?: unknown;
|
|
8
|
+
fileName?: string;
|
|
9
9
|
}): string;
|
|
10
10
|
export declare function getCreateKeyError(error: any): string;
|
|
11
11
|
export declare function getTestKeyError({ reason }: {
|
|
@@ -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
|
}
|