eh-api-client
Advanced tools
Comparing version 0.50.0 to 0.51.0
@@ -57,3 +57,3 @@ // Type definitions for eh-api-client 0.24.0 | ||
exists(options: Options, cb?: Callback<boolean>): Promise<boolean>; | ||
getClient(userId: number, app: string): Client; | ||
getClient(userId: number, app: string, token?: string): Client; | ||
getClientWithAuthBearerToken(token: string): Client; | ||
@@ -60,0 +60,0 @@ getRawClient(): Client; |
10
index.js
@@ -136,9 +136,11 @@ var | ||
*/ | ||
Factory.prototype.getClient = function(userId, app) { | ||
Factory.prototype.getClient = function(userId, app, token) { | ||
if(!userId) { | ||
userId = 0; | ||
} | ||
var client = new this.Client(this.apiURL, { | ||
internalAuth: userId + ":" + app | ||
}); | ||
var internalAuth = userId + ":" + app; | ||
if (token) { | ||
internalAuth = internalAuth + ":" + token | ||
} | ||
var client = new this.Client(this.apiURL, { internalAuth }); | ||
Factory.setClientProperties(client) | ||
@@ -145,0 +147,0 @@ client._factory = this; |
{ | ||
"name": "eh-api-client", | ||
"version": "0.50.0", | ||
"version": "0.51.0", | ||
"description": "Node.js rest client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
47572
1521