@leancodepl/axios-cqrs-client 7.2.4 → 7.3.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
@@ -26,8 +26,7 @@ function mkCqrsClient(cqrsEndpoint, tokenProvider) {
26
26
  baseURL: cqrsEndpoint
27
27
  });
28
28
  apiAxios.interceptors.request.use(async (config)=>{
29
- var _tokenProvider;
30
- const token = await ((_tokenProvider = tokenProvider) == null ? void 0 : _tokenProvider.getToken());
29
+ const token = await (tokenProvider == null ? void 0 : tokenProvider.getToken());
31
30
  if (token) {
32
31
  config.headers.set("Authorization", `Bearer ${token}`);
33
32
  }
@@ -41,13 +40,13 @@ function mkCqrsClient(cqrsEndpoint, tokenProvider) {
41
40
  switch(error.response.status){
42
41
  case 401:
43
42
  {
44
- var _config_params, _tokenProvider;
43
+ var _config_params;
45
44
  const config = error.config;
46
45
  if ((_config_params = config.params) == null ? void 0 : _config_params.isRetry) {
47
46
  response.data = createError("The request has not been authorized and token refresh did not help");
48
47
  break;
49
48
  }
50
- if (!((_tokenProvider = tokenProvider) == null ? void 0 : _tokenProvider.invalidateToken)) {
49
+ if (!(tokenProvider == null ? void 0 : tokenProvider.invalidateToken)) {
51
50
  response.data = createError("User needs to be authenticated to execute the command/query/operation");
52
51
  break;
53
52
  }
package/index.esm.js CHANGED
@@ -18,8 +18,7 @@ function mkCqrsClient(cqrsEndpoint, tokenProvider) {
18
18
  baseURL: cqrsEndpoint
19
19
  });
20
20
  apiAxios.interceptors.request.use(async (config)=>{
21
- var _tokenProvider;
22
- const token = await ((_tokenProvider = tokenProvider) == null ? void 0 : _tokenProvider.getToken());
21
+ const token = await (tokenProvider == null ? void 0 : tokenProvider.getToken());
23
22
  if (token) {
24
23
  config.headers.set("Authorization", `Bearer ${token}`);
25
24
  }
@@ -33,13 +32,13 @@ function mkCqrsClient(cqrsEndpoint, tokenProvider) {
33
32
  switch(error.response.status){
34
33
  case 401:
35
34
  {
36
- var _config_params, _tokenProvider;
35
+ var _config_params;
37
36
  const config = error.config;
38
37
  if ((_config_params = config.params) == null ? void 0 : _config_params.isRetry) {
39
38
  response.data = createError("The request has not been authorized and token refresh did not help");
40
39
  break;
41
40
  }
42
- if (!((_tokenProvider = tokenProvider) == null ? void 0 : _tokenProvider.invalidateToken)) {
41
+ if (!(tokenProvider == null ? void 0 : tokenProvider.invalidateToken)) {
43
42
  response.data = createError("User needs to be authenticated to execute the command/query/operation");
44
43
  break;
45
44
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@leancodepl/axios-cqrs-client",
3
- "version": "7.2.4",
3
+ "version": "7.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
- "@leancodepl/validation": "7.2.4",
6
+ "@leancodepl/validation": "7.3.0",
7
7
  "axios": ">=1.0.0"
8
8
  },
9
9
  "type": "commonjs",