@actual-app/api
Advanced tools
Comparing version 1.0.1 to 1.0.2
30
api.js
@@ -10,12 +10,5 @@ const { | ||
// account_id; | ||
// amount; | ||
// payee_id; | ||
// payee; | ||
// imported_payee; | ||
// category_id; | ||
// date; | ||
// notes; | ||
// imported_id; | ||
// subtransactions; | ||
async function loadBudget(budgetId) { | ||
return send('api/load-budget', { id: budgetId }); | ||
} | ||
@@ -47,6 +40,2 @@ async function batchBudgetUpdates(func) { | ||
function addTransaction(transaction) { | ||
return addTransactions(transaction.account_id, [transaction]); | ||
} | ||
function addTransactions(accountId, transactions) { | ||
@@ -104,4 +93,4 @@ return send('api/transactions-add', { accountId, transactions }); | ||
function getCategories({ asList } = {}) { | ||
return send('api/categories-get', { asList }); | ||
function getCategoryGroups() { | ||
return send('api/categories-get', { grouped: true }); | ||
} | ||
@@ -121,2 +110,6 @@ | ||
function getCategories() { | ||
return send('api/categories-get', { grouped: false }); | ||
} | ||
function createCategory(category) { | ||
@@ -154,4 +147,4 @@ return send('api/category-create', { category }); | ||
function createPayeeRule(payee_id, rule) { | ||
return send('api/payee-rule-create', { payee_id, rule }); | ||
function createPayeeRule(payeeId, rule) { | ||
return send('api/payee-rule-create', { payee_id: payeeId, rule }); | ||
} | ||
@@ -174,2 +167,3 @@ | ||
loadBudget, | ||
batchBudgetUpdates, | ||
@@ -176,0 +170,0 @@ getBudgetMonths, |
@@ -64,6 +64,7 @@ let ipc = require('node-ipc'); | ||
let hasError = false; | ||
let res; | ||
try { | ||
await init(); | ||
await func(); | ||
res = await func(); | ||
} catch (e) { | ||
@@ -76,9 +77,14 @@ if (e.type) { | ||
} | ||
} else { | ||
console.log(e); | ||
} | ||
hasError = true; | ||
throw e; | ||
} finally { | ||
await send('api/cleanup', { hasError }); | ||
disconnect(); | ||
} | ||
await send('api/cleanup', { hasError }); | ||
disconnect(); | ||
return res; | ||
} | ||
@@ -89,3 +95,3 @@ | ||
await send('api/load-budget', { id }); | ||
await func(); | ||
return func(); | ||
}); | ||
@@ -92,0 +98,0 @@ } |
{ | ||
"name": "@actual-app/api", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "An API for Actual", | ||
@@ -5,0 +5,0 @@ "main": "api.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8039