Skip to content

Commit

Permalink
Merge branch 'develop' into feat.myaxios-migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik authored Nov 21, 2023
2 parents 8d7a136 + 5c63d2c commit d8330f6
Show file tree
Hide file tree
Showing 112 changed files with 19,131 additions and 5,892 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@typescript-eslint/no-explicit-any": "off",
"class-methods-use-this": "off",
"@typescript-eslint/return-await": "error",
"import/prefer-default-export": "error",
"import/prefer-default-export": "off",
"sonarjs/no-ignored-return": "error",
"no-new": "error",
"@typescript-eslint/no-shadow": "error",
Expand Down
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.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'ujjwal-ab') && (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' || github.triggering_actor == 'ujjwal-ab)
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.actor == 'ujjwal-ab') && (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' || github.triggering_actor == 'ujjwal-ab')
steps:
- name: Create Branch
uses: peterjgrainger/[email protected]
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

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.50.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.49.1...v1.50.0) (2023-11-13)


### Features

* add clickId support for tiktok and pinterest destination ([#2784](https://github.com/rudderlabs/rudder-transformer/issues/2784)) ([0e14296](https://github.com/rudderlabs/rudder-transformer/commit/0e1429663d167a2c5cded0d9130374eb586a18c0))
* add delivery_category as part of contents, remove flattening custom_data in FB conversions ([#2812](https://github.com/rudderlabs/rudder-transformer/issues/2812)) ([e82cef8](https://github.com/rudderlabs/rudder-transformer/commit/e82cef88e154d47519f0deeb60f55773f25fd3ad))
* add delivery_category as part of contents, update flattening custom_data in FB Pixel ([#2816](https://github.com/rudderlabs/rudder-transformer/issues/2816)) ([ee1f473](https://github.com/rudderlabs/rudder-transformer/commit/ee1f4733e82291375d85a6de8b8626ffdc8907b1))
* adding support for future oauth facility in salesforce ([#2746](https://github.com/rudderlabs/rudder-transformer/issues/2746)) ([916ea4c](https://github.com/rudderlabs/rudder-transformer/commit/916ea4c8d08f69b68b7795dd513a25a3cded55fa))
* introduce v1/source/sourceType endpoint ([#2722](https://github.com/rudderlabs/rudder-transformer/issues/2722)) ([0996e81](https://github.com/rudderlabs/rudder-transformer/commit/0996e816d3671c3e25561f76e3219be99225f24b))
* move cdkV1 to cdkv2 component tests ([#2804](https://github.com/rudderlabs/rudder-transformer/issues/2804)) ([195b48a](https://github.com/rudderlabs/rudder-transformer/commit/195b48ac0f438a200933e4bbb956fcc3941b7aed))
* use custom screen name amplitude ([#2823](https://github.com/rudderlabs/rudder-transformer/issues/2823)) ([93a82bd](https://github.com/rudderlabs/rudder-transformer/commit/93a82bd4856b462768d0213ae3de8b9b78e9858c))


### Bug Fixes

* source_transform_error stat label correction ([#2825](https://github.com/rudderlabs/rudder-transformer/issues/2825)) ([f3bcd7c](https://github.com/rudderlabs/rudder-transformer/commit/f3bcd7c9338ef96267be84f845c63f5234d37e33))
* shopify redis metric when there is no data returned for a key ([#2811](https://github.com/rudderlabs/rudder-transformer/issues/2811)) ([c02370e](https://github.com/rudderlabs/rudder-transformer/commit/c02370e38fabb581698baa00e1ddd3da93dc07fa))
* snapchat_conversion category mapping ([#2826](https://github.com/rudderlabs/rudder-transformer/issues/2826)) ([7acd004](https://github.com/rudderlabs/rudder-transformer/commit/7acd004e4290dfb5ea20402929041462eddb4496))

### [1.49.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.49.0...v1.49.1) (2023-11-10)


### Bug Fixes

* update create-hotfix-branch.yml ([#2815](https://github.com/rudderlabs/rudder-transformer/issues/2815)) ([dd884dd](https://github.com/rudderlabs/rudder-transformer/commit/dd884ddc78898bd7de155ec4f05ce8fe6e2c4b80))

## [1.49.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.48.0...v1.49.0) (2023-11-06)


Expand Down
135 changes: 111 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.49.0",
"version": "1.50.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down Expand Up @@ -28,6 +28,7 @@
"build:ci": "tsc -p tsconfig.json",
"build:swagger": "npm run build && npm run setup:swagger",
"build": "npm run build:ci && npm run copy",
"clean:build": "npm run clean && npm run build",
"build:clean": "npm run clean && npm run build",
"verify": "eslint . || exit 1; npm run test:js || exit 1",
"test:testRouter": "jest testRouter --detectOpenHandles --coverage --notify --watchAll=false",
Expand Down Expand Up @@ -64,7 +65,7 @@
"@ndhoule/extend": "^2.0.0",
"@pyroscope/nodejs": "^0.2.6",
"@rudderstack/integrations-lib": "^0.1.8",
"@rudderstack/workflow-engine": "^0.5.7",
"@rudderstack/workflow-engine": "^0.6.9",
"ajv": "^8.12.0",
"ajv-draft-04": "^1.0.0",
"ajv-formats": "^2.1.1",
Expand Down
88 changes: 88 additions & 0 deletions src/cdk/v2/destinations/gladly/procWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
bindings:
- name: EventType
path: ../../../../constants
- path: ./utils
exportAll: true
- name: defaultRequestConfig
path: ../../../../v0/util
- name: removeUndefinedAndNullValues
path: ../../../../v0/util
- name: getDestinationExternalID
path: ../../../../v0/util
- name: httpGET
path: ../../../../adapters/network
- name: processAxiosResponse
path: ../../../../adapters/utils/networkUtils


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")
$.assert(messageType in {{$.EventType.([.IDENTIFY])}}, "message type " + messageType + " is not supported")
$.assertConfig(.destination.Config.apiToken, "API Token is not present. Aborting")
$.assertConfig(.destination.Config.domain, "Gladly domain is not present. Aborting")
$.assertConfig(.destination.Config.userName, "User Name is not present. Aborting")
- name: preparePayload
template: |
$.context.payload = {
name: .message.traits.name || .message.context.traits.name,
image: .message.traits.avatar || .message.context.traits.avatar,
address: .message.traits.address || .message.context.traits.address
}
$.context.payload.address && typeof $.context.payload.address === "object" ? $.context.payload.address = JSON.stringify($.context.payload.address)
$.context.payload.emails = $.formatField(.message, "email")
$.context.payload.phones = $.formatField(.message, "phone")
$.context.payload.customAttributes = $.getCustomAttributes(.message)
$.context.payload.externalCustomerId = $.getExternalCustomerId(.message)
$.context.payload.id = $.getCustomerId(.message)
$.context.payload = $.removeUndefinedAndNullValues($.context.payload)
- name: validatePayload
template: |
$.validatePayload($.context.payload)
- name: findCustomer
description: Find if customer is exist or not based on email, phone or externalCustomerId
condition: $.getQueryParams($.context.payload) !== undefined
template: |
const requestOptions = {
headers: $.getHeaders(.destination)
}
const endpoint = $.getEndpoint(.destination) + "?" + $.getQueryParams($.context.payload);
const rawResponse = await $.httpGET(endpoint,requestOptions)
const processedResponse = $.processAxiosResponse(rawResponse)
processedResponse
- name: createCustomer
description: Build response for create customer
condition: $.outputs.findCustomer.status === 400 || ($.outputs.findCustomer.status === 200 && $.outputs.findCustomer.response.length === 0) || $.getQueryParams($.context.payload) === undefined
template: |
const response = $.defaultRequestConfig()
response.body.JSON = $.removeUndefinedAndNullValues($.context.payload)
response.endpoint = $.getEndpoint(.destination)
response.method = "POST"
response.headers = $.getHeaders(.destination)
response
else:
name: updateCustomer
description: Build response for update customer
template: |
const response = $.defaultRequestConfig()
response.body.JSON = $.removeUndefinedAndNullValues($.context.payload.{~["id"]})
response.endpoint = $.getEndpoint(.destination) + "/" + $.outputs.findCustomer.response[0].id
response.method = "PATCH"
response.headers = $.getHeaders(.destination)
response
33 changes: 33 additions & 0 deletions src/cdk/v2/destinations/gladly/rtWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
bindings:
- name: handleRtTfSingleEventError
path: ../../../../v0/util/index
- path: ./utils
exportAll: true

steps:
- name: validateInput
template: |
$.assert(Array.isArray(^) && ^.length > 0, "Invalid event array")
- name: transform
externalWorkflow:
path: ./procWorkflow.yaml
loopOverInput: true

- name: successfulEvents
template: |
$.outputs.transform#idx.output.({
"batchedRequest": .,
"batched": false,
"destination": ^[idx].destination,
"metadata": ^[idx].metadata[],
"statusCode": 200
})[]
- name: failedEvents
template: |
$.outputs.transform#idx.error.(
$.handleRtTfSingleEventError(^[idx], .originalError ?? ., {})
)[]
- name: finalPayload
template: |
[...$.outputs.successfulEvents, ...$.outputs.failedEvents]
Loading

0 comments on commit d8330f6

Please sign in to comment.