diff --git a/src/configurations/destinations/salesforce_oauth/db-config.json b/src/configurations/destinations/salesforce_oauth/db-config.json new file mode 100644 index 000000000..0e7115bb1 --- /dev/null +++ b/src/configurations/destinations/salesforce_oauth/db-config.json @@ -0,0 +1,45 @@ +{ + "name": "SALESFORCE_OAUTH", + "displayName": "Salesforce V2", + "config": { + "isAudienceSupported": true, + "supportsVisualMapper": true, + "auth": { + "type": "OAuth", + "role": "salesforce", + "rudderScopes": [ + "delivery" + ] + }, + "transformAt": "router", + "transformAtV1": "router", + "saveDestinationResponse": true, + "includeKeys": ["oneTrustCookieCategories"], + "excludeKeys": [], + "supportedSourceTypes": [ + "android", + "ios", + "web", + "unity", + "amp", + "cloud", + "warehouse", + "reactnative", + "flutter", + "cordova", + "shopify" + ], + "supportedMessageTypes": ["identify"], + "destConfig": { + "defaultConfig": [ + "rudderAccountId", + "mapProperties", + "sandbox", + "useContactId", + "oneTrustCookieCategories" + ] + }, + "secretKeys": [] + }, + "options": { "hidden": true } +} diff --git a/src/configurations/destinations/salesforce_oauth/metadata.json b/src/configurations/destinations/salesforce_oauth/metadata.json new file mode 100644 index 000000000..59c4d726b --- /dev/null +++ b/src/configurations/destinations/salesforce_oauth/metadata.json @@ -0,0 +1,25 @@ +{ + "metadata": { + "primaryCategory": "", + "secondaryCategory": [], + "docLink": "", + "logoPath": "", + "connectionMode": { + "cloud-mode": true, + "device-mode": ["web", "android"] + }, + "supportedMethods": { + "cloud-mode": ["track", "identify"], + "device-mode": { + "web": ["track", "identify"] + } + }, + "releaseStatus": "beta", + "sourceCode": { + "android": { + "github": "", + "version": "v1.0.0" + } + } + } +} diff --git a/src/configurations/destinations/salesforce_oauth/schema.json b/src/configurations/destinations/salesforce_oauth/schema.json new file mode 100644 index 000000000..2383092fc --- /dev/null +++ b/src/configurations/destinations/salesforce_oauth/schema.json @@ -0,0 +1,24 @@ +{ + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "required": [], + "type": "object", + "properties": { + "mapProperties": { "type": "boolean", "default": true }, + "sandbox": { "type": "boolean", "default": false }, + "useContactId": { "type": "boolean", "default": false }, + "oneTrustCookieCategories": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + } + } +} diff --git a/src/configurations/destinations/salesforce_oauth/ui-config.json b/src/configurations/destinations/salesforce_oauth/ui-config.json new file mode 100644 index 000000000..8c7f52dcc --- /dev/null +++ b/src/configurations/destinations/salesforce_oauth/ui-config.json @@ -0,0 +1,43 @@ +{ + "uiConfig": [ + { + "title": "Other Settings", + "fields": [ + { + "type": "checkbox", + "label": "Map Rudder Properties to Salesforce Properties", + "value": "mapProperties", + "default": true + }, + { "type": "checkbox", "label": "Sandbox mode", "value": "sandbox", "default": false }, + { + "type": "checkbox", + "label": "Use contactId for converted leads", + "value": "useContactId", + "default": false, + "footerNote": "It is suggested to enable this option when both lead and contact field mappings are same." + } + ] + }, + { + "title": "Consent Settings", + "fields": [ + { + "type": "dynamicCustomForm", + "value": "oneTrustCookieCategories", + "label": "OneTrust Cookie Categories", + "customFields": [ + { + "type": "textInput", + "placeholder": "Marketing", + "value": "oneTrustCookieCategory", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "label": "Category Name/ID", + "required": false + } + ] + } + ] + } + ] +} diff --git a/test/data/validation/destinations/salesforce_oauth.json b/test/data/validation/destinations/salesforce_oauth.json new file mode 100644 index 000000000..df31fa005 --- /dev/null +++ b/test/data/validation/destinations/salesforce_oauth.json @@ -0,0 +1,35 @@ +[ + { + "config": { + "mapProperties": true, + "sandbox": false, + "useContactId": true + }, + "result": true + }, + { + "config": { + "mapProperties": true, + "sandbox": false, + "useContactId": true + }, + "result": true + }, + { + "config": { + "mapProperties": true, + "sandbox": false, + "useContactId": true + }, + "result": true + }, + { + "config": { + "mapProperties": true, + "sandbox": "random", + "useContactId": true + }, + "result": false, + "err": ["sandbox must be boolean"] + } +]