-
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.
feat: facebook custom audience app secret support (#3357)
* feat: facebook custom audience app secret support * fix: review comment addressed * fix: add test case description
- Loading branch information
1 parent
265a71d
commit fce4ef9
Showing
3 changed files
with
180 additions
and
3 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { getEndPoint } from '../../../../../src/v0/destinations/fb_custom_audience/config'; | ||
|
||
export const mockFns = (_) => { | ||
// @ts-ignore | ||
jest.useFakeTimers().setSystemTime(new Date('2023-10-15')); | ||
}; | ||
|
||
export const data = [ | ||
{ | ||
name: 'fb_custom_audience', | ||
|
@@ -54463,4 +54468,149 @@ export const data = [ | |
}, | ||
}, | ||
}, | ||
]; | ||
{ | ||
name: 'fb_custom_audience', | ||
description: | ||
'If App secret is configured in the UI, appsecret_proof and appsecret_time will be added to destination request.', | ||
feature: 'processor', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: [ | ||
{ | ||
message: { | ||
userId: 'user 1', | ||
anonymousId: 'anon-id-new', | ||
event: 'event1', | ||
type: 'audiencelist', | ||
properties: { | ||
listData: { | ||
add: [ | ||
{ | ||
EMAIL: '[email protected]', | ||
DOBM: '2', | ||
DOBD: '13', | ||
DOBY: '2013', | ||
PHONE: '@09432457768', | ||
GEN: 'f', | ||
FI: 'Ms.', | ||
MADID: 'ABC', | ||
ZIP: 'ZIP ', | ||
ST: '123abc ', | ||
COUNTRY: 'IN', | ||
}, | ||
], | ||
}, | ||
}, | ||
context: { | ||
ip: '14.5.67.21', | ||
library: { | ||
name: 'http', | ||
}, | ||
}, | ||
timestamp: '2020-02-02T00:23:09.544Z', | ||
}, | ||
destination: { | ||
Config: { | ||
accessToken: 'ABC', | ||
appSecret: 'dummySecret', | ||
userSchema: [ | ||
'EMAIL', | ||
'DOBM', | ||
'DOBD', | ||
'DOBY', | ||
'PHONE', | ||
'GEN', | ||
'FI', | ||
'MADID', | ||
'ZIP', | ||
'ST', | ||
'COUNTRY', | ||
], | ||
isHashRequired: false, | ||
disableFormat: false, | ||
audienceId: 'aud1', | ||
isRaw: true, | ||
type: 'NA', | ||
subType: 'ANYTHING', | ||
maxUserCount: '50', | ||
}, | ||
Enabled: true, | ||
Transformations: [], | ||
IsProcessorEnabled: true, | ||
}, | ||
libraries: [], | ||
request: { | ||
query: {}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: [ | ||
{ | ||
output: { | ||
version: '1', | ||
type: 'REST', | ||
method: 'POST', | ||
endpoint: getEndPoint('aud1'), | ||
headers: {}, | ||
params: { | ||
access_token: 'ABC', | ||
appsecret_proof: 'd103874f3b5f01f57c4f84edfb96ac94055da8f83c2b45e6f26dafca9188ff4d', | ||
appsecret_time: 1697328000, | ||
payload: { | ||
is_raw: true, | ||
data_source: { | ||
sub_type: 'ANYTHING', | ||
}, | ||
schema: [ | ||
'EMAIL', | ||
'DOBM', | ||
'DOBD', | ||
'DOBY', | ||
'PHONE', | ||
'GEN', | ||
'FI', | ||
'MADID', | ||
'ZIP', | ||
'ST', | ||
'COUNTRY', | ||
], | ||
data: [ | ||
[ | ||
'[email protected]', | ||
'2', | ||
'13', | ||
'2013', | ||
'@09432457768', | ||
'f', | ||
'Ms.', | ||
'ABC', | ||
'ZIP ', | ||
'123abc ', | ||
'IN', | ||
], | ||
], | ||
}, | ||
}, | ||
userId: '', | ||
body: { | ||
JSON: {}, | ||
XML: {}, | ||
JSON_ARRAY: {}, | ||
FORM: {}, | ||
}, | ||
files: {}, | ||
}, | ||
statusCode: 200, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
].map((d) => ({ ...d, mockFns })); |