diff --git a/src/v0/destinations/facebook_pixel/config.js b/src/v0/destinations/facebook_pixel/config.js index f5f895aea9..17d5887e1b 100644 --- a/src/v0/destinations/facebook_pixel/config.js +++ b/src/v0/destinations/facebook_pixel/config.js @@ -1,5 +1,7 @@ const { getMappingConfig } = require('../../util'); +const VERSION = 'v18.0'; + const CONFIG_CATEGORIES = { USERDATA: { standard: false, @@ -106,6 +108,7 @@ const STANDARD_ECOMM_EVENTS_TYPE = [ ]; module.exports = { + VERSION, CONFIG_CATEGORIES, MAPPING_CONFIG, ACTION_SOURCES_VALUES, diff --git a/src/v0/destinations/facebook_pixel/transform.js b/src/v0/destinations/facebook_pixel/transform.js index 1bc97ac1fb..8a63998b45 100644 --- a/src/v0/destinations/facebook_pixel/transform.js +++ b/src/v0/destinations/facebook_pixel/transform.js @@ -4,6 +4,7 @@ const moment = require('moment'); const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); const stats = require('../../../util/stats'); const { + VERSION, CONFIG_CATEGORIES, MAPPING_CONFIG, FB_PIXEL_DEFAULT_EXCLUSION, @@ -65,7 +66,7 @@ const responseBuilderSimple = (message, category, destination) => { } = Config; const integrationsObj = getIntegrationsObj(message, 'fb_pixel'); - const endpoint = `https://graph.facebook.com/v17.0/${pixelId}/events?access_token=${accessToken}`; + const endpoint = `https://graph.facebook.com/${VERSION}/${pixelId}/events?access_token=${accessToken}`; const userData = fetchUserData( message, diff --git a/src/v0/destinations/fb/config.js b/src/v0/destinations/fb/config.js index 2ad9aeacba..0e52b42416 100644 --- a/src/v0/destinations/fb/config.js +++ b/src/v0/destinations/fb/config.js @@ -1,6 +1,8 @@ const fs = require('fs'); const path = require('path'); +const VERSION = 'v18.0'; + const getPath = (file) => path.resolve(__dirname, file); const baseMapping = JSON.parse(fs.readFileSync(getPath('./data/FbAppBasicMapping.json'))); @@ -20,6 +22,7 @@ const eventPropToTypeMapping = JSON.parse( ); module.exports = { + VERSION, baseMapping, eventNameMapping, eventPropsMapping, diff --git a/src/v0/destinations/fb/transform.js b/src/v0/destinations/fb/transform.js index c0d78a2b3f..e6f8e986cf 100644 --- a/src/v0/destinations/fb/transform.js +++ b/src/v0/destinations/fb/transform.js @@ -14,6 +14,7 @@ const { } = require('../../util'); const { + VERSION, baseMapping, eventNameMapping, eventPropsMapping, @@ -250,7 +251,7 @@ function responseBuilderSimple(message, payload, destination) { // "https://graph.facebook.com/v13.0/644748472345539/activities" - const endpoint = `https://graph.facebook.com/v17.0/${appID}/activities`; + const endpoint = `https://graph.facebook.com/${VERSION}/${appID}/activities`; const response = defaultRequestConfig(); response.endpoint = endpoint; diff --git a/src/v0/destinations/fb_custom_audience/config.js b/src/v0/destinations/fb_custom_audience/config.js index 635ad2a9bb..284ab0d4a4 100644 --- a/src/v0/destinations/fb_custom_audience/config.js +++ b/src/v0/destinations/fb_custom_audience/config.js @@ -1,4 +1,4 @@ -const BASE_URL = 'https://graph.facebook.com/v17.0'; +const BASE_URL = 'https://graph.facebook.com/v18.0'; function getEndPoint(audienceId) { return `${BASE_URL}/${audienceId}/users`; @@ -93,7 +93,7 @@ const subTypeFields = [ // const MAX_USER_COUNT = 500; (using from destination definition) const USER_ADD = 'add'; const USER_DELETE = 'remove'; -/* No official Documentation is available for this but using trial +/* No official Documentation is available for this but using trial and error method we found that 65000 bytes is the maximum payload allowed size but we are 60000 just to be sure batching is done properly */ const maxPayloadSize = 60000; // bytes diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts index d560658341..eb9ce344e0 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts @@ -1,3 +1,5 @@ +import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; + export const data = [ { name: 'facebook_pixel', @@ -24,8 +26,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_access_token`, params: { destination: 'facebook_pixel', }, @@ -89,8 +90,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=my_access_token`, params: { destination: 'facebook_pixel', }, @@ -139,8 +139,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_timestamp_correct_access_token`, params: { destination: 'facebook_pixel', }, @@ -209,8 +208,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=throttled_valid_access_token`, params: { destination: 'facebook_pixel', }, @@ -274,8 +272,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_account_id_valid_access_token`, params: { destination: 'facebook_pixel', }, @@ -342,8 +339,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=not_found_access_token`, params: { destination: 'facebook_pixel', }, @@ -411,8 +407,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234570/events?access_token=valid_access_token`, }, method: 'POST', }, @@ -477,8 +472,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234571/events?access_token=valid_access_token`, }, method: 'POST', }, @@ -543,8 +537,7 @@ export const data = [ userId: '', headers: {}, version: '1', - endpoint: - 'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234572/events?access_token=valid_access_token_unhandled_response`, }, method: 'POST', }, diff --git a/test/integrations/destinations/facebook_pixel/network.ts b/test/integrations/destinations/facebook_pixel/network.ts index a63970c4c6..05b3a05fd0 100644 --- a/test/integrations/destinations/facebook_pixel/network.ts +++ b/test/integrations/destinations/facebook_pixel/network.ts @@ -1,10 +1,11 @@ import { data } from './dataDelivery/data'; import { getFormData } from '../../../../src/adapters/network'; +import { VERSION } from '../../../../src/v0/destinations/facebook_pixel/config'; export const networkCallsData = [ { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_access_token`, data: getFormData(data[0].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -24,7 +25,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_timestamp_correct_access_token`, data: getFormData(data[2].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -49,7 +50,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=throttled_valid_access_token`, data: getFormData(data[3].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -69,7 +70,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_account_id_valid_access_token`, data: getFormData(data[4].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -91,7 +92,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=not_found_access_token`, data: getFormData(data[5].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -112,7 +113,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234570/events?access_token=valid_access_token`, data: getFormData(data[6].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -133,7 +134,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234571/events?access_token=valid_access_token`, data: getFormData(data[7].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -154,7 +155,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response', + url: `https://graph.facebook.com/${VERSION}/1234567891234572/events?access_token=valid_access_token_unhandled_response`, data: getFormData(data[8].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -175,7 +176,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token', + url: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=my_access_token`, data: getFormData(data[1].input.request.body.body.FORM).toString(), params: { destination: 'facebook_pixel' }, headers: { 'User-Agent': 'RudderLabs' }, diff --git a/test/integrations/destinations/facebook_pixel/processor/data.ts b/test/integrations/destinations/facebook_pixel/processor/data.ts index 96e80c01e8..557bc7066c 100644 --- a/test/integrations/destinations/facebook_pixel/processor/data.ts +++ b/test/integrations/destinations/facebook_pixel/processor/data.ts @@ -1,3 +1,5 @@ +import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; + export const mockFns = (_) => { // @ts-ignore jest.useFakeTimers().setSystemTime(new Date('2023-10-15')); @@ -106,7 +108,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -445,7 +447,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -569,7 +571,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -688,7 +690,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -807,7 +809,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -927,7 +929,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1047,7 +1049,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1166,7 +1168,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1284,7 +1286,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1419,7 +1421,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1554,7 +1556,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1705,7 +1707,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1855,7 +1857,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -1984,7 +1986,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -2106,7 +2108,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -2249,7 +2251,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -2392,7 +2394,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -2516,7 +2518,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -2640,7 +2642,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -2768,7 +2770,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -2893,7 +2895,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -3014,7 +3016,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -3133,7 +3135,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -3282,7 +3284,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -3510,7 +3512,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -3631,7 +3633,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -3884,7 +3886,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -4027,7 +4029,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -4289,7 +4291,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -4752,7 +4754,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -4897,7 +4899,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -5178,7 +5180,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -5310,7 +5312,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -5440,7 +5442,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -6032,8 +6034,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=dummyAccessToken', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=dummyAccessToken`, headers: {}, params: {}, body: { @@ -6181,7 +6182,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -6306,7 +6307,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -6437,7 +6438,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/facebook_pixel/router/data.ts b/test/integrations/destinations/facebook_pixel/router/data.ts index ef6b9f8635..ee2f6968b1 100644 --- a/test/integrations/destinations/facebook_pixel/router/data.ts +++ b/test/integrations/destinations/facebook_pixel/router/data.ts @@ -1,3 +1,5 @@ +import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; + export const mockFns = (_) => { // @ts-ignore jest.useFakeTimers().setSystemTime(new Date('2023-10-15')); @@ -193,7 +195,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { @@ -254,7 +256,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/dummyPixelId/events?access_token=09876', + endpoint: `https://graph.facebook.com/${VERSION}/dummyPixelId/events?access_token=09876`, headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/fb/dataDelivery/data.ts b/test/integrations/destinations/fb/dataDelivery/data.ts index c50cffee80..f9405ba4b3 100644 --- a/test/integrations/destinations/fb/dataDelivery/data.ts +++ b/test/integrations/destinations/fb/dataDelivery/data.ts @@ -1,357 +1,372 @@ +import { VERSION } from '../../../../../src/v0/destinations/fb/config'; + export const data = [ { - "name": "fb", - "description": "Test 0", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "event": "CUSTOM_APP_EVENTS", - "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", - "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", - "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", - "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", - "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", - "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", - "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"additional_bet_index\":0,\"battle_id\":\"N/A\",\"bet_amount\":9,\"bet_level\":1,\"bet_multiplier\":1,\"coin_balance\":9466052,\"current_module_name\":\"CasinoGameModule\",\"days_in_game\":0,\"extra_param\":\"N/A\",\"fb_profile\":\"0\",\"featureGameType\":\"N/A\",\"game_fps\":30,\"game_id\":\"fireEagleBase\",\"game_name\":\"FireEagleSlots\",\"gem_balance\":0,\"graphicsQuality\":\"HD\",\"idfa\":\"2bf99787-33d2-4ae2-a76a-c49672f97252\",\"internetReachability\":\"ReachableViaLocalAreaNetwork\",\"isLowEndDevice\":\"False\",\"is_auto_spin\":\"False\",\"is_turbo\":\"False\",\"isf\":\"False\",\"ishighroller\":\"False\",\"jackpot_win_amount\":90,\"jackpot_win_type\":\"Silver\",\"level\":6,\"lifetime_gem_balance\":0,\"no_of_spin\":1,\"player_total_battles\":0,\"player_total_shields\":0,\"start_date\":\"2019-08-01\",\"total_payments\":0,\"tournament_id\":\"T1561970819\",\"userId\":\"c82cbdff-e5be-4009-ac78-cdeea09ab4b1\",\"versionSessionCount\":2,\"win_amount\":0,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", - "advertiser_tracking_enabled": "0", - "application_tracking_enabled": "0" + name: 'fb', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: { + event: 'CUSTOM_APP_EVENTS', + advertiser_id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + 'ud[fn]': '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', + 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', + 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', + 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', + extinfo: + '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + custom_events: + '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + advertiser_tracking_enabled: '0', + application_tracking_enabled: '0', }, - "JSON": {} + JSON: {}, + }, + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities?access_token=invalid_access_token`, + files: {}, + headers: { + 'x-forwarded-for': '1.2.3.4', }, - "endpoint": "https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=invalid_access_token", - "files": {}, - "headers": { - "x-forwarded-for": "1.2.3.4" + method: 'POST', + statusCode: 200, + type: 'REST', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + version: '1', + params: { + destination: 'fb', }, - "method": "POST", - "statusCode": 200, - "type": "REST", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "version": "1", - "params": { - "destination": "fb" - } }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 400, - "body": { - "output": { - "status": 400, - "message": "Invalid OAuth 2.0 access token", - "destinationResponse": { - "error": { - "message": "The access token could not be decrypted", - "type": "OAuthException", - "code": 190, - "fbtrace_id": "fbpixel_trace_id" + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Invalid OAuth 2.0 access token', + destinationResponse: { + error: { + message: 'The access token could not be decrypted', + type: 'OAuthException', + code: 190, + fbtrace_id: 'fbpixel_trace_id', }, - "status": 500 + status: 500, }, - "statTags": { - "destType": "FB", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + statTags: { + destType: 'FB', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, }, { - "name": "fb", - "description": "Test 1", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "event": "CUSTOM_APP_EVENTS", - "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", - "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", - "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", - "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", - "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", - "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", - "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"additional_bet_index\":0,\"battle_id\":\"N/A\",\"bet_amount\":9,\"bet_level\":1,\"bet_multiplier\":1,\"coin_balance\":9466052,\"current_module_name\":\"CasinoGameModule\",\"days_in_game\":0,\"extra_param\":\"N/A\",\"fb_profile\":\"0\",\"featureGameType\":\"N/A\",\"game_fps\":30,\"game_id\":\"fireEagleBase\",\"game_name\":\"FireEagleSlots\",\"gem_balance\":0,\"graphicsQuality\":\"HD\",\"idfa\":\"2bf99787-33d2-4ae2-a76a-c49672f97252\",\"internetReachability\":\"ReachableViaLocalAreaNetwork\",\"isLowEndDevice\":\"False\",\"is_auto_spin\":\"False\",\"is_turbo\":\"False\",\"isf\":\"False\",\"ishighroller\":\"False\",\"jackpot_win_amount\":90,\"jackpot_win_type\":\"Silver\",\"level\":6,\"lifetime_gem_balance\":0,\"no_of_spin\":1,\"player_total_battles\":0,\"player_total_shields\":0,\"start_date\":\"2019-08-01\",\"total_payments\":0,\"tournament_id\":\"T1561970819\",\"userId\":\"c82cbdff-e5be-4009-ac78-cdeea09ab4b1\",\"versionSessionCount\":2,\"win_amount\":0,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", - "advertiser_tracking_enabled": "0", - "application_tracking_enabled": "0" + name: 'fb', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: { + event: 'CUSTOM_APP_EVENTS', + advertiser_id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + 'ud[fn]': '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', + 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', + 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', + 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', + extinfo: + '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + custom_events: + '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + advertiser_tracking_enabled: '0', + application_tracking_enabled: '0', }, - "JSON": {} + JSON: {}, }, - "endpoint": "https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=my_access_token", - "files": {}, - "headers": { - "x-forwarded-for": "1.2.3.4" + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities?access_token=my_access_token`, + files: {}, + headers: { + 'x-forwarded-for': '1.2.3.4', + }, + method: 'POST', + statusCode: 200, + type: 'REST', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + version: '1', + params: { + destination: 'fb', }, - "method": "POST", - "statusCode": 200, - "type": "REST", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "version": "1", - "params": { - "destination": "fb" - } }, - "method": "POST" - } + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Request Processed Successfully', + destinationResponse: { + events_received: 1, + fbtrace_id: 'facebook_trace_id', + }, + }, + }, + }, }, - "output": { - "response": { - "status": 200, - "body": { - "output": { - "status": 200, - "message": "Request Processed Successfully", - "destinationResponse": { - "events_received": 1, - "fbtrace_id": "facebook_trace_id" - } - } - } - } - } }, { - "name": "fb", - "description": "Test 2", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "event": "CUSTOM_APP_EVENTS", - "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", - "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", - "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", - "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", - "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", - "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", - "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"additional_bet_index\":0,\"battle_id\":\"N/A\",\"bet_amount\":9,\"bet_level\":1,\"bet_multiplier\":1,\"coin_balance\":9466052,\"current_module_name\":\"CasinoGameModule\",\"days_in_game\":0,\"extra_param\":\"N/A\",\"fb_profile\":\"0\",\"featureGameType\":\"N/A\",\"game_fps\":30,\"game_id\":\"fireEagleBase\",\"game_name\":\"FireEagleSlots\",\"gem_balance\":0,\"graphicsQuality\":\"HD\",\"idfa\":\"2bf99787-33d2-4ae2-a76a-c49672f97252\",\"internetReachability\":\"ReachableViaLocalAreaNetwork\",\"isLowEndDevice\":\"False\",\"is_auto_spin\":\"False\",\"is_turbo\":\"False\",\"isf\":\"False\",\"ishighroller\":\"False\",\"jackpot_win_amount\":90,\"jackpot_win_type\":\"Silver\",\"level\":6,\"lifetime_gem_balance\":0,\"no_of_spin\":1,\"player_total_battles\":0,\"player_total_shields\":0,\"start_date\":\"2019-08-01\",\"total_payments\":0,\"tournament_id\":\"T1561970819\",\"userId\":\"c82cbdff-e5be-4009-ac78-cdeea09ab4b1\",\"versionSessionCount\":2,\"win_amount\":0,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", - "advertiser_tracking_enabled": "0", - "application_tracking_enabled": "0" + name: 'fb', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: { + event: 'CUSTOM_APP_EVENTS', + advertiser_id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + 'ud[fn]': '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', + 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', + 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', + 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', + extinfo: + '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + custom_events: + '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + advertiser_tracking_enabled: '0', + application_tracking_enabled: '0', }, - "JSON": {} + JSON: {}, + }, + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_timestamp_correct_access_token`, + files: {}, + headers: { + 'x-forwarded-for': '1.2.3.4', }, - "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token", - "files": {}, - "headers": { - "x-forwarded-for": "1.2.3.4" + method: 'POST', + statusCode: 200, + type: 'REST', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + version: '1', + params: { + destination: 'fb', }, - "method": "POST", - "statusCode": 200, - "type": "REST", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "version": "1", - "params": { - "destination": "fb" - } }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 400, - "body": { - "output": { - "status": 400, - "message": "Event Timestamp Too Old", - "destinationResponse": { - "error": { - "message": "Invalid parameter", - "type": "OAuthException", - "code": 100, - "error_subcode": 2804003, - "is_transient": false, - "error_user_title": "Event Timestamp Too Old", - "error_user_msg": "The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.", - "fbtrace_id": "A6UyEgg_HdoiRX9duxcBOjb" + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Event Timestamp Too Old', + destinationResponse: { + error: { + message: 'Invalid parameter', + type: 'OAuthException', + code: 100, + error_subcode: 2804003, + is_transient: false, + error_user_title: 'Event Timestamp Too Old', + error_user_msg: + 'The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.', + fbtrace_id: 'A6UyEgg_HdoiRX9duxcBOjb', }, - "status": 400 + status: 400, }, - "statTags": { - "destType": "FB", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + statTags: { + destType: 'FB', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, }, { - "name": "fb", - "description": "Test 3", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token", - "headers": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",0,100,\"50.00\",0,0,0,\"\"]", - "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"Viewed Screen\",\"fb_description\":\"Main.1233\"}]", - "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", - "advertiser_tracking_enabled": "0", - "application_tracking_enabled": "0", - "event": "CUSTOM_APP_EVENTS" - } + name: 'fb', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=throttled_valid_access_token`, + headers: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + extinfo: + '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', + custom_events: + '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + advertiser_tracking_enabled: '0', + application_tracking_enabled: '0', + event: 'CUSTOM_APP_EVENTS', + }, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + statusCode: 200, + params: { + destination: 'fb', }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "statusCode": 200, - "params": { - "destination": "fb" - } }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 429, - "body": { - "output": { - "status": 429, - "message": "API User Too Many Calls", - "destinationResponse": { - "error": { - "message": "User request limit reached", - "type": "OAuthException", - "code": 17, - "fbtrace_id": "facebook_px_trace_id_4" + output: { + response: { + status: 429, + body: { + output: { + status: 429, + message: 'API User Too Many Calls', + destinationResponse: { + error: { + message: 'User request limit reached', + type: 'OAuthException', + code: 17, + fbtrace_id: 'facebook_px_trace_id_4', }, - "status": 500 + status: 500, + }, + statTags: { + destType: 'FB', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', }, - "statTags": { - "destType": "FB", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "throttled", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + }, + }, + }, + }, }, { - "name": "fb", - "description": "Test 4", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token", - "headers": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",0,100,\"50.00\",0,0,0,\"\"]", - "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"Viewed Screen\",\"fb_description\":\"Main.1233\"}]", - "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", - "advertiser_tracking_enabled": "0", - "application_tracking_enabled": "0", - "event": "CUSTOM_APP_EVENTS" - } + name: 'fb', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: `https://graph.facebook.com/${VERSION}/1234567891234567/events?access_token=invalid_account_id_valid_access_token`, + headers: {}, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: { + extinfo: + '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', + custom_events: + '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + advertiser_tracking_enabled: '0', + application_tracking_enabled: '0', + event: 'CUSTOM_APP_EVENTS', + }, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + statusCode: 200, + params: { + destination: 'fb', }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "statusCode": 200, - "params": { - "destination": "fb" - } }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 400, - "body": { - "output": { - "status": 400, - "message": "Object with ID 'PIXEL_ID' / 'DATASET_ID' / 'AUDIENCE_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation", - "destinationResponse": { - "error": { - "message": "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", - "type": "GraphMethodException", - "code": 100, - "error_subcode": 33, - "fbtrace_id": "facebook_px_trace_id_5" + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + "Object with ID 'PIXEL_ID' / 'DATASET_ID' / 'AUDIENCE_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation", + destinationResponse: { + error: { + message: + "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", + type: 'GraphMethodException', + code: 100, + error_subcode: 33, + fbtrace_id: 'facebook_px_trace_id_5', }, - "status": 400 + status: 400, }, - "statTags": { - "destType": "FB", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } - } -] \ No newline at end of file + statTags: { + destType: 'FB', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/fb/network.ts b/test/integrations/destinations/fb/network.ts index 07a84a7e66..1a2f114d74 100644 --- a/test/integrations/destinations/fb/network.ts +++ b/test/integrations/destinations/fb/network.ts @@ -2,6 +2,7 @@ import { cloneDeep } from 'lodash'; import { getFormData } from '../../../../src/adapters/network'; import * as fbPixelNw from '../facebook_pixel/network'; import { data } from './dataDelivery/data'; +import { VERSION } from '../../../../src/v0/destinations/fb/config'; const fbPixelTcs = data .filter((_, i) => [2, 3, 4].includes(i)) @@ -19,7 +20,7 @@ const fbPixelTcs = data export const networkCallsData = [ { httpReq: { - url: 'https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=invalid_access_token', + url: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities?access_token=invalid_access_token`, data: getFormData(data[0].input.request.body.body.FORM).toString(), params: { destination: 'fb' }, headers: { 'User-Agent': 'RudderLabs' }, @@ -39,7 +40,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=my_access_token', + url: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities?access_token=my_access_token`, data: getFormData(data[1].input.request.body.body.FORM).toString(), params: { destination: 'fb' }, headers: { 'x-forwarded-for': '1.2.3.4', 'User-Agent': 'RudderLabs' }, diff --git a/test/integrations/destinations/fb/processor/data.ts b/test/integrations/destinations/fb/processor/data.ts index 9b57f3ef78..a437b90855 100644 --- a/test/integrations/destinations/fb/processor/data.ts +++ b/test/integrations/destinations/fb/processor/data.ts @@ -1,3 +1,5 @@ +import { VERSION } from '../../../../../src/v0/destinations/fb/config'; + export const data = [ { name: 'fb', @@ -618,7 +620,7 @@ export const data = [ }, JSON: {}, }, - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, files: {}, headers: { 'x-forwarded-for': '1.2.3.4', @@ -803,7 +805,7 @@ export const data = [ }, JSON: {}, }, - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, files: {}, headers: { 'x-forwarded-for': '1.2.3.4', @@ -893,7 +895,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { @@ -993,7 +995,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { @@ -1177,7 +1179,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { @@ -1277,7 +1279,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { @@ -1377,7 +1379,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { @@ -1551,7 +1553,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { @@ -1731,7 +1733,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { @@ -1831,7 +1833,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: { 'x-forwarded-for': '2.3.4.5', }, @@ -2153,7 +2155,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/RudderFbApp/activities', + endpoint: `https://graph.facebook.com/${VERSION}/RudderFbApp/activities`, headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts b/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts index d2220e16da..3066dae887 100644 --- a/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts +++ b/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts @@ -1,3 +1,5 @@ +import { getEndPoint } from '../../../../../src/v0/destinations/fb_custom_audience/config'; + export const data = [ { name: 'fb_custom_audience', @@ -11,7 +13,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'successResponse', }, @@ -94,7 +96,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'permissionMissingError', }, @@ -176,7 +178,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'audienceUnavailableError', }, @@ -245,7 +247,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'audienceDeletedError', }, @@ -312,7 +314,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'failedToUpdateAudienceError', }, @@ -380,7 +382,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'parameterExceededError', }, @@ -447,7 +449,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'tooManyCallsError', }, @@ -514,7 +516,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'code200PermissionError', }, diff --git a/test/integrations/destinations/fb_custom_audience/network.ts b/test/integrations/destinations/fb_custom_audience/network.ts index 7dd904fdd9..bbdc1ffc28 100644 --- a/test/integrations/destinations/fb_custom_audience/network.ts +++ b/test/integrations/destinations/fb_custom_audience/network.ts @@ -1,10 +1,12 @@ +import { getEndPoint } from '../../../../src/v0/destinations/fb_custom_audience/config'; + export const networkCallsData = [ { httpReq: { version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'successResponse', }, @@ -70,7 +72,7 @@ export const networkCallsData = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'permissionMissingError', }, @@ -111,7 +113,7 @@ export const networkCallsData = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'audienceUnavailableError', }, @@ -152,7 +154,7 @@ export const networkCallsData = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'audienceDeletedError', }, @@ -218,7 +220,7 @@ export const networkCallsData = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'failedToUpdateAudienceError', }, @@ -284,7 +286,7 @@ export const networkCallsData = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'parameterExceededError', }, @@ -350,7 +352,7 @@ export const networkCallsData = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'tooManyCallsError', }, @@ -416,7 +418,7 @@ export const networkCallsData = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: { 'test-dest-response-key': 'code200PermissionError', }, diff --git a/test/integrations/destinations/fb_custom_audience/processor/data.ts b/test/integrations/destinations/fb_custom_audience/processor/data.ts index 17dcda3a98..4f892f6fef 100644 --- a/test/integrations/destinations/fb_custom_audience/processor/data.ts +++ b/test/integrations/destinations/fb_custom_audience/processor/data.ts @@ -1,3 +1,5 @@ +import { getEndPoint } from '../../../../../src/v0/destinations/fb_custom_audience/config'; + export const data = [ { name: 'fb_custom_audience', @@ -552,7 +554,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -607,7 +609,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -763,7 +765,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -818,7 +820,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, userId: '', params: { @@ -963,7 +965,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -993,7 +995,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -1123,7 +1125,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -1179,7 +1181,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -1336,7 +1338,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, userId: '', params: { @@ -1391,7 +1393,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -1547,7 +1549,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -1602,7 +1604,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -1758,7 +1760,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, userId: '', params: { @@ -1813,7 +1815,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, userId: '', params: { @@ -1955,7 +1957,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, userId: '', params: { @@ -2097,7 +2099,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, userId: '', params: { @@ -2226,7 +2228,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -28302,7 +28304,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -34844,7 +34846,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -41386,7 +41388,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -47902,7 +47904,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', diff --git a/test/integrations/destinations/fb_custom_audience/router/data.ts b/test/integrations/destinations/fb_custom_audience/router/data.ts index c458b45c91..efefb80a89 100644 --- a/test/integrations/destinations/fb_custom_audience/router/data.ts +++ b/test/integrations/destinations/fb_custom_audience/router/data.ts @@ -1,3 +1,5 @@ +import { getEndPoint } from '../../../../../src/v0/destinations/fb_custom_audience/config'; + export const data = [ { name: 'fb_custom_audience', @@ -189,7 +191,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -241,7 +243,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -332,7 +334,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -383,7 +385,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -26748,7 +26750,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/23848494844100489/users', + endpoint: getEndPoint('23848494844100489'), headers: {}, params: { access_token: 'ABC', @@ -26874,7 +26876,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -33409,7 +33411,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -39944,7 +39946,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC', @@ -46453,7 +46455,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v17.0/aud1/users', + endpoint: getEndPoint('aud1'), headers: {}, params: { access_token: 'ABC',