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

@trayio/axios

Package Overview
Dependencies
Maintainers
0
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trayio/axios - npm Package Compare versions

Comparing version 4.50.0 to 4.51.0

7

dist/http/AxiosHttpClient.d.ts

@@ -6,5 +6,9 @@ import * as TE from 'fp-ts/TaskEither';

import { FileStorage } from '@trayio/commons/file/File';
type AxiosOptions = {
rejectUnauthorized: boolean;
};
export declare class AxiosHttpClient implements HttpClient {
private readonly fileStorage;
constructor(fileStorage?: FileStorage);
private readonly axiosOptions;
constructor(fileStorage?: FileStorage, axiosOptions?: AxiosOptions);
execute(method: HttpMethod, url: string, request: HttpRequest): TE.TaskEither<Error, HttpResponse>;

@@ -15,2 +19,3 @@ private axiosErrorToHttpResponse;

}
export {};
//# sourceMappingURL=AxiosHttpClient.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -7,2 +30,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

exports.AxiosHttpClient = void 0;
const O = __importStar(require("fp-ts/Option"));
const Http_1 = require("@trayio/commons/http/Http");

@@ -15,6 +39,9 @@ const Task_1 = require("@trayio/commons/task/Task");

const BufferExtensions_1 = require("@trayio/commons/buffer/BufferExtensions");
const function_1 = require("fp-ts/lib/function");
class AxiosHttpClient {
fileStorage;
constructor(fileStorage = new NodeFsFileStorage_1.NodeFsFileStorage()) {
axiosOptions;
constructor(fileStorage = new NodeFsFileStorage_1.NodeFsFileStorage(), axiosOptions = { rejectUnauthorized: false }) {
this.fileStorage = fileStorage;
this.axiosOptions = axiosOptions;
}

@@ -42,7 +69,10 @@ execute(method, url, request) {

let axiosConfig;
const httpCertificate = (0, function_1.pipe)(request.agent, O.map((agent) => agent), O.chain((agent) => agent.certificate), O.getOrElse(() => ({})));
// We need a keep-alive heartbeat shorter than 350 seconds to bypass the idle timeout in AWS NAT/LB servers:
// https://repost.aws/knowledge-center/lambda-vpc-timeout
const httpsAgent = new https_1.Agent({
const axiosHttpsAgent = new https_1.Agent({
...httpCertificate,
keepAlive: true,
keepAliveMsecs: 42000,
rejectUnauthorized: this.axiosOptions.rejectUnauthorized,
});

@@ -67,3 +97,3 @@ if (headers['content-type'] &&

headers,
httpsAgent,
httpsAgent: axiosHttpsAgent,
params: request.queryString,

@@ -81,3 +111,3 @@ };

headers,
httpsAgent,
httpsAgent: axiosHttpsAgent,
params: request.queryString,

@@ -84,0 +114,0 @@ };

3

dist/http/AxiosHttpClient.unit.test.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const HttpClient_abstract_test_1 = require("@trayio/commons/http/HttpClient.abstract.test");
const NodeFsFileStorage_1 = require("@trayio/commons/file/NodeFsFileStorage");
const AxiosHttpClient_1 = require("./AxiosHttpClient");
describe('AxiosHttpClient Tests', () => {
(0, HttpClient_abstract_test_1.httpClientTest)(new AxiosHttpClient_1.AxiosHttpClient());
(0, HttpClient_abstract_test_1.httpClientTest)(new AxiosHttpClient_1.AxiosHttpClient(new NodeFsFileStorage_1.NodeFsFileStorage(), { rejectUnauthorized: false }));
});
{
"name": "@trayio/axios",
"version": "4.50.0",
"version": "4.51.0",
"description": "Axios extensions and implementations",

@@ -17,3 +17,3 @@ "exports": {

"dependencies": {
"@trayio/commons": "4.50.0",
"@trayio/commons": "4.51.0",
"axios": "1.7.4",

@@ -20,0 +20,0 @@ "form-data": "4.0.0"

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