@libj/http
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -1,2 +0,2 @@ | ||
import { GetRequestOptions, HttpClientConfig, HttpRequestOptions, HttpResponse, HttpSubmitArgs } from './types'; | ||
import { GetRequestOptions, HttpClientConfig, HttpRequestOptions, HttpResponse, HttpRetryConfig, HttpSubmitArgs } from './types'; | ||
import { LooseObject } from '../common/types'; | ||
@@ -13,6 +13,8 @@ export declare class HttpClient { | ||
}; | ||
setRetry(config: HttpRetryConfig): void; | ||
/*** Private ***/ | ||
private agent; | ||
private retryConfig; | ||
private processRequestOptions; | ||
private extractSubmitArgs; | ||
} |
@@ -67,2 +67,5 @@ "use strict"; | ||
}); | ||
HttpClient.prototype.setRetry = function (config) { | ||
this.retryConfig = config; | ||
}; | ||
HttpClient.prototype.processRequestOptions = function (inOptions) { | ||
@@ -92,6 +95,14 @@ var options = __assign({}, inOptions); | ||
} | ||
// Handle retry config | ||
var retryConfig = {}; | ||
if (this.retryConfig) { | ||
Object.assign(retryConfig, this.retryConfig); | ||
} | ||
if (options.retry) { | ||
options['axios-retry'] = __assign({}, options.retry); | ||
Object.assign(retryConfig, options.retry); | ||
delete options.retry; | ||
} | ||
if (Object.keys(retryConfig).length) { | ||
options['axios-retry'] = retryConfig; | ||
} | ||
return options; | ||
@@ -98,0 +109,0 @@ }; |
{ | ||
"dependencies": { | ||
"@libj/http-meta": "0.1.23", | ||
"@libj/logger": "0.2.2", | ||
"@libj/http-meta": "0.1.24", | ||
"@libj/logger": "0.2.3", | ||
"@libj/make-uri": "1.1.15", | ||
@@ -12,3 +12,3 @@ "axios": "^0.21.1", | ||
"name": "@libj/http", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Http toolbox", | ||
@@ -37,3 +37,3 @@ "author": "Sergey Poskachey <seregynp@gmail.com>", | ||
], | ||
"gitHead": "ae203452a0377a3d2b7a3638d8c4ff8951de7565" | ||
"gitHead": "1c40a140cd12ddce9c1e9b5eb8c5cc5ac66a2eb7" | ||
} |
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
24550
337
+ Added@libj/http-meta@0.1.24(transitive)
+ Added@libj/logger@0.2.3(transitive)
- Removed@libj/http-meta@0.1.23(transitive)
- Removed@libj/logger@0.2.2(transitive)
Updated@libj/http-meta@0.1.24
Updated@libj/logger@0.2.3