diff --git a/dist/adapter.esm.js b/dist/adapter.esm.js index da7f4982f1ba7eb6110732c53203f66c8e8ebf6b..f0577e32cca3f6658b34c18c42ebfbc84cdad6dc 100644 --- a/dist/adapter.esm.js +++ b/dist/adapter.esm.js @@ -68,12 +68,13 @@ class Adapter { * @returns {object} */ auth() { - let config = this.config; + let adapterConfig = this.config; + console.error('config', adapterConfig); return this.axios - .get(`${config.api}/token`, { + .get(`${adapterConfig.api}/token`, { params: { - client_id: config.client_id, - secret: config.secret, + client_id: adapterConfig.client_id, + secret: adapterConfig.secret, }, }) .then((response) => { @@ -89,10 +90,10 @@ class Adapter { * @returns {object} */ poll() { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { - return this.axios.get(`${config.api}/receive`, { + return this.axios.get(`${adapterConfig.api}/receive`, { headers, }); }) @@ -118,11 +119,11 @@ class Adapter { * @returns */ publish(topic, body) { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { return this.axios.post( - `${config.api}/send`, + `${adapterConfig.api}/send`, { topic, body, @@ -149,11 +150,11 @@ class Adapter { * @returns */ broadcast(body) { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { return this.axios.post( - `${config.api}/notify`, + `${adapterConfig.api}/notify`, { body, }, diff --git a/dist/adapter.js b/dist/adapter.js index 3f49e269011c7dd018349a138765d922c8666578..c0a62b59e8e4be7dc8bbcd062979712983562a5b 100644 --- a/dist/adapter.js +++ b/dist/adapter.js @@ -70,12 +70,13 @@ class Adapter { * @returns {object} */ auth() { - let config = this.config; + let adapterConfig = this.config; + console.error('config', adapterConfig); return this.axios - .get(`${config.api}/token`, { + .get(`${adapterConfig.api}/token`, { params: { - client_id: config.client_id, - secret: config.secret, + client_id: adapterConfig.client_id, + secret: adapterConfig.secret, }, }) .then((response) => { @@ -91,10 +92,10 @@ class Adapter { * @returns {object} */ poll() { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { - return this.axios.get(`${config.api}/receive`, { + return this.axios.get(`${adapterConfig.api}/receive`, { headers, }); }) @@ -120,11 +121,11 @@ class Adapter { * @returns */ publish(topic, body) { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { return this.axios.post( - `${config.api}/send`, + `${adapterConfig.api}/send`, { topic, body, @@ -151,11 +152,11 @@ class Adapter { * @returns */ broadcast(body) { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { return this.axios.post( - `${config.api}/notify`, + `${adapterConfig.api}/notify`, { body, }, diff --git a/src/adapter/index.js b/src/adapter/index.js index 91320eb47e00d30256b50a7c13e871e35e487aa6..934cd138559350a3d9cdc0bb24029b4d90440d7a 100644 --- a/src/adapter/index.js +++ b/src/adapter/index.js @@ -68,12 +68,13 @@ export class Adapter { * @returns {object} */ auth() { - let config = this.config; + let adapterConfig = this.config; + console.error('config', adapterConfig); return this.axios - .get(`${config.api}/token`, { + .get(`${adapterConfig.api}/token`, { params: { - client_id: config.client_id, - secret: config.secret, + client_id: adapterConfig.client_id, + secret: adapterConfig.secret, }, }) .then((response) => { @@ -89,10 +90,10 @@ export class Adapter { * @returns {object} */ poll() { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { - return this.axios.get(`${config.api}/receive`, { + return this.axios.get(`${adapterConfig.api}/receive`, { headers, }); }) @@ -118,11 +119,11 @@ export class Adapter { * @returns */ publish(topic, body) { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { return this.axios.post( - `${config.api}/send`, + `${adapterConfig.api}/send`, { topic, body, @@ -149,11 +150,11 @@ export class Adapter { * @returns */ broadcast(body) { - let config = this.config; + let adapterConfig = this.config; return this.getAuthorizationHeader() .then((headers) => { return this.axios.post( - `${config.api}/notify`, + `${adapterConfig.api}/notify`, { body, },