feat: added budget from schedule
This commit is contained in:
27
lib/actual.js
Normal file
27
lib/actual.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import api from '@actual-app/api';
|
||||
|
||||
import { checkEnv } from './env.js';
|
||||
|
||||
checkEnv([
|
||||
'ACTUAL_URL',
|
||||
'ACTUAL_PASSWORD',
|
||||
'ACTUAL_ENCRYPTION',
|
||||
'ACTUAL_ID'
|
||||
]);
|
||||
|
||||
await api.init({
|
||||
dataDir: './data',
|
||||
serverURL: process.env.ACTUAL_URL,
|
||||
password: process.env.ACTUAL_PASSWORD,
|
||||
});
|
||||
|
||||
await api.downloadBudget(process.env.ACTUAL_ID, {
|
||||
password: process.env.ACTUAL_ENCRYPTION,
|
||||
});
|
||||
|
||||
|
||||
export async function getSchedules(select = '*') {
|
||||
return (await api.runQuery(api.q('schedules').select(select).filter({ completed: false }))).data;
|
||||
}
|
||||
|
||||
export * from '@actual-app/api';
|
||||
Reference in New Issue
Block a user