@adtrackify/at-service-common 1.0.17 → 1.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adtrackify/at-service-common",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -33,4 +33,3 @@ export const axiosHttpService = (config: any = {}) => {
33
33
  setBaseUrl: (url: string) => !!(axiosService.defaults.baseURL = url)
34
34
  };
35
35
  };
36
-
@@ -1,5 +1,6 @@
1
1
  import { Destination } from 'aws-sdk/clients/lexmodelbuildingservice';
2
2
  import * as log from 'lambda-log';
3
+ import { HttpStatusCodes } from '../../libs';
3
4
  import { ApiResponse } from '../../types/api-response';
4
5
  import { axiosHttpService } from '../generic/http-client';
5
6
 
@@ -36,7 +37,11 @@ export class DestinationsClient {
36
37
  const client = await this.getClient();
37
38
  const createDestinationResponse = await client.post('/', createDestinationRequest);
38
39
  log.info('createDestinationResponse', { createDestinationResponse });
39
- return createDestinationResponse;
40
+ return {
41
+ status: createDestinationResponse.status,
42
+ headers: createDestinationResponse.headers,
43
+ data: createDestinationResponse.status === HttpStatusCodes.OK ? createDestinationResponse.data as { destination: Destination; } : createDestinationResponse.data
44
+ } as ApiResponse<{ destination: Destination; } | any>;
40
45
  };
41
46
 
42
47
  getPixelDestinations = async (pixelId: string): Promise<ApiResponse<{ destinations: Destination[]; } | any>> => {
@@ -32,4 +32,16 @@ export interface DestinationCatalogFields {
32
32
  type: string,
33
33
  required: boolean,
34
34
  order: number;
35
- }
35
+ }
36
+
37
+ export interface AdTrackifyFacebookDestination extends Destination {
38
+ configuration: FacebookPixelConfiguration;
39
+ }
40
+ export interface FacebookPixelConfiguration {
41
+ apiAccessToken?: string;
42
+ enableConversionAPI: boolean;
43
+ pixelId: string;
44
+ }
45
+ export interface GoogleAnalytics4Configuration {
46
+ measurementId: string;
47
+ }