import { LiteFarmClient } from './dist/litefarm-client.js';
import dotenv from 'dotenv';
import fs from 'fs';
dotenv.config();
const client = new LiteFarmClient(process.env.LITEFARM_EMAIL, process.env.LITEFARM_PASSWORD);
await client.login();
console.log("Fetching tasks...");
// Using the farm ID from the previous check script
// Ideally we should fetch the farm ID dynamically but let's try the hardcoded one first as it worked before
const tasks = await client.getTasks({ farm_id: '15758606-cb0d-11f0-a430-eed6bc26dc01' });
console.log(`Fetched ${tasks.length} tasks.`);
fs.writeFileSync('tasks_dump.json', JSON.stringify(tasks, null, 2));
console.log("Dumped to tasks_dump.json");