Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@evergis/api

Package Overview
Dependencies
Maintainers
6
Versions
330
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evergis/api - npm Package Compare versions

Comparing version 0.1.59 to 0.1.60

es/ApiEvent.d.ts

3

es/Api.d.ts

@@ -12,5 +12,2 @@ import { HttpClient } from './__generated__/HttpClient';

};
export declare enum ApiEvent {
ConnectionLost = "ConnectionLost"
}
export declare class Api extends EventEmitter {

@@ -17,0 +14,0 @@ protected readonly http: HttpClient;

@@ -8,6 +8,3 @@ import { defaultApiConfig } from './defaultApiConfig';

import { Print } from './services/Print';
export var ApiEvent;
(function (ApiEvent) {
ApiEvent["ConnectionLost"] = "ConnectionLost";
})(ApiEvent || (ApiEvent = {}));
import { ApiEvent } from './ApiEvent';
export class Api extends EventEmitter {

@@ -14,0 +11,0 @@ constructor({ url, wsUrl, config = defaultApiConfig }) {

import { HttpClient, HTTPError } from '../__generated__/HttpClient';
import { ApiEvent } from '../Api';
import { ApiEvent } from '../ApiEvent';
import { errorHandler } from './errorHandler';
const apiEventsByResponseStatus = {
401: ApiEvent.Unauthorized,
403: ApiEvent.ConnectionLost,
};
export class ExtendedHttpClient extends HttpClient {

@@ -13,5 +17,5 @@ constructor(prefixUrl, emitter) {

response => {
if (response.status === 403) {
emitter &&
emitter.emit(ApiEvent.ConnectionLost, errorHandler(new HTTPError(response)));
const apiEvent = apiEventsByResponseStatus[response.status];
if (emitter && apiEvent) {
emitter.emit(apiEvent, errorHandler(new HTTPError(response)));
}

@@ -18,0 +22,0 @@ return response;

{
"name": "@evergis/api",
"version": "0.1.59",
"version": "0.1.60",
"license": "ISC",

@@ -5,0 +5,0 @@ "author": "everpoint",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc