@adtrackify/at-service-common 1.0.27 → 1.0.28

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/index.d.ts CHANGED
@@ -89,16 +89,9 @@ declare module '@adtrackify/at-service-common/clients/internal-api/accounts-clie
89
89
  }
90
90
  export class AccountsClient {
91
91
  BASE_API_URL: string;
92
- ACCOUNTS_API_KEY: string;
93
- constructor(baseApiUrl: string, accountsApiKey: string);
94
- getConfig: () => {
95
- baseURL: string;
96
- headers: {
97
- common: {
98
- 'x-api-key': string;
99
- };
100
- };
101
- };
92
+ ACCOUNTS_API_KEY?: string;
93
+ constructor(baseApiUrl: string, accountsApiKey?: string);
94
+ getConfig: () => any;
102
95
  getClient: () => Promise<{
103
96
  instance: () => import("axios").AxiosInstance;
104
97
  get: (url: string, config?: any) => Promise<{
package/dist/index.js CHANGED
@@ -628166,14 +628166,17 @@ var AccountsClient = class {
628166
628166
  }
628167
628167
  getConfig = () => {
628168
628168
  const SERVICE_API_ROOT_URL = `${this.BASE_API_URL}/accounts`;
628169
- return {
628170
- baseURL: SERVICE_API_ROOT_URL,
628171
- headers: {
628169
+ const params = {
628170
+ baseURL: SERVICE_API_ROOT_URL
628171
+ };
628172
+ if (this.ACCOUNTS_API_KEY) {
628173
+ params.headers = {
628172
628174
  common: {
628173
628175
  "x-api-key": this.ACCOUNTS_API_KEY
628174
628176
  }
628175
- }
628176
- };
628177
+ };
628178
+ }
628179
+ return params;
628177
628180
  };
628178
628181
  getClient = async () => {
628179
628182
  return axiosHttpService(this.getConfig());