@leancodepl/axios-cqrs-client 7.8.1 → 8.0.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
@@ -1,15 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var axios = require('axios');
6
4
  var validation = require('@leancodepl/validation');
7
5
  var utils = require('@leancodepl/utils');
8
6
 
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
12
-
13
7
  function _extends() {
14
8
  _extends = Object.assign || function assign(target) {
15
9
  for(var i = 1; i < arguments.length; i++){
@@ -27,7 +21,6 @@ function createSuccess(result) {
27
21
  result
28
22
  };
29
23
  }
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
24
  function createError(error) {
32
25
  return {
33
26
  isSuccess: false,
@@ -35,7 +28,7 @@ function createError(error) {
35
28
  };
36
29
  }
37
30
  function mkCqrsClient({ cqrsEndpoint, tokenProvider, axiosOptions }) {
38
- const apiAxios = axios__default["default"].create(_extends({
31
+ const apiAxios = axios.create(_extends({
39
32
  baseURL: cqrsEndpoint
40
33
  }, axiosOptions));
41
34
  apiAxios.interceptors.request.use(async (config)=>{
package/index.esm.js CHANGED
@@ -19,7 +19,6 @@ function createSuccess(result) {
19
19
  result
20
20
  };
21
21
  }
22
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
22
  function createError(error) {
24
23
  return {
25
24
  isSuccess: false,
package/package.json CHANGED
@@ -1,20 +1,22 @@
1
1
  {
2
2
  "name": "@leancodepl/axios-cqrs-client",
3
- "version": "7.8.1",
3
+ "version": "8.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
- "@leancodepl/cqrs-client-base": "7.8.1",
7
- "@leancodepl/validation": "7.8.1",
6
+ "@leancodepl/cqrs-client-base": "8.0.0",
7
+ "@leancodepl/validation": "8.0.0",
8
8
  "axios": ">=1.6.0"
9
9
  },
10
10
  "exports": {
11
11
  "./package.json": "./package.json",
12
12
  ".": {
13
13
  "module": "./index.esm.js",
14
+ "types": "./index.esm.d.ts",
14
15
  "import": "./index.cjs.mjs",
15
16
  "default": "./index.cjs.js"
16
17
  }
17
18
  },
18
19
  "module": "./index.esm.js",
19
- "main": "./index.cjs.js"
20
+ "main": "./index.cjs.js",
21
+ "types": "./index.esm.d.ts"
20
22
  }
@@ -7,7 +7,7 @@ export type MkCqrsClientParameters = {
7
7
  };
8
8
  export declare function mkCqrsClient({ cqrsEndpoint, tokenProvider, axiosOptions }: MkCqrsClientParameters): {
9
9
  createQuery<TQuery, TResult>(type: string): (dto: TQuery) => Promise<ApiError | ApiSuccess<TResult>>;
10
- createOperation<TOperation, TResult_1>(type: string): (dto: TOperation) => Promise<ApiError | ApiSuccess<TResult_1>>;
10
+ createOperation<TOperation, TResult>(type: string): (dto: TOperation) => Promise<ApiError | ApiSuccess<TResult>>;
11
11
  createCommand<TCommand, TErrorCodes extends {
12
12
  [name: string]: number;
13
13
  }>(type: string, errorCodesMap: TErrorCodes): {
@@ -5,8 +5,8 @@ export declare function mkUncapitalizedCqrsClient(params: MkCqrsClientParameters
5
5
  result: import("@leancodepl/utils").TransformDeep<TResult, "uncapitalize">;
6
6
  isSuccess: true;
7
7
  }>;
8
- createOperation<TOperation, TResult_1>(type: string): (dto: TOperation) => Promise<import("@leancodepl/cqrs-client-base").ApiError | {
9
- result: import("@leancodepl/utils").TransformDeep<TResult_1, "uncapitalize">;
8
+ createOperation<TOperation, TResult>(type: string): (dto: TOperation) => Promise<import("@leancodepl/cqrs-client-base").ApiError | {
9
+ result: import("@leancodepl/utils").TransformDeep<TResult, "uncapitalize">;
10
10
  isSuccess: true;
11
11
  }>;
12
12
  createCommand<TCommand, TErrorCodes extends {