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
4
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 2.10.0 to 2.11.0

63

dist/http/AxiosHttpClient.js
"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) {

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

exports.AxiosHttpClient = void 0;
const TE = __importStar(require("fp-ts/TaskEither"));
const function_1 = require("fp-ts/function");
const Http_1 = require("@trayio/commons/http/Http");

@@ -64,3 +39,3 @@ const Task_1 = require("@trayio/commons/task/Task");

const newValue = typeof value === 'string' ? value : value.join(', ');
return Object.assign(Object.assign({}, acc), { [key]: newValue });
return Object.assign(Object.assign({}, acc), { [key.toLowerCase()]: newValue });
}, {});

@@ -72,20 +47,22 @@ let axiosConfig;

this.appendFields(formData)(request.body.fields);
const fileEntries = Object.entries(request.body.files);
const taskEithers = fileEntries.map(([key, value]) => { var _a; return this.fileStorage.read(value.key, (_a = value.metadata.name) !== null && _a !== void 0 ? _a : key); });
return (0, function_1.pipe)(TE.sequenceArray(taskEithers), TE.chain((files) => {
files.forEach((file) => {
formData.append(file.metadata.name, file.content, file.key);
const { files } = request.body;
Object.keys(files).forEach((key) => {
var _a;
const file = files[key];
formData.append(key, file.content, {
filename: (_a = file.metadata.name) !== null && _a !== void 0 ? _a : file.key,
contentType: file.metadata.contentType,
});
axiosConfig = {
url: finalUrl,
method: method.toString(),
data: formData,
responseType: 'stream',
headers,
params: request.queryString,
};
return (0, Task_1.createTaskEitherFromPromiseWithSimpleError)(() => (0, axios_1.default)(axiosConfig)
.then(this.axiosResponseToHttpResponse)
.catch(this.axiosErrorToHttpResponse.bind(this)));
}));
});
axiosConfig = {
url: finalUrl,
method: method.toString(),
data: formData,
responseType: 'stream',
headers,
params: request.queryString,
};
return (0, Task_1.createTaskEitherFromPromiseWithSimpleError)(() => (0, axios_1.default)(axiosConfig)
.then(this.axiosResponseToHttpResponse)
.catch(this.axiosErrorToHttpResponse.bind(this)));
}

@@ -92,0 +69,0 @@ axiosConfig = {

{
"name": "@trayio/axios",
"version": "2.10.0",
"version": "2.11.0",
"description": "Axios extensions and implementations",

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

"dependencies": {
"@trayio/commons": "2.10.0",
"@trayio/commons": "2.11.0",
"axios": "1.6.0",

@@ -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