@actual-app/api 25.12.0-nightly.20251122 → 25.12.0-nightly.20251124
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/src/server/api-models.d.ts +12 -16
- package/@types/loot-core/src/server/budget/app.d.ts +2 -2
- package/@types/loot-core/src/types/api-handlers.d.ts +60 -51
- package/@types/loot-core/src/types/models/schedule.d.ts +2 -2
- package/@types/loot-core/src/types/server-handlers.d.ts +3 -1
- package/@types/loot-core/typings/window.d.ts +1 -0
- package/@types/methods.d.ts +63 -53
- package/dist/app/bundle.api.js +5 -5
- package/dist/methods.js +3 -3
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Budget } from '../types/budget';
|
|
2
|
-
import type { AccountEntity, CategoryEntity, CategoryGroupEntity, PayeeEntity, ScheduleEntity
|
|
2
|
+
import type { AccountEntity, CategoryEntity, CategoryGroupEntity, PayeeEntity, ScheduleEntity } from '../types/models';
|
|
3
3
|
import { RemoteFile } from './cloud-storage';
|
|
4
4
|
export type APIAccountEntity = Pick<AccountEntity, 'id' | 'name'> & {
|
|
5
|
-
offbudget
|
|
6
|
-
closed
|
|
5
|
+
offbudget?: boolean;
|
|
6
|
+
closed?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare const accountModel: {
|
|
9
9
|
toExternal(account: AccountEntity): APIAccountEntity;
|
|
@@ -27,7 +27,7 @@ export declare const categoryModel: {
|
|
|
27
27
|
fromDb(category: import("./db").DbCategory): CategoryEntity;
|
|
28
28
|
};
|
|
29
29
|
export type APICategoryGroupEntity = Pick<CategoryGroupEntity, 'id' | 'name' | 'is_income' | 'hidden'> & {
|
|
30
|
-
categories
|
|
30
|
+
categories?: APICategoryEntity[];
|
|
31
31
|
};
|
|
32
32
|
export declare const categoryGroupModel: {
|
|
33
33
|
toExternal(group: CategoryGroupEntity): APICategoryGroupEntity;
|
|
@@ -72,19 +72,15 @@ export declare const budgetModel: {
|
|
|
72
72
|
fromExternal(file: APIFileEntity): Budget;
|
|
73
73
|
};
|
|
74
74
|
export type AmountOPType = 'is' | 'isapprox' | 'isbetween';
|
|
75
|
-
export type APIScheduleEntity = Pick<ScheduleEntity, 'id' | 'name'> & {
|
|
76
|
-
rule?:
|
|
77
|
-
next_date?:
|
|
78
|
-
completed?:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
amount: number | {
|
|
83
|
-
num1: number;
|
|
84
|
-
num2: number;
|
|
85
|
-
};
|
|
75
|
+
export type APIScheduleEntity = Pick<ScheduleEntity, 'id' | 'name' | 'posts_transaction'> & {
|
|
76
|
+
rule?: ScheduleEntity['rule'];
|
|
77
|
+
next_date?: ScheduleEntity['next_date'];
|
|
78
|
+
completed?: ScheduleEntity['completed'];
|
|
79
|
+
payee?: ScheduleEntity['_payee'];
|
|
80
|
+
account?: ScheduleEntity['_account'];
|
|
81
|
+
amount?: ScheduleEntity['_amount'];
|
|
86
82
|
amountOp: AmountOPType;
|
|
87
|
-
date:
|
|
83
|
+
date: ScheduleEntity['_date'];
|
|
88
84
|
};
|
|
89
85
|
export declare const scheduleModel: {
|
|
90
86
|
toExternal(schedule: ScheduleEntity): APIScheduleEntity;
|
|
@@ -88,10 +88,10 @@ declare function createCategory({ name, groupId, isIncome, hidden, }: {
|
|
|
88
88
|
hidden?: boolean;
|
|
89
89
|
}): Promise<CategoryEntity['id']>;
|
|
90
90
|
declare function updateCategory(category: CategoryEntity): Promise<{
|
|
91
|
-
error
|
|
91
|
+
error: {
|
|
92
92
|
type: 'category-exists';
|
|
93
93
|
};
|
|
94
|
-
}>;
|
|
94
|
+
} | object>;
|
|
95
95
|
declare function moveCategory({ id, groupId, targetId, }: {
|
|
96
96
|
id: CategoryEntity['id'];
|
|
97
97
|
groupId: CategoryGroupEntity['id'];
|
|
@@ -3,10 +3,11 @@ import type { ImportTransactionsResult } from '../server/accounts/app';
|
|
|
3
3
|
import type { APIAccountEntity, APICategoryEntity, APICategoryGroupEntity, APIFileEntity, APIPayeeEntity, APIScheduleEntity } from '../server/api-models';
|
|
4
4
|
import { BudgetFileHandlers } from '../server/budgetfiles/app';
|
|
5
5
|
import { type batchUpdateTransactions } from '../server/transactions';
|
|
6
|
+
import type { QueryState } from '../shared/query';
|
|
6
7
|
import type { ImportTransactionEntity, NewRuleEntity, RuleEntity, TransactionEntity, ScheduleEntity } from './models';
|
|
7
8
|
export interface ApiHandlers {
|
|
8
|
-
'api/batch-budget-start': () => Promise<
|
|
9
|
-
'api/batch-budget-end': () => Promise<
|
|
9
|
+
'api/batch-budget-start': () => Promise<void>;
|
|
10
|
+
'api/batch-budget-end': () => Promise<void>;
|
|
10
11
|
'api/load-budget': (...args: Parameters<BudgetFileHandlers['load-budget']>) => Promise<void>;
|
|
11
12
|
'api/download-budget': (arg: {
|
|
12
13
|
syncId: string;
|
|
@@ -19,11 +20,11 @@ export interface ApiHandlers {
|
|
|
19
20
|
'api/finish-import': () => Promise<void>;
|
|
20
21
|
'api/abort-import': () => Promise<void>;
|
|
21
22
|
'api/query': (arg: {
|
|
22
|
-
query:
|
|
23
|
+
query: QueryState;
|
|
23
24
|
}) => Promise<unknown>;
|
|
24
25
|
'api/budget-months': () => Promise<string[]>;
|
|
25
26
|
'api/budget-month': (arg: {
|
|
26
|
-
month:
|
|
27
|
+
month: string;
|
|
27
28
|
}) => Promise<{
|
|
28
29
|
month: string;
|
|
29
30
|
incomeAvailable: number;
|
|
@@ -61,104 +62,110 @@ export interface ApiHandlers {
|
|
|
61
62
|
accounts: any;
|
|
62
63
|
}) => Promise<unknown>;
|
|
63
64
|
'api/transactions-import': (arg: {
|
|
64
|
-
accountId:
|
|
65
|
+
accountId: APIAccountEntity['id'];
|
|
65
66
|
transactions: ImportTransactionEntity[];
|
|
66
|
-
isPreview?:
|
|
67
|
+
isPreview?: boolean;
|
|
67
68
|
opts?: ImportTransactionsOpts;
|
|
68
69
|
}) => Promise<ImportTransactionsResult>;
|
|
69
70
|
'api/transactions-add': (arg: {
|
|
70
|
-
accountId:
|
|
71
|
-
transactions:
|
|
71
|
+
accountId: APIAccountEntity['id'];
|
|
72
|
+
transactions: Omit<ImportTransactionEntity, 'account'>[];
|
|
72
73
|
runTransfers?: boolean;
|
|
73
74
|
learnCategories?: boolean;
|
|
74
75
|
}) => Promise<'ok'>;
|
|
75
76
|
'api/transactions-get': (arg: {
|
|
76
|
-
accountId?:
|
|
77
|
+
accountId?: APIAccountEntity['id'];
|
|
77
78
|
startDate?: string;
|
|
78
79
|
endDate?: string;
|
|
79
80
|
}) => Promise<TransactionEntity[]>;
|
|
80
81
|
'api/transaction-update': (arg: {
|
|
81
|
-
id:
|
|
82
|
+
id: TransactionEntity['id'];
|
|
82
83
|
fields: any;
|
|
83
84
|
}) => Promise<Awaited<ReturnType<typeof batchUpdateTransactions>>['updated']>;
|
|
84
85
|
'api/transaction-delete': (arg: {
|
|
85
|
-
id:
|
|
86
|
+
id: TransactionEntity['id'];
|
|
86
87
|
}) => Promise<Awaited<ReturnType<typeof batchUpdateTransactions>>['deleted']>;
|
|
87
88
|
'api/sync': () => Promise<void>;
|
|
88
89
|
'api/bank-sync': (arg?: {
|
|
89
|
-
accountId:
|
|
90
|
+
accountId: APIAccountEntity['id'];
|
|
90
91
|
}) => Promise<void>;
|
|
91
92
|
'api/accounts-get': () => Promise<APIAccountEntity[]>;
|
|
92
93
|
'api/account-create': (arg: {
|
|
93
|
-
account:
|
|
94
|
-
initialBalance?:
|
|
94
|
+
account: Omit<APIAccountEntity, 'id'>;
|
|
95
|
+
initialBalance?: number;
|
|
95
96
|
}) => Promise<string>;
|
|
96
97
|
'api/account-update': (arg: {
|
|
97
|
-
id:
|
|
98
|
+
id: APIAccountEntity['id'];
|
|
98
99
|
fields: any;
|
|
99
100
|
}) => Promise<void>;
|
|
100
101
|
'api/account-close': (arg: {
|
|
101
|
-
id:
|
|
102
|
-
transferAccountId
|
|
103
|
-
transferCategoryId
|
|
104
|
-
}) => Promise<
|
|
102
|
+
id: APIAccountEntity['id'];
|
|
103
|
+
transferAccountId?: APIAccountEntity['id'];
|
|
104
|
+
transferCategoryId?: APICategoryEntity['id'];
|
|
105
|
+
}) => Promise<void>;
|
|
105
106
|
'api/account-reopen': (arg: {
|
|
106
|
-
id:
|
|
107
|
-
}) => Promise<
|
|
107
|
+
id: APIAccountEntity['id'];
|
|
108
|
+
}) => Promise<void>;
|
|
108
109
|
'api/account-delete': (arg: {
|
|
109
|
-
id:
|
|
110
|
-
}) => Promise<
|
|
110
|
+
id: APIAccountEntity['id'];
|
|
111
|
+
}) => Promise<void>;
|
|
111
112
|
'api/account-balance': (arg: {
|
|
112
|
-
id:
|
|
113
|
+
id: APIAccountEntity['id'];
|
|
113
114
|
cutoff?: Date;
|
|
114
115
|
}) => Promise<number>;
|
|
115
116
|
'api/categories-get': (arg: {
|
|
116
|
-
grouped
|
|
117
|
+
grouped?: boolean;
|
|
117
118
|
}) => Promise<Array<APICategoryGroupEntity | APICategoryEntity>>;
|
|
118
119
|
'api/category-groups-get': () => Promise<APICategoryGroupEntity[]>;
|
|
119
120
|
'api/category-group-create': (arg: {
|
|
120
|
-
group:
|
|
121
|
-
}) => Promise<
|
|
121
|
+
group: Omit<APICategoryGroupEntity, 'id'>;
|
|
122
|
+
}) => Promise<APICategoryGroupEntity['id']>;
|
|
122
123
|
'api/category-group-update': (arg: {
|
|
123
|
-
id:
|
|
124
|
+
id: APICategoryGroupEntity['id'];
|
|
124
125
|
fields: any;
|
|
125
|
-
}) => Promise<
|
|
126
|
+
}) => Promise<void>;
|
|
126
127
|
'api/category-group-delete': (arg: {
|
|
127
|
-
id:
|
|
128
|
-
transferCategoryId
|
|
129
|
-
}) => Promise<
|
|
128
|
+
id: APICategoryGroupEntity['id'];
|
|
129
|
+
transferCategoryId?: APICategoryEntity['id'];
|
|
130
|
+
}) => Promise<void>;
|
|
130
131
|
'api/category-create': (arg: {
|
|
131
|
-
category:
|
|
132
|
-
}) => Promise<
|
|
132
|
+
category: Omit<APICategoryEntity, 'id'>;
|
|
133
|
+
}) => Promise<APICategoryEntity['id']>;
|
|
133
134
|
'api/category-update': (arg: {
|
|
134
|
-
id:
|
|
135
|
+
id: APICategoryEntity['id'];
|
|
135
136
|
fields: any;
|
|
136
|
-
}) => Promise<
|
|
137
|
+
}) => Promise<{
|
|
138
|
+
error: {
|
|
139
|
+
type: 'category-exists';
|
|
140
|
+
};
|
|
141
|
+
} | object>;
|
|
137
142
|
'api/category-delete': (arg: {
|
|
138
|
-
id:
|
|
139
|
-
transferCategoryId?:
|
|
143
|
+
id: APICategoryEntity['id'];
|
|
144
|
+
transferCategoryId?: APICategoryEntity['id'];
|
|
140
145
|
}) => Promise<{
|
|
141
|
-
error
|
|
142
|
-
}
|
|
146
|
+
error: 'no-categories';
|
|
147
|
+
} | {
|
|
148
|
+
error: 'category-type';
|
|
149
|
+
} | object>;
|
|
143
150
|
'api/payees-get': () => Promise<APIPayeeEntity[]>;
|
|
144
151
|
'api/common-payees-get': () => Promise<APIPayeeEntity[]>;
|
|
145
152
|
'api/payee-create': (arg: {
|
|
146
|
-
payee:
|
|
147
|
-
}) => Promise<
|
|
153
|
+
payee: Omit<APIPayeeEntity, 'id'>;
|
|
154
|
+
}) => Promise<APIPayeeEntity['id']>;
|
|
148
155
|
'api/payee-update': (arg: {
|
|
149
|
-
id:
|
|
156
|
+
id: APIPayeeEntity['id'];
|
|
150
157
|
fields: any;
|
|
151
|
-
}) => Promise<
|
|
158
|
+
}) => Promise<void>;
|
|
152
159
|
'api/payee-delete': (arg: {
|
|
153
|
-
id:
|
|
154
|
-
}) => Promise<
|
|
160
|
+
id: APIPayeeEntity['id'];
|
|
161
|
+
}) => Promise<void>;
|
|
155
162
|
'api/payees-merge': (arg: {
|
|
156
|
-
targetId:
|
|
163
|
+
targetId: APIPayeeEntity['id'];
|
|
157
164
|
mergeIds: string[];
|
|
158
165
|
}) => Promise<void>;
|
|
159
166
|
'api/rules-get': () => Promise<RuleEntity[]>;
|
|
160
167
|
'api/payee-rules-get': (arg: {
|
|
161
|
-
id:
|
|
168
|
+
id: APIPayeeEntity['id'];
|
|
162
169
|
}) => Promise<RuleEntity[]>;
|
|
163
170
|
'api/rule-create': (arg: {
|
|
164
171
|
rule: NewRuleEntity;
|
|
@@ -166,8 +173,8 @@ export interface ApiHandlers {
|
|
|
166
173
|
'api/rule-update': (arg: {
|
|
167
174
|
rule: RuleEntity;
|
|
168
175
|
}) => Promise<RuleEntity>;
|
|
169
|
-
'api/rule-delete': (id:
|
|
170
|
-
'api/schedule-create': (schedule: APIScheduleEntity) => Promise<ScheduleEntity['id']>;
|
|
176
|
+
'api/rule-delete': (id: RuleEntity['id']) => Promise<boolean>;
|
|
177
|
+
'api/schedule-create': (schedule: Omit<APIScheduleEntity, 'id'>) => Promise<ScheduleEntity['id']>;
|
|
171
178
|
'api/schedule-update': (arg: {
|
|
172
179
|
id: ScheduleEntity['id'];
|
|
173
180
|
fields: Partial<APIScheduleEntity>;
|
|
@@ -180,7 +187,9 @@ export interface ApiHandlers {
|
|
|
180
187
|
name: string;
|
|
181
188
|
}) => Promise<string>;
|
|
182
189
|
'api/get-server-version': () => Promise<{
|
|
183
|
-
error
|
|
190
|
+
error: 'no-server';
|
|
191
|
+
} | {
|
|
192
|
+
error: 'network-failure';
|
|
184
193
|
} | {
|
|
185
194
|
version: string;
|
|
186
195
|
}>;
|
|
@@ -31,7 +31,7 @@ export interface ScheduleEntity {
|
|
|
31
31
|
num2: number;
|
|
32
32
|
};
|
|
33
33
|
_amountOp: string;
|
|
34
|
-
_date: RecurConfig;
|
|
34
|
+
_date: RecurConfig | string;
|
|
35
35
|
_conditions: RuleConditionEntity[];
|
|
36
36
|
_actions: Array<{
|
|
37
37
|
op: unknown;
|
|
@@ -41,7 +41,7 @@ export type DiscoverScheduleEntity = {
|
|
|
41
41
|
id: ScheduleEntity['id'];
|
|
42
42
|
account: AccountEntity['id'];
|
|
43
43
|
payee: PayeeEntity['id'];
|
|
44
|
-
date:
|
|
44
|
+
date: RecurConfig;
|
|
45
45
|
amount: ScheduleEntity['_amount'];
|
|
46
46
|
_conditions: ScheduleEntity['_conditions'];
|
|
47
47
|
};
|
package/@types/methods.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { APIAccountEntity, APICategoryEntity, APICategoryGroupEntity, APIFileEntity, APIPayeeEntity, APIScheduleEntity } from './loot-core/src/server/api-models';
|
|
2
|
+
import type { Query } from './loot-core/src/shared/query';
|
|
3
|
+
import type { ImportTransactionEntity, RuleEntity, TransactionEntity } from './loot-core/src/types/models';
|
|
2
4
|
export { q } from './app/query';
|
|
3
|
-
export declare function runImport(
|
|
4
|
-
export declare function loadBudget(budgetId:
|
|
5
|
-
export declare function downloadBudget(syncId:
|
|
6
|
-
password?:
|
|
5
|
+
export declare function runImport(budgetName: APIFileEntity['name'], func: () => Promise<void>): Promise<void>;
|
|
6
|
+
export declare function loadBudget(budgetId: string): Promise<void>;
|
|
7
|
+
export declare function downloadBudget(syncId: string, { password }?: {
|
|
8
|
+
password?: string;
|
|
7
9
|
}): Promise<void>;
|
|
8
|
-
export declare function getBudgets(): Promise<
|
|
10
|
+
export declare function getBudgets(): Promise<APIFileEntity[]>;
|
|
9
11
|
export declare function sync(): Promise<void>;
|
|
10
12
|
export declare function runBankSync(args?: {
|
|
11
|
-
accountId:
|
|
13
|
+
accountId: APIAccountEntity['id'];
|
|
12
14
|
}): Promise<void>;
|
|
13
|
-
export declare function batchBudgetUpdates(func:
|
|
15
|
+
export declare function batchBudgetUpdates(func: () => Promise<void>): Promise<void>;
|
|
14
16
|
/**
|
|
15
17
|
* @deprecated Please use `aqlQuery` instead.
|
|
16
18
|
* This function will be removed in a future release.
|
|
17
19
|
*/
|
|
18
|
-
export declare function runQuery(query:
|
|
19
|
-
export declare function aqlQuery(query:
|
|
20
|
+
export declare function runQuery(query: Query): Promise<unknown>;
|
|
21
|
+
export declare function aqlQuery(query: Query): Promise<unknown>;
|
|
20
22
|
export declare function getBudgetMonths(): Promise<string[]>;
|
|
21
|
-
export declare function getBudgetMonth(month:
|
|
23
|
+
export declare function getBudgetMonth(month: string): Promise<{
|
|
22
24
|
month: string;
|
|
23
25
|
incomeAvailable: number;
|
|
24
26
|
lastMonthOverspent: number;
|
|
@@ -31,9 +33,9 @@ export declare function getBudgetMonth(month: any): Promise<{
|
|
|
31
33
|
totalBalance: number;
|
|
32
34
|
categoryGroups: Record<string, unknown>[];
|
|
33
35
|
}>;
|
|
34
|
-
export declare function setBudgetAmount(month:
|
|
35
|
-
export declare function setBudgetCarryover(month:
|
|
36
|
-
export declare function addTransactions(accountId:
|
|
36
|
+
export declare function setBudgetAmount(month: string, categoryId: APICategoryEntity['id'], value: number): Promise<void>;
|
|
37
|
+
export declare function setBudgetCarryover(month: string, categoryId: APICategoryEntity['id'], flag: boolean): Promise<void>;
|
|
38
|
+
export declare function addTransactions(accountId: APIAccountEntity['id'], transactions: Omit<ImportTransactionEntity, 'account'>[], { learnCategories, runTransfers, }?: {
|
|
37
39
|
learnCategories?: boolean;
|
|
38
40
|
runTransfers?: boolean;
|
|
39
41
|
}): Promise<"ok">;
|
|
@@ -41,57 +43,65 @@ export interface ImportTransactionsOpts {
|
|
|
41
43
|
defaultCleared?: boolean;
|
|
42
44
|
dryRun?: boolean;
|
|
43
45
|
}
|
|
44
|
-
export declare function importTransactions(accountId:
|
|
46
|
+
export declare function importTransactions(accountId: APIAccountEntity['id'], transactions: ImportTransactionEntity[], opts?: ImportTransactionsOpts): Promise<import("./@types/loot-core/src/server/accounts/sync").ReconcileTransactionsResult & {
|
|
45
47
|
errors: Array<{
|
|
46
48
|
message: string;
|
|
47
49
|
}>;
|
|
48
50
|
}>;
|
|
49
|
-
export declare function getTransactions(accountId:
|
|
50
|
-
export declare function updateTransaction(id:
|
|
51
|
+
export declare function getTransactions(accountId: APIAccountEntity['id'], startDate: string, endDate: string): Promise<TransactionEntity[]>;
|
|
52
|
+
export declare function updateTransaction(id: TransactionEntity['id'], fields: Partial<TransactionEntity>): Promise<TransactionEntity[] | ({
|
|
51
53
|
id: any;
|
|
52
54
|
transfer_id: any;
|
|
53
55
|
} | {
|
|
54
56
|
id: any;
|
|
55
57
|
category: any;
|
|
56
58
|
})[]>;
|
|
57
|
-
export declare function deleteTransaction(id:
|
|
58
|
-
export declare function getAccounts(): Promise<
|
|
59
|
-
export declare function createAccount(account:
|
|
60
|
-
export declare function updateAccount(id:
|
|
61
|
-
export declare function closeAccount(id:
|
|
62
|
-
export declare function reopenAccount(id:
|
|
63
|
-
export declare function deleteAccount(id:
|
|
64
|
-
export declare function getAccountBalance(id:
|
|
65
|
-
export declare function getCategoryGroups(): Promise<
|
|
66
|
-
export declare function createCategoryGroup(group:
|
|
67
|
-
export declare function updateCategoryGroup(id:
|
|
68
|
-
export declare function deleteCategoryGroup(id:
|
|
69
|
-
export declare function getCategories(): Promise<(
|
|
70
|
-
export declare function createCategory(category:
|
|
71
|
-
export declare function updateCategory(id:
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
export declare function deleteTransaction(id: TransactionEntity['id']): Promise<TransactionEntity[]>;
|
|
60
|
+
export declare function getAccounts(): Promise<APIAccountEntity[]>;
|
|
61
|
+
export declare function createAccount(account: Omit<APIAccountEntity, 'id'>, initialBalance?: number): Promise<string>;
|
|
62
|
+
export declare function updateAccount(id: APIAccountEntity['id'], fields: Partial<APIAccountEntity>): Promise<void>;
|
|
63
|
+
export declare function closeAccount(id: APIAccountEntity['id'], transferAccountId?: APIAccountEntity['id'], transferCategoryId?: APICategoryEntity['id']): Promise<void>;
|
|
64
|
+
export declare function reopenAccount(id: APIAccountEntity['id']): Promise<void>;
|
|
65
|
+
export declare function deleteAccount(id: APIAccountEntity['id']): Promise<void>;
|
|
66
|
+
export declare function getAccountBalance(id: APIAccountEntity['id'], cutoff?: Date): Promise<number>;
|
|
67
|
+
export declare function getCategoryGroups(): Promise<APICategoryGroupEntity[]>;
|
|
68
|
+
export declare function createCategoryGroup(group: Omit<APICategoryGroupEntity, 'id'>): Promise<string>;
|
|
69
|
+
export declare function updateCategoryGroup(id: APICategoryGroupEntity['id'], fields: Partial<APICategoryGroupEntity>): Promise<void>;
|
|
70
|
+
export declare function deleteCategoryGroup(id: APICategoryGroupEntity['id'], transferCategoryId?: APICategoryEntity['id']): Promise<void>;
|
|
71
|
+
export declare function getCategories(): Promise<(APICategoryEntity | APICategoryGroupEntity)[]>;
|
|
72
|
+
export declare function createCategory(category: Omit<APICategoryEntity, 'id'>): Promise<string>;
|
|
73
|
+
export declare function updateCategory(id: APICategoryEntity['id'], fields: Partial<APICategoryEntity>): Promise<object | {
|
|
74
|
+
error: {
|
|
75
|
+
type: "category-exists";
|
|
76
|
+
};
|
|
74
77
|
}>;
|
|
75
|
-
export declare function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export declare function
|
|
81
|
-
export declare function
|
|
82
|
-
export declare function
|
|
83
|
-
export declare function
|
|
84
|
-
export declare function
|
|
85
|
-
export declare function
|
|
86
|
-
export declare function
|
|
87
|
-
export declare function
|
|
88
|
-
export declare function
|
|
89
|
-
export declare function
|
|
90
|
-
export declare function
|
|
91
|
-
export declare function
|
|
92
|
-
export declare function
|
|
78
|
+
export declare function deleteCategory(id: APICategoryEntity['id'], transferCategoryId?: APICategoryEntity['id']): Promise<object | {
|
|
79
|
+
error: "no-categories";
|
|
80
|
+
} | {
|
|
81
|
+
error: "category-type";
|
|
82
|
+
}>;
|
|
83
|
+
export declare function getCommonPayees(): Promise<APIPayeeEntity[]>;
|
|
84
|
+
export declare function getPayees(): Promise<APIPayeeEntity[]>;
|
|
85
|
+
export declare function createPayee(payee: Omit<APIPayeeEntity, 'id'>): Promise<string>;
|
|
86
|
+
export declare function updatePayee(id: APIPayeeEntity['id'], fields: Partial<APIPayeeEntity>): Promise<void>;
|
|
87
|
+
export declare function deletePayee(id: APIPayeeEntity['id']): Promise<void>;
|
|
88
|
+
export declare function mergePayees(targetId: APIPayeeEntity['id'], mergeIds: APIPayeeEntity['id'][]): Promise<void>;
|
|
89
|
+
export declare function getRules(): Promise<RuleEntity[]>;
|
|
90
|
+
export declare function getPayeeRules(id: RuleEntity['id']): Promise<RuleEntity[]>;
|
|
91
|
+
export declare function createRule(rule: Omit<RuleEntity, 'id'>): Promise<RuleEntity>;
|
|
92
|
+
export declare function updateRule(rule: RuleEntity): Promise<RuleEntity>;
|
|
93
|
+
export declare function deleteRule(id: RuleEntity['id']): Promise<boolean>;
|
|
94
|
+
export declare function holdBudgetForNextMonth(month: string, amount: number): Promise<boolean>;
|
|
95
|
+
export declare function resetBudgetHold(month: string): Promise<void>;
|
|
96
|
+
export declare function createSchedule(schedule: Omit<APIScheduleEntity, 'id'>): Promise<string>;
|
|
97
|
+
export declare function updateSchedule(id: APIScheduleEntity['id'], fields: Partial<APIScheduleEntity>, resetNextDate?: boolean): Promise<string>;
|
|
98
|
+
export declare function deleteSchedule(scheduleId: APIScheduleEntity['id']): Promise<void>;
|
|
99
|
+
export declare function getSchedules(): Promise<APIScheduleEntity[]>;
|
|
100
|
+
export declare function getIDByName(type: 'accounts' | 'schedules' | 'categories' | 'payees', name: string): Promise<string>;
|
|
93
101
|
export declare function getServerVersion(): Promise<{
|
|
94
|
-
error
|
|
102
|
+
error: "no-server";
|
|
103
|
+
} | {
|
|
104
|
+
error: "network-failure";
|
|
95
105
|
} | {
|
|
96
106
|
version: string;
|
|
97
107
|
}>;
|
package/dist/app/bundle.api.js
CHANGED
|
@@ -109306,7 +109306,7 @@ const categoryGroupModel = {
|
|
|
109306
109306
|
},
|
|
109307
109307
|
fromExternal(group) {
|
|
109308
109308
|
const result = { ...group };
|
|
109309
|
-
if ("categories" in group) {
|
|
109309
|
+
if ("categories" in group && group.categories) {
|
|
109310
109310
|
result.categories = group.categories.map(categoryModel.fromExternal);
|
|
109311
109311
|
}
|
|
109312
109312
|
return result;
|
|
@@ -109372,6 +109372,7 @@ const scheduleModel = {
|
|
|
109372
109372
|
},
|
|
109373
109373
|
//just an update
|
|
109374
109374
|
fromExternal(schedule) {
|
|
109375
|
+
const amount = schedule.amount ?? 0;
|
|
109375
109376
|
const result = {
|
|
109376
109377
|
id: schedule.id,
|
|
109377
109378
|
name: schedule.name,
|
|
@@ -109382,7 +109383,7 @@ const scheduleModel = {
|
|
|
109382
109383
|
tombstone: false,
|
|
109383
109384
|
_payee: String(schedule.payee),
|
|
109384
109385
|
_account: String(schedule.account),
|
|
109385
|
-
_amount:
|
|
109386
|
+
_amount: amount,
|
|
109386
109387
|
_amountOp: schedule.amountOp,
|
|
109387
109388
|
// e.g. 'isapprox', 'is', etc.
|
|
109388
109389
|
_date: schedule.date,
|
|
@@ -109390,7 +109391,7 @@ const scheduleModel = {
|
|
|
109390
109391
|
{ op: "is", field: "payee", value: String(schedule.payee) },
|
|
109391
109392
|
{ op: "is", field: "account", value: String(schedule.account) },
|
|
109392
109393
|
{ op: "isapprox", field: "date", value: schedule.date },
|
|
109393
|
-
{ op: schedule.amountOp, field: "amount", value:
|
|
109394
|
+
{ op: schedule.amountOp, field: "amount", value: amount }
|
|
109394
109395
|
],
|
|
109395
109396
|
_actions: []
|
|
109396
109397
|
// empty array, as you requested
|
|
@@ -109905,7 +109906,7 @@ handlers["api/schedules-get"] = async function () {
|
|
|
109905
109906
|
};
|
|
109906
109907
|
handlers["api/schedule-create"] = withMutation(async function (schedule) {
|
|
109907
109908
|
checkFileOpen();
|
|
109908
|
-
const internalSchedule = scheduleModel.fromExternal(schedule);
|
|
109909
|
+
const internalSchedule = scheduleModel.fromExternal({ ...schedule, id: "" });
|
|
109909
109910
|
const partialSchedule = {
|
|
109910
109911
|
name: internalSchedule.name,
|
|
109911
109912
|
posts_transaction: internalSchedule.posts_transaction
|
|
@@ -120544,7 +120545,6 @@ async function importPayees$1(data, entityIdMap) {
|
|
|
120544
120545
|
if (!payee.isTombstone) {
|
|
120545
120546
|
const id2 = await createPayee$1({
|
|
120546
120547
|
name: payee.name,
|
|
120547
|
-
category: entityIdMap.get(payee.autoFillCategoryId) || null,
|
|
120548
120548
|
transfer_acct: entityIdMap.get(payee.targetAccountId) || null
|
|
120549
120549
|
});
|
|
120550
120550
|
entityIdMap.set(payee.entityId, id2);
|
package/dist/methods.js
CHANGED
|
@@ -92,8 +92,8 @@ Object.defineProperty(exports, "q", { enumerable: true, get: function () { retur
|
|
|
92
92
|
function send(name, args) {
|
|
93
93
|
return injected.send(name, args);
|
|
94
94
|
}
|
|
95
|
-
async function runImport(
|
|
96
|
-
await send('api/start-import', { budgetName
|
|
95
|
+
async function runImport(budgetName, func) {
|
|
96
|
+
await send('api/start-import', { budgetName });
|
|
97
97
|
try {
|
|
98
98
|
await func();
|
|
99
99
|
}
|
|
@@ -149,7 +149,7 @@ function setBudgetAmount(month, categoryId, value) {
|
|
|
149
149
|
function setBudgetCarryover(month, categoryId, flag) {
|
|
150
150
|
return send('api/budget-set-carryover', { month, categoryId, flag });
|
|
151
151
|
}
|
|
152
|
-
function addTransactions(accountId, transactions, { learnCategories = false, runTransfers = false } = {}) {
|
|
152
|
+
function addTransactions(accountId, transactions, { learnCategories = false, runTransfers = false, } = {}) {
|
|
153
153
|
return send('api/transactions-add', {
|
|
154
154
|
accountId,
|
|
155
155
|
transactions,
|
package/dist/package.json
CHANGED