@pipedream/platform
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -5,8 +5,7 @@ "use strict"; | ||
const axios_1 = require("axios"); | ||
const buildURL = require("axios/lib/helpers/buildURL"); | ||
const querystring = require("querystring"); | ||
const utils_1 = require("./utils"); | ||
const errors_1 = require("./errors"); | ||
function cleanObject(o) { | ||
for (const k in o || {}) { | ||
function cleanObject(o = {}) { | ||
for (const k in o) { | ||
if (typeof o[k] === "undefined") { | ||
@@ -52,4 +51,7 @@ delete o[k]; | ||
function transformConfigForOauth(config) { | ||
const { baseURL, url, } = config; | ||
const newUrl = buildURL((baseURL !== null && baseURL !== void 0 ? baseURL : "") + url, config.params, oauth1ParamsSerializer); // build url as axios will | ||
var _a; | ||
const newUrl = axios_1.default.getUri({ | ||
...config, | ||
paramsSerializer: oauth1ParamsSerializer, | ||
}); | ||
const requestData = { | ||
@@ -65,3 +67,3 @@ method: config.method || "get", | ||
hasContentType = true; | ||
formEncodedContentType = config.headers[k] === "application/x-www-form-urlencoded"; | ||
formEncodedContentType = ((_a = config.headers) === null || _a === void 0 ? void 0 : _a[k]) === "application/x-www-form-urlencoded"; | ||
break; | ||
@@ -68,0 +70,0 @@ } |
import axios from "axios"; | ||
import { AxiosRequestConfig } from "./index"; | ||
import { AxiosRequestConfig as AxiosConfig } from "axios"; | ||
import * as buildURL from "axios/lib/helpers/buildURL"; | ||
import * as querystring from "querystring"; | ||
@@ -9,4 +7,4 @@ import { cloneSafe } from "./utils"; | ||
function cleanObject(o: { string: any; }) { | ||
for (const k in o || {}) { | ||
function cleanObject(o = {}) { | ||
for (const k in o) { | ||
if (typeof o[k] === "undefined") { | ||
@@ -54,6 +52,6 @@ delete o[k]; | ||
export function transformConfigForOauth(config: AxiosRequestConfig) { | ||
const { | ||
baseURL, url, | ||
} = config; | ||
const newUrl: string = buildURL((baseURL ?? "") + url, config.params, oauth1ParamsSerializer); // build url as axios will | ||
const newUrl = axios.getUri({ | ||
...config, | ||
paramsSerializer: oauth1ParamsSerializer, | ||
}); | ||
const requestData = { | ||
@@ -69,3 +67,3 @@ method: config.method || "get", | ||
hasContentType = true; | ||
formEncodedContentType = config.headers[k] === "application/x-www-form-urlencoded"; | ||
formEncodedContentType = config.headers?.[k] === "application/x-www-form-urlencoded"; | ||
break; | ||
@@ -89,3 +87,2 @@ } | ||
const requestData = transformConfigForOauth(config); | ||
const payload = { | ||
@@ -92,0 +89,0 @@ requestData, |
{ | ||
"name": "@pipedream/platform", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "Pipedream platform globals (typing and runtime type checking)", | ||
@@ -15,3 +15,3 @@ "homepage": "https://pipedream.com", | ||
"dependencies": { | ||
"axios": "^0.21.2", | ||
"axios": "^1.6.5", | ||
"fp-ts": "^2.0.2", | ||
@@ -18,0 +18,0 @@ "io-ts": "^2.0.0", |
41807
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.9(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedform-data@4.0.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removedaxios@0.21.4(transitive)
Updatedaxios@^1.6.5