Skip to content

Commit

Permalink
chore(release): pull release/v1.80.0 into main (#3771)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored Oct 3, 2024
2 parents 4c0c681 + 028e7fc commit e0238d1
Show file tree
Hide file tree
Showing 51 changed files with 7,516 additions and 1,600 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.80.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.79.1...v1.80.0) (2024-09-30)


### Features

* add unity source support in Singular ([#3634](https://github.com/rudderlabs/rudder-transformer/issues/3634)) ([12996d7](https://github.com/rudderlabs/rudder-transformer/commit/12996d7a7ce23de7c150c1c1e012d4dda8668977))
* onboard shopify to v1 ([#3665](https://github.com/rudderlabs/rudder-transformer/issues/3665)) ([d40e772](https://github.com/rudderlabs/rudder-transformer/commit/d40e772f1a3741c1c4e9ab2365ed464b3988812e))


### Bug Fixes

* add correct validation for purchase events ([#3766](https://github.com/rudderlabs/rudder-transformer/issues/3766)) ([9cc72f2](https://github.com/rudderlabs/rudder-transformer/commit/9cc72f2288f99ee394977ffeb209faaae657f6d2))
* braze include fields_to_export to lookup users ([#3761](https://github.com/rudderlabs/rudder-transformer/issues/3761)) ([173b989](https://github.com/rudderlabs/rudder-transformer/commit/173b9895fb2a0bed615f6e3a9c670abe42d5754f))
* correct typo for order fulfillment event, add test ([#3764](https://github.com/rudderlabs/rudder-transformer/issues/3764)) ([6f92bd3](https://github.com/rudderlabs/rudder-transformer/commit/6f92bd31b60caaa07d18bb86ce5939cd7cc9a416))
* fixing lytics user_id and anonymousId mapping ([#3745](https://github.com/rudderlabs/rudder-transformer/issues/3745)) ([45b1067](https://github.com/rudderlabs/rudder-transformer/commit/45b1067d81f3883e19d35634ffec52434fef452f))
* payment info entered event in facebook_conversions ([#3762](https://github.com/rudderlabs/rudder-transformer/issues/3762)) ([7fa7c8d](https://github.com/rudderlabs/rudder-transformer/commit/7fa7c8d3a4f6aefb580cf0de2e64e2f8aef5b5ce))
* posthog alias mapping swap ([#3765](https://github.com/rudderlabs/rudder-transformer/issues/3765)) ([b6240d0](https://github.com/rudderlabs/rudder-transformer/commit/b6240d06a9d1f7f3bc8f245807f72a72ab40f170)), closes [#3507](https://github.com/rudderlabs/rudder-transformer/issues/3507)

### [1.79.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.79.0...v1.79.1) (2024-09-24)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.79.1",
"version": "1.80.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/v2/destinations/bluecore/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ const verifyPayload = (payload, message) => {
}
break;
case 'purchase':
if (!payload?.properties?.order_id) {
if (!isDefinedAndNotNull(payload?.properties?.order_id)) {
throw new InstrumentationError(
'[Bluecore] property:: order_id is required for purchase event',
);
}
if (!payload?.properties?.total) {
if (!isDefinedAndNotNull(payload?.properties?.total)) {
throw new InstrumentationError(
'[Bluecore] property:: total is required for purchase event',
);
Expand Down
9 changes: 9 additions & 0 deletions src/cdk/v2/destinations/lytics/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { getMappingConfig } from '../../../../v0/util';

const CONFIG_CATEGORIES = {
CUSTOMER_PROPERTIES_CONFIG: { name: 'LYTICSIdentifyConfig' },
};

const MAPPING_CONFIG = getMappingConfig(CONFIG_CATEGORIES, __dirname);
export const CUSTOMER_PROPERTIES_CONFIG =
MAPPING_CONFIG[CONFIG_CATEGORIES.CUSTOMER_PROPERTIES_CONFIG.name];
25 changes: 25 additions & 0 deletions src/cdk/v2/destinations/lytics/data/LYTICSIdentifyConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[
{
"destKey": "user_id",
"sourceKeys": "userIdOnly",
"sourceFromGenericMap": true,
"required": false
},
{
"destKey": "anonymous_id",
"sourceKeys": "anonymousId",
"required": false
},
{
"destKey": "first_name",
"sourceKeys": "firstName",
"sourceFromGenericMap": true,
"required": false
},
{
"destKey": "last_name",
"sourceKeys": "lastName",
"sourceFromGenericMap": true,
"required": false
}
]
16 changes: 9 additions & 7 deletions src/cdk/v2/destinations/lytics/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ bindings:
path: ../../../../v0/util
- name: removeUndefinedAndNullValues
path: ../../../../v0/util
- name: constructPayload
path: ../../../../v0/util
- path: ../../bindings/jsontemplate
- name: defaultRequestConfig
path: ../../../../v0/util
- path: ./config

steps:
- name: validateInput
Expand All @@ -24,20 +27,19 @@ steps:
condition: $.context.messageType === {{$.EventType.IDENTIFY}}
template: |
const flattenTraits = $.flattenJson(.message.traits ?? .message.context.traits);
$.context.payload = .message.({
const payload = $.constructPayload(.message, $.CUSTOMER_PROPERTIES_CONFIG);
$.context.payload = {
...flattenTraits,
first_name: {{{{$.getGenericPaths("firstName")}}}},
last_name: {{{{$.getGenericPaths("lastName")}}}},
user_id: {{{{$.getGenericPaths("userId")}}}}
})
...payload,
}
else:
name: payloadForOthers
template: |
const flattenProperties = $.flattenJson(.message.properties);
const customerPropertiesInfo = $.constructPayload(.message, $.CUSTOMER_PROPERTIES_CONFIG);
$.context.payload = .message.({
...flattenProperties,
first_name: .properties.firstName ?? .properties.firstname,
last_name: .properties.lastName ?? .properties.lastname
...customerPropertiesInfo
})
- name: trackPayload
condition: $.context.messageType === {{$.EventType.TRACK}}
Expand Down
14 changes: 14 additions & 0 deletions src/v0/destinations/braze/braze.util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,20 @@ describe('dedup utility tests', () => {
{
external_ids: ['user1', 'user2'],
user_aliases: [{ alias_name: 'user3', alias_label: 'rudder_id' }],
fields_to_export: [
'created_at',
'custom_attributes',
'dob',
'email',
'first_name',
'gender',
'home_city',
'last_name',
'phone',
'time_zone',
'external_id',
'user_aliases',
],
},
{
headers: {
Expand Down
21 changes: 19 additions & 2 deletions src/v0/destinations/braze/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,36 @@ const BrazeDedupUtility = {
const identfierChunks = _.chunk(identifiers, 50);
return identfierChunks;
},

getFieldsToExport() {
return [
'created_at',
'custom_attributes',
'dob',
'email',
'first_name',
'gender',
'home_city',
'last_name',
'phone',
'time_zone',
'external_id',
'user_aliases',
// 'country' and 'language' not needed because it is not billable so we don't use it
];
},
async doApiLookup(identfierChunks, { destination, metadata }) {
return Promise.all(
identfierChunks.map(async (ids) => {
const externalIdentifiers = ids.filter((id) => id.external_id);
const aliasIdentifiers = ids.filter((id) => id.alias_name !== undefined);

const fieldsToExport = this.getFieldsToExport();
const { processedResponse: lookUpResponse } = await handleHttpRequest(
'post',
`${getEndpointFromConfig(destination)}/users/export/ids`,
{
external_ids: externalIdentifiers.map((extId) => extId.external_id),
user_aliases: aliasIdentifiers,
fields_to_export: fieldsToExport,
},
{
headers: {
Expand Down
27 changes: 21 additions & 6 deletions src/v0/destinations/facebook_conversions/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,31 @@ const validateProductSearchedData = (eventTypeCustomData) => {
}
};

const getProducts = (message, category) => {
let products = message.properties?.products;
if (['product added', 'product viewed', 'products searched'].includes(category.type)) {
return [message.properties];
}
if (
['payment info entered', 'product added to wishlist'].includes(category.type) &&
!Array.isArray(products)
) {
products = [message.properties];
}
return products;
};

const populateCustomDataBasedOnCategory = (customData, message, category, categoryToContent) => {
let eventTypeCustomData = {};
if (category.name) {
eventTypeCustomData = constructPayload(message, MAPPING_CONFIG[category.name]);
}
const products = getProducts(message, category);

switch (category.type) {
case 'product list viewed': {
const { contentIds, contents } = populateContentsAndContentIDs(
message.properties?.products,
products,
message.properties?.quantity,
);

Expand Down Expand Up @@ -119,9 +134,7 @@ const populateCustomDataBasedOnCategory = (customData, message, category, catego
}
case 'product added':
case 'product viewed':
case 'products searched':
case 'payment info entered':
case 'product added to wishlist': {
case 'products searched': {
const contentCategory = eventTypeCustomData.content_category;
const contentType =
message.properties?.content_type ||
Expand All @@ -131,7 +144,7 @@ const populateCustomDataBasedOnCategory = (customData, message, category, catego
categoryToContent,
DESTINATION.toLowerCase(),
);
const { contentIds, contents } = populateContentsAndContentIDs([message.properties]);
const { contentIds, contents } = populateContentsAndContentIDs(products);
eventTypeCustomData = {
...eventTypeCustomData,
content_ids: contentIds.length === 1 ? contentIds[0] : contentIds,
Expand All @@ -142,10 +155,12 @@ const populateCustomDataBasedOnCategory = (customData, message, category, catego
validateProductSearchedData(eventTypeCustomData);
break;
}
case 'payment info entered':
case 'product added to wishlist':
case 'order completed':
case 'checkout started': {
const { contentIds, contents } = populateContentsAndContentIDs(
message.properties?.products,
products,
message.properties?.quantity,
message.properties?.delivery_category,
);
Expand Down
27 changes: 0 additions & 27 deletions src/v0/destinations/lytics/config.js

This file was deleted.

19 changes: 0 additions & 19 deletions src/v0/destinations/lytics/data/LYTICSIdentifyConfig.json

This file was deleted.

12 changes: 0 additions & 12 deletions src/v0/destinations/lytics/data/LYTICSPageScreenConfig.json

This file was deleted.

12 changes: 0 additions & 12 deletions src/v0/destinations/lytics/data/LYTICSTrackConfig.json

This file was deleted.

Loading

0 comments on commit e0238d1

Please sign in to comment.