@jupiterone/integration-sdk-http-client
Advanced tools
Comparing version 13.4.0 to 13.5.0
@@ -170,2 +170,14 @@ "use strict"; | ||
} | ||
else if (bodyType === 'urlencoded') { | ||
fmtBody = new URLSearchParams(); | ||
Object.entries(body).forEach(([key, value]) => { | ||
if (typeof value !== 'string') { | ||
throw new integration_sdk_core_1.IntegrationError({ | ||
code: 'INVALID_FORM_DATA', | ||
message: 'Form values must be strings', | ||
}); | ||
} | ||
fmtBody.append(key, value); | ||
}); | ||
} | ||
else { | ||
@@ -181,2 +193,5 @@ fmtBody = JSON.stringify(body); | ||
...(bodyType === 'text' && { 'Content-Type': 'text/plain' }), | ||
...(bodyType === 'urlencoded' && { | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
Accept: 'application/json', | ||
@@ -183,0 +198,0 @@ ...(authorize && this.authorizationHeaders), |
@@ -7,3 +7,3 @@ import { IntegrationLogger } from '@jupiterone/integration-sdk-core'; | ||
body?: Record<string, unknown> | string; | ||
bodyType?: 'json' | 'form' | 'text'; | ||
bodyType?: 'json' | 'form' | 'text' | 'urlencoded'; | ||
headers?: Record<string, string>; | ||
@@ -10,0 +10,0 @@ authorize?: boolean; |
{ | ||
"name": "@jupiterone/integration-sdk-http-client", | ||
"version": "13.4.0", | ||
"version": "13.5.0", | ||
"description": "The HTTP client for use in JupiterOne integrations", | ||
@@ -27,3 +27,3 @@ "main": "dist/src/index.js", | ||
"@jupiterone/hierarchical-token-bucket": "^0.3.1", | ||
"@jupiterone/integration-sdk-core": "^13.4.0", | ||
"@jupiterone/integration-sdk-core": "^13.5.0", | ||
"@lifeomic/attempt": "^3.0.3", | ||
@@ -35,4 +35,4 @@ "form-data": "^4.0.0", | ||
"devDependencies": { | ||
"@jupiterone/integration-sdk-dev-tools": "^13.4.0", | ||
"@jupiterone/integration-sdk-private-test-utils": "^13.4.0", | ||
"@jupiterone/integration-sdk-dev-tools": "^13.5.0", | ||
"@jupiterone/integration-sdk-private-test-utils": "^13.5.0", | ||
"@types/node-fetch": "^2.6.11" | ||
@@ -44,3 +44,3 @@ }, | ||
"homepage": "https://github.com/JupiterOne/sdk#readme", | ||
"gitHead": "b3164088dd191b6b8dbef23559c44c6e8da22fe6" | ||
"gitHead": "0870041484694a5261fcfce41c94eab5584d4193" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
241424
858