@libj/http
Advanced tools
Comparing version 0.10.1 to 0.11.0
@@ -0,1 +1,2 @@ | ||
import { AxiosRequestConfig } from 'axios'; | ||
import { GetRequestOptions, HttpClientConfig, HttpRequestOptions, HttpResponse, HttpRetryConfig, HttpSubmitArgs } from './types'; | ||
@@ -10,3 +11,3 @@ import { LooseObject } from '../common/types'; | ||
get interceptors(): { | ||
request: import("axios").AxiosInterceptorManager<import("axios").AxiosRequestConfig>; | ||
request: import("axios").AxiosInterceptorManager<AxiosRequestConfig>; | ||
response: import("axios").AxiosInterceptorManager<import("axios").AxiosResponse<any>>; | ||
@@ -13,0 +14,0 @@ }; |
@@ -114,2 +114,7 @@ "use strict"; | ||
} | ||
// Handle Bearer auth token | ||
if (inOptions.auth && inOptions.auth.bearerToken) { | ||
options.headers = __assign(__assign({}, options.headers), { Authorization: src_1.makeHttpBearerAuth(inOptions.auth.bearerToken) }); | ||
delete options.auth; | ||
} | ||
return options; | ||
@@ -116,0 +121,0 @@ }; |
@@ -6,6 +6,13 @@ import { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
export declare type HttpRetryConfig = IAxiosRetryConfig; | ||
export interface HttpRequestOptions extends AxiosRequestConfig { | ||
export interface HtpRequestOptionsBearerAuth { | ||
bearerToken: string; | ||
} | ||
export interface HttpRequestOptions extends Omit<AxiosRequestConfig, 'auth'> { | ||
method?: any; | ||
cookies?: LooseObject; | ||
retry?: HttpRetryConfig; | ||
auth?: { | ||
username: string; | ||
password: string; | ||
} | HtpRequestOptionsBearerAuth; | ||
} | ||
@@ -12,0 +19,0 @@ export interface GetRequestOptions extends HttpRequestOptions { |
{ | ||
"dependencies": { | ||
"@libj/http-meta": "0.2.2", | ||
"@libj/logger": "0.2.10", | ||
"@libj/make-uri": "1.2.5", | ||
"@libj/http-meta": "0.2.3", | ||
"@libj/logger": "0.2.11", | ||
"@libj/make-uri": "1.2.6", | ||
"axios": "^0.21.1", | ||
@@ -12,3 +12,3 @@ "axios-retry": "^3.2.5", | ||
"name": "@libj/http", | ||
"version": "0.10.1", | ||
"version": "0.11.0", | ||
"description": "Http toolbox", | ||
@@ -37,3 +37,3 @@ "author": "Sergey Poskachey <seregynp@gmail.com>", | ||
], | ||
"gitHead": "93eac4ca7359f9461911fe322aa16661a42df466" | ||
"gitHead": "831daf155bd629061c8ea925ef5444587a8fa885" | ||
} |
Sorry, the diff of this file is not supported yet
27885
388
+ Added@libj/http-meta@0.2.3(transitive)
+ Added@libj/logger@0.2.11(transitive)
+ Added@libj/make-uri@1.2.6(transitive)
- Removed@libj/http-meta@0.2.2(transitive)
- Removed@libj/logger@0.2.10(transitive)
- Removed@libj/make-uri@1.2.5(transitive)
Updated@libj/http-meta@0.2.3
Updated@libj/logger@0.2.11
Updated@libj/make-uri@1.2.6