From 391b99358f6284df8d217a053fc82f7fe05b4acf Mon Sep 17 00:00:00 2001 From: Anant Jain Date: Mon, 18 Sep 2023 18:27:02 +0530 Subject: [PATCH] chore: change name of slack properties --- src/v0/destinations/slack/transform.js | 10 +++++----- test/__tests__/data/slack_input.json | 14 +++++++------- test/__tests__/data/slack_output.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/v0/destinations/slack/transform.js b/src/v0/destinations/slack/transform.js index b56ebfbc48..c913f3103e 100644 --- a/src/v0/destinations/slack/transform.js +++ b/src/v0/destinations/slack/transform.js @@ -180,17 +180,17 @@ const buildtemplateList = (templateListForThisEvent, eventTemplateSettings, even const processTrack = (message, destination) => { // logger.debug(JSON.stringify(destination)); const { Config } = destination; - const { eventChannelSettings, eventTemplateSettings, incomingWebhooksType, blacklistedEvents } = + const { eventChannelSettings, eventTemplateSettings, incomingWebhooksType, denyListOfEvents } = Config; const eventName = message.event; if (!eventName) { throw new InstrumentationError('Event name is required'); } - if (blacklistedEvents?.length > 0) { - const blackListedEvents = blacklistedEvents.map((item) => item.eventName); - if (blackListedEvents.includes(eventName)) { - throw new ConfigurationError('Event is blacklisted. Please check configuration.'); + if (denyListOfEvents?.length > 0) { + const denyListofEvents = denyListOfEvents.map((item) => item.eventName); + if (denyListofEvents.includes(eventName)) { + throw new ConfigurationError('Event is denied. Please check configuration.'); } } diff --git a/test/__tests__/data/slack_input.json b/test/__tests__/data/slack_input.json index 9b1ec52664..f9a0b49841 100644 --- a/test/__tests__/data/slack_input.json +++ b/test/__tests__/data/slack_input.json @@ -154,7 +154,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -390,7 +390,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -518,7 +518,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -646,7 +646,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -772,7 +772,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -899,7 +899,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } @@ -1369,7 +1369,7 @@ "trait": "" } ], - "blacklistedEvents": [ + "denyListOfEvents": [ { "eventName": "black_event" } diff --git a/test/__tests__/data/slack_output.json b/test/__tests__/data/slack_output.json index 853daf7801..63d7934a00 100644 --- a/test/__tests__/data/slack_output.json +++ b/test/__tests__/data/slack_output.json @@ -159,6 +159,6 @@ "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'" }, { - "error": "Event is blacklisted. Please check configuration." + "error": "Event is denied. Please check configuration." } ] \ No newline at end of file