feat: 🔊 added logs on actual

This commit is contained in:
oxypomme
2025-04-25 00:25:20 +02:00
parent 6c79788957
commit 884a251094
3 changed files with 90 additions and 45 deletions

View File

@@ -1,6 +1,8 @@
import chalk from 'chalk';
import api from '@actual-app/api';
import { checkEnv } from './env.js';
import pckg from '../package.json' with { type: 'json' };
checkEnv([
'ACTUAL_URL',
@@ -9,12 +11,17 @@ checkEnv([
'ACTUAL_ID'
]);
console.log(chalk.grey(`Connecting to Actual ${chalk.underline(process.env.ACTUAL_URL)}@${pckg.dependencies['@actual-app/api']}...`));
await api.init({
dataDir: './data',
serverURL: process.env.ACTUAL_URL,
password: process.env.ACTUAL_PASSWORD,
});
// console.log(chalk.grey(`Syncing files...`));
// await api.sync();
console.log(chalk.grey(`Downloading budget ${chalk.underline(process.env.ACTUAL_ID)}...`));
await api.downloadBudget(process.env.ACTUAL_ID, {
password: process.env.ACTUAL_ENCRYPTION,
});