diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9a9bd5c..25d9c0a7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.70.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.69.0...v1.70.0) (2024-04-05) + + +### Features + +* extend gcm support for additional destinations ([#1307](https://github.com/rudderlabs/rudder-config-schema/issues/1307)) ([d819a43](https://github.com/rudderlabs/rudder-config-schema/commit/d819a43b2287c33cb30fd26a90da9abb2e6c5ac0)) + ## [1.69.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.68.1...v1.69.0) (2024-04-02) diff --git a/package-lock.json b/package-lock.json index 41582be72..17c105d7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-config-schema", - "version": "1.69.0", + "version": "1.70.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-config-schema", - "version": "1.69.0", + "version": "1.70.0", "license": "MIT", "dependencies": { "ajv": "^8.12.0", diff --git a/package.json b/package.json index a11353c63..f6450ddc7 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-config-schema", - "version": "1.69.0", + "version": "1.70.0", "description": "", "main": "src/index.ts", "private": true, diff --git a/src/configurations/destinations/linkedin_insight_tag/db-config.json b/src/configurations/destinations/linkedin_insight_tag/db-config.json index 8e3a60efd..80bb03c26 100644 --- a/src/configurations/destinations/linkedin_insight_tag/db-config.json +++ b/src/configurations/destinations/linkedin_insight_tag/db-config.json @@ -10,7 +10,8 @@ "whitelistedEvents", "oneTrustCookieCategories", "eventFilteringOption", - "eventToConversionIdMap" + "eventToConversionIdMap", + "consentManagement" ], "excludeKeys": [], "supportedSourceTypes": ["web"], @@ -31,7 +32,7 @@ "eventToConversionIdMap", "oneTrustCookieCategories" ], - "web": ["useNativeSDK"] + "web": ["useNativeSDK", "consentManagement"] } } } diff --git a/src/configurations/destinations/linkedin_insight_tag/schema.json b/src/configurations/destinations/linkedin_insight_tag/schema.json index fddffa4cc..d3fedfc00 100644 --- a/src/configurations/destinations/linkedin_insight_tag/schema.json +++ b/src/configurations/destinations/linkedin_insight_tag/schema.json @@ -1,3 +1,59 @@ { - "configSchema": null + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "consentManagement": { + "type": "object", + "properties": { + "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"] + } + } + ] + } + } + } + } + } + } } diff --git a/src/configurations/destinations/linkedin_insight_tag/ui-config.json b/src/configurations/destinations/linkedin_insight_tag/ui-config.json index e2b1e3211..50439ac84 100644 --- a/src/configurations/destinations/linkedin_insight_tag/ui-config.json +++ b/src/configurations/destinations/linkedin_insight_tag/ui-config.json @@ -111,7 +111,98 @@ "label": "Category ID", "required": false } - ] + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "type": "dynamicCustomForm", + "value": "consentManagement", + "label": "Consent management settings", + "footerNote": "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.", + "customFields": [ + { + "type": "singleSelect", + "label": "Consent management provider", + "value": "provider", + "options": [ + { + "name": "Custom", + "value": "custom" + }, + { + "name": "Ketch", + "value": "ketch" + }, + { + "name": "OneTrust", + "value": "oneTrust" + } + ], + "defaultOption": { + "name": "OneTrust", + "value": "oneTrust" + }, + "required": true + }, + { + "type": "singleSelect", + "label": "the required consent logic", + "value": "resolutionStrategy", + "options": [ + { + "name": "AND", + "value": "and" + }, + { + "name": "OR", + "value": "or" + } + ], + "required": true, + "variant": "badge", + "preRequisites": { + "fields": [ + { + "configKey": "provider", + "value": "custom" + } + ] + } + }, + { + "type": "dynamicCustomForm", + "value": "consents", + "label": "Enter consent category ID’s", + "customFields": [ + { + "type": "textInput", + "placeholder": "Marketing", + "value": "consent", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "required": false + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": true + } + ] + } } ] } diff --git a/src/configurations/destinations/posthog/db-config.json b/src/configurations/destinations/posthog/db-config.json index 7945ef39b..d898e0a54 100644 --- a/src/configurations/destinations/posthog/db-config.json +++ b/src/configurations/destinations/posthog/db-config.json @@ -15,7 +15,8 @@ "oneTrustCookieCategories", "enableLocalStoragePersistence", "eventFilteringOption", - "useV2Group" + "useV2Group", + "consentManagement" ], "transformAtV1": "processor", "saveDestinationResponse": true, @@ -67,8 +68,19 @@ "disableSessionRecording", "propertyBlackList", "xhrHeaders", - "enableLocalStoragePersistence" - ] + "enableLocalStoragePersistence", + "consentManagement" + ], + "android": ["consentManagement"], + "ios": ["consentManagement"], + "unity": ["consentManagement"], + "amp": ["consentManagement"], + "cloud": ["consentManagement"], + "reactnative": ["consentManagement"], + "flutter": ["consentManagement"], + "cordova": ["consentManagement"], + "shopify": ["consentManagement"], + "warehouse": ["consentManagement"] }, "secretKeys": ["teamApiKey"] } diff --git a/src/configurations/destinations/posthog/schema.json b/src/configurations/destinations/posthog/schema.json index fddffa4cc..b401ae9d7 100644 --- a/src/configurations/destinations/posthog/schema.json +++ b/src/configurations/destinations/posthog/schema.json @@ -1,3 +1,519 @@ { - "configSchema": null + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "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"] + } + } + ] + } + } + } + } + } + } } diff --git a/src/configurations/destinations/posthog/ui-config.json b/src/configurations/destinations/posthog/ui-config.json index a11079c79..4155d3b48 100644 --- a/src/configurations/destinations/posthog/ui-config.json +++ b/src/configurations/destinations/posthog/ui-config.json @@ -167,7 +167,98 @@ "label": "Category ID", "required": false } - ] + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "type": "dynamicCustomForm", + "value": "consentManagement", + "label": "Consent management settings", + "footerNote": "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.", + "customFields": [ + { + "type": "singleSelect", + "label": "Consent management provider", + "value": "provider", + "options": [ + { + "name": "Custom", + "value": "custom" + }, + { + "name": "Ketch", + "value": "ketch" + }, + { + "name": "OneTrust", + "value": "oneTrust" + } + ], + "defaultOption": { + "name": "OneTrust", + "value": "oneTrust" + }, + "required": true + }, + { + "type": "singleSelect", + "label": "the required consent logic", + "value": "resolutionStrategy", + "options": [ + { + "name": "AND", + "value": "and" + }, + { + "name": "OR", + "value": "or" + } + ], + "required": true, + "variant": "badge", + "preRequisites": { + "fields": [ + { + "configKey": "provider", + "value": "custom" + } + ] + } + }, + { + "type": "dynamicCustomForm", + "value": "consents", + "label": "Enter consent category ID’s", + "customFields": [ + { + "type": "textInput", + "placeholder": "Marketing", + "value": "consent", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "required": false + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": true + } + ] + } } ] }, diff --git a/src/configurations/destinations/rs/db-config.json b/src/configurations/destinations/rs/db-config.json index eed40943b..cc275b949 100644 --- a/src/configurations/destinations/rs/db-config.json +++ b/src/configurations/destinations/rs/db-config.json @@ -5,7 +5,7 @@ "config": { "transformAtV1": "processor", "saveDestinationResponse": true, - "includeKeys": ["oneTrustCookieCategories"], + "includeKeys": ["oneTrustCookieCategories", "consentManagement"], "excludeKeys": [], "supportedSourceTypes": [ "android", @@ -60,7 +60,18 @@ "jsonPaths", "useRudderStorage", "oneTrustCookieCategories" - ] + ], + "web": ["consentManagement"], + "android": ["consentManagement"], + "ios": ["consentManagement"], + "unity": ["consentManagement"], + "amp": ["consentManagement"], + "cloud": ["consentManagement"], + "reactnative": ["consentManagement"], + "flutter": ["consentManagement"], + "cordova": ["consentManagement"], + "shopify": ["consentManagement"], + "cloudSource": ["consentManagement"] }, "secretKeys": ["password", "accessKeyID", "accessKey"] } diff --git a/src/configurations/destinations/rs/schema.json b/src/configurations/destinations/rs/schema.json index 8a059df1f..b84fc84d5 100644 --- a/src/configurations/destinations/rs/schema.json +++ b/src/configurations/destinations/rs/schema.json @@ -87,6 +87,517 @@ } } } + }, + "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"] + } + } + ] + } + }, + "cloudSource": { + "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"] + } + } + ] + } + } + } } }, "allOf": [ diff --git a/src/configurations/destinations/rs/ui-config.json b/src/configurations/destinations/rs/ui-config.json index 24a8f85e9..50ed1c59a 100644 --- a/src/configurations/destinations/rs/ui-config.json +++ b/src/configurations/destinations/rs/ui-config.json @@ -309,7 +309,98 @@ "label": "Category ID", "required": false } - ] + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "type": "dynamicCustomForm", + "value": "consentManagement", + "label": "Consent management settings", + "footerNote": "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.", + "customFields": [ + { + "type": "singleSelect", + "label": "Consent management provider", + "value": "provider", + "options": [ + { + "name": "Custom", + "value": "custom" + }, + { + "name": "Ketch", + "value": "ketch" + }, + { + "name": "OneTrust", + "value": "oneTrust" + } + ], + "defaultOption": { + "name": "OneTrust", + "value": "oneTrust" + }, + "required": true + }, + { + "type": "singleSelect", + "label": "the required consent logic", + "value": "resolutionStrategy", + "options": [ + { + "name": "AND", + "value": "and" + }, + { + "name": "OR", + "value": "or" + } + ], + "required": true, + "variant": "badge", + "preRequisites": { + "fields": [ + { + "configKey": "provider", + "value": "custom" + } + ] + } + }, + { + "type": "dynamicCustomForm", + "value": "consents", + "label": "Enter consent category ID’s", + "customFields": [ + { + "type": "textInput", + "placeholder": "Marketing", + "value": "consent", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "required": false + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": true + } + ] + } } ] } diff --git a/test/data/validation/destinations/linkedin_insight_tag.json b/test/data/validation/destinations/linkedin_insight_tag.json new file mode 100644 index 000000000..daedc9f4e --- /dev/null +++ b/test/data/validation/destinations/linkedin_insight_tag.json @@ -0,0 +1,95 @@ +[ + { + "testTitle": "With valid multiple consent management providers config", + "config": { + "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": { + "consentManagement": { + "web": [ + { + "provider": "custom", + "resolutionStrategy": "nor" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.web.0.resolutionStrategy must be equal to one of the allowed values", + "consentManagement.web.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management custom provider config and no resolutionStrategy value", + "config": { + "consentManagement": { + "web": [ + { + "provider": "custom" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.web.0 must have required property 'resolutionStrategy'", + "consentManagement.web.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", + "config": { + "consentManagement": { + "web": [ + { + "provider": "oneTrust" + } + ] + } + }, + "result": true + }, + { + "testTitle": "With consent management custom provider config invalid provider value", + "config": { + "consentManagement": { + "web": [ + { + "provider": "dummyProvider" + } + ] + } + }, + "result": false, + "err": ["consentManagement.web.0.provider must be equal to one of the allowed values"] + } +] diff --git a/test/data/validation/destinations/posthog.json b/test/data/validation/destinations/posthog.json new file mode 100644 index 000000000..00ea5b2b7 --- /dev/null +++ b/test/data/validation/destinations/posthog.json @@ -0,0 +1,95 @@ +[ + { + "testTitle": "With valid multiple consent management providers config", + "config": { + "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": { + "consentManagement": { + "android": [ + { + "provider": "custom", + "resolutionStrategy": "nor" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0.resolutionStrategy must be equal to one of the allowed values", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management custom provider config and no resolutionStrategy value", + "config": { + "consentManagement": { + "android": [ + { + "provider": "custom" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0 must have required property 'resolutionStrategy'", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", + "config": { + "consentManagement": { + "android": [ + { + "provider": "oneTrust" + } + ] + } + }, + "result": true + }, + { + "testTitle": "With consent management custom provider config invalid provider value", + "config": { + "consentManagement": { + "android": [ + { + "provider": "dummyProvider" + } + ] + } + }, + "result": false, + "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] + } +] diff --git a/test/data/validation/destinations/rs.json b/test/data/validation/destinations/rs.json index 0e70b6fec..a4dc49d53 100644 --- a/test/data/validation/destinations/rs.json +++ b/test/data/validation/destinations/rs.json @@ -192,5 +192,168 @@ "useSTSTokens": false }, "result": true + }, + { + "testTitle": "With valid multiple consent management providers config", + "config": { + "host": "test-host", + "database": "test-database", + "user": "test-user", + "password": "test-password", + "port": "0000", + "useSSH": false, + "syncFrequency": "30", + "enableSSE": false, + "useRudderStorage": false, + "useSTSTokens": false, + "bucketName": "test-bucket", + "roleBasedAuth": false, + "accessKeyID": "", + "accessKey": "", + "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": { + "host": "test-host", + "database": "test-database", + "user": "test-user", + "password": "test-password", + "port": "0000", + "useSSH": false, + "syncFrequency": "30", + "enableSSE": false, + "useRudderStorage": false, + "useSTSTokens": false, + "bucketName": "test-bucket", + "roleBasedAuth": false, + "accessKeyID": "", + "accessKey": "", + "consentManagement": { + "android": [ + { + "provider": "custom", + "resolutionStrategy": "nor" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0.resolutionStrategy must be equal to one of the allowed values", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management custom provider config and no resolutionStrategy value", + "config": { + "host": "test-host", + "database": "test-database", + "user": "test-user", + "password": "test-password", + "port": "0000", + "useSSH": false, + "syncFrequency": "30", + "enableSSE": false, + "useRudderStorage": false, + "useSTSTokens": false, + "bucketName": "test-bucket", + "roleBasedAuth": false, + "accessKeyID": "", + "accessKey": "", + "consentManagement": { + "android": [ + { + "provider": "custom" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0 must have required property 'resolutionStrategy'", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", + "config": { + "host": "test-host", + "database": "test-database", + "user": "test-user", + "password": "test-password", + "port": "0000", + "useSSH": false, + "syncFrequency": "30", + "enableSSE": false, + "useRudderStorage": false, + "useSTSTokens": false, + "bucketName": "test-bucket", + "roleBasedAuth": false, + "accessKeyID": "", + "accessKey": "", + "consentManagement": { + "android": [ + { + "provider": "oneTrust" + } + ] + } + }, + "result": true + }, + { + "testTitle": "With consent management custom provider config invalid provider value", + "config": { + "host": "test-host", + "database": "test-database", + "user": "test-user", + "password": "test-password", + "port": "0000", + "useSSH": false, + "syncFrequency": "30", + "enableSSE": false, + "useRudderStorage": false, + "useSTSTokens": false, + "bucketName": "test-bucket", + "roleBasedAuth": false, + "accessKeyID": "", + "accessKey": "", + "consentManagement": { + "android": [ + { + "provider": "dummyProvider" + } + ] + } + }, + "result": false, + "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] } ]