@tyvm/knowhow-api-client 0.0.4 → 0.0.6

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
@@ -11,11 +11,11 @@ export interface TokenStorage {
11
11
  clearToken(): void;
12
12
  }
13
13
  export declare class KnowhowClientFactory {
14
- protected api: AxiosInstance;
15
14
  private client?;
16
15
  private _client?;
17
16
  private config;
18
17
  private tokenStorage?;
18
+ api: AxiosInstance;
19
19
  constructor(config: ClientConfig, tokenStorage?: TokenStorage);
20
20
  getClient(): Promise<Client>;
21
21
  setToken(token: string): void;
package/dist/client.js CHANGED
@@ -33,7 +33,7 @@ class KnowhowClientFactory {
33
33
  return this.client;
34
34
  if (this._client)
35
35
  return this._client;
36
- const initClient = new openapi_client_axios_1.default({
36
+ const api = new openapi_client_axios_1.default({
37
37
  definition: openapi_json_1.default,
38
38
  axiosConfigDefaults: {
39
39
  baseURL: this.config.baseURL + "/api",
@@ -41,7 +41,9 @@ class KnowhowClientFactory {
41
41
  "Content-Type": "application/json",
42
42
  },
43
43
  },
44
- }).init();
44
+ });
45
+ // Initialize the client properly
46
+ const initClient = api.init();
45
47
  this._client = initClient;
46
48
  this.client = await this._client;
47
49
  // Apply token if available