@mittwald/api-client 4.14.1 → 4.15.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.
@@ -1,4 +1,4 @@
1
- import { ApiClientError, } from "@mittwald/api-client-commons";
1
+ import { ApiClientError, withAccessToken, withEventConsistencyHandling, } from "@mittwald/api-client-commons";
2
2
  import MittwaldApiV2Client from "../generated/v2/client.js";
3
3
  import { MittwaldAPIClientVersion } from "../version.js";
4
4
  import { isBrowser } from "browser-or-node";
@@ -22,13 +22,7 @@ export class MittwaldAPIClient extends MittwaldApiV2Client {
22
22
  };
23
23
  }
24
24
  setupInterceptors() {
25
- this.axios.interceptors.request.use((conf) => {
26
- const token = this.apiToken;
27
- if (token) {
28
- conf.headers.set("x-access-token", token);
29
- }
30
- return conf;
31
- });
25
+ withAccessToken(this, this.apiToken);
32
26
  }
33
27
  static newUnauthenticated() {
34
28
  return new MittwaldAPIClient();
@@ -49,5 +43,9 @@ export class MittwaldAPIClient extends MittwaldApiV2Client {
49
43
  }
50
44
  throw ApiClientError.fromResponse("Login failed", authResult);
51
45
  }
46
+ withEventConsistencyHandling() {
47
+ withEventConsistencyHandling(this);
48
+ return this;
49
+ }
52
50
  }
53
51
  export default MittwaldAPIClient;
@@ -1 +1 @@
1
- export const MittwaldAPIClientVersion = '4.14.0';
1
+ export const MittwaldAPIClientVersion = '4.14.1';
@@ -8,5 +8,6 @@ export declare class MittwaldAPIClient extends MittwaldApiV2Client {
8
8
  static newUnauthenticated(): MittwaldAPIClient;
9
9
  static newWithToken(apiToken: string): MittwaldAPIClient;
10
10
  static newWithCredentials(email: string, password: string): Promise<MittwaldAPIClient>;
11
+ withEventConsistencyHandling(): this;
11
12
  }
12
13
  export default MittwaldAPIClient;
@@ -1 +1 @@
1
- export declare const MittwaldAPIClientVersion = '4.14.0';
1
+ export declare const MittwaldAPIClientVersion = '4.14.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/api-client",
3
- "version": "4.14.1",
3
+ "version": "4.15.0",
4
4
  "author": "Mittwald CM Service GmbH & Co. KG <opensource@mittwald.de>",
5
5
  "type": "module",
6
6
  "description": "Auto-generated client for the mittwald API",
@@ -42,7 +42,7 @@
42
42
  "test:client-generation-clean": "git diff --exit-code"
43
43
  },
44
44
  "dependencies": {
45
- "@mittwald/api-client-commons": "^4.14.1",
45
+ "@mittwald/api-client-commons": "^4.15.0",
46
46
  "browser-or-node": "^3.0.0-pre.0"
47
47
  },
48
48
  "devDependencies": {
@@ -76,5 +76,5 @@
76
76
  "optional": true
77
77
  }
78
78
  },
79
- "gitHead": "c3643fd79bff88f584fc64050801a0701fcd3371"
79
+ "gitHead": "b04612b188ae649a5d1fb7788da3a6149d6a7ebd"
80
80
  }