Skip to content

Commit

Permalink
chore: merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
yashasvibajpai committed Oct 18, 2023
2 parents ea12af1 + 8542960 commit e329c5e
Show file tree
Hide file tree
Showing 38 changed files with 3,154 additions and 538 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-hotfix-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823')
if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116')
steps:
- name: Create Branch
uses: peterjgrainger/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

# Only allow release stakeholders to initiate releases
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823')
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116')
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-for-prod-rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

# Only allow to be deployed from tags and main branch
# Only allow specific actors to trigger
if: (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/main')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs')
if: (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/main')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'chandumlg') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'chandumlg')

steps:
- name: Get Target Version
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

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.45.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.45.2...v1.45.3) (2023-10-17)


### Bug Fixes

* ut metadata map ts type ([c8d3882](https://github.com/rudderlabs/rudder-transformer/commit/c8d3882baccc57d7b892c55ff9811c951afb5ec6))

### [1.45.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.45.1...v1.45.2) (2023-10-17)


### Bug Fixes

* add event metadata to 298 status code responses ([f0493dc](https://github.com/rudderlabs/rudder-transformer/commit/f0493dccfd47bfe1897ebcec27141e2df31393c0))

### [1.45.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.45.0...v1.45.1) (2023-10-17)


### Bug Fixes

* **clevertap:** invalid parameters ordering issue ([a70d4db](https://github.com/rudderlabs/rudder-transformer/commit/a70d4db57b302abc710907aadb8570944d54165a))
* **clevertap:** parameters ordering issue ([#2727](https://github.com/rudderlabs/rudder-transformer/issues/2727)) ([bd6e096](https://github.com/rudderlabs/rudder-transformer/commit/bd6e096db3dc6b9bd2d607084b8a38ff315fab9c))

## [1.45.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.44.2...v1.45.0) (2023-10-11)


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.45.0",
"version": "1.45.3",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
8 changes: 8 additions & 0 deletions src/constants/destinationCanonicalNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ const DestHandlerMap = {
};

const DestCanonicalNames = {
facebook_conversions: [
'fb_conversions',
'fb conversions',
'FacebookConversions',
'Facebook Conversions',
'FB Conversions',
'Facebook_Conversions',
],
fb_pixel: [
'fb_pixel',
'fb pixel',
Expand Down
14 changes: 11 additions & 3 deletions src/services/userTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ProcessorTransformationResponse,
UserTransformationResponse,
UserTransformationServiceResponse,
MessageIdMetadataMap,
} from '../types/index';
import {
RespStatusError,
Expand Down Expand Up @@ -49,8 +50,15 @@ export default class UserTransformService {
const eventsToProcess = destEvents as ProcessorTransformationRequest[];
const transformationVersionId =
eventsToProcess[0]?.destination?.Transformations[0]?.VersionID;
const messageIds = eventsToProcess.map((ev) => ev.metadata?.messageId);
const messageIdsSet = new Set<string>(messageIds);
const messageIds: string[] = [];
const messageIdsSet = new Set<string>();
const messageIdMetadataMap: MessageIdMetadataMap = {};
eventsToProcess.forEach((ev) => {
messageIds.push(ev.metadata?.messageId);
messageIdsSet.add(ev.metadata?.messageId);
messageIdMetadataMap[ev.metadata?.messageId] = ev.metadata;
});

const messageIdsInOutputSet = new Set<string>();

const commonMetadata = {
Expand Down Expand Up @@ -125,7 +133,7 @@ export default class UserTransformService {
const droppedEvents = messageIdsNotInOutput.map((id) => ({
statusCode: HTTP_CUSTOM_STATUS_CODES.FILTERED,
metadata: {
...commonMetadata,
...(isEmpty(messageIdMetadataMap[id]) ? commonMetadata : messageIdMetadataMap[id]),
messageId: id,
messageIds: null,
},
Expand Down
5 changes: 5 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ type Metadata = {
transformationId: string;
};

type MessageIdMetadataMap = {
[key: string]: Metadata;
};

type UserTransformationInput = {
VersionID: string;
ID: string;
Expand Down Expand Up @@ -223,6 +227,7 @@ type ComparatorInput = {

export {
Metadata,
MessageIdMetadataMap,
UserTransformationLibrary,
ProcessorTransformationRequest,
ProcessorTransformationResponse,
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/clevertap/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ const processRouterDest = (inputs, reqMetadata) => {
batchedEvents.forEach((batch) => {
const batchedRequest = generateClevertapBatchedPayload(batch.events, batch.destination);
batchResponseList.push(
getSuccessRespEvents(batchedRequest, batch.metadata, batch.destination, reqMetadata),
getSuccessRespEvents(batchedRequest, batch.metadata, batch.destination),
);
});
}
Expand Down
126 changes: 126 additions & 0 deletions src/v0/destinations/facebook_conversions/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
const { getMappingConfig } = require('../../util');

const ENDPOINT = (datasetId, accessToken) =>
`https://graph.facebook.com/v17.0/${datasetId}/events?access_token=${accessToken}`;

const CONFIG_CATEGORIES = {
USERDATA: {
standard: false,
type: 'identify',
name: 'FBCUserDataConfig',
},
COMMON: { name: 'FBCCommonConfig' },
APPDATA: { name: 'FBCAppEventsConfig' },
SIMPLE_TRACK: {
standard: false,
type: 'simple track',
name: 'FBCSimpleCustomConfig',
},
PRODUCT_LIST_VIEWED: {
standard: true,
type: 'product list viewed',
eventName: 'ViewContent',
name: 'FBCProductListViewedCustomData',
},
PRODUCT_VIEWED: {
standard: true,
type: 'product viewed',
eventName: 'ViewContent',
name: 'FBCProductViewedCustomData',
},
PRODUCT_ADDED: {
standard: true,
type: 'product added',
eventName: 'AddToCart',
name: 'FBCProductAddedCustomData',
},
ORDER_COMPLETED: {
standard: true,
type: 'order completed',
eventName: 'Purchase',
name: 'FBCOrderCompletedCustomData',
},
PRODUCTS_SEARCHED: {
standard: true,
type: 'products searched',
eventName: 'Search',
name: 'FBCProductSearchedCustomData',
},
CHECKOUT_STARTED: {
standard: true,
type: 'checkout started',
eventName: 'InitiateCheckout',
name: 'FBCCheckoutStartedCustomData',
},
PAYMENT_INFO_ENTERED: {
standard: true,
type: 'payment info entered',
eventName: 'AddPaymentInfo',
name: 'FBCPaymentInfoEnteredCustomData',
},
PRODUCT_ADDED_TO_WISHLIST: {
standard: true,
type: 'product added to wishlist',
eventName: 'AddToWishlist',
name: 'FBCProductAddedToWishlistCustomData',
},
OTHER_STANDARD: {
standard: true,
type: 'otherStandard',
name: 'FBCSimpleCustomConfig',
},
PAGE_VIEW: {
standard: true,
type: 'page_view',
eventName: 'PageView',
name: 'FBCSimpleCustomConfig',
},
};

const MAPPING_CONFIG = getMappingConfig(CONFIG_CATEGORIES, __dirname);
const ACTION_SOURCES_VALUES = [
'email',
'website',
'app',
'phone_call',
'chat',
'physical_store',
'system_generated',
'other',
];

const OTHER_STANDARD_EVENTS = [
'Lead',
'CompleteRegistration',
'Contact',
'CustomizeProduct',
'Donate',
'FindLocation',
'Schedule',
'StartTrial',
'SubmitApplication',
'Subscribe',
];

const FB_CONVERSIONS_DEFAULT_EXCLUSION = ['opt_out', 'event_id', 'action_source'];
const STANDARD_ECOMM_EVENTS_CATEGORIES = [
CONFIG_CATEGORIES.PRODUCT_LIST_VIEWED,
CONFIG_CATEGORIES.PRODUCT_VIEWED,
CONFIG_CATEGORIES.PRODUCT_ADDED,
CONFIG_CATEGORIES.ORDER_COMPLETED,
CONFIG_CATEGORIES.PRODUCTS_SEARCHED,
CONFIG_CATEGORIES.CHECKOUT_STARTED,
CONFIG_CATEGORIES.PAYMENT_INFO_ENTERED,
CONFIG_CATEGORIES.PRODUCT_ADDED_TO_WISHLIST,
];

module.exports = {
ENDPOINT,
MAPPING_CONFIG,
CONFIG_CATEGORIES,
ACTION_SOURCES_VALUES,
FB_CONVERSIONS_DEFAULT_EXCLUSION,
STANDARD_ECOMM_EVENTS_CATEGORIES,
OTHER_STANDARD_EVENTS,
DESTINATION: 'FACEBOOK_CONVERSIONS',
};
101 changes: 101 additions & 0 deletions src/v0/destinations/facebook_conversions/data/FBCAppEventsConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
[
{
"destKey": "advertiser_tracking_enabled",
"sourceKeys": "context.device.adTrackingEnabled",
"required": true
},
{
"destKey": "application_tracking_enabled",
"sourceKeys": "properties.application_tracking_enabled",
"required": true
},
{
"destKey": "extinfo.0",
"sourceKeys": "context.device.type",
"required": true,
"metadata": {
"type": "toLower"
}
},
{
"destKey": "extinfo.1",
"sourceKeys": "context.app.namespace"
},
{
"destKey": "extinfo.2",
"sourceKeys": "context.app.build"
},
{
"destKey": "extinfo.3",
"sourceKeys": "context.app.version"
},
{
"destKey": "extinfo.4",
"sourceKeys": "context.os.version",
"required": true
},
{
"destKey": "extinfo.5",
"sourceKeys": "context.device.model"
},
{
"destKey": "extinfo.6",
"sourceKeys": "context.locale"
},
{
"destKey": "extinfo.7",
"sourceKeys": "context.abv_timezone"
},
{
"destKey": "extinfo.8",
"sourceKeys": "context.network.carrier"
},
{
"destKey": "extinfo.9",
"sourceKeys": "context.screen.width"
},
{
"destKey": "extinfo.10",
"sourceKeys": "context.screen.height"
},
{
"destKey": "extinfo.11",
"sourceKeys": "context.screen.density"
},
{
"destKey": "extinfo.12",
"sourceKeys": "context.cpu_cores"
},
{
"destKey": "extinfo.13",
"sourceKeys": "context.ext_storage_size"
},
{
"destKey": "extinfo.14",
"sourceKeys": "context.avl_storage_size"
},
{
"destKey": "extinfo.15",
"sourceKeys": "context.timezone"
},
{
"destKey": "campaign_ids",
"sourceKeys": ["properties.campaignId", "context.traits.campaignId", "context.campaign.name"]
},
{
"destKey": "install_referrer",
"sourceKeys": "properties.install_referrer"
},
{
"destKey": "installer_package",
"sourceKeys": "properties.installer_package"
},
{
"destKey": "url_schemes",
"sourceKeys": "properties.url_schemes"
},
{
"destKey": "windows_attribution_id",
"sourceKeys": "properties.windows_attribution_id"
}
]
Loading

0 comments on commit e329c5e

Please sign in to comment.