@maioradv/cms-basic-lib 1.0.3 → 1.0.4

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/dist/client.d.ts CHANGED
@@ -37,5 +37,6 @@ export declare class MaiorCmsApiClient implements ClientApiI {
37
37
  constructor(config: ApiConfigs);
38
38
  protected _initClient(): Axios;
39
39
  protected _initModules(): void;
40
+ _setAccessToken(accessToken: string): void;
40
41
  auth(): Promise<AccessTokenDto>;
41
42
  }
package/dist/client.js CHANGED
@@ -49,6 +49,9 @@ class MaiorCmsApiClient {
49
49
  this.productVariants = new variants_1.default(this.client);
50
50
  this.roles = new roles_1.default(this.client);
51
51
  }
52
+ _setAccessToken(accessToken) {
53
+ this.client.defaults.headers.common[types_1.ApiHeader.Authorization] = `Bearer ${accessToken}`;
54
+ }
52
55
  async auth() {
53
56
  if (!this.configApi.credentials)
54
57
  throw new error_1.AuthError('Missing credentials');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maioradv/cms-basic-lib",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "JS lib for Maior CMS Basic Api",
5
5
  "repository": "https://github.com/maioradv/cms-basic-lib.git",
6
6
  "author": "Maior ADV Srl",