From 417a83ce8a17d3a9d64943c896d9db3af01ee2d6 Mon Sep 17 00:00:00 2001 From: Dilip Kola Date: Wed, 19 Jun 2024 14:38:26 +0530 Subject: [PATCH 1/2] chore: upgrade packages --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/v0/util/index.js | 8 +------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index c1ca7a6ca6..d2bc9b452b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,8 @@ "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", "@rudderstack/integrations-lib": "^0.2.10", - "@rudderstack/json-template-engine": "^0.13.8", - "@rudderstack/workflow-engine": "^0.8.6", + "@rudderstack/json-template-engine": "^0.14.1", + "@rudderstack/workflow-engine": "^0.8.8", "@shopify/jest-koa-mocks": "^5.1.1", "ajv": "^8.12.0", "ajv-draft-04": "^1.0.0", @@ -4526,17 +4526,17 @@ } }, "node_modules/@rudderstack/json-template-engine": { - "version": "0.13.8", - "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.13.8.tgz", - "integrity": "sha512-2bl6a25SEm+LapdNqR5QhLv61dQiv3squmCr4Qy9U89BIp9yX9WOL8tvoaIS1isN7lwIOViD3cD8ft0ehlj8Sw==" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.14.1.tgz", + "integrity": "sha512-frQ0UyN/hslA9K4cFyHLvLLTxHFhcWZRnF1ELbAHvj8AZJCblM8LZXh4A62aMmF0FbNqgsO5CeOStPqvYm3ugg==" }, "node_modules/@rudderstack/workflow-engine": { - "version": "0.8.6", - "resolved": "https://registry.npmjs.org/@rudderstack/workflow-engine/-/workflow-engine-0.8.6.tgz", - "integrity": "sha512-O+Kj3y4DZNgV2fWAOkwYwqsnjot0YxiVrDFWUkLdFQHTSXJ5Y/eqDJglDXdcpwSPg9AlaUFVHsGzw6BkAQLcIA==", + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/@rudderstack/workflow-engine/-/workflow-engine-0.8.8.tgz", + "integrity": "sha512-6vX13wWlfQxFktq8MnAHTBpKulrjwYyZ8ZXcyugEU/BuVedtBTfjGGFsBrlKldLPuRsTZt8XuYbW8Ua7g2C5Kw==", "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", - "@rudderstack/json-template-engine": "^0.13.8", + "@rudderstack/json-template-engine": "^0.14.1", "jsonata": "^2.0.5", "lodash": "^4.17.21", "object-sizeof": "^2.6.4", diff --git a/package.json b/package.json index 5b0d74c650..adeee0612b 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", "@rudderstack/integrations-lib": "^0.2.10", - "@rudderstack/json-template-engine": "^0.13.8", - "@rudderstack/workflow-engine": "^0.8.6", + "@rudderstack/json-template-engine": "^0.14.1", + "@rudderstack/workflow-engine": "^0.8.8", "@shopify/jest-koa-mocks": "^5.1.1", "ajv": "^8.12.0", "ajv-draft-04": "^1.0.0", diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 389b93a7af..b5ae74d480 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -2248,15 +2248,9 @@ const validateEventAndLowerCaseConversion = (event, isMandatory, convertToLowerC return convertToLowerCase ? event.toString().toLowerCase() : event.toString(); }; -const applyCustomMappings = (message, mappings) => { - const flatMappings = mappings.map((mapping) => ({ - input: mapping.from, - output: mapping.to, - })); - return JsonTemplateEngine.createAsSync(flatMappings, { defaultPathType: PathType.JSON }).evaluate( +const applyCustomMappings = (message, mappings) => JsonTemplateEngine.createAsSync(mappings, { defaultPathType: PathType.JSON }).evaluate( message, ); -}; // ======================================================================== // EXPORTS From 136ca64b3d8b1949950f98d4431a9670e22810cf Mon Sep 17 00:00:00 2001 From: Dilip Kola Date: Wed, 19 Jun 2024 15:31:48 +0530 Subject: [PATCH 2/2] fix: lint issues --- src/v0/util/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/v0/util/index.js b/src/v0/util/index.js index b5ae74d480..366c58ce93 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -2248,9 +2248,8 @@ const validateEventAndLowerCaseConversion = (event, isMandatory, convertToLowerC return convertToLowerCase ? event.toString().toLowerCase() : event.toString(); }; -const applyCustomMappings = (message, mappings) => JsonTemplateEngine.createAsSync(mappings, { defaultPathType: PathType.JSON }).evaluate( - message, - ); +const applyCustomMappings = (message, mappings) => + JsonTemplateEngine.createAsSync(mappings, { defaultPathType: PathType.JSON }).evaluate(message); // ======================================================================== // EXPORTS