@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 +3 -10
- package/dist/index.js +8 -5
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
- package/src/clients/internal-api/accounts-client.ts +10 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adtrackify/at-service-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -88,4 +88,4 @@
|
|
|
88
88
|
"author": "",
|
|
89
89
|
"license": "ISC",
|
|
90
90
|
"homepage": "https://bitbucket.org/eacap/at-tracking-event-types#readme"
|
|
91
|
-
}
|
|
91
|
+
}
|
|
@@ -21,23 +21,26 @@ export interface PixelConfigResponseData {
|
|
|
21
21
|
|
|
22
22
|
export class AccountsClient {
|
|
23
23
|
public BASE_API_URL: string;
|
|
24
|
-
public ACCOUNTS_API_KEY
|
|
24
|
+
public ACCOUNTS_API_KEY?: string;
|
|
25
25
|
|
|
26
|
-
constructor (baseApiUrl: string, accountsApiKey
|
|
26
|
+
constructor (baseApiUrl: string, accountsApiKey?: string) {
|
|
27
27
|
this.BASE_API_URL = baseApiUrl;
|
|
28
28
|
this.ACCOUNTS_API_KEY = accountsApiKey;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
getConfig = () => {
|
|
32
32
|
const SERVICE_API_ROOT_URL = `${this.BASE_API_URL}/accounts`;
|
|
33
|
-
|
|
34
|
-
baseURL: SERVICE_API_ROOT_URL
|
|
35
|
-
|
|
33
|
+
const params: any = {
|
|
34
|
+
baseURL: SERVICE_API_ROOT_URL
|
|
35
|
+
};
|
|
36
|
+
if (this.ACCOUNTS_API_KEY) {
|
|
37
|
+
params.headers = {
|
|
36
38
|
common: {
|
|
37
39
|
'x-api-key': this.ACCOUNTS_API_KEY
|
|
38
40
|
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return params;
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
getClient = async () => {
|