Skip to content

Commit

Permalink
Merge branch 'develop' into feat.hs-handle-partial-error
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored Apr 26, 2024
2 parents 722f3d1 + 038c1aa commit a09afd6
Show file tree
Hide file tree
Showing 23 changed files with 4,509 additions and 7,943 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.63.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.62.2...v1.63.0) (2024-04-25)


### Features

* remove redundant data from traits in hubspot ([#3310](https://github.com/rudderlabs/rudder-transformer/issues/3310)) ([4b21f13](https://github.com/rudderlabs/rudder-transformer/commit/4b21f1353d3d9a431a0d5446d019f66a543b977b))

### [1.62.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.62.1...v1.62.2) (2024-04-18)


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.62.2",
"version": "1.63.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
6 changes: 3 additions & 3 deletions src/cdk/v2/destinations/bloomreach/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps:
const userId = .message.().(
{{{{$.getGenericPaths("userIdOnly")}}}};
);
$.assert(userId ?? .message.anonymousId, "Either one of userId or anonymousId is required. Aborting");
$.assert(userId || .message.anonymousId, "Either one of userId or anonymousId is required. Aborting");
- name: prepareIdentifyPayload
condition: $.context.messageType === {{$.EventType.IDENTIFY}}
Expand All @@ -64,7 +64,7 @@ steps:
- name: pageEventName
condition: $.context.messageType === {{$.EventType.PAGE}}
template: |
const category = .message.category ?? .message.properties.category;
const category = .message.category || .message.properties.category;
const name = .message.name || .message.properties.name;
const eventNameArray = ["Viewed"];
category ? eventNameArray.push(category);
Expand All @@ -74,7 +74,7 @@ steps:
- name: screenEventName
condition: $.context.messageType === {{$.EventType.SCREEN}}
template: |
const category = .message.category ?? .message.properties.category;
const category = .message.category || .message.properties.category;
const name = .message.name || .message.properties.name;
const eventNameArray = ["Viewed"];
category ? eventNameArray.push(category);
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/v2/destinations/movable_ink/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ steps:
{{{{$.getGenericPaths("email")}}}};
);
$.assert(userId ?? email ?? .message.anonymousId, "Either one of userId or email or anonymousId is required. Aborting");
$.assert(userId || email || .message.anonymousId, "Either one of userId or email or anonymousId is required. Aborting");
$.validateEventPayload(.message);
- name: preparePayload
Expand All @@ -50,7 +50,7 @@ steps:
));
$.context.payload = {
...(.message),
userId: userId ?? email,
userId: userId || email,
timestamp: timestampInUnix,
anonymousId: .message.anonymousId
}
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/hs/HSTransform-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ const processIdentify = async (message, destination, propertyMap) => {
GENERIC_TRUE_VALUES.includes(mappedToDestination.toString()) &&
operation
) {
addExternalIdToHSTraits(message);
if (!objectType) {
throw new InstrumentationError('objectType not found');
}
if (operation === 'createObject') {
addExternalIdToHSTraits(message);
endpoint = CRM_CREATE_UPDATE_ALL_OBJECTS.replace(':objectType', objectType);
} else if (operation === 'updateObject' && getHsSearchId(message)) {
const { hsSearchId } = getHsSearchId(message);
Expand Down
59 changes: 58 additions & 1 deletion test/integrations/destinations/bloomreach/processor/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const page: ProcessorTestData[] = [
{
id: 'bloomreach-page-test-1',
name: destType,
description: 'Page call with category, name',
description: 'Page call with category from properties and root-level name',
scenario: 'Framework+Business',
successCriteria:
'Response should contain event_name = "Viewed {{ category }} {{ name }} Page" and properties and status code should be 200',
Expand Down Expand Up @@ -69,4 +69,61 @@ export const page: ProcessorTestData[] = [
},
},
},
{
id: 'bloomreach-page-test-2',
name: destType,
description: 'Page call with category, name from properties',
scenario: 'Framework+Business',
successCriteria:
'Response should contain event_name = "Viewed {{ category }} {{ name }} Page" and properties and status code should be 200',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
destination,
message: {
type: 'page',
anonymousId: 'anonId123',
name: '',
properties: { ...properties, name: 'Integration' },
integrations: {
All: true,
},
originalTimestamp: '2024-03-04T15:32:56.409Z',
},
metadata: generateMetadata(1),
},
],
},
},
output: {
response: {
status: 200,
body: [
{
output: transformResultBuilder({
method: 'POST',
userId: '',
endpoint,
headers,
JSON: {
data: {
customer_ids: { cookie: 'anonId123' },
properties: { ...properties, name: 'Integration' },
timestamp: 1709566376,
event_type: 'Viewed Docs Integration Page',
},
name: 'customers/events',
},
}),
statusCode: 200,
metadata: generateMetadata(1),
},
],
},
},
},
];
78 changes: 76 additions & 2 deletions test/integrations/destinations/bloomreach/processor/validation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { ProcessorTestData } from '../../../testTypes';
import { generateMetadata } from '../../../testUtils';
import { destType, destination, processorInstrumentationErrorStatTags } from '../common';
import { generateMetadata, transformResultBuilder } from '../../../testUtils';
import {
destType,
destination,
processorInstrumentationErrorStatTags,
traits,
headers,
endpoint,
} from '../common';

export const validation: ProcessorTestData[] = [
{
Expand Down Expand Up @@ -128,4 +135,71 @@ export const validation: ProcessorTestData[] = [
},
},
},
{
id: 'bloomreach-validation-test-4',
name: destType,
description: 'Empty userId and non empty anonymousId',
scenario: 'Framework',
successCriteria: 'Response should contain all the mapping and status code should be 200',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
destination,
message: {
type: 'identify',
userId: '',
anonymousId: 'anonId123',
traits,
integrations: {
All: true,
},
originalTimestamp: '2024-03-04T15:32:56.409Z',
},
metadata: generateMetadata(1),
},
],
},
},
output: {
response: {
status: 200,
body: [
{
output: transformResultBuilder({
method: 'POST',
userId: '',
endpoint,
headers,
JSON: {
data: {
customer_ids: { registered: '', cookie: 'anonId123' },
properties: {
email: '[email protected]',
first_name: 'John',
last_name: 'Doe',
phone: '1234567890',
city: 'New York',
country: 'USA',
address: {
city: 'New York',
country: 'USA',
pinCode: '123456',
},
},
update_timestamp: 1709566376,
},
name: 'customers',
},
}),
statusCode: 200,
metadata: generateMetadata(1),
},
],
},
},
},
];
1 change: 0 additions & 1 deletion test/integrations/destinations/hs/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,6 @@ export const data = [
firstname: 'Test Hubspot',
anonymousId: '12345',
country: 'India',
email: '[email protected]',
},
},
XML: {},
Expand Down
1 change: 0 additions & 1 deletion test/integrations/destinations/hs/router/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,6 @@ export const data = [
firstname: 'Test Hubspot',
anonymousId: '12345',
country: 'India',
email: '[email protected]',
},
id: '103605',
},
Expand Down
Loading

0 comments on commit a09afd6

Please sign in to comment.