-
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.
chore(release): pull release/v1.56.0 into main (#3103)
- Loading branch information
Showing
74 changed files
with
7,209 additions
and
3,298 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ N/A | |
|
||
N/A | ||
|
||
@coderabbitai review | ||
|
||
<hr> | ||
|
||
### Developer checklist | ||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
# Only allow these users to create new hotfix branch from 'main' | ||
if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'koladilip' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'ujjwal-ab') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'ujjwal-ab') | ||
if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'koladilip' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'ujjwal-ab') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'sanpj2292') | ||
steps: | ||
- name: Create Branch | ||
uses: peterjgrainger/[email protected] | ||
|
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 |
---|---|---|
|
@@ -132,7 +132,7 @@ dist | |
|
||
# Others | ||
**/.DS_Store | ||
|
||
.dccache | ||
|
||
.idea | ||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const { getMappingConfig } = require('../../../../v0/util'); | ||
|
||
const BASE_URL = 'https://api.bluecore.com/api/track/mobile/v1'; | ||
|
||
const CONFIG_CATEGORIES = { | ||
IDENTIFY: { | ||
name: 'bluecoreIdentifyConfig', | ||
type: 'identify', | ||
}, | ||
TRACK: { | ||
name: 'bluecoreTrackConfig', | ||
type: 'track', | ||
}, | ||
COMMON: { | ||
name: 'bluecoreCommonConfig', | ||
type: 'common', | ||
}, | ||
}; | ||
|
||
const EVENT_NAME_MAPPING = [ | ||
{ | ||
src: ['product viewed'], | ||
dest: 'viewed_product', | ||
}, | ||
{ | ||
src: ['products searched'], | ||
dest: 'search', | ||
}, | ||
{ | ||
src: ['product added'], | ||
dest: 'add_to_cart', | ||
}, | ||
{ | ||
src: ['product removed'], | ||
dest: 'remove_from_cart', | ||
}, | ||
{ | ||
src: ['product added to wishlist'], | ||
dest: 'wishlist', | ||
}, | ||
{ | ||
src: ['order completed'], | ||
dest: 'purchase', | ||
}, | ||
]; | ||
|
||
const BLUECORE_EXCLUSION_FIELDS = ['query', 'order_id', 'total']; | ||
|
||
const MAPPING_CONFIG = getMappingConfig(CONFIG_CATEGORIES, __dirname); | ||
module.exports = { | ||
CONFIG_CATEGORIES, | ||
MAPPING_CONFIG, | ||
EVENT_NAME_MAPPING, | ||
BASE_URL, | ||
BLUECORE_EXCLUSION_FIELDS, | ||
}; |
52 changes: 52 additions & 0 deletions
52
src/cdk/v2/destinations/bluecore/data/bluecoreCommonConfig.json
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,52 @@ | ||
[ | ||
{ | ||
"destKey": "properties.customer.name", | ||
"sourceKeys": "name", | ||
"required": false, | ||
"sourceFromGenericMap": true | ||
}, | ||
{ | ||
"destKey": "properties.customer.first_name", | ||
"sourceKeys": "firstName", | ||
"required": false, | ||
"sourceFromGenericMap": true | ||
}, | ||
{ | ||
"destKey": "properties.customer.last_name", | ||
"sourceKeys": "lastName", | ||
"required": false, | ||
"sourceFromGenericMap": true | ||
}, | ||
{ | ||
"destKey": "properties.customer.age", | ||
"sourceKeys": ["context.traits.age", "traits.age"], | ||
"required": false | ||
}, | ||
{ | ||
"destKey": "properties.customer.sex", | ||
"sourceKeys": ["traits.gender", "context.traits.gender", "traits.sex", "context.traits.sex"], | ||
"required": false | ||
}, | ||
{ | ||
"destKey": "properties.customer.address", | ||
"sourceKeys": "address", | ||
"required": false, | ||
"sourceFromGenericMap": true | ||
}, | ||
{ | ||
"destKey": "properties.customer.email", | ||
"sourceKeys": "email", | ||
"required": false, | ||
"sourceFromGenericMap": true | ||
}, | ||
{ | ||
"destKey": "properties.client", | ||
"sourceKeys": "context.app.version", | ||
"required": false | ||
}, | ||
{ | ||
"destKey": "properties.device", | ||
"sourceKeys": "context.device.model", | ||
"required": false | ||
} | ||
] |
7 changes: 7 additions & 0 deletions
7
src/cdk/v2/destinations/bluecore/data/bluecoreIdentifyConfig.json
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,7 @@ | ||
[ | ||
{ | ||
"destKey": "event", | ||
"sourceKeys": ["traits.action", "context.traits.action"], | ||
"required": false | ||
} | ||
] |
22 changes: 22 additions & 0 deletions
22
src/cdk/v2/destinations/bluecore/data/bluecoreTrackConfig.json
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,22 @@ | ||
[ | ||
{ | ||
"destKey": "properties.search_term", | ||
"sourceKeys": "properties.query", | ||
"required": false | ||
}, | ||
{ | ||
"destKey": "properties.order_id", | ||
"sourceKeys": "properties.order_id", | ||
"required": false | ||
}, | ||
{ | ||
"destKey": "properties.total", | ||
"sourceKeys": "properties.total", | ||
"required": false | ||
}, | ||
{ | ||
"destKey": "properties.products", | ||
"sourceKeys": ["properties.products"], | ||
"required": false | ||
} | ||
] |
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,69 @@ | ||
bindings: | ||
- name: EventType | ||
path: ../../../../constants | ||
- path: ../../bindings/jsontemplate | ||
- name: defaultRequestConfig | ||
path: ../../../../v0/util | ||
- name: removeUndefinedNullValuesAndEmptyObjectArray | ||
path: ../../../../v0/util | ||
- name: removeUndefinedAndNullValues | ||
path: ../../../../v0/util | ||
- path: ./utils | ||
- path: lodash | ||
name: cloneDeep | ||
|
||
steps: | ||
- name: messageType | ||
template: | | ||
.message.type.toLowerCase(); | ||
- name: validateInput | ||
template: | | ||
let messageType = $.outputs.messageType; | ||
$.assert(messageType, "message Type is not present. Aborting"); | ||
$.assert(messageType in {{$.EventType.([.TRACK, .IDENTIFY])}}, "message type " + messageType + " is not supported"); | ||
$.assertConfig(.destination.Config.bluecoreNamespace, "[BLUECORE] account namespace required for Authentication."); | ||
- name: prepareIdentifyPayload | ||
condition: $.outputs.messageType === {{$.EventType.IDENTIFY}} | ||
template: | | ||
const payload = $.constructProperties(.message); | ||
payload.token = .destination.Config.bluecoreNamespace; | ||
$.verifyPayload(payload, .message); | ||
payload.event = payload.event ?? 'customer_patch'; | ||
payload.properties.distinct_id = $.populateAccurateDistinctId(payload, .message); | ||
$.context.payloads = [$.removeUndefinedAndNullValues(payload)]; | ||
- name: handleTrackEvent | ||
condition: $.outputs.messageType === {{$.EventType.TRACK}} | ||
steps: | ||
- name: validateInput | ||
description: Additional validation for Track events | ||
template: | | ||
$.assert(.message.event, "event_name could not be mapped. Aborting.") | ||
- name: deduceEventNames | ||
template: | | ||
$.context.deducedEventNameArray = $.deduceTrackEventName(.message.event,.destination.Config) | ||
- name: preparePayload | ||
template: | | ||
const payload = $.constructProperties(.message); | ||
$.context.payloads = $.context.deducedEventNameArray@eventName.( | ||
const newPayload = $.cloneDeep(payload); | ||
newPayload.properties.distinct_id = $.populateAccurateDistinctId(newPayload, ^.message); | ||
const temporaryProductArray = newPayload.properties.products ?? $.createProductForStandardEcommEvent(^.message, eventName); | ||
newPayload.properties.products = $.normalizeProductArray(temporaryProductArray); | ||
newPayload.event = eventName; | ||
newPayload.token = ^.destination.Config.bluecoreNamespace; | ||
$.verifyPayload(newPayload, ^.message); | ||
$.removeUndefinedNullValuesAndEmptyObjectArray(newPayload) | ||
)[]; | ||
- name: buildResponse | ||
template: | | ||
$.context.payloads.( | ||
const response = $.defaultRequestConfig(); | ||
response.body.JSON = .; | ||
response.method = "POST"; | ||
response.endpoint = "https://api.bluecore.com/api/track/mobile/v1"; | ||
response.headers = { | ||
"Content-Type": "application/json" | ||
}; | ||
response | ||
) |
Oops, something went wrong.