@activepieces/pieces-common
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "@activepieces/pieces-common", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"type": "commonjs", | ||
@@ -11,6 +11,6 @@ "dependencies": { | ||
"nanoid": "^3.3.4", | ||
"semver": "7.5.3", | ||
"@activepieces/pieces-framework": "0.6.10", | ||
"@activepieces/shared": "0.6.4", | ||
"tslib": "1.14.1" | ||
"semver": "7.5.4", | ||
"@activepieces/pieces-framework": "0.6.17", | ||
"@activepieces/shared": "0.8.3", | ||
"tslib": "2.6.1" | ||
}, | ||
@@ -17,0 +17,0 @@ "main": "./src/index.js", |
@@ -0,7 +1,7 @@ | ||
import { DelegatingAuthenticationConverter } from './delegating-authentication-converter'; | ||
import type { HttpClient } from './http-client'; | ||
import type { HttpHeaders } from './http-headers'; | ||
import type { HttpMessageBody } from './http-message-body'; | ||
import type { HttpRequest } from './http-request'; | ||
import type { HttpHeaders } from './http-headers'; | ||
import { HttpResponse } from './http-response'; | ||
import { DelegatingAuthenticationConverter } from './delegating-authentication-converter'; | ||
export declare abstract class BaseHttpClient implements HttpClient { | ||
@@ -8,0 +8,0 @@ private readonly baseUrl; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BaseHttpClient = void 0; | ||
const node_url_1 = require("node:url"); | ||
const http_header_1 = require("./http-header"); | ||
const media_type_1 = require("./media-type"); | ||
const node_url_1 = require("node:url"); | ||
class BaseHttpClient { | ||
@@ -22,2 +22,3 @@ constructor(baseUrl, authenticationConverter) { | ||
getHeaders(request) { | ||
var _a; | ||
let requestHeaders = { | ||
@@ -30,3 +31,10 @@ [http_header_1.HttpHeader.ACCEPT]: media_type_1.MediaType.APPLICATION_JSON, | ||
if (request.body) { | ||
requestHeaders[http_header_1.HttpHeader.CONTENT_TYPE] = media_type_1.MediaType.APPLICATION_JSON; | ||
switch ((_a = request.headers) === null || _a === void 0 ? void 0 : _a['Content-Type']) { | ||
case 'text/csv': | ||
requestHeaders[http_header_1.HttpHeader.CONTENT_TYPE] = media_type_1.MediaType.TEXT_CSV; | ||
break; | ||
default: | ||
requestHeaders[http_header_1.HttpHeader.CONTENT_TYPE] = media_type_1.MediaType.APPLICATION_JSON; | ||
break; | ||
} | ||
} | ||
@@ -33,0 +41,0 @@ if (request.headers) { |
export declare enum MediaType { | ||
APPLICATION_JSON = "application/json" | ||
APPLICATION_JSON = "application/json", | ||
TEXT_CSV = "text/csv" | ||
} |
@@ -7,3 +7,4 @@ "use strict"; | ||
MediaType["APPLICATION_JSON"] = "application/json"; | ||
MediaType["TEXT_CSV"] = "text/csv"; | ||
})(MediaType || (exports.MediaType = MediaType = {})); | ||
//# sourceMappingURL=media-type.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37482
567
+ Added@activepieces/pieces-framework@0.6.17(transitive)
+ Added@activepieces/shared@0.8.20.8.3(transitive)
+ Addedsemver@7.5.4(transitive)
+ Addedtslib@2.6.1(transitive)
- Removed@activepieces/pieces-framework@0.6.10(transitive)
- Removed@activepieces/shared@0.6.4(transitive)
- Removedsemver@7.5.3(transitive)
- Removedtslib@1.14.1(transitive)
Updated@activepieces/shared@0.8.3
Updatedsemver@7.5.4
Updatedtslib@2.6.1