Skip to content

Commit

Permalink
feat: fetch isHashRequired from connection configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs committed Aug 26, 2024
1 parent b6fd84c commit c1cde0f
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/v0/destinations/fb_custom_audience/recordTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ const processRecordEventArray = (
async function processRecordInputs(groupedRecordInputs) {
const { destination, connection } = groupedRecordInputs[0];
const { message } = groupedRecordInputs[0];
const { isHashRequired, accessToken, disableFormat, type, subType, isRaw, maxUserCount } =
destination.Config;
const { accessToken, disableFormat, type, subType, isRaw, maxUserCount } = destination.Config;
const audienceId = get(connection, 'config.destination.audienceId');
const isHashRequired = get(connection, 'config.destination.isHashRequired');
const prepareParams = {
access_token: accessToken,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ const destination: Destination = {
export const rETLBatchingRouterRequest: RouterTransformationRequest = {
input: [
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'insert',
Expand Down Expand Up @@ -62,6 +69,13 @@ export const rETLBatchingRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(1),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'insert',
Expand Down Expand Up @@ -92,6 +106,13 @@ export const rETLBatchingRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(2),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'insert',
Expand Down
49 changes: 49 additions & 0 deletions test/integrations/destinations/fb_custom_audience/router/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ const destination: Destination = {
export const rETLRecordRouterRequest: RouterTransformationRequest = {
input: [
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'insert',
Expand Down Expand Up @@ -62,6 +69,13 @@ export const rETLRecordRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(3),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'update',
Expand Down Expand Up @@ -92,6 +106,13 @@ export const rETLRecordRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(4),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'delete',
Expand Down Expand Up @@ -122,6 +143,13 @@ export const rETLRecordRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(1),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'delete',
Expand Down Expand Up @@ -152,6 +180,13 @@ export const rETLRecordRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(2),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'update',
Expand Down Expand Up @@ -182,6 +217,13 @@ export const rETLRecordRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(5),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'update',
Expand Down Expand Up @@ -212,6 +254,13 @@ export const rETLRecordRouterRequest: RouterTransformationRequest = {
metadata: generateMetadata(6),
},
{
connection: {
config: {
destination: {
isHashRequired: true,
},
},
},
destination: destination,
message: {
action: 'lol',
Expand Down

0 comments on commit c1cde0f

Please sign in to comment.