-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vikas Venkatraman
authored and
Vikas Venkatraman
committed
Jun 4, 2024
1 parent
5263566
commit be23c39
Showing
5 changed files
with
808 additions
and
994 deletions.
There are no files selected for viewing
123 changes: 123 additions & 0 deletions
123
test/integrations/destinations/fb_custom_audience/router/audienceList.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import { Destination, RouterTransformationRequest } from '../../../../../src/types'; | ||
import { generateMetadata } from '../../../testUtils'; | ||
|
||
const destination: Destination = { | ||
Config: { | ||
accessToken: 'ABC', | ||
disableFormat: false, | ||
isHashRequired: true, | ||
isRaw: false, | ||
maxUserCount: '50', | ||
oneTrustCookieCategories: [], | ||
skipVerify: false, | ||
subType: 'NA', | ||
type: 'NA', | ||
userSchema: ['EMAIL'], | ||
}, | ||
ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', | ||
Name: 'FB_CUSTOM_AUDIENCE', | ||
Enabled: true, | ||
WorkspaceID: '1TSN08muJTZwH8iCDmnnRt1pmLd', | ||
DestinationDefinition: { | ||
ID: '1aIXqM806xAVm92nx07YwKbRrO9', | ||
Name: 'FB_CUSTOM_AUDIENCE', | ||
DisplayName: 'FB_CUSTOM_AUDIENCE', | ||
Config: {}, | ||
}, | ||
Transformations: [], | ||
IsConnectionEnabled: true, | ||
IsProcessorEnabled: true, | ||
}; | ||
|
||
export const rETLAudienceRouterRequest: RouterTransformationRequest = { | ||
input: [ | ||
{ | ||
message: { | ||
sentAt: '2023-03-30 06:42:55.991938402 +0000 UTC', | ||
userId: '2MUWghI7u85n91dd1qzGyswpZan-2MUWqbQqvctyfMGqU9QCNadpKNy', | ||
channel: 'sources', | ||
messageId: '4d906837-031d-4d34-b97a-62fdf51b4d3a', | ||
event: 'Add_Audience', | ||
context: { | ||
destinationFields: 'EMAIL, FN', | ||
externalId: [{ type: 'FB_CUSTOM_AUDIENCE-23848494844100489', identifierType: 'EMAIL' }], | ||
mappedToDestination: 'true', | ||
sources: { | ||
job_run_id: 'cgiiurt8um7k7n5dq480', | ||
task_run_id: 'cgiiurt8um7k7n5dq48g', | ||
job_id: '2MUWghI7u85n91dd1qzGyswpZan', | ||
version: '895/merge', | ||
}, | ||
}, | ||
recordId: '725ad989-6750-4839-b46b-0ddb3b8e5aa2/1/10', | ||
rudderId: '85c49666-c628-4835-937b-8f1d9ee7a724', | ||
properties: { | ||
listData: { | ||
add: [ | ||
{ EMAIL: '[email protected]', FN: 'vishwa' }, | ||
{ EMAIL: '[email protected]', FN: 'hskks' }, | ||
{ EMAIL: '[email protected]', FN: 'ghfry' }, | ||
{ EMAIL: '[email protected]', FN: 'hbcwqe' }, | ||
{ EMAIL: '[email protected]', FN: 'dsfds' }, | ||
{ EMAIL: 'ascscxsaca@com', FN: 'scadscdvcda' }, | ||
{ EMAIL: '[email protected]', FN: 'subscribed' }, | ||
{ EMAIL: '[email protected]', FN: 'subscribed' }, | ||
{ EMAIL: '[email protected]', FN: 'pending' }, | ||
{ EMAIL: '[email protected]', FN: 'pending' }, | ||
], | ||
}, | ||
}, | ||
type: 'audienceList', | ||
anonymousId: '63228b51-394e-4ca2-97a0-427f6187480b', | ||
}, | ||
destination: destination, | ||
metadata: generateMetadata(3), | ||
}, | ||
{ | ||
message: { | ||
sentAt: '2023-03-30 06:42:55.991938402 +0000 UTC', | ||
userId: '2MUWghI7u85n91dd1qzGyswpZan-2MUWqbQqvctyfMGqU9QCNadpKNy', | ||
channel: 'sources', | ||
messageId: '4d906837-031d-4d34-b97a-62fdf51b4d3a', | ||
event: 'Add_Audience', | ||
context: { | ||
externalId: [{ type: 'FB_CUSTOM_AUDIENCE-23848494844100489', identifierType: 'EMAIL' }], | ||
mappedToDestination: 'true', | ||
sources: { | ||
job_run_id: 'cgiiurt8um7k7n5dq480', | ||
task_run_id: 'cgiiurt8um7k7n5dq48g', | ||
job_id: '2MUWghI7u85n91dd1qzGyswpZan', | ||
version: '895/merge', | ||
}, | ||
}, | ||
recordId: '725ad989-6750-4839-b46b-0ddb3b8e5aa2/1/10', | ||
rudderId: '85c49666-c628-4835-937b-8f1d9ee7a724', | ||
properties: { | ||
listData: { | ||
add: [ | ||
{ EMAIL: '[email protected]', FN: 'vishwa' }, | ||
{ EMAIL: '[email protected]', FN: 'hskks' }, | ||
{ EMAIL: '[email protected]', FN: 'ghfry' }, | ||
{ EMAIL: '[email protected]', FN: 'hbcwqe' }, | ||
{ EMAIL: '[email protected]', FN: 'dsfds' }, | ||
{ EMAIL: 'ascscxsaca@com', FN: 'scadscdvcda' }, | ||
{ EMAIL: '[email protected]', FN: 'subscribed' }, | ||
{ EMAIL: '[email protected]', FN: 'subscribed' }, | ||
{ EMAIL: '[email protected]', FN: 'pending' }, | ||
{ EMAIL: '[email protected]', FN: 'pending' }, | ||
], | ||
}, | ||
}, | ||
type: 'audienceList', | ||
anonymousId: '63228b51-394e-4ca2-97a0-427f6187480b', | ||
}, | ||
destination: destination, | ||
metadata: generateMetadata(4), | ||
}, | ||
], | ||
destType: 'fb_custom_audience', | ||
}; | ||
|
||
module.exports = { | ||
rETLAudienceRouterRequest, | ||
}; |
130 changes: 130 additions & 0 deletions
130
test/integrations/destinations/fb_custom_audience/router/batchingRecord.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
import { Destination, RouterTransformationRequest } from '../../../../../src/types'; | ||
import { generateMetadata } from '../../../testUtils'; | ||
|
||
const destination: Destination = { | ||
Config: { | ||
accessToken: 'ABC', | ||
disableFormat: false, | ||
isHashRequired: true, | ||
isRaw: false, | ||
maxUserCount: '2', | ||
oneTrustCookieCategories: [], | ||
skipVerify: false, | ||
subType: 'NA', | ||
type: 'NA', | ||
userSchema: ['EMAIL'], | ||
}, | ||
ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', | ||
Name: 'FB_CUSTOM_AUDIENCE', | ||
Enabled: true, | ||
WorkspaceID: '1TSN08muJTZwH8iCDmnnRt1pmLd', | ||
DestinationDefinition: { | ||
ID: '1aIXqM806xAVm92nx07YwKbRrO9', | ||
Name: 'FB_CUSTOM_AUDIENCE', | ||
DisplayName: 'FB_CUSTOM_AUDIENCE', | ||
Config: {}, | ||
}, | ||
Transformations: [], | ||
IsConnectionEnabled: true, | ||
IsProcessorEnabled: true, | ||
}; | ||
|
||
export const rETLBatchingRouterRequest: RouterTransformationRequest = { | ||
input: [ | ||
{ | ||
destination: destination, | ||
message: { | ||
action: 'insert', | ||
context: { | ||
destinationFields: 'EMAIL, FI', | ||
externalId: [ | ||
{ | ||
type: 'FB_CUSTOM_AUDIENCE-23848494844100489', | ||
identifierType: 'EMAIL', | ||
}, | ||
], | ||
mappedToDestination: 'true', | ||
sources: { | ||
job_run_id: 'cgiiurt8um7k7n5dq480', | ||
task_run_id: 'cgiiurt8um7k7n5dq48g', | ||
job_id: '2MUWghI7u85n91dd1qzGyswpZan', | ||
version: '895/merge', | ||
}, | ||
}, | ||
recordId: '2', | ||
rudderId: '2', | ||
fields: { | ||
EMAIL: '[email protected]', | ||
FI: 'ghui', | ||
}, | ||
type: 'record', | ||
}, | ||
metadata: generateMetadata(1), | ||
}, | ||
{ | ||
destination: destination, | ||
message: { | ||
action: 'insert', | ||
context: { | ||
destinationFields: 'EMAIL, FI', | ||
externalId: [ | ||
{ | ||
type: 'FB_CUSTOM_AUDIENCE-23848494844100489', | ||
identifierType: 'EMAIL', | ||
}, | ||
], | ||
mappedToDestination: 'true', | ||
sources: { | ||
job_run_id: 'cgiiurt8um7k7n5dq480', | ||
task_run_id: 'cgiiurt8um7k7n5dq48g', | ||
job_id: '2MUWghI7u85n91dd1qzGyswpZan', | ||
version: '895/merge', | ||
}, | ||
}, | ||
recordId: '2', | ||
rudderId: '2', | ||
fields: { | ||
EMAIL: '[email protected]', | ||
FI: 'ghui', | ||
}, | ||
type: 'record', | ||
}, | ||
metadata: generateMetadata(2), | ||
}, | ||
{ | ||
destination: destination, | ||
message: { | ||
action: 'insert', | ||
context: { | ||
destinationFields: 'EMAIL, FI', | ||
externalId: [ | ||
{ | ||
type: 'FB_CUSTOM_AUDIENCE-23848494844100489', | ||
identifierType: 'EMAIL', | ||
}, | ||
], | ||
mappedToDestination: 'true', | ||
sources: { | ||
job_run_id: 'cgiiurt8um7k7n5dq480', | ||
task_run_id: 'cgiiurt8um7k7n5dq48g', | ||
job_id: '2MUWghI7u85n91dd1qzGyswpZan', | ||
version: '895/merge', | ||
}, | ||
}, | ||
recordId: '2', | ||
rudderId: '2', | ||
fields: { | ||
EMAIL: '[email protected]', | ||
FI: 'ghui', | ||
}, | ||
type: 'record', | ||
}, | ||
metadata: generateMetadata(3), | ||
}, | ||
], | ||
destType: 'fb_custom_audience', | ||
}; | ||
|
||
module.exports = { | ||
rETLBatchingRouterRequest, | ||
}; |
Oops, something went wrong.