@actual-app/api 6.0.1 → 6.1.1

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/index.js CHANGED
@@ -31,7 +31,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
32
  exports.shutdown = exports.init = exports.utils = exports.methods = exports.internal = void 0;
33
33
  const node_fetch_1 = __importDefault(require("node-fetch"));
34
- const bundle = __importStar(require("./app/bundle.api"));
34
+ // eslint-disable-next-line import/extensions
35
+ const bundle = __importStar(require("./app/bundle.api.js"));
35
36
  const injected = __importStar(require("./injected"));
36
37
  let actualApp;
37
38
  exports.internal = bundle.lib;
@@ -52,6 +53,7 @@ async function init(config = {}) {
52
53
  exports.init = init;
53
54
  async function shutdown() {
54
55
  if (actualApp) {
56
+ await actualApp.send('sync');
55
57
  await actualApp.send('close-budget');
56
58
  actualApp = null;
57
59
  }
package/dist/methods.d.ts CHANGED
@@ -3,6 +3,7 @@ export function loadBudget(budgetId: any): Promise<any>;
3
3
  export function downloadBudget(syncId: any, { password }?: {
4
4
  password: any;
5
5
  }): Promise<any>;
6
+ export function sync(): Promise<any>;
6
7
  export function batchBudgetUpdates(func: any): Promise<void>;
7
8
  export function runQuery(query: any): any;
8
9
  export function getBudgetMonths(): any;
package/dist/methods.js CHANGED
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- 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.filterTransactions = exports.getTransactions = exports.importTransactions = exports.addTransactions = exports.setBudgetCarryover = exports.setBudgetAmount = exports.getBudgetMonth = exports.getBudgetMonths = exports.runQuery = exports.batchBudgetUpdates = exports.downloadBudget = exports.loadBudget = exports.runImport = exports.q = void 0;
29
+ 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.filterTransactions = 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;
30
30
  const injected = __importStar(require("./injected"));
31
31
  var query_1 = require("./app/query");
32
32
  Object.defineProperty(exports, "q", { enumerable: true, get: function () { return __importDefault(query_1).default; } });
@@ -53,6 +53,10 @@ async function downloadBudget(syncId, { password } = {}) {
53
53
  return send('api/download-budget', { syncId, password });
54
54
  }
55
55
  exports.downloadBudget = downloadBudget;
56
+ async function sync() {
57
+ return send('api/sync');
58
+ }
59
+ exports.sync = sync;
56
60
  async function batchBudgetUpdates(func) {
57
61
  await send('api/batch-budget-start');
58
62
  try {
@@ -0,0 +1,6 @@
1
+ BEGIN TRANSACTION;
2
+
3
+ ALTER TABLE categories ADD COLUMN hidden BOOLEAN NOT NULL DEFAULT 0;
4
+ ALTER TABLE category_groups ADD COLUMN hidden BOOLEAN NOT NULL DEFAULT 0;
5
+
6
+ COMMIT;
@@ -0,0 +1,5 @@
1
+ BEGIN TRANSACTION;
2
+
3
+ ALTER TABLE accounts DROP COLUMN type;
4
+
5
+ COMMIT;
@@ -0,0 +1,10 @@
1
+ BEGIN TRANSACTION;
2
+
3
+ CREATE TABLE transaction_filters
4
+ (id TEXT PRIMARY KEY,
5
+ name TEXT,
6
+ conditions TEXT,
7
+ conditions_op TEXT DEFAULT 'and',
8
+ tombstone INTEGER DEFAULT 0);
9
+
10
+ COMMIT;
@@ -0,0 +1,5 @@
1
+ BEGIN TRANSACTION;
2
+
3
+ ALTER TABLE accounts ADD COLUMN type TEXT;
4
+
5
+ COMMIT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actual-app/api",
3
- "version": "6.0.1",
3
+ "version": "6.1.1",
4
4
  "license": "MIT",
5
5
  "description": "An API for Actual",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "lint": "eslint .",
13
12
  "build:app": "yarn workspace loot-core build:api",
14
13
  "build:node": "tsc --p tsconfig.dist.json",
15
14
  "build:migrations": "cp migrations/*.sql dist/migrations",
@@ -19,9 +18,10 @@
19
18
  "dependencies": {
20
19
  "better-sqlite3": "^8.2.0",
21
20
  "node-fetch": "^2.6.9",
22
- "uuid": "3.3.2"
21
+ "uuid": "^9.0.0"
23
22
  },
24
23
  "devDependencies": {
24
+ "@types/uuid": "^9.0.2",
25
25
  "typescript": "^5.0.2"
26
26
  }
27
27
  }