feat: added budget from schedule

This commit is contained in:
2024-07-23 11:41:19 +02:00
commit e51e42efa8
9 changed files with 726 additions and 0 deletions

27
lib/actual.js Normal file
View 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';