Skip to content

Commit

Permalink
Merge branch 'develop' into feat.oneSignal_router_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 authored Nov 1, 2023
2 parents 78773b3 + c38f14f commit abecf18
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 44 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.47.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.46.5...v1.47.0) (2023-10-30)


### Features

* add custom utm parameters to mixpanel ([#2771](https://github.com/rudderlabs/rudder-transformer/issues/2771)) ([9c4fcd3](https://github.com/rudderlabs/rudder-transformer/commit/9c4fcd3595534a8b563df3467e23c94c580f08a6))
* add support filtering component tests by feature and index ([#2748](https://github.com/rudderlabs/rudder-transformer/issues/2748)) ([146f1c6](https://github.com/rudderlabs/rudder-transformer/commit/146f1c63db4e895c7d5ce2848a1b60e7c5bb9fb6))
* onboard destination ortto ([#2730](https://github.com/rudderlabs/rudder-transformer/issues/2730)) ([9be5740](https://github.com/rudderlabs/rudder-transformer/commit/9be5740d8670890b0318da3d37f258ddc5e35445))
* onboard facebook custom audience to transformer proxy ([#2769](https://github.com/rudderlabs/rudder-transformer/issues/2769)) ([14c5e40](https://github.com/rudderlabs/rudder-transformer/commit/14c5e40284af7df9e4f5b262ad226dd3afef226e))
* add custom event name support in pinterest v5 ([#2773](https://github.com/rudderlabs/rudder-transformer/pull/2773)) ([a586a92](https://github.com/rudderlabs/rudder-transformer/commit/a586a92bf410679d0f3aa7012d4d10f8e2f515d5))


### Bug Fixes

* bugsnag error for salesforce ([#2753](https://github.com/rudderlabs/rudder-transformer/issues/2753)) ([a2ccdad](https://github.com/rudderlabs/rudder-transformer/commit/a2ccdad52a1fb88f962745800cb45d605b5e0bf3))
* oom kill while stringifying large response json ([#2754](https://github.com/rudderlabs/rudder-transformer/issues/2754)) ([c8baf5b](https://github.com/rudderlabs/rudder-transformer/commit/c8baf5b2b6325d9e30200339055dcbefd780936c))
* salesforce: handle ECONNABORTED error ([#2732](https://github.com/rudderlabs/rudder-transformer/issues/2732)) ([6b23a9b](https://github.com/rudderlabs/rudder-transformer/commit/6b23a9b33acd28fdacaa2390c1970a1fa4415ffa))

### [1.46.5](https://github.com/rudderlabs/rudder-transformer/compare/v1.46.4...v1.46.5) (2023-10-23)


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.46.5",
"version": "1.47.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
6 changes: 2 additions & 4 deletions src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,8 @@ steps:
eventNames = $.convertToSnakeCase(eventNames);
eventNames.length === 0 ? eventNames = $.ecomEventMaps.(){eventInLowerCase in .src}.dest[] ?? [];
(eventNames.length === 0 && .destination.Config.sendAsCustomEvent) ? eventNames = ["custom"];
(eventNames.length === 0 && $.outputs.apiVersion === {{$.API_VERSION.v3}}) ? eventNames = [event];
$.assertConfig(eventNames.length > 0,
event + " is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting")
eventNames
eventNames.length === 0 ? eventNames = [event];
eventNames;
- name: payload
template: |
Expand Down
18 changes: 6 additions & 12 deletions src/v0/destinations/pinterest_tag/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const convertToSnakeCase = (eventName) =>
const deduceTrackScreenEventName = (message, Config) => {
let eventName;
const { event, name } = message;
const { apiVersion = API_VERSION.v3, eventsMapping, sendAsCustomEvent } = Config;
const { eventsMapping, sendAsCustomEvent } = Config;
const trackEventOrScreenName = event || name;
if (!trackEventOrScreenName) {
throw new InstrumentationError('event_name could not be mapped. Aborting');
Expand Down Expand Up @@ -209,17 +209,11 @@ const deduceTrackScreenEventName = (message, Config) => {
return ['custom'];
}

if (apiVersion === API_VERSION.v3) {
/*
Step 4: In case both of the above stated cases fail, will send the event name as it is.
This is going to be reflected as "unknown" event in conversion API dashboard.
*/
return [trackEventOrScreenName];
}

throw new ConfigurationError(
`${event} is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting`,
);
/*
Step 4: In case all of the above stated cases failed, will send the event name as it is.
This is going to be reflected as "unknown" event in conversion API dashboard.
*/
return [trackEventOrScreenName];
};

/**
Expand Down
65 changes: 59 additions & 6 deletions test/__tests__/data/pinterest_tag_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,12 @@
"advertiser_id": "123456",
"app_id": "429047995",
"custom_data": {
"contents": [{ "item_price": "undefined", "quantity": 1 }],
"contents": [
{
"item_price": "undefined",
"quantity": 1
}
],
"currency": "USD",
"num_items": 0,
"order_id": "50314b8e9bcf000000000000",
Expand All @@ -698,7 +703,9 @@
},
"endpoint": "https://ct.pinterest.com/events/v3",
"files": {},
"headers": { "Content-Type": "application/json" },
"headers": {
"Content-Type": "application/json"
},
"method": "POST",
"params": {},
"type": "REST",
Expand Down Expand Up @@ -906,8 +913,54 @@
"statusCode": 400,
"error": "Conversion Token not found. Aborting"
},
{
"statusCode": 400,
"error": "custom event is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting"
}
[
{
"version": "1",
"type": "REST",
"method": "POST",
"endpoint": "https://api.pinterest.com/v5/ad_accounts/accountId123/events",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer conversionToken123"
},
"params": {},
"body": {
"JSON": {
"event_name": "custom event",
"event_time": 1597383030,
"action_source": "web",
"event_id": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9",
"app_id": "429047995",
"user_data": {
"em": ["48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"],
"ph": ["d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b"],
"ln": ["dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251"],
"fn": ["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"],
"ct": ["6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85"],
"st": ["3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd"],
"zp": ["1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c"],
"country": ["582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf"],
"hashed_maids": ["6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090"],
"client_user_agent": "chrome"
},
"custom_data": {
"currency": "USD",
"value": "27.5",
"order_id": "50314b8e9bcf000000000000",
"num_items": 0,
"contents": [
{
"quantity": 1,
"item_price": "undefined"
}
]
}
},
"JSON_ARRAY": {},
"XML": {},
"FORM": {}
},
"files": {}
}
]
]
60 changes: 51 additions & 9 deletions test/integrations/destinations/pinterest_tag/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3417,16 +3417,58 @@ export const data = [
body: [
{
metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' },
error:
"custom event is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting: Workflow: procWorkflow, Step: eventNames, ChildStep: undefined, OriginalError: custom event is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting",
statTags: {
destType: 'PINTEREST_TAG',
errorCategory: 'platform',
feature: 'processor',
implementation: 'cdkV2',
module: 'destination',
output: {
body: {
JSON: {
event_time: 1597383030,
action_source: 'web',
event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
app_id: '429047995',
user_data: {
em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'],
ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'],
ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'],
fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'],
ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'],
st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'],
zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'],
country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'],
hashed_maids: [
'6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090',
],
client_user_agent: 'chrome',
},
custom_data: {
num_items: 0,
contents: [
{
quantity: 1,
item_price: 'undefined',
},
],
currency: 'USD',
value: '27.5',
order_id: '50314b8e9bcf000000000000',
},
event_name: 'custom event',
},
JSON_ARRAY: {},
XML: {},
FORM: {},
},
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer conversionToken123',
},
params: {},
files: {},
userId: '',
},
statusCode: 400,
statusCode: 200,
},
],
},
Expand Down
61 changes: 51 additions & 10 deletions test/integrations/destinations/pinterest_tag/step/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3339,17 +3339,58 @@ export const data = [
status: 200,
body: [
{
error:
"custom event is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting",
statTags: {
destType: 'PINTEREST_TAG',
errorCategory: 'dataValidation',
errorType: 'configuration',
feature: 'processor',
implementation: 'native',
module: 'destination',
output: {
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer conversionToken123',
},
params: {},
body: {
JSON: {
event_name: 'custom event',
event_time: 1597383030,
action_source: 'web',
event_id: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
app_id: '429047995',
user_data: {
em: ['48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08'],
ph: ['d164bbe036663cb5c96835e9ccc6501e9a521127ea62f6359744928ba932413b'],
ln: ['dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251'],
fn: ['9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'],
ct: ['6689106ca7922c30b2fd2c175c85bc7fc2d52cc4941bdd7bb622c6cdc6284a85'],
st: ['3b45022ab36728cdae12e709e945bba267c50ee8a91e6e4388539a8e03a3fdcd'],
zp: ['1a4292e00780e18d00e76fde9850aee5344e939ba593333cd5e4b4aa2cd33b0c'],
country: ['582967534d0f909d196b97f9e6921342777aea87b46fa52df165389db1fb8ccf'],
hashed_maids: [
'6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090',
],
client_user_agent: 'chrome',
},
custom_data: {
currency: 'USD',
value: '27.5',
order_id: '50314b8e9bcf000000000000',
num_items: 0,
contents: [
{
quantity: 1,
item_price: 'undefined',
},
],
},
},
JSON_ARRAY: {},
XML: {},
FORM: {},
},
files: {},
userId: '',
},
statusCode: 400,
statusCode: 200,
},
],
},
Expand Down

0 comments on commit abecf18

Please sign in to comment.