Skip to content

Commit

Permalink
chore(release): pull release/v1.40.0 into main (#2546)
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir-4116 authored Sep 5, 2023
2 parents d00c616 + 5ae2530 commit dfd6af6
Show file tree
Hide file tree
Showing 398 changed files with 28,104 additions and 25,429 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

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.40.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.39.1...v1.40.0) (2023-09-04)


### Features

* add eu instance support to kustomer destination ([#2513](https://github.com/rudderlabs/rudder-transformer/issues/2513)) ([34dbabf](https://github.com/rudderlabs/rudder-transformer/commit/34dbabfcec610b87a0a1512743528bef2e4b69ae))
* blank audience support in google ads ([#2526](https://github.com/rudderlabs/rudder-transformer/issues/2526)) ([54d3704](https://github.com/rudderlabs/rudder-transformer/commit/54d3704a9dea612b98735f7191351e8195af205a))
* eloqua new destination cdkv2 ([#2501](https://github.com/rudderlabs/rudder-transformer/issues/2501)) ([1db0573](https://github.com/rudderlabs/rudder-transformer/commit/1db0573eff0a0091248ffa2107fd8064a03ce2dd))
* **ga4:** added support of campaign_details event ([#2542](https://github.com/rudderlabs/rudder-transformer/issues/2542)) ([95920b8](https://github.com/rudderlabs/rudder-transformer/commit/95920b8a851e1e78a7154dae222033c7f34b3c09))
* **posthog:** support timestamp mapping from properties ([#2507](https://github.com/rudderlabs/rudder-transformer/issues/2507)) ([88392d7](https://github.com/rudderlabs/rudder-transformer/commit/88392d70b73525a15933e5a83a25df7d6c9417ee))
* retl audience support google ads ([#2530](https://github.com/rudderlabs/rudder-transformer/issues/2530)) ([804aa79](https://github.com/rudderlabs/rudder-transformer/commit/804aa79113ed628d4c4dc92ad5dd4aa347aabe5a))
* support for profiles event in redis ([#2497](https://github.com/rudderlabs/rudder-transformer/issues/2497)) ([f0c0a21](https://github.com/rudderlabs/rudder-transformer/commit/f0c0a211d167be2393c92db0a37dd517b1dbd1c4))


### Bug Fixes

* **braze:** enable merge behaviour to stitch user data ([#2508](https://github.com/rudderlabs/rudder-transformer/issues/2508)) ([8a2cf93](https://github.com/rudderlabs/rudder-transformer/commit/8a2cf93d9e83954edf1878390c254fb88a6c83c7))
* **gaoc:** custom variables issue ([#2545](https://github.com/rudderlabs/rudder-transformer/issues/2545)) ([3afee53](https://github.com/rudderlabs/rudder-transformer/commit/3afee53759e19765c4a284910cfd86e774dc0a24))
* **INT-512:** removed personal information from test cases ([#2517](https://github.com/rudderlabs/rudder-transformer/issues/2517)) ([9582e31](https://github.com/rudderlabs/rudder-transformer/commit/9582e31b9398f8d9bb01c431fd573fc54dbf7b3d))
* **iterable:** squadcast alert ([#2535](https://github.com/rudderlabs/rudder-transformer/issues/2535)) ([5a2194b](https://github.com/rudderlabs/rudder-transformer/commit/5a2194baa2c07d5b0fbe7bd7f4cfdec9117661ba))
* missing type for page and group calls ([#2512](https://github.com/rudderlabs/rudder-transformer/issues/2512)) ([bf08b9e](https://github.com/rudderlabs/rudder-transformer/commit/bf08b9e7177dbe7920e50e014484189a0c336b75))
* remove secure environment for datafile call ([#2544](https://github.com/rudderlabs/rudder-transformer/issues/2544)) ([b069e26](https://github.com/rudderlabs/rudder-transformer/commit/b069e262e9864a60611ee1b1e8e6c91dad76b7f4))
* fix: marketo bulk upload bugs and refactor ([#2414](https://github.com/rudderlabs/rudder-transformer/issues/2414)) ([9e3ace1](https://github.com/rudderlabs/rudder-transformer/pull/2546/commits/9e3ace17012f8fae3db35608367d98840037d1c0))

### [1.39.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.39.0...v1.39.1) (2023-08-28)


Expand Down
44 changes: 44 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Elastic License 2.0 (ELv2)

**Acceptance**
By using the software, you agree to all of the terms and conditions below.

**Copyright License**
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below

**Limitations**
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.

You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.

You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.

**Patents**
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.

**Notices**
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.

If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.

**No Other Rights**
These terms do not imply any licenses other than those expressly granted in these terms.

**Termination**
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.

**No Liability**
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.

**Definitions**
The *licensor* is the entity offering these terms, and the *software* is the software the licensor makes available under these terms, including any portion of it.

*you* refers to the individual or entity agreeing to these terms.

*your company* is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. *control* means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.

*your licenses* are all the licenses granted to you for the software under these terms.

*use* means anything you do with the software requiring one of your licenses.

*trademark* means trademarks, service marks, and similar rights.
21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# RudderStack Transformer

RudderStack Transformer is a service which transforms the RudderStack events to destination-specific singular events. This feature is released under
under the [MIT license](https://github.com/rudderlabs/rudder-transformer/blob/main/LICENSE.md).
under the [Elastic License 2.0](https://www.elastic.co/licensing/elastic-license).

## Transformer Setup

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.39.1",
"version": "1.40.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
67 changes: 47 additions & 20 deletions src/adapters/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ const { processAxiosResponse } = require('./utils/networkUtils');

const MAX_CONTENT_LENGTH = parseInt(process.env.MAX_CONTENT_LENGTH, 10) || 100000000;
const MAX_BODY_LENGTH = parseInt(process.env.MAX_BODY_LENGTH, 10) || 100000000;
const REQUEST_TIMEOUT_IN_MS = parseInt(process.env.REQUEST_TIMEOUT_IN_MS, 10) || 1000 * 60;
// (httpsAgent, httpsAgent) ,these are deployment specific configs not request specific
const networkClientConfigs = {
// `method` is the request method to be used when making the request
method: 'get',

// `timeout` specifies the number of milliseconds before the request times out. If the request takes longer than `timeout`, the request will be aborted.
timeout: 1000 * 60,
timeout: REQUEST_TIMEOUT_IN_MS,

// `withCredentials` indicates whether or not cross-site Access-Control requests should be made using credentials
withCredentials: false,
Expand All @@ -42,13 +43,34 @@ const networkClientConfigs = {
httpsAgent: new https.Agent({ keepAlive: true }),
};

const fireLatencyStat = (startTime, statTags) => {
const fireHTTPStats = (clientResponse, startTime, statTags) => {
const destType = statTags.destType ? statTags.destType : '';
const feature = statTags.feature ? statTags.feature : '';
const endpointPath = statTags.endpointPath ? statTags.endpointPath : '';
const statusCode = clientResponse.success ? clientResponse.response.status : '';
stats.timing('outgoing_request_latency', startTime, {
feature,
destType,
endpointPath,
});
stats.counter('outgoing_request_count', 1, {
feature,
destType,
endpointPath,
success: clientResponse.success,
statusCode,
});
};

const enhanceRequestOptions = (options) => {
const requestOptions = {
...networkClientConfigs,
...options,
maxContentLength: MAX_CONTENT_LENGTH,
maxBodyLength: MAX_BODY_LENGTH,
};

return requestOptions;
};

/**
Expand All @@ -58,13 +80,8 @@ const fireLatencyStat = (startTime, statTags) => {
*/
const httpSend = async (options, statTags = {}) => {
let clientResponse;
// here the options argument K-Vs will take priority over requestOptions
const requestOptions = {
...networkClientConfigs,
...options,
maxContentLength: MAX_CONTENT_LENGTH,
maxBodyLength: MAX_BODY_LENGTH,
};
// here the options argument K-Vs will take priority over the default options
const requestOptions = enhanceRequestOptions(options);

const startTime = new Date();
try {
Expand All @@ -73,7 +90,7 @@ const httpSend = async (options, statTags = {}) => {
} catch (err) {
clientResponse = { success: false, response: err };
} finally {
fireLatencyStat(startTime, statTags);
fireHTTPStats(clientResponse, startTime, statTags);
}
return clientResponse;
};
Expand All @@ -88,15 +105,17 @@ const httpSend = async (options, statTags = {}) => {
*/
const httpGET = async (url, options, statTags = {}) => {
let clientResponse;
// here the options argument K-Vs will take priority over the default options
const requestOptions = enhanceRequestOptions(options);

const startTime = new Date();
try {
const response = await axios.get(url, options);
const response = await axios.get(url, requestOptions);
clientResponse = { success: true, response };
} catch (err) {
clientResponse = { success: false, response: err };
} finally {
fireLatencyStat(startTime, statTags);
fireHTTPStats(clientResponse, startTime, statTags);
}
return clientResponse;
};
Expand All @@ -111,15 +130,17 @@ const httpGET = async (url, options, statTags = {}) => {
*/
const httpDELETE = async (url, options, statTags = {}) => {
let clientResponse;
// here the options argument K-Vs will take priority over the default options
const requestOptions = enhanceRequestOptions(options);

const startTime = new Date();
try {
const response = await axios.delete(url, options);
const response = await axios.delete(url, requestOptions);
clientResponse = { success: true, response };
} catch (err) {
clientResponse = { success: false, response: err };
} finally {
fireLatencyStat(startTime, statTags);
fireHTTPStats(clientResponse, startTime, statTags);
}
return clientResponse;
};
Expand All @@ -135,15 +156,17 @@ const httpDELETE = async (url, options, statTags = {}) => {
*/
const httpPOST = async (url, data, options, statTags = {}) => {
let clientResponse;
// here the options argument K-Vs will take priority over the default options
const requestOptions = enhanceRequestOptions(options);

const startTime = new Date();
try {
const response = await axios.post(url, data, options);
const response = await axios.post(url, data, requestOptions);
clientResponse = { success: true, response };
} catch (err) {
clientResponse = { success: false, response: err };
} finally {
fireLatencyStat(startTime, statTags);
fireHTTPStats(clientResponse, startTime, statTags);
}
return clientResponse;
};
Expand All @@ -159,15 +182,17 @@ const httpPOST = async (url, data, options, statTags = {}) => {
*/
const httpPUT = async (url, data, options, statTags = {}) => {
let clientResponse;
// here the options argument K-Vs will take priority over the default options
const requestOptions = enhanceRequestOptions(options);

const startTime = new Date();
try {
const response = await axios.put(url, data, options);
const response = await axios.put(url, data, requestOptions);
clientResponse = { success: true, response };
} catch (err) {
clientResponse = { success: false, response: err };
} finally {
fireLatencyStat(startTime, statTags);
fireHTTPStats(clientResponse, startTime, statTags);
}
return clientResponse;
};
Expand All @@ -183,15 +208,17 @@ const httpPUT = async (url, data, options, statTags = {}) => {
*/
const httpPATCH = async (url, data, options, statTags = {}) => {
let clientResponse;
// here the options argument K-Vs will take priority over the default options
const requestOptions = enhanceRequestOptions(options);

const startTime = new Date();
try {
const response = await axios.patch(url, data, options);
const response = await axios.patch(url, data, requestOptions);
clientResponse = { success: true, response };
} catch (err) {
clientResponse = { success: false, response: err };
} finally {
fireLatencyStat(startTime, statTags);
fireHTTPStats(clientResponse, startTime, statTags);
}
return clientResponse;
};
Expand Down
5 changes: 5 additions & 0 deletions src/cdk/v2/destinations/eloqua/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ELOQUA = 'eloqua';

module.exports = {
ELOQUA
};
46 changes: 46 additions & 0 deletions src/cdk/v2/destinations/eloqua/procWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
bindings:
- name: EventType
path: ../../../../constants
- path: ../../bindings/jsontemplate
exportAll: true
- path: ./config
- name: removeUndefinedAndNullValues
path: ../../../../v0/util
- name: defaultRequestConfig
path: ../../../../v0/util
- path: ./utils

steps:
- name: validateInput
template: |
let messageType = .message.type;
$.assert(messageType, "message Type is not present. Aborting message.");
$.assert(.message.type.toLowerCase() ==='identify' || .message.type.toLowerCase() ==='track', "Event type " + .message.type.toLowerCase() + " is not supported. Aborting message.");
$.assert(.message.traits || .message.properties, "Message traits/properties not present. Aborting message.");
- name: prepareCommonResponse
description: |
Populate traits
template: |
const identifierKey = .message.context.externalId[0].identifierType
let data = .message.traits || .message.properties
data = $.stringifyValues(data)
data[identifierKey] = .message.userId
data
- name: prepareResponse
description: |
Populate traits
template: |
let eventType = (.message.context.externalId[0].type.split('-')[1].toString() === "contacts") ? 'identify' : 'track';
{
identifierFieldName: .message.context.externalId[0].identifierType,
data: $.outputs.prepareCommonResponse,
customObjectId: .message.context.externalId[0].type.split('-')[1].toString(),
type: eventType
}
- name: buildResponseForProcessTransformation
description: build response
template: |
const response = $.defaultRequestConfig();
response.body.JSON = $.outputs.prepareResponse
response
11 changes: 11 additions & 0 deletions src/cdk/v2/destinations/eloqua/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const stringifyValues = (data) => {
Object.keys(data).forEach((key) => {
if (typeof data[key] !== 'string') {
data[key] = JSON.stringify(data[key]);
}
});
return data;
};
module.exports = {
stringifyValues,
};
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ steps:
$.assertConfig(.destination.Config.experimentId, "Experiment ID is not present. Aborting");
$.assertConfig(!(.destination.Config.trackKnownUsers && !(.message.userId)), "UserId is required for event tracking when the 'Track Known Users' setting is enabled. Please include a 'userId' in your event payload");
$.assertConfig(!(!.destination.Config.trackKnownUsers && !(.message.anonymousId)), "AnonymousId is required when 'Track Known Users' setting is disabled");
$.assertConfig(!(.destination.Config.secureEnvironment && !(.destination.Config.dataFileAccessToken)), "Data File Access Token is not present for secure environment. Aborting");
- name: messageType
template: |
Expand All @@ -60,12 +59,7 @@ steps:
description: Fetch the data file from the data file url
template: |
const dataFileUrl = .destination.Config.dataFileUrl;
const options = .destination.Config.secureEnvironment ? {
headers: {
"Authorization": "Bearer " + .destination.Config.dataFileAccessToken
}
};
const rawResponse = await $.handleHttpRequest("get", dataFileUrl, options);
const rawResponse = await $.handleHttpRequest("get", dataFileUrl);
const processedResponse = rawResponse.processedResponse;
$.assertHttpResp(processedResponse, "Data File Lookup Failed");
processedResponse.response
Expand Down
Loading

0 comments on commit dfd6af6

Please sign in to comment.