Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): pull hotfix-release/v1.83.1 into main #3840

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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.83.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.83.0...v1.83.1) (2024-11-01)

## [1.83.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.82.2...v1.83.0) (2024-10-25)


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.83.0",
"version": "1.83.1",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable no-param-reassign */

const get = require('get-value');
const { cloneDeep, isNumber } = require('lodash');
const { cloneDeep } = require('lodash');
const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib');
const isString = require('lodash/isString');
const {
constructPayload,
defaultRequestConfig,
Expand Down Expand Up @@ -36,18 +35,7 @@ const updateMappingJson = (mapping) => {
const responseBuilder = async (metadata, message, { Config }, payload) => {
const response = defaultRequestConfig();
const { event } = message;
const { subAccount } = Config;
let { customerId, loginCustomerId } = Config;
if (isNumber(customerId)) {
customerId = customerId.toString();
}
if (isNumber(loginCustomerId)) {
loginCustomerId = loginCustomerId.toString();
}
if (!isString(customerId) || !isString(loginCustomerId)) {
throw new InstrumentationError('customerId and loginCustomerId should be a string or number');
}
const filteredCustomerId = removeHyphens(customerId);
const filteredCustomerId = removeHyphens(Config.customerId);
response.endpoint = `${BASE_ENDPOINT}/${filteredCustomerId}:uploadConversionAdjustments`;
response.body.JSON = payload;
const accessToken = getAccessToken(metadata, 'access_token');
Expand All @@ -57,9 +45,9 @@ const responseBuilder = async (metadata, message, { Config }, payload) => {
'developer-token': getValueFromMessage(metadata, 'secret.developer_token'),
};
response.params = { event, customerId: filteredCustomerId };
if (subAccount)
if (loginCustomerId) {
const filteredLoginCustomerId = removeHyphens(loginCustomerId);
if (Config.subAccount)
if (Config.loginCustomerId) {
const filteredLoginCustomerId = removeHyphens(Config.loginCustomerId);
response.headers['login-customer-id'] = filteredLoginCustomerId;
} else throw new ConfigurationError(`LoginCustomerId is required as subAccount is true.`);

Expand Down
6 changes: 1 addition & 5 deletions src/v0/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const {
} = require('@rudderstack/integrations-lib');

const { JsonTemplateEngine, PathType } = require('@rudderstack/json-template-engine');
const isString = require('lodash/isString');
const logger = require('../../logger');
const stats = require('../../util/stats');
const { DestCanonicalNames, DestHandlerMap } = require('../../constants/destinationCanonicalNames');
Expand Down Expand Up @@ -1623,7 +1622,7 @@ function isHttpStatusRetryable(status) {
function generateUUID() {
return crypto.randomUUID({
disableEntropyCache: true,
}); /* using disableEntropyCache as true to not cache the generated uuids.
}); /* using disableEntropyCache as true to not cache the generated uuids.
For more Info https://nodejs.org/api/crypto.html#cryptorandomuuidoptions:~:text=options%20%3CObject%3E-,disableEntropyCache,-%3Cboolean%3E%20By
*/
}
Expand All @@ -1647,9 +1646,6 @@ function isAppleFamily(platform) {
}

function removeHyphens(str) {
if (!isString(str)) {
return str;
}
return str.replace(/-/g, '');
}

Expand Down
16 changes: 0 additions & 16 deletions src/v0/util/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const {
validateEventAndLowerCaseConversion,
groupRouterTransformEvents,
isAxiosError,
removeHyphens,
} = require('./index');
const exp = require('constants');

Expand Down Expand Up @@ -969,18 +968,3 @@ describe('isAxiosError', () => {
expect(isAxiosError(error)).toBe(false);
});
});

describe('removeHyphens', () => {
const data = [
{ input: 'hello-w--orld', expected: 'helloworld' },
{ input: '', expected: '' },
{ input: null, expected: null },
{ input: undefined, expected: undefined },
{ input: 12345, expected: 12345 },
];
it('should remove hyphens from string else return the input as it is', () => {
data.forEach(({ input, expected }) => {
expect(removeHyphens(input)).toBe(expected);
});
});
});
Loading
Loading