UNPKG

tableau-server-client

Version:

Node client to interact with the Tableau REST Api

23 lines (19 loc) 477 B
const Http = require('./http'); const Api = require('./api'); class Client { constructor(baseUrl, apiVersion) { this.apiVersion = apiVersion; this.http = new Http(baseUrl, apiVersion); this.initializeApis(); } initializeApis() { const dependencies = { apiVersion: this.apiVersion, http: this.http, }; Object.keys(Api).forEach(apiName => { this[apiName] = new Api[apiName](dependencies); }); } } module.exports = Client;