Socket
Socket
Sign inDemoInstall

eh-api-client

Package Overview
Dependencies
54
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.49.0 to 0.50.0

3

index.d.ts

@@ -19,2 +19,3 @@ // Type definitions for eh-api-client 0.24.0

get<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;
get<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;
post<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;

@@ -33,2 +34,3 @@ post<T extends any>(options: Options, body: unknown, cb?: Callback<T>): Promise<T>;

setHeaders(headers: Record<string, string>): void;
setAuthBearerToken(token: string): void
prototype: Client;

@@ -58,2 +60,3 @@ }

getClient(userId: number, app: string): Client;
getClientWithAuthBearerToken(token: string): Client;
getRawClient(): Client;

@@ -60,0 +63,0 @@ get<T extends any>(options: Options, cb?: Callback<T>): Promise<T>;

@@ -149,3 +149,17 @@ var

/**
* @param {string} token
*/
Factory.prototype.getClientWithAuthBearerToken = function(token) {
if(!userId) {
userId = 0;
}
var client = new this.Client(this.apiURL);
Factory.setClientProperties(client)
client._factory = this;
client.setAuthBearerToken(token)
return client;
};
/**
*/
Factory.prototype.getRawClient = function(options) {

@@ -152,0 +166,0 @@ var client = new this.Client(this.apiURL, options);

@@ -402,2 +402,10 @@ var

Client.prototype.setAuthBearerToken = function (token) {
if (typeof token !== 'string' || !token) {
throw new Error('token must be a non empty string')
}
this.headers = Object.clone(this.headers)
this.headers['Authorization'] = 'Bearer ' + token
}
methods.forEach(function(method) {

@@ -404,0 +412,0 @@ Client.prototype[method.toLowerCase()] = function() {

2

package.json
{
"name": "eh-api-client",
"version": "0.49.0",
"version": "0.50.0",
"description": "Node.js rest client",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc