Skip to content

Commit

Permalink
Merge branch 'develop' into chore.cm360-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik authored May 21, 2024
2 parents a88b017 + ffd4958 commit 8b8b767
Show file tree
Hide file tree
Showing 74 changed files with 15,455 additions and 16,604 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1

- name: Setup Docker Buildx
Expand Down Expand Up @@ -88,6 +89,7 @@ jobs:
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1

- name: Setup Docker Buildx
Expand Down
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,53 @@

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.66.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.66.0...v1.66.1) (2024-05-20)


### Bug Fixes

* add validation for null/undefined traits in slack ([#3382](https://github.com/rudderlabs/rudder-transformer/issues/3382)) ([755073c](https://github.com/rudderlabs/rudder-transformer/commit/755073c4341a454785050d835021d9f17e0b9d3f))
* gaoc store sales batching transform contract ([#3384](https://github.com/rudderlabs/rudder-transformer/issues/3384)) ([e7678cb](https://github.com/rudderlabs/rudder-transformer/commit/e7678cbdae4c06449ea9352ce3db390d2a29da14))
* move af_currency outside properties in eventValue ([#3316](https://github.com/rudderlabs/rudder-transformer/issues/3316)) ([71c3d46](https://github.com/rudderlabs/rudder-transformer/commit/71c3d46236fff9209625cfb0737c21db2d275345))
* remove default traits from ortto ([#3389](https://github.com/rudderlabs/rudder-transformer/issues/3389)) ([fbb0811](https://github.com/rudderlabs/rudder-transformer/commit/fbb0811aa0e417b0cffcea4ecc103979afccfe74))
* update validation of event duration ([#3376](https://github.com/rudderlabs/rudder-transformer/issues/3376)) ([3ad7850](https://github.com/rudderlabs/rudder-transformer/commit/3ad78506446915ada8bdc5f5594dc2710e6b0646))

## [1.66.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.65.1...v1.66.0) (2024-05-13)


### Features

* add slack source ([#3148](https://github.com/rudderlabs/rudder-transformer/issues/3148))
* onboard monday to proxy ([#3347](https://github.com/rudderlabs/rudder-transformer/issues/3347))
* onboard emarsys destination ([#3369](https://github.com/rudderlabs/rudder-transformer/issues/3369))


### Bug Fixes

* ninetailed: modify parameter requirements and add default values ([#3364](https://github.com/rudderlabs/rudder-transformer/issues/3364))

### [1.65.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.65.0...v1.65.1) (2024-05-10)


### Bug Fixes

* update regex which was discarding firstname and lastname ([#3360](https://github.com/rudderlabs/rudder-transformer/issues/3360)) ([cb10aa7](https://github.com/rudderlabs/rudder-transformer/commit/cb10aa7707518b52edcf7fb1081c6969bcb5f8f8))

## [1.65.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.64.0...v1.65.0) (2024-05-06)


### Features

* generate anonymousId and move to component testcases ([447f85f](https://github.com/rudderlabs/rudder-transformer/commit/447f85faf6ccca2179ab33b7fe43e281fc4f5897))


### Bug Fixes

* auth0 error handling ([2e22075](https://github.com/rudderlabs/rudder-transformer/commit/2e22075ddf792c573642fd09c5f9d31d8132525b))
* auth0 error handling for missing userId ([#3334](https://github.com/rudderlabs/rudder-transformer/issues/3334)) ([d2cce77](https://github.com/rudderlabs/rudder-transformer/commit/d2cce772d6f0485ff8ee51af261006eb2066c3a2))
* braze dedup for non-billable attributes ([#3320](https://github.com/rudderlabs/rudder-transformer/issues/3320)) ([ac59fdc](https://github.com/rudderlabs/rudder-transformer/commit/ac59fdc37d6fe08847d79d249d166de7cc358fd6))
* multiple event mappings in ortto ([#3341](https://github.com/rudderlabs/rudder-transformer/issues/3341)) ([0a9a2e9](https://github.com/rudderlabs/rudder-transformer/commit/0a9a2e9e2a3029ad7b4834820ba2132d3f57ce98))

## [1.64.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.63.0...v1.64.0) (2024-04-29)


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.64.0",
"version": "1.66.1",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
24 changes: 24 additions & 0 deletions src/cdk/v2/destinations/emarsys/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const ALLOWED_OPT_IN_VALUES = ['1', '2', ''];
const groupedSuccessfulPayload = {
identify: {
method: 'PUT',
batches: [],
},
group: {
method: 'POST',
batches: [],
},
track: {
method: 'POST',
batches: [],
},
};

module.exports = {
MAX_BATCH_SIZE: 1000,
EMAIL_FIELD_ID: 3,
OPT_IN_FILED_ID: 31,
ALLOWED_OPT_IN_VALUES,
MAX_BATCH_SIZE_BYTES: 8000000, // 8 MB,
groupedSuccessfulPayload,
};
88 changes: 88 additions & 0 deletions src/cdk/v2/destinations/emarsys/procWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
bindings:
- name: EventType
path: ../../../../constants
- path: ../../bindings/jsontemplate
exportAll: true
- name: removeUndefinedValues
path: ../../../../v0/util
- name: removeUndefinedAndNullValues
path: ../../../../v0/util
- name: defaultRequestConfig
path: ../../../../v0/util
- name: getIntegrationsObj
path: ../../../../v0/util
- name: getFieldValueFromMessage
path: ../../../../v0/util
- name: CommonUtils
path: ../../../../util/common
- path: ./utils
- path: ./config
- path: lodash
name: cloneDeep

steps:
- name: checkIfProcessed
condition: .message.statusCode
template: |
$.batchMode ? .message.body.JSON : .message
onComplete: return
- name: messageType
template: |
.message.type.toLowerCase()
- name: validateInput
template: |
let messageType = $.outputs.messageType;
$.assert(messageType, "Message type is not present. Aborting message.");
$.assert(messageType in {{$.EventType.([.TRACK, .IDENTIFY, .GROUP])}},
"message type " + messageType + " is not supported")
$.assertConfig(.destination.Config.emersysUsername, "Emersys user name is not configured. Aborting");
$.assertConfig(.destination.Config.emersysUserSecret, "Emersys user secret is not configured. Aborting");
- name: validateInputForTrack
description: Additional validation for Track events
condition: $.outputs.messageType === {{$.EventType.TRACK}}
template: |
$.assert(.message.event, "event could not be mapped to conversion rule. Aborting.")
- name: preparePayloadForIdentify
description: |
Builds identify payload. ref: https://dev.emarsys.com/docs/core-api-reference/f8ljhut3ac2i1-update-contacts
condition: $.outputs.messageType === {{$.EventType.IDENTIFY}}
template: |
$.context.payload = $.buildIdentifyPayload(.message, .destination.Config,);
- name: preparePayloadForGroup
description: |
Builds group payload. ref: https://dev.emarsys.com/docs/core-api-reference/1m0m70hy3tuov-add-contacts-to-a-contact-list
condition: $.outputs.messageType === {{$.EventType.GROUP}}
template: |
$.context.payload = $.buildGroupPayload(.message, .destination.Config,);
- name: preparePayloadForTrack
description: |
Builds track payload. ref: https://dev.emarsys.com/docs/core-api-reference/fl0xx6rwfbwqb-trigger-an-external-event
condition: $.outputs.messageType === {{$.EventType.TRACK}}
template: |
const properties = ^.message.properties;
const integrationObject = $.getIntegrationsObj(^.message, 'emarsys');
const emersysIdentifierId = $.deduceCustomIdentifier(integrationObject, ^.destination.Config.emersysCustomIdentifier);
const payload = {
key_id: emersysIdentifierId,
external_id: $.deduceExternalIdValue(^.message,emersysIdentifierId,.destination.Config.fieldMapping),
trigger_id: integrationObject.trigger_id,
data: properties.data,
attachment:$.CommonUtils.toArray(properties.attachment),
event_time: $.getFieldValueFromMessage(^.message, 'timestamp'),
};
$.context.payload = {
eventType: ^.message.type,
destinationPayload: {
payload: $.removeUndefinedAndNullValues(payload),
eventId: $.deduceEventId(^.message,.destination.Config),
},
};
- name: buildResponse
template: |
const response = $.defaultRequestConfig();
response.body.JSON = $.context.payload;
response.endpoint = $.deduceEndPoint($.context.payload,.destination.Config);
response.method = "POST";
response.headers = $.buildHeader(.destination.Config)
response
38 changes: 38 additions & 0 deletions src/cdk/v2/destinations/emarsys/rtWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
bindings:
- path: ./utils
- name: handleRtTfSingleEventError
path: ../../../../v0/util/index

steps:
- name: validateInput
template: |
$.assert(Array.isArray(^) && ^.length > 0, "Invalid event array")
- name: transform
externalWorkflow:
path: ./procWorkflow.yaml
bindings:
- name: batchMode
value: true
loopOverInput: true
- name: successfulEvents
template: |
$.outputs.transform#idx.output.({
"message": .[],
"destination": ^ [idx].destination,
"metadata": ^ [idx].metadata
})[]
- name: failedEvents
template: |
$.outputs.transform#idx.error.(
$.handleRtTfSingleEventError(^[idx], .originalError ?? ., {})
)[]
- name: batchSuccessfulEvents
description: Batches the successfulEvents
template: |
$.context.batchedPayload = $.batchResponseBuilder($.outputs.successfulEvents);
- name: finalPayload
template: |
[...$.outputs.failedEvents, ...$.context.batchedPayload]
Loading

0 comments on commit 8b8b767

Please sign in to comment.