From 0ad9f8064c97a6c0ad3ff595e89ea5dda3756625 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 20 Aug 2024 13:09:59 +0000 Subject: [PATCH 1/3] chore(release): 1.87.0 --- CHANGELOG.md | 9 +++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd1a11f9b..6688c8e61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ 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.87.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.86.1...v1.87.0) (2024-08-20) + + +### Features + +* enable vdm for sfmc ([efc4ad2](https://github.com/rudderlabs/rudder-config-schema/commit/efc4ad2901e6d2b443c6279f21c3e4e31fd755fd)) +* iam support for redshift source ([#1613](https://github.com/rudderlabs/rudder-config-schema/issues/1613)) ([31c97ec](https://github.com/rudderlabs/rudder-config-schema/commit/31c97ec001fc8f4b45f006075aea5f285b2bb419)) +* iam support for redshift source ([#1619](https://github.com/rudderlabs/rudder-config-schema/issues/1619)) ([c5195cb](https://github.com/rudderlabs/rudder-config-schema/commit/c5195cb8b7ca695aa8918679bf5ba588f739a87b)) + ### [1.86.1](https://github.com/rudderlabs/rudder-config-schema/compare/v1.86.0...v1.86.1) (2024-08-14) diff --git a/package-lock.json b/package-lock.json index 04a963ebb..d1f60171f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-config-schema", - "version": "1.86.1", + "version": "1.87.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-config-schema", - "version": "1.86.1", + "version": "1.87.0", "license": "MIT", "dependencies": { "ajv": "^8.12.0", diff --git a/package.json b/package.json index 488d3c8fd..6264de2df 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-config-schema", - "version": "1.86.1", + "version": "1.87.0", "description": "", "main": "src/index.ts", "private": true, From f5418e9157bd2c9b74602621dd570cf8476e2360 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:10:29 +0530 Subject: [PATCH 2/3] feat: onboarding bloomreach for retl (#1571) Co-authored-by: Gauravudia <60897972+Gauravudia@users.noreply.github.com> --- .../destinations/bloomreach/db-config.json | 14 +- .../destinations/bloomreach/schema.json | 50 ++++ .../bloomreach_catalog/db-config.json | 36 +++ .../bloomreach_catalog/schema.json | 101 ++++++++ .../bloomreach_catalog/ui-config.json | 229 ++++++++++++++++++ .../destinations/bloomreach_catalog.json | 149 ++++++++++++ 6 files changed, 576 insertions(+), 3 deletions(-) create mode 100644 src/configurations/destinations/bloomreach_catalog/db-config.json create mode 100644 src/configurations/destinations/bloomreach_catalog/schema.json create mode 100644 src/configurations/destinations/bloomreach_catalog/ui-config.json create mode 100644 test/data/validation/destinations/bloomreach_catalog.json diff --git a/src/configurations/destinations/bloomreach/db-config.json b/src/configurations/destinations/bloomreach/db-config.json index 9121b8ef4..9d4c9afa9 100644 --- a/src/configurations/destinations/bloomreach/db-config.json +++ b/src/configurations/destinations/bloomreach/db-config.json @@ -5,6 +5,11 @@ "cdkV2Enabled": true, "transformAtV1": "router", "saveDestinationResponse": true, + "supportsBlankAudienceCreation": false, + "supportsVisualMapper": false, + "disableJsonMapper": false, + "isAudienceSupported": false, + "syncBehaviours": ["upsert"], "supportedSourceTypes": [ "android", "ios", @@ -15,7 +20,8 @@ "reactnative", "flutter", "cordova", - "shopify" + "shopify", + "warehouse" ], "supportedMessageTypes": { "cloud": ["identify", "track", "page", "screen"] @@ -30,7 +36,8 @@ "reactnative": ["cloud"], "flutter": ["cloud"], "cordova": ["cloud"], - "shopify": ["cloud"] + "shopify": ["cloud"], + "warehouse": ["cloud"] }, "destConfig": { "defaultConfig": [ @@ -51,7 +58,8 @@ "reactnative": ["connectionMode", "consentManagement"], "flutter": ["connectionMode", "consentManagement"], "cordova": ["connectionMode", "consentManagement"], - "shopify": ["connectionMode", "consentManagement"] + "shopify": ["connectionMode", "consentManagement"], + "warehouse": ["connectionMode", "consentManagement"] }, "secretKeys": ["apiKey", "apiSecret"] }, diff --git a/src/configurations/destinations/bloomreach/schema.json b/src/configurations/destinations/bloomreach/schema.json index 2eebc22e8..b201967b8 100644 --- a/src/configurations/destinations/bloomreach/schema.json +++ b/src/configurations/destinations/bloomreach/schema.json @@ -82,6 +82,10 @@ "shopify": { "type": "string", "enum": ["cloud"] + }, + "warehouse": { + "type": "string", + "enum": ["cloud"] } } }, @@ -547,6 +551,52 @@ } ] } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } } } } diff --git a/src/configurations/destinations/bloomreach_catalog/db-config.json b/src/configurations/destinations/bloomreach_catalog/db-config.json new file mode 100644 index 000000000..87ee1c2ac --- /dev/null +++ b/src/configurations/destinations/bloomreach_catalog/db-config.json @@ -0,0 +1,36 @@ +{ + "name": "BLOOMREACH_CATALOG", + "displayName": "Bloomreach Catalog", + "config": { + "cdkV2Enabled": true, + "transformAtV1": "router", + "saveDestinationResponse": true, + "supportsBlankAudienceCreation": false, + "supportsVisualMapper": true, + "disableJsonMapper": true, + "isAudienceSupported": false, + "syncBehaviours": ["mirror"], + "supportedSourceTypes": ["warehouse"], + "supportedMessageTypes": { + "cloud": ["record"] + }, + "supportedConnectionModes": { + "warehouse": ["cloud"] + }, + "destConfig": { + "defaultConfig": [ + "apiBaseUrl", + "apiKey", + "apiSecret", + "projectToken", + "oneTrustCookieCategories", + "catalogID" + ], + "warehouse": ["connectionMode", "consentManagement"] + }, + "secretKeys": ["apiKey", "apiSecret"] + }, + "options": { + "isBeta": true + } +} diff --git a/src/configurations/destinations/bloomreach_catalog/schema.json b/src/configurations/destinations/bloomreach_catalog/schema.json new file mode 100644 index 000000000..47ab403e9 --- /dev/null +++ b/src/configurations/destinations/bloomreach_catalog/schema.json @@ -0,0 +1,101 @@ +{ + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "required": ["apiBaseUrl", "apiKey", "apiSecret", "projectToken", "catalogID"], + "type": "object", + "properties": { + "apiBaseUrl": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$|^$" + }, + "apiKey": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + }, + "apiSecret": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + }, + "projectToken": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + }, + "catalogID": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + }, + "oneTrustCookieCategories": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "connectionMode": { + "type": "object", + "properties": { + "warehouse": { + "type": "string", + "enum": ["cloud"] + } + } + }, + "consentManagement": { + "type": "object", + "properties": { + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + } + } + } + } + } +} diff --git a/src/configurations/destinations/bloomreach_catalog/ui-config.json b/src/configurations/destinations/bloomreach_catalog/ui-config.json new file mode 100644 index 000000000..50e59a161 --- /dev/null +++ b/src/configurations/destinations/bloomreach_catalog/ui-config.json @@ -0,0 +1,229 @@ +{ + "uiConfig": { + "baseTemplate": [ + { + "title": "Initial setup", + "note": "Review how this destination is set up", + "sections": [ + { + "groups": [ + { + "title": "Connection settings", + "note": [ + "Update your connection settings here.", + { + "text": "Follow this guide for detailed instructions on retrieving the required settings from Bloomreach.", + "link": "https://documentation.bloomreach.com/engagement/reference/authentication" + } + ], + "icon": "settings", + "fields": [ + { + "type": "textInput", + "label": "API Base URL", + "note": "URL of the Bloomreach instance", + "configKey": "apiBaseUrl", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$|^$", + "regexErrorMessage": "Invalid API Base URl", + "placeholder": "e.g. https://demoapp-api.bloomreach.com" + }, + { + "type": "textInput", + "label": "API Key", + "note": "API Key from Project settings > Access management > API", + "configKey": "apiKey", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "regexErrorMessage": "Invalid API Key", + "placeholder": "e.g. eb3hb4***123", + "secret": true + }, + { + "type": "textInput", + "label": "API Secret", + "note": "API Secret from Project settings > Access management> API", + "configKey": "apiSecret", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "regexErrorMessage": "Invalid API Secret", + "placeholder": "e.g. 9p7v71***123", + "secret": true + }, + { + "type": "textInput", + "label": "Project Token", + "note": "Project Token from Project settings > Access management> API", + "configKey": "projectToken", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "regexErrorMessage": "Invalid Project Token", + "placeholder": "e.g. geu9qu-***-x0i983-***" + }, + { + "type": "textInput", + "label": "Catalog ID", + "note": "Enter the catalog Id that will be used for rETL source for syncing.", + "configKey": "catalogID", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "regexErrorMessage": "Invalid Catalog ID", + "placeholder": "e.g. 65372e*****123" + } + ] + } + ] + }, + { + "groups": [ + { + "title": "Connection mode", + "note": [ + "Update how you want to route events from your source to destination. ", + { + "text": "Get help deciding", + "link": "https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/" + } + ], + "icon": "sliders", + "fields": [] + } + ] + } + ] + }, + { + "title": "Configuration settings", + "note": "Manage the settings for your destination", + "sections": [ + { + "id": "consentSettings", + "title": "Consent settings", + "note": "Configure consent settings for each provider here", + "icon": "settings", + "groups": [ + { + "title": "OneTrust cookie consent settings", + "note": [ + "Enter your OneTrust category names if you have them configured. ", + { + "text": "Learn more ", + "link": "https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/onetrust-consent-manager/" + }, + "about RudderStack's OneTrust Consent Manager feature." + ], + "fields": [ + { + "type": "tagInput", + "label": "Cookie category name", + "note": "Input your OneTrust category names by pressing 'Enter' after each entry", + "configKey": "oneTrustCookieCategories", + "tagKey": "oneTrustCookieCategory", + "placeholder": "e.g: Credit card visit", + "default": [ + { + "oneTrustCookieCategory": "" + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + } + ] + } + ] + } + ], + "sdkTemplate": { + "title": "SDK settings", + "note": "not visible in the ui", + "fields": [] + }, + "consentSettingsTemplate": { + "title": "Consent settings", + "note": "not visible in the ui", + "fields": [ + { + "type": "dynamicCustomForm", + "configKey": "consentManagement", + "default": [], + "rowFields": [ + { + "type": "singleSelect", + "label": "Consent management provider", + "configKey": "provider", + "options": [ + { + "label": "Custom", + "value": "custom" + }, + { + "label": "Ketch", + "value": "ketch" + }, + { + "label": "OneTrust", + "value": "oneTrust" + } + ], + "default": "oneTrust", + "required": true + }, + { + "type": "singleSelect", + "label": "the required consent logic", + "configKey": "resolutionStrategy", + "options": [ + { + "label": "AND", + "value": "and" + }, + { + "label": "OR", + "value": "or" + } + ], + "required": true, + "variant": "badge", + "preRequisites": { + "fields": [ + { + "configKey": "provider", + "value": "custom" + } + ] + } + }, + { + "type": "tagInput", + "label": "Enter consent category ID’s", + "note": "Input your consent category IDs by pressing ‘Enter’ after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "configKey": "consents", + "tagKey": "consent", + "placeholder": "e.g: Marketing", + "default": [ + { + "consent": "" + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": true + } + ] + } + } + ] + } + } +} diff --git a/test/data/validation/destinations/bloomreach_catalog.json b/test/data/validation/destinations/bloomreach_catalog.json new file mode 100644 index 000000000..f0da998cc --- /dev/null +++ b/test/data/validation/destinations/bloomreach_catalog.json @@ -0,0 +1,149 @@ +[ + { + "config": { + "apiBaseUrl": "https://api.test.com/", + "apiKey": "test-apiKey", + "apiSecret": "test-apiSecret", + "projectToken": "test-projectToken", + "catalogID": "test-catalogID", + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "Marketing" + } + ] + }, + "result": true + }, + { + "config": { + "apiKey": "test-apiKey", + "apiSecret": "test-apiSecret", + "projectToken": "test-projectToken", + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "Marketing" + } + ] + }, + "result": false, + "err": [" must have required property 'apiBaseUrl'", " must have required property 'catalogID'"] + }, + { + "testTitle": "With valid multiple consent management providers config", + "config": { + "apiBaseUrl": "https://api.test.com/", + "apiKey": "test-apiKey", + "apiSecret": "test-apiSecret", + "projectToken": "test-projectToken", + "catalogID": "test-catalogID", + "consentManagement": { + "web": [ + { + "provider": "custom", + "consents": [ + { + "consent": "Marketing" + } + ], + "resolutionStrategy": "or" + }, + { + "provider": "oneTrust", + "consents": [ + { + "consent": "Marketing" + } + ] + }, + { + "provider": "ketch", + "consents": [] + } + ] + } + }, + "result": true + }, + { + "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", + "config": { + "apiBaseUrl": "https://api.test.com/", + "apiKey": "test-apiKey", + "apiSecret": "test-apiSecret", + "projectToken": "test-projectToken", + "catalogID": "test-catalogID", + "consentManagement": { + "warehouse": [ + { + "provider": "custom", + "resolutionStrategy": "nor" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.warehouse.0.resolutionStrategy must be equal to one of the allowed values", + "consentManagement.warehouse.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management custom provider config and no resolutionStrategy value", + "config": { + "apiBaseUrl": "https://api.test.com/", + "apiKey": "test-apiKey", + "apiSecret": "test-apiSecret", + "projectToken": "test-projectToken", + "catalogID": "test-catalogID", + "consentManagement": { + "warehouse": [ + { + "provider": "custom" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.warehouse.0 must have required property 'resolutionStrategy'", + "consentManagement.warehouse.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", + "config": { + "apiBaseUrl": "https://api.test.com/", + "apiKey": "test-apiKey", + "apiSecret": "test-apiSecret", + "projectToken": "test-projectToken", + "catalogID": "test-catalogID", + "consentManagement": { + "warehouse": [ + { + "provider": "oneTrust" + } + ] + } + }, + "result": true + }, + { + "testTitle": "With consent management custom provider config invalid provider value", + "config": { + "apiBaseUrl": "https://api.test.com/", + "apiKey": "test-apiKey", + "apiSecret": "test-apiSecret", + "projectToken": "test-projectToken", + "catalogID": "test-catalogID", + "consentManagement": { + "warehouse": [ + { + "provider": "dummyProvider" + } + ] + } + }, + "result": false, + "err": ["consentManagement.warehouse.0.provider must be equal to one of the allowed values"] + } +] From a6a7fa99245e3e476d9e5c35b45cddb2729eed19 Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti <110057617+aanshi07@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:46:34 +0530 Subject: [PATCH 3/3] feat: onboard smartly destination (#1618) --- .../destinations/smartly/db-config.json | 69 ++ .../destinations/smartly/schema.json | 630 ++++++++++++++++++ .../destinations/smartly/ui-config.json | 203 ++++++ .../data/validation/destinations/smartly.json | 87 +++ 4 files changed, 989 insertions(+) create mode 100644 src/configurations/destinations/smartly/db-config.json create mode 100644 src/configurations/destinations/smartly/schema.json create mode 100644 src/configurations/destinations/smartly/ui-config.json create mode 100644 test/data/validation/destinations/smartly.json diff --git a/src/configurations/destinations/smartly/db-config.json b/src/configurations/destinations/smartly/db-config.json new file mode 100644 index 000000000..d289688d8 --- /dev/null +++ b/src/configurations/destinations/smartly/db-config.json @@ -0,0 +1,69 @@ +{ + "name": "SMARTLY", + "displayName": "Smartly", + "config": { + "cdkV2Enabled": true, + "transformAtV1": "router", + "saveDestinationResponse": true, + "includeKeys": [ + "apiToken", + "eventsMapping", + "blacklistedEvents", + "whitelistedEvents", + "eventFilteringOption", + "oneTrustCookieCategories", + "consentManagement" + ], + "excludeKeys": [], + "supportedSourceTypes": [ + "android", + "ios", + "unity", + "amp", + "web", + "cloud", + "warehouse", + "reactnative", + "flutter", + "cordova", + "shopify" + ], + "supportedMessageTypes": { "cloud": ["track"] }, + "supportedConnectionModes": { + "android": ["cloud"], + "ios": ["cloud"], + "web": ["cloud"], + "unity": ["cloud"], + "amp": ["cloud"], + "reactnative": ["cloud"], + "flutter": ["cloud"], + "cordova": ["cloud"], + "shopify": ["cloud"], + "cloud": ["cloud"], + "warehouse": ["cloud"] + }, + "destConfig": { + "defaultConfig": [ + "apiToken", + "eventsMapping", + "blacklistedEvents", + "whitelistedEvents", + "eventFilteringOption", + "oneTrustCookieCategories" + ], + "android": ["connectionMode", "consentManagement"], + "ios": ["connectionMode", "consentManagement"], + "web": ["connectionMode", "consentManagement"], + "unity": ["connectionMode", "consentManagement"], + "amp": ["connectionMode", "consentManagement"], + "cloud": ["connectionMode", "consentManagement"], + "warehouse": ["connectionMode", "consentManagement"], + "reactnative": ["connectionMode", "consentManagement"], + "flutter": ["connectionMode", "consentManagement"], + "cordova": ["connectionMode", "consentManagement"], + "shopify": ["connectionMode", "consentManagement"] + }, + "secretKeys": ["apiToken"] + }, + "options": { "isBeta": true } +} diff --git a/src/configurations/destinations/smartly/schema.json b/src/configurations/destinations/smartly/schema.json new file mode 100644 index 000000000..1c9f94463 --- /dev/null +++ b/src/configurations/destinations/smartly/schema.json @@ -0,0 +1,630 @@ +{ + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "required": ["apiToken"], + "type": "object", + "properties": { + "apiToken": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|.*" + }, + "eventsMapping": { + "type": "array", + "items": { + "type": "object", + "properties": { + "from": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + }, + "to": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + } + } + } + }, + "eventFilteringOption": { + "type": "string", + "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], + "default": "disable" + }, + "whitelistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "blacklistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "oneTrustCookieCategories": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "consentManagement": { + "type": "object", + "properties": { + "cloud": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "android": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "ios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "web": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "unity": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "amp": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "reactnative": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "flutter": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "cordova": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "shopify": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + } + } + }, + "connectionMode": { + "type": "object", + "properties": { + "android": { + "type": "string", + "enum": ["cloud"] + }, + "ios": { + "type": "string", + "enum": ["cloud"] + }, + "web": { + "type": "string", + "enum": ["cloud"] + }, + "unity": { + "type": "string", + "enum": ["cloud"] + }, + "amp": { + "type": "string", + "enum": ["cloud"] + }, + "reactnative": { + "type": "string", + "enum": ["cloud"] + }, + "flutter": { + "type": "string", + "enum": ["cloud"] + }, + "cordova": { + "type": "string", + "enum": ["cloud"] + }, + "shopify": { + "type": "string", + "enum": ["cloud"] + }, + "cloud": { + "type": "string", + "enum": ["cloud"] + }, + "warehouse": { + "type": "string", + "enum": ["cloud"] + } + } + } + } + } +} diff --git a/src/configurations/destinations/smartly/ui-config.json b/src/configurations/destinations/smartly/ui-config.json new file mode 100644 index 000000000..8682ae70e --- /dev/null +++ b/src/configurations/destinations/smartly/ui-config.json @@ -0,0 +1,203 @@ +{ + "uiConfig": { + "baseTemplate": [ + { + "title": "Initial setup", + "note": "Review how this destination is set up", + "sections": [ + { + "groups": [ + { + "title": "Connection settings", + "icon": "settings", + "fields": [ + { + "type": "textInput", + "label": "Api Token", + "note": "", + "configKey": "apiToken", + "secret": true, + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|.*", + "regexErrorMessage": "Invalid Api Token", + "placeholder": "e.g: MOx2ZmMwLNE2A2IdNKL0N2VhN2XXXXX1MTVmMzA1ODk0YmIkNDZhNTojMTk3YTBlMTg1YXXXXXMDA2ZDVmZjY0ZGFiOTVkNDMXXXXcwOWFk" + } + ] + } + ] + }, + { + "groups": [ + { + "title": "Connection mode", + "note": [ + "Update how you want to route events from your source to destination. ", + { + "text": "Get help deciding", + "link": "https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/" + } + ], + "icon": "sliders", + "fields": [], + "defaultConnectionModes": { + "web": "cloud" + } + } + ] + } + ] + }, + { + "title": "Configuration settings", + "note": "Manage the settings for your destination", + "sections": [ + { + "title": "Other settings", + "note": "Configure advanced RudderStack features here", + "icon": "otherSettings", + "groups": [ + { + "title": "Client-side event filtering", + "note": "Decide what events are allowed (allowlisting) and blocked (denylisting)", + "preRequisites": { + "fields": [ + { + "configKey": "connectionMode.web", + "value": "cloud" + } + ], + "condition": "or" + }, + "fields": [ + { + "type": "singleSelect", + "label": "Choose if you want to turn on events filtering:", + "configKey": "eventFilteringOption", + "note": "You must select either allowlist or denylist to enable events filtering", + "options": [ + { + "label": "No events filtering", + "value": "disable" + }, + { + "label": "Filter via allowlist", + "value": "whitelistedEvents" + }, + { + "label": "Filter via denylist", + "value": "blacklistedEvents" + } + ], + "default": "disable" + }, + { + "type": "tagInput", + "label": "Allowlisted events", + "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to allowlist.", + "configKey": "whitelistedEvents", + "tagKey": "eventName", + "placeholder": "e.g: Anonymous page visit", + "default": [ + { + "eventName": "" + } + ], + "preRequisites": { + "fields": [ + { + "configKey": "eventFilteringOption", + "value": "whitelistedEvents" + } + ] + } + }, + { + "type": "tagInput", + "label": "Denylisted events", + "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to denylist. ", + "configKey": "blacklistedEvents", + "tagKey": "eventName", + "placeholder": "e.g: Anonymous page visit", + "default": [ + { + "eventName": "" + } + ], + "preRequisites": { + "fields": [ + { + "configKey": "eventFilteringOption", + "value": "blacklistedEvents" + } + ] + } + } + ] + } + ] + } + ] + }, + { + "title": "Event mapping", + "note": "Map RudderStack events to Smartly events", + "hideEditIcon": true, + "sections": [ + { + "groups": [ + { + "title": "RudderStack Event name to Smartly Event name Mapping", + "fields": [ + { + "type": "redirect", + "redirectGroupKey": "eventsMapping", + "label": "External Event Mapping", + "note": "Map RudderStack events to Smartly events" + } + ] + } + ] + } + ] + } + ], + "sdkTemplate": { + "title": "SDK settings", + "note": "not visible in the ui", + "fields": [] + }, + "redirectGroups": { + "eventsMapping": { + "fields": [ + { + "type": "dynamicCustomForm", + "label": "Map Rudderstack Events to Smartly Events.", + "configKey": "eventsMapping", + "rowFields": [ + { + "type": "mappingRow", + "columns": [ + { + "type": "textInput", + "configKey": "from", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "regexErrorMessage": "Invalid Event name", + "label": "RudderStack Event Name", + "placeholder": "e.g: product added" + }, + { + "type": "textInput", + "configKey": "to", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "regexErrorMessage": "Invalid Event name", + "label": "Smartly Event Name", + "placeholder": "e.g: product added" + } + ] + } + ] + } + ] + } + } + } +} diff --git a/test/data/validation/destinations/smartly.json b/test/data/validation/destinations/smartly.json new file mode 100644 index 000000000..2a76fb493 --- /dev/null +++ b/test/data/validation/destinations/smartly.json @@ -0,0 +1,87 @@ +[ + { + "config": { + "apiToken": "testAuthToken", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "connectionMode": { + "web": "cloud" + } + }, + "result": true + }, + { + "config": { + "apiToken": "testAuthToken", + "eventFilteringOption": "whitelistedEvents", + "whitelistedEvents": [ + { + "eventName": "testevent" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "connectionMode": { + "web": "device" + } + }, + "result": false, + "err": ["connectionMode.web must be equal to one of the allowed values"] + }, + { + "config": { + "apiToken": "testAuthToken", + "eventFilteringOption": "enable", + "whitelistedEvents": [ + { + "eventName": "testevent" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": ["eventFilteringOption must be equal to one of the allowed values"] + }, + { + "config": { + "eventFilteringOption": "whitelistedEvents", + "whitelistedEvents": [ + { + "eventName": "testevent" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "useNativeSDK": { + "web": false + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiToken'"] + } +]