Skip to content

Commit

Permalink
chore(release): pull release/v1.22.0 into main (#2046)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 authored Apr 11, 2023
2 parents 9b926c0 + 56d55d8 commit c01cfc7
Show file tree
Hide file tree
Showing 75 changed files with 32,770 additions and 1,945 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ jobs:
source_branch_name=${GITHUB_REF##*/}
release_type=release
grep -q "hotfix/" <<< "${GITHUB_REF}" && release_type=hotfix-release
git fetch origin main --depth=1
git fetch origin main
git fetch --tags origin
git merge origin/main
current_version=$(jq -r .version package.json)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PAT }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.PAT }}
run: |
git fetch --tags origin
git tag -a v${{ steps.extract-version.outputs.release_version }} -m "chore: release v${{ steps.extract-version.outputs.release_version }}"
git push origin refs/tags/v${{ steps.extract-version.outputs.release_version }}
npm run release:github
Expand Down
971 changes: 32 additions & 939 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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.21.0",
"version": "1.22.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
1 change: 1 addition & 0 deletions src/v0/destinations/clevertap/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const CLEVERTAP_DEFAULT_EXCLUSION = [
'userId',
'id',
'ts',
'overrideFields',
];
// ref : https://developer.clevertap.com/docs/disassociate-api
const DEL_MAX_BATCH_SIZE = 100;
Expand Down
24 changes: 22 additions & 2 deletions src/v0/destinations/clevertap/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const responseWrapper = (payload, destination) => {
* @returns
* return the final payload after converting to the relevant data-types.
*/
const convertObjectAndArrayToString = (payload) => {
const convertObjectAndArrayToString = (payload, event) => {
const finalPayload = {};
if (payload) {
Object.keys(payload).forEach((key) => {
Expand All @@ -89,6 +89,15 @@ const convertObjectAndArrayToString = (payload) => {
finalPayload[key] = payload[key];
}
});
if (event === 'Charged' && finalPayload.Items) {
finalPayload.Items = JSON.parse(finalPayload.Items);
if (
!Array.isArray(finalPayload.Items) ||
(Array.isArray(finalPayload.Items) && typeof finalPayload.Items[0] !== 'object')
) {
throw new InstrumentationError('Products property value must be an array of objects');
}
}
}
return finalPayload;
};
Expand Down Expand Up @@ -208,6 +217,14 @@ const getClevertapProfile = (message, category) => {
CLEVERTAP_DEFAULT_EXCLUSION,
);
profile = convertObjectAndArrayToString(profile);

// Add additional properties being passed inside overrideFields in traits
// to be added to the profile object, to be sent into Clevertap profileData
if (message.traits?.overrideFields) {
const { overrideFields } = message.traits;
Object.assign(profile, overrideFields);
}

return removeUndefinedAndNullValues(profile);
};

Expand Down Expand Up @@ -292,7 +309,10 @@ const responseBuilderSimple = (message, category, destination) => {
eventPayload.type = 'event';
// stringify the evtData if it's an Object or array.
if (eventPayload.evtData) {
eventPayload.evtData = convertObjectAndArrayToString(eventPayload.evtData);
eventPayload.evtData = convertObjectAndArrayToString(
eventPayload.evtData,
eventPayload.evtName,
);
}

// setting identification for tracking payload here based on destination config
Expand Down
26 changes: 3 additions & 23 deletions src/v0/destinations/fb_custom_audience/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ const {
defaultDeleteRequestConfig,
checkSubsetOfArray,
isDefinedAndNotNullAndNotEmpty,
getSuccessRespEvents,
getErrorRespEvents,
returnArrayOfSubarrays,
isDefinedAndNotNull,
flattenMap,
handleRtTfSingleEventError,
simpleProcessRouterDest,
getDestinationExternalIDInfoForRetl,
} = require('../../util');

Expand Down Expand Up @@ -371,26 +369,8 @@ const processEvent = (message, destination) => {

const process = (event) => processEvent(event.message, event.destination);

const processRouterDest = (inputs, reqMetadata) => {
if (!Array.isArray(inputs) || inputs.length <= 0) {
const respEvents = getErrorRespEvents(null, 400, 'Invalid event array');
return [respEvents];
}
const respList = inputs.map((input) => {
try {
if (input.message.statusCode) {
// already transformed event
return getSuccessRespEvents(input.message, [input.metadata], input.destination);
}
const transformedList = process(input);
const responseList = transformedList.map((transformedPayload) =>
getSuccessRespEvents(transformedPayload, [input.metadata], input.destination),
);
return responseList;
} catch (error) {
return handleRtTfSingleEventError(input, error, reqMetadata);
}
});
const processRouterDest = async (inputs, reqMetadata) => {
const respList = await simpleProcessRouterDest(inputs, process, reqMetadata);
return flattenMap(respList);
};

Expand Down
18 changes: 18 additions & 0 deletions src/v0/destinations/google_adwords_offline_conversions/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@ const CALL_CONVERSION = `${BASE_ENDPOINT}:uploadCallConversions`;
// Ref - https://developers.google.com/google-ads/api/rest/reference/rest/v11/customers.googleAds/searchStream
const SEARCH_STREAM = `${BASE_ENDPOINT}/googleAds:searchStream`;

const STORE_CONVERSION_CONFIG = `${BASE_ENDPOINT}/offlineUserDataJobs`;
const CONFIG_CATEGORIES = {
TRACK_CLICK_CONVERSIONS_CONFIG: {
name: 'TrackClickConversionsConfig',
},
TRACK_CALL_CONVERSIONS_CONFIG: {
name: 'TrackCallConversionsConfig',
},
TRACK_STORE_CONVERSION_CONFIG_CREATE_JOB: {
name: 'TrackCreateJobStoreConversionsConfig',
},
TRACK_STORE_CONVERSION_CONFIG_ADD_CONVERSION: {
name: 'TrackAddStoreConversionsConfig',
},
TRACK_STORE_ADDRESS_IDENTIFIER: {
name: 'storeAddoperationAddressMap'
}
};

const CONVERSION_ACTION_ID_CACHE_TTL = process.env.CONVERSION_ACTION_ID_CACHE_TTL
Expand All @@ -41,4 +51,12 @@ module.exports = {
SEARCH_STREAM,
CONVERSION_ACTION_ID_CACHE_TTL,
CONVERSION_CUSTOM_VARIABLE_CACHE_TTL,
STORE_CONVERSION_CONFIG,
trackCreateStoreConversionsMapping:
MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_STORE_CONVERSION_CONFIG_CREATE_JOB.name],
trackAddStoreConversionsMapping:
MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_STORE_CONVERSION_CONFIG_ADD_CONVERSION.name],
trackAddStoreAddressConversionsMapping:
MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_STORE_ADDRESS_IDENTIFIER.name],

};
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[
{
"destKey": "operations.create.transaction_attribute.store_attribute.store_code",
"sourceKeys": [
"properties.store_code",
"properties.storeCode"
],
"required": false,
"metadata": {
"type": "toString"
}
},
{
"destKey": "operations.create.transaction_attribute.transaction_amount_micros",
"sourceKeys": [
"properties.conversionValue",
"properties.total",
"properties.value",
"properties.revenue"
],
"required": true,
"metadata": {
"type": "toNumber"
}
},
{
"destKey": "operations.create.transaction_attribute.order_id",
"sourceKeys": [
"properties.order_id",
"properties.orderId"
],
"required": false,
"metadata": {
"type": "toString"
}
},
{
"destKey": "operations.create.transaction_attribute.currency_code",
"sourceKeys": "properties.currency",
"required": true,
"metadata": {
"type": "toString"
}
},
{
"destKey": "operations.create.transaction_attribute.transaction_date_time",
"sourceKeys": [
"properties.transaction_date_time",
"originalTimestamp"
],
"required": true,
"metadata": {
"type": "toString"
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"destKey": "enable_match_rate_range_preview",
"sourceKeys": "properties.enable_match_rate_range_preview",
"required": false
},
{
"destKey": "job.storeSalesMetadata.loyaltyFraction",
"sourceKeys": "properties.loyaltyFraction",
"required": false,
"defaultValue":"1"
},
{
"destKey": "job.storeSalesMetadata.transaction_upload_fraction",
"sourceKeys": "properties.transaction_upload_fraction",
"required": false,
"defaultValue":"1"
},
{
"destKey": "job.storeSalesMetadata.custom_key",
"sourceKeys": "properties.custom_key",
"required": false
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[
{
"sourceKeys": "city",
"destKey": "city",
"sourceFromGenericMap": true
},
{
"sourceKeys": "state",
"destKey": "state",
"sourceFromGenericMap": true
},
{
"sourceKeys": [
"context.traits.country_code",
"properties.country_code",
"context.traits.countryCode",
"properties.countryCode"
],
"destKey": "country_code"
},
{
"sourceKeys": [
"context.traits.postal_code",
"properties.postal_code",
"context.traits.postalCode",
"properties.postalCode",
"context.traits.zipCode",
"properties.zipCode"
],
"destKey": "postal_code"
},
{
"sourceKeys": "firstName",
"destKey": "hashed_first_name",
"sourceFromGenericMap": true,
"metadata": {
"type": [
"toLower"
]
}
},
{
"destKey": "hashed_street_address",
"sourceKeys": [
"properties.streetAddress",
"context.traits.streetAddress",
"traits.street",
"context.traits.street"
],
"metadata": {
"type": [
"toLower"
]
}
},
{
"sourceKeys": "lastName",
"destKey": "hashed_last_name",
"metadata": {
"type": [
"toLower"
]
},
"sourceFromGenericMap": true
}
]
Loading

0 comments on commit c01cfc7

Please sign in to comment.