const initSqlJs = require('sql.js');
const fs = require('fs');

initSqlJs().then(SQL => {
    const buffer = fs.readFileSync('E:/var/lib/9router/db/data.sqlite');
    const db = new SQL.Database(buffer);
    
    // Get MiMo provider full data
    const nodes = db.exec("SELECT id, data FROM providerNodes");
    if (nodes[0]?.values) {
        nodes[0].values.forEach(row => {
            const data = JSON.parse(row[1]);
            if (data.baseUrl?.includes('mimo')) {
                console.log('MiMo Provider Full Data:');
                console.log(JSON.stringify(data, null, 2));
            }
        });
    }
    
    db.close();
    process.exit(0);
});
