@trayio/axios 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ import FormData = require('form-data');
5
5
  import { FileStorage } from '@trayio/commons/file/File';
6
6
  export declare class AxiosHttpClient implements HttpClient {
7
7
  private readonly fileStorage;
8
- constructor(fileStorage: FileStorage);
8
+ constructor(fileStorage?: FileStorage);
9
9
  execute(method: HttpMethod, url: string, request: HttpRequest): TE.TaskEither<Error, HttpResponse>;
10
10
  private axiosErrorToHttpResponse;
11
11
  private axiosResponseToHttpResponse;
@@ -1 +1 @@
1
- {"version":3,"file":"AxiosHttpClient.d.ts","sourceRoot":"","sources":["../../src/http/AxiosHttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAEN,UAAU,EACV,WAAW,EAEX,YAAY,EAEZ,MAAM,2BAA2B,CAAC;AAGnC,OAAO,QAAQ,GAAG,QAAQ,WAAW,CAAC,CAAC;AACvC,OAAO,EAAQ,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE9D,qBAAa,eAAgB,YAAW,UAAU;IACrC,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAErD,OAAO,CACN,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,GAClB,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC;IA+FrC,OAAO,CAAC,wBAAwB;IAchC,OAAO,CAAC,2BAA2B;IAUnC,YAAY,aAAc,QAAQ,cAAc,OAAO,MAAM,EAAE,MAAM,CAAC,cAKpE;CACF"}
1
+ {"version":3,"file":"AxiosHttpClient.d.ts","sourceRoot":"","sources":["../../src/http/AxiosHttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAEN,UAAU,EACV,WAAW,EAEX,YAAY,EAEZ,MAAM,2BAA2B,CAAC;AAGnC,OAAO,QAAQ,GAAG,QAAQ,WAAW,CAAC,CAAC;AACvC,OAAO,EAAQ,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAG9D,qBAAa,eAAgB,YAAW,UAAU;IAEhD,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,GAAE,WAAqC;IAGpE,OAAO,CACN,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,GAClB,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC;IA+FrC,OAAO,CAAC,wBAAwB;IAchC,OAAO,CAAC,2BAA2B;IAUnC,YAAY,aAAc,QAAQ,cAAc,OAAO,MAAM,EAAE,MAAM,CAAC,cAKpE;CACF"}
@@ -33,8 +33,9 @@ const Http_1 = require("@trayio/commons/http/Http");
33
33
  const Task_1 = require("@trayio/commons/task/Task");
34
34
  const axios_1 = __importDefault(require("axios"));
35
35
  const FormData = require("form-data");
36
+ const NodeFsFileStorage_1 = require("@trayio/commons/file/NodeFsFileStorage");
36
37
  class AxiosHttpClient {
37
- constructor(fileStorage) {
38
+ constructor(fileStorage = new NodeFsFileStorage_1.NodeFsFileStorage()) {
38
39
  this.fileStorage = fileStorage;
39
40
  this.appendFields = (formData) => (fields) => {
40
41
  Object.entries(fields).forEach(([key, value]) => {
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const NodeFsFileStorage_1 = require("@trayio/commons/file/NodeFsFileStorage");
4
3
  const HttpClient_abstract_test_1 = require("@trayio/commons/http/HttpClient.abstract.test");
5
4
  const AxiosHttpClient_1 = require("./AxiosHttpClient");
6
- (0, HttpClient_abstract_test_1.httpClientTest)(new AxiosHttpClient_1.AxiosHttpClient(new NodeFsFileStorage_1.NodeFsFileStorage()));
5
+ (0, HttpClient_abstract_test_1.httpClientTest)(new AxiosHttpClient_1.AxiosHttpClient());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/axios",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Axios extensions and implementations",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
@@ -14,7 +14,7 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@trayio/commons": "1.9.0",
17
+ "@trayio/commons": "1.10.0",
18
18
  "axios": "0.27.2",
19
19
  "form-data": "4.0.0"
20
20
  },