New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@apigames/rest-client

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apigames/rest-client - npm Package Compare versions

Comparing version 22.1.0-dev.7 to 22.1.0-dev.8

2

lib/classes/rest.client.d.ts
import { IRestClient, RestClientOptions, RestClientResponse } from '..';
export default class RestClient implements IRestClient {
private HandleError;
private IsAxiosError;
private PrepareRequestConfig;
private ProcessError;
private ProcessResponse;

@@ -7,0 +7,0 @@ Delete(uri: string, headers?: Record<string, string>, options?: RestClientOptions): Promise<RestClientResponse>;

@@ -19,15 +19,2 @@ "use strict";

class RestClient {
HandleError(uri, response) {
if ((0, json_1.isDefinedAndNotNull)(response)) {
(0, __1.ThrowException)({
statusCode: response.status,
statusText: response.statusText,
headers: response.headers,
data: response.data,
});
}
else {
(0, __1.ThrowNetworkConnectionException)(uri);
}
}
IsAxiosError(error) {

@@ -50,2 +37,20 @@ return error.isAxiosError !== undefined;

}
ProcessError(uri, error) {
if (this.IsAxiosError(error)) {
if ((0, json_1.isDefinedAndNotNull)(error.response)) {
(0, __1.ThrowException)({
statusCode: error.response.status,
statusText: error.response.statusText,
headers: error.response.headers,
data: error.response.data,
});
}
else {
(0, __1.ThrowNetworkConnectionException)(uri);
}
}
else {
throw error;
}
}
ProcessResponse(axiosResponse) {

@@ -65,8 +70,3 @@ return {

catch (error) {
if (this.IsAxiosError(error)) {
this.HandleError(uri, error.response);
}
else {
throw error;
}
this.ProcessError(uri, error);
}

@@ -81,8 +81,3 @@ });

catch (error) {
if (this.IsAxiosError(error)) {
this.HandleError(uri, error.response);
}
else {
throw error;
}
this.ProcessError(uri, error);
}

@@ -97,8 +92,3 @@ });

catch (error) {
if (this.IsAxiosError(error)) {
this.HandleError(uri, error.response);
}
else {
throw error;
}
this.ProcessError(uri, error);
}

@@ -113,8 +103,3 @@ });

catch (error) {
if (this.IsAxiosError(error)) {
this.HandleError(uri, error.response);
}
else {
throw error;
}
this.ProcessError(uri, error);
}

@@ -129,8 +114,3 @@ });

catch (error) {
if (this.IsAxiosError(error)) {
this.HandleError(uri, error.response);
}
else {
throw error;
}
this.ProcessError(uri, error);
}

@@ -145,8 +125,3 @@ });

catch (error) {
if (this.IsAxiosError(error)) {
this.HandleError(uri, error.response);
}
else {
throw error;
}
this.ProcessError(uri, error);
}

@@ -153,0 +128,0 @@ });

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "22.1.0-dev.7",
"version": "22.1.0-dev.8",
"main": "lib/index.js",

@@ -9,0 +9,0 @@ "types": "lib/index.d.ts",

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