@aircall/http
Advanced tools
Comparing version 0.5.6 to 0.5.7
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.5.7](https://gitlab.com/aircall/shared/front-end-modules/compare/@aircall/http@0.5.6...@aircall/http@0.5.7) (2022-10-27) | ||
**Note:** Version bump only for package @aircall/http | ||
## [0.5.6](https://gitlab.com/aircall/shared/front-end-modules/compare/@aircall/http@0.5.5...@aircall/http@0.5.6) (2022-09-01) | ||
@@ -8,0 +16,0 @@ |
@@ -89,3 +89,3 @@ "use strict"; | ||
}; | ||
const { apiBaseUrl, logger, headers, handleError } = this.options; | ||
const { apiBaseUrl, logger, headers, handleError, adapter } = this.options; | ||
if (!apiBaseUrl) { | ||
@@ -102,2 +102,3 @@ throw new Error('Missing API URL!'); | ||
this.setAxiosInstance(axios_1.default.create({ | ||
adapter: adapter ? adapter : undefined, | ||
baseURL: apiBaseUrl, | ||
@@ -104,0 +105,0 @@ headers: Object.assign(Object.assign({}, headers), { 'Content-Type': 'application/json; charset=UTF-8', Accept: 'application/json, text/plain, */*' }) |
@@ -1,2 +0,2 @@ | ||
import { AxiosRequestConfig, AxiosError } from 'axios'; | ||
import { AxiosRequestConfig, AxiosError, AxiosPromise } from 'axios'; | ||
import { Logger } from '@aircall/logger'; | ||
@@ -36,2 +36,3 @@ export interface ResponseLogPayload { | ||
export interface HttpServiceOptions { | ||
adapter?: (config: AxiosRequestConfig) => AxiosPromise; | ||
apiBaseUrl?: string; | ||
@@ -38,0 +39,0 @@ headers?: AxiosRequestConfig['headers']; |
{ | ||
"name": "@aircall/http", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"main": "dist/index.js", | ||
@@ -14,3 +14,3 @@ "types": "dist/index.d.ts", | ||
}, | ||
"gitHead": "15ff4196f1a1653dfe35b3dedfd4c5710eadbd05", | ||
"gitHead": "e3fa6e9343bcf0c043fcbc383126cb76b6da6973", | ||
"dependencies": { | ||
@@ -17,0 +17,0 @@ "@aircall/logger": "^2.8.0", |
@@ -32,3 +32,3 @@ import axios, { AxiosInstance, AxiosRequestConfig, AxiosError, AxiosResponse } from 'axios'; | ||
public constructor(private options: HttpServiceOptions) { | ||
const { apiBaseUrl, logger, headers, handleError } = this.options; | ||
const { apiBaseUrl, logger, headers, handleError, adapter } = this.options; | ||
@@ -50,2 +50,3 @@ if (!apiBaseUrl) { | ||
axios.create({ | ||
adapter: adapter ? adapter : undefined, | ||
baseURL: apiBaseUrl, | ||
@@ -52,0 +53,0 @@ headers: { |
@@ -1,2 +0,2 @@ | ||
import { AxiosRequestConfig, AxiosError } from 'axios'; | ||
import { AxiosRequestConfig, AxiosError, AxiosPromise } from 'axios'; | ||
import { Logger } from '@aircall/logger'; | ||
@@ -43,2 +43,3 @@ | ||
export interface HttpServiceOptions { | ||
adapter?: (config: AxiosRequestConfig) => AxiosPromise; | ||
apiBaseUrl?: string; | ||
@@ -45,0 +46,0 @@ headers?: AxiosRequestConfig['headers']; |
Sorry, the diff of this file is not supported yet
47214
878