oci-common
Advanced tools
Comparing version 2.67.0 to 2.68.0
@@ -22,2 +22,3 @@ /** | ||
}; | ||
bodyDuplexMode?: any; | ||
} |
@@ -16,7 +16,10 @@ /** | ||
private httpOptions; | ||
private bodyDuplexMode; | ||
private static BODY_DUPLEX_KEY; | ||
private static DEFAULT_DUPLEX_VALUE; | ||
constructor(signer: RequestSigner | null, circuitBreaker?: typeof Breaker, httpOptions?: { | ||
[key: string]: any; | ||
} | undefined); | ||
} | undefined, bodyDuplexMode?: any); | ||
send(req: HttpRequest, forceExcludeBody?: boolean, targetService?: string, operationName?: string, timestamp?: string, endpoint?: string, apiReferenceLink?: string): Promise<Response>; | ||
} | ||
export {}; |
@@ -42,3 +42,3 @@ "use strict"; | ||
class FetchHttpClient { | ||
constructor(signer, circuitBreaker, httpOptions) { | ||
constructor(signer, circuitBreaker, httpOptions, bodyDuplexMode) { | ||
this.signer = signer; | ||
@@ -52,2 +52,4 @@ this.circuitBreaker = null; | ||
this.httpOptions = httpOptions; | ||
if (bodyDuplexMode) | ||
this.bodyDuplexMode = bodyDuplexMode; | ||
} | ||
@@ -67,7 +69,14 @@ send(req, forceExcludeBody = false, targetService = "", operationName = "", timestamp = new Date().toISOString(), endpoint = "", apiReferenceLink = "") { | ||
} | ||
const request = new Request(req.uri, { | ||
const reqInit = { | ||
method: req.method, | ||
headers: req.headers, | ||
body: body.requestBody | ||
}); | ||
}; | ||
if (body.requestBody) { | ||
reqInit[FetchHttpClient.BODY_DUPLEX_KEY] = this.bodyDuplexMode | ||
? this.bodyDuplexMode | ||
: FetchHttpClient.DEFAULT_DUPLEX_VALUE; | ||
} | ||
const request = new Request(req.uri, reqInit); | ||
// Send Request | ||
// Need to convert to type RequestInit for Fetch() type compatibility | ||
@@ -101,2 +110,4 @@ let options = this.httpOptions; | ||
exports.FetchHttpClient = FetchHttpClient; | ||
FetchHttpClient.BODY_DUPLEX_KEY = "duplex"; | ||
FetchHttpClient.DEFAULT_DUPLEX_VALUE = "half"; | ||
//# sourceMappingURL=http.js.map |
{ | ||
"name": "oci-common", | ||
"version": "2.67.0", | ||
"version": "2.68.0", | ||
"description": "OCI Common module for NodeJS", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
457180
6225