@cubejs-client/core
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -409,6 +409,8 @@ 'use strict'; | ||
function () { | ||
function CubejsApi(apiToken) { | ||
function CubejsApi(apiToken, options) { | ||
_classCallCheck(this, CubejsApi); | ||
options = options || {}; | ||
this.apiToken = apiToken; | ||
this.apiUrl = options.apiUrl || API_URL; | ||
} | ||
@@ -419,3 +421,3 @@ | ||
value: function request(url, config) { | ||
return whatwgFetch.fetch("".concat(API_URL).concat(url), Object.assign({ | ||
return whatwgFetch.fetch("".concat(this.apiUrl).concat(url), Object.assign({ | ||
headers: { | ||
@@ -422,0 +424,0 @@ Authorization: this.apiToken, |
{ | ||
"name": "@cubejs-client/core", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "cube.js client", | ||
@@ -5,0 +5,0 @@ "main": "dist/cubejs-client-core.js", |
@@ -9,4 +9,6 @@ import { fetch } from 'whatwg-fetch'; | ||
class CubejsApi { | ||
constructor(apiToken) { | ||
constructor(apiToken, options) { | ||
options = options || {}; | ||
this.apiToken = apiToken; | ||
this.apiUrl = options.apiUrl || API_URL; | ||
} | ||
@@ -16,3 +18,3 @@ | ||
return fetch( | ||
`${API_URL}${url}`, | ||
`${this.apiUrl}${url}`, | ||
Object.assign({ headers: { Authorization: this.apiToken, 'Content-Type': 'application/json' }}, config || {}) | ||
@@ -19,0 +21,0 @@ ) |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
449833
12915