@actual-app/api 6.5.0 → 6.7.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/dist/app/bundle.api.js +773 -312
- package/dist/methods.js +5 -1
- package/dist/methods.test.js +29 -1
- package/dist/migrations/1707267033000_reports.sql +28 -0
- package/dist/package.json +5 -5
- package/package.json +5 -5
package/dist/methods.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.deletePayee = exports.updatePayee = exports.createPayee = exports.getPayees = exports.deleteCategory = exports.updateCategory = exports.createCategory = exports.getCategories = exports.deleteCategoryGroup = exports.updateCategoryGroup = exports.createCategoryGroup = exports.deleteAccount = exports.reopenAccount = exports.closeAccount = exports.updateAccount = exports.createAccount = exports.getAccounts = exports.deleteTransaction = exports.updateTransaction = exports.getTransactions = exports.importTransactions = exports.addTransactions = exports.setBudgetCarryover = exports.setBudgetAmount = exports.getBudgetMonth = exports.getBudgetMonths = exports.runQuery = exports.batchBudgetUpdates = exports.sync = exports.downloadBudget = exports.loadBudget = exports.runImport = exports.q = void 0;
|
|
26
|
+
exports.deletePayee = exports.updatePayee = exports.createPayee = exports.getPayees = exports.deleteCategory = exports.updateCategory = exports.createCategory = exports.getCategories = exports.deleteCategoryGroup = exports.updateCategoryGroup = exports.createCategoryGroup = exports.getCategoryGroups = exports.deleteAccount = exports.reopenAccount = exports.closeAccount = exports.updateAccount = exports.createAccount = exports.getAccounts = exports.deleteTransaction = exports.updateTransaction = exports.getTransactions = exports.importTransactions = exports.addTransactions = exports.setBudgetCarryover = exports.setBudgetAmount = exports.getBudgetMonth = exports.getBudgetMonths = exports.runQuery = exports.batchBudgetUpdates = exports.sync = exports.downloadBudget = exports.loadBudget = exports.runImport = exports.q = void 0;
|
|
27
27
|
const injected = __importStar(require("./injected"));
|
|
28
28
|
var query_1 = require("./app/query");
|
|
29
29
|
Object.defineProperty(exports, "q", { enumerable: true, get: function () { return query_1.q; } });
|
|
@@ -137,6 +137,10 @@ function deleteAccount(id) {
|
|
|
137
137
|
return send('api/account-delete', { id });
|
|
138
138
|
}
|
|
139
139
|
exports.deleteAccount = deleteAccount;
|
|
140
|
+
function getCategoryGroups() {
|
|
141
|
+
return send('api/category-groups-get');
|
|
142
|
+
}
|
|
143
|
+
exports.getCategoryGroups = getCategoryGroups;
|
|
140
144
|
function createCategoryGroup(group) {
|
|
141
145
|
return send('api/category-group-create', { group });
|
|
142
146
|
}
|
package/dist/methods.test.js
CHANGED
|
@@ -61,10 +61,38 @@ describe('API CRUD operations', () => {
|
|
|
61
61
|
// load test budget
|
|
62
62
|
await api.loadBudget(budgetName);
|
|
63
63
|
});
|
|
64
|
-
// apis: createCategoryGroup, updateCategoryGroup, deleteCategoryGroup
|
|
64
|
+
// apis: getCategoryGroups, createCategoryGroup, updateCategoryGroup, deleteCategoryGroup
|
|
65
65
|
test('CategoryGroups: successfully update category groups', async () => {
|
|
66
66
|
const month = '2023-10';
|
|
67
67
|
global.currentMonth = month;
|
|
68
|
+
// get existing category groups
|
|
69
|
+
const groups = await api.getCategoryGroups();
|
|
70
|
+
expect(groups).toEqual(expect.arrayContaining([
|
|
71
|
+
expect.objectContaining({
|
|
72
|
+
hidden: 0,
|
|
73
|
+
id: 'fc3825fd-b982-4b72-b768-5b30844cf832',
|
|
74
|
+
is_income: 0,
|
|
75
|
+
name: 'Usual Expenses',
|
|
76
|
+
sort_order: 16384,
|
|
77
|
+
tombstone: 0,
|
|
78
|
+
}),
|
|
79
|
+
expect.objectContaining({
|
|
80
|
+
hidden: 0,
|
|
81
|
+
id: 'a137772f-cf2f-4089-9432-822d2ddc1466',
|
|
82
|
+
is_income: 0,
|
|
83
|
+
name: 'Investments and Savings',
|
|
84
|
+
sort_order: 32768,
|
|
85
|
+
tombstone: 0,
|
|
86
|
+
}),
|
|
87
|
+
expect.objectContaining({
|
|
88
|
+
hidden: 0,
|
|
89
|
+
id: '2E1F5BDB-209B-43F9-AF2C-3CE28E380C00',
|
|
90
|
+
is_income: 1,
|
|
91
|
+
name: 'Income',
|
|
92
|
+
sort_order: 32768,
|
|
93
|
+
tombstone: 0,
|
|
94
|
+
}),
|
|
95
|
+
]));
|
|
68
96
|
// create our test category group
|
|
69
97
|
const mainGroupId = await api.createCategoryGroup({
|
|
70
98
|
name: 'test-group',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BEGIN TRANSACTION;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE custom_reports
|
|
4
|
+
(
|
|
5
|
+
id TEXT PRIMARY KEY,
|
|
6
|
+
name TEXT,
|
|
7
|
+
start_date TEXT,
|
|
8
|
+
end_date TEXT,
|
|
9
|
+
date_static INTEGER DEFAULT 0,
|
|
10
|
+
date_range TEXT,
|
|
11
|
+
mode TEXT DEFAULT 'total',
|
|
12
|
+
group_by TEXT DEFAULT 'Category',
|
|
13
|
+
balance_type TEXT DEFAULT 'Expense',
|
|
14
|
+
show_empty INTEGER DEFAULT 0,
|
|
15
|
+
show_offbudget INTEGER DEFAULT 0,
|
|
16
|
+
show_hidden INTEGER DEFAULT 0,
|
|
17
|
+
show_uncategorized INTEGER DEFAULT 0,
|
|
18
|
+
selected_categories TEXT,
|
|
19
|
+
graph_type TEXT DEFAULT 'BarGraph',
|
|
20
|
+
conditions TEXT,
|
|
21
|
+
conditions_op TEXT DEFAULT 'and',
|
|
22
|
+
metadata TEXT,
|
|
23
|
+
interval TEXT DEFAULT 'Monthly',
|
|
24
|
+
color_scheme TEXT,
|
|
25
|
+
tombstone INTEGER DEFAULT 0
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
COMMIT;
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actual-app/api",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "An API for Actual",
|
|
6
6
|
"engines": {
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"clean": "rm -rf dist @types"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"better-sqlite3": "^9.
|
|
24
|
+
"better-sqlite3": "^9.3.0",
|
|
25
25
|
"compare-versions": "^6.1.0",
|
|
26
26
|
"node-fetch": "^3.3.2",
|
|
27
|
-
"uuid": "^9.0.
|
|
27
|
+
"uuid": "^9.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@swc/core": "^1.3.105",
|
|
31
31
|
"@swc/jest": "^0.2.31",
|
|
32
|
-
"@types/jest": "^27.5.
|
|
32
|
+
"@types/jest": "^27.5.2",
|
|
33
33
|
"@types/uuid": "^9.0.2",
|
|
34
|
-
"jest": "^27.
|
|
34
|
+
"jest": "^27.5.1",
|
|
35
35
|
"tsc-alias": "^1.8.8",
|
|
36
36
|
"typescript": "^5.0.2"
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actual-app/api",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "An API for Actual",
|
|
6
6
|
"engines": {
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"clean": "rm -rf dist @types"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"better-sqlite3": "^9.
|
|
24
|
+
"better-sqlite3": "^9.3.0",
|
|
25
25
|
"compare-versions": "^6.1.0",
|
|
26
26
|
"node-fetch": "^3.3.2",
|
|
27
|
-
"uuid": "^9.0.
|
|
27
|
+
"uuid": "^9.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@swc/core": "^1.3.105",
|
|
31
31
|
"@swc/jest": "^0.2.31",
|
|
32
|
-
"@types/jest": "^27.5.
|
|
32
|
+
"@types/jest": "^27.5.2",
|
|
33
33
|
"@types/uuid": "^9.0.2",
|
|
34
|
-
"jest": "^27.
|
|
34
|
+
"jest": "^27.5.1",
|
|
35
35
|
"tsc-alias": "^1.8.8",
|
|
36
36
|
"typescript": "^5.0.2"
|
|
37
37
|
}
|