-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update FBCA spec to support VDM v2 events #3675
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
40a9777
feat: add job run id level isolation
koladilip 9d1487d
Merge branch 'develop' into feat.many-to-one
koladilip d708309
feat: add group by sourceID for rETL
koladilip a1bc2c1
fix: lint isues
koladilip 68c7822
Merge branch 'develop' into feat.many-to-one
koladilip 38de49a
fix: lint issues
koladilip 7e258d5
fix: component test cases
koladilip 73f1d2a
Merge branch 'develop' into feat.many-to-one
koladilip bc19a45
Merge branch 'develop' into feat.many-to-one
koladilip 7ed91a7
Merge branch 'develop' into feat.many-to-one
koladilip d09ca5c
feat: update FBCA spec to support VDM v2 events
sandeepdsvs 0017cf7
Merge remote-tracking branch 'origin/feat.many-to-one' into develop
sandeepdsvs cf6e879
feat: update FBCA spec to support VDM v2 events
sandeepdsvs 75dab29
chore: updated tests
sandeepdsvs 018bf23
chore: added logs
sandeepdsvs 13c5469
fix: audienceId not found error
vyeshwanth b6fd84c
fix: tests
vyeshwanth c1cde0f
feat: fetch isHashRequired from connection configuration
sandeepdsvs 42fbce5
chore: addressed review comments
sandeepdsvs 9a9340f
Merge branch 'develop' into feat.vdm-next-poc
sandeepdsvs 9589ab7
feat: added backward compatability to support both old and new VDM
sandeepdsvs a5dfc8f
chore: updated mapped schema parameter
sandeepdsvs 9782db9
chore: addressed review comments
sandeepdsvs 6914e00
Merge branch 'develop' into feat.many-to-one
koladilip 344b336
chore: add fallback to destination and source ids
koladilip 055077a
chore: revert test cases
koladilip 92c30e5
Merge branch 'feat.many-to-one' into feat.vdm-next-poc
koladilip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
const lodash = require('lodash'); | ||
const get = require('get-value'); | ||
const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); | ||
const { schemaFields } = require('./config'); | ||
const { schemaFields, VDM_V2_SCHEMA_VERSION } = require('./config'); | ||
const { MappedToDestinationKey } = require('../../../constants'); | ||
const stats = require('../../../util/stats'); | ||
const { | ||
|
@@ -17,6 +17,7 @@ | |
ensureApplicableFormat, | ||
getUpdatedDataElement, | ||
getSchemaForEventMappedToDest, | ||
getSchemaForEventMappedToDestForVDMv2, | ||
batchingWithPayloadSize, | ||
responseBuilderSimple, | ||
getDataSource, | ||
|
@@ -100,18 +101,18 @@ | |
}; | ||
|
||
async function processRecordInputs(groupedRecordInputs) { | ||
const { destination } = groupedRecordInputs[0]; | ||
const { destination, connection } = groupedRecordInputs[0]; | ||
const { message } = groupedRecordInputs[0]; | ||
const { | ||
isHashRequired, | ||
accessToken, | ||
disableFormat, | ||
type, | ||
subType, | ||
isRaw, | ||
maxUserCount, | ||
audienceId, | ||
} = destination.Config; | ||
const { accessToken, disableFormat, type, subType, isRaw, maxUserCount } = destination.Config; | ||
let audienceId; | ||
let isHashRequired; | ||
if (connection?.config?.destination?.schemaVersion === VDM_V2_SCHEMA_VERSION) { | ||
audienceId = connection?.config?.destination?.audienceId; | ||
isHashRequired = connection?.config?.destination?.isHashRequired; | ||
} else { | ||
audienceId = destination.Config?.audienceId; | ||
isHashRequired = destination.Config?.isHashRequired; | ||
} | ||
const prepareParams = { | ||
access_token: accessToken, | ||
}; | ||
|
@@ -125,7 +126,7 @@ | |
// audience id validation | ||
let operationAudienceId = audienceId; | ||
const mappedToDestination = get(message, MappedToDestinationKey); | ||
if (mappedToDestination) { | ||
if (mappedToDestination && !operationAudienceId) { | ||
const { objectType } = getDestinationExternalIDInfoForRetl(message, 'FB_CUSTOM_AUDIENCE'); | ||
operationAudienceId = objectType; | ||
} | ||
|
@@ -136,7 +137,11 @@ | |
// user schema validation | ||
let { userSchema } = destination.Config; | ||
if (mappedToDestination) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we sending mappedToDestination in new format? |
||
userSchema = getSchemaForEventMappedToDest(message); | ||
if (connection?.config?.destination?.schemaVersion === VDM_V2_SCHEMA_VERSION) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. write common util for this condition, mostly this will be used multiple destinations |
||
userSchema = getSchemaForEventMappedToDestForVDMv2(message); | ||
} else { | ||
userSchema = getSchemaForEventMappedToDest(message); | ||
} | ||
} | ||
if (!Array.isArray(userSchema)) { | ||
userSchema = [userSchema]; | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can declare this in global somewhere, this is same for any destination