@leancodepl/axios-cqrs-client 7.3.6 → 7.4.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.
package/index.cjs.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var validation = require('@leancodepl/validation');
6
5
  var axios = require('axios');
6
+ var validation = require('@leancodepl/validation');
7
7
 
8
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
9
 
@@ -15,6 +15,7 @@ function createSuccess(result) {
15
15
  result
16
16
  };
17
17
  }
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
19
  function createError(error) {
19
20
  return {
20
21
  isSuccess: false,
@@ -28,7 +29,8 @@ function mkCqrsClient(cqrsEndpoint, tokenProvider) {
28
29
  apiAxios.interceptors.request.use(async (config)=>{
29
30
  const token = await (tokenProvider == null ? void 0 : tokenProvider.getToken());
30
31
  if (token) {
31
- config.headers.set("Authorization", `Bearer ${token}`);
32
+ var _config_headers;
33
+ (_config_headers = config.headers) == null ? void 0 : _config_headers.set("Authorization", `Bearer ${token}`);
32
34
  }
33
35
  return config;
34
36
  });
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
package/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { handleResponse } from '@leancodepl/validation';
2
1
  import axios from 'axios';
2
+ import { handleResponse } from '@leancodepl/validation';
3
3
 
4
4
  function createSuccess(result) {
5
5
  return {
@@ -7,6 +7,7 @@ function createSuccess(result) {
7
7
  result
8
8
  };
9
9
  }
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
11
  function createError(error) {
11
12
  return {
12
13
  isSuccess: false,
@@ -20,7 +21,8 @@ function mkCqrsClient(cqrsEndpoint, tokenProvider) {
20
21
  apiAxios.interceptors.request.use(async (config)=>{
21
22
  const token = await (tokenProvider == null ? void 0 : tokenProvider.getToken());
22
23
  if (token) {
23
- config.headers.set("Authorization", `Bearer ${token}`);
24
+ var _config_headers;
25
+ (_config_headers = config.headers) == null ? void 0 : _config_headers.set("Authorization", `Bearer ${token}`);
24
26
  }
25
27
  return config;
26
28
  });
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@leancodepl/axios-cqrs-client",
3
- "version": "7.3.6",
3
+ "version": "7.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
- "@leancodepl/validation": "7.3.6",
7
- "axios": ">=1.0.0"
6
+ "@leancodepl/cqrs-client-base": "7.4.0",
7
+ "@leancodepl/validation": "7.4.0",
8
+ "axios": ">=1.6.0"
8
9
  },
9
10
  "exports": {
10
11
  "./package.json": "./package.json",