const ZoomdataSDK = require('zoomdata-client/distribute/sdk/zoomdata-client.node');

async function run() {
    const application = {
        secure: true,
        host: '2-5-latest.zoomdata.com',
        port: 443,
        path: '/zoomdata'
    };
    
    const credentials = {
        key: 'oUvpLx0eCi'
    };

    const client = await ZoomdataSDK.createClient({ application, credentials });

    console.log('Client ready');
    
    const queryConfig = {
        filters: [],
        groups: [{
            name: 'position',
            limit: 10,
            sort: { dir: 'asc', name: 'position' }
        }],
        metrics: [
            { name: 'satisfaction', func: 'sum' }
        ]
    };

    try {
        const data = await fetchData(client, 'My FLAT FILE Source', queryConfig);
        console.log('Received data:', data);
    } finally {
        client.close();
    }
}

async function fetchData(client, name, queryConfig) {
    const query = await client.createQuery({ name }, queryConfig);

    console.log('Query created');

    return new Promise((resolve, reject) => {
        console.log('Running query...');
        client.runQuery(query, resolve, reject);
    });
}

run().catch(console.error);

@@ -168,18 +168,17 @@
 t: '
-2-5-latest
+developer
 .zoo
@@ -232,16 +232,20 @@
 zoomdata
+-2.6
 '%0A    %7D;
@@ -294,18 +294,18 @@
 y: '
-oUvpLx0eCi
+KVKWiD8kUl
 '%0A  
@@ -759,27 +759,14 @@
 t, '
-My FLAT FILE Source
+Impala
 ', q

Update application config