Skip to content

Commit

Permalink
feat: onboarding salesforce with oauth (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 authored Nov 10, 2023
1 parent 968310a commit f774dfd
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/configurations/destinations/salesforce_oauth/db-config.json
Original file line number Diff line number Diff line change
@@ -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 }
}
25 changes: 25 additions & 0 deletions src/configurations/destinations/salesforce_oauth/metadata.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
24 changes: 24 additions & 0 deletions src/configurations/destinations/salesforce_oauth/schema.json
Original file line number Diff line number Diff line change
@@ -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})$"
}
}
}
}
}
}
}
43 changes: 43 additions & 0 deletions src/configurations/destinations/salesforce_oauth/ui-config.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
]
}
]
}
35 changes: 35 additions & 0 deletions test/data/validation/destinations/salesforce_oauth.json
Original file line number Diff line number Diff line change
@@ -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"]
}
]

0 comments on commit f774dfd

Please sign in to comment.