-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: onboarding customerio segment (#1853)
Co-authored-by: Manish Kumar <[email protected]> Co-authored-by: Manish Kumar <[email protected]>
- Loading branch information
1 parent
a9c3a6d
commit fe53d8c
Showing
4 changed files
with
322 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/configurations/destinations/customerio_audience/db-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "CUSTOMERIO_AUDIENCE", | ||
"displayName": "Customer.io Audience", | ||
"config": { | ||
"supportsBlankAudienceCreation": true, | ||
"disableJsonMapper": true, | ||
"supportsVisualMapper": true, | ||
"syncBehaviours": ["mirror"], | ||
"transformAtV1": "router", | ||
"saveDestinationResponse": true, | ||
"excludeKeys": [], | ||
"supportedSourceTypes": ["warehouse"], | ||
"supportedMessageTypes": { | ||
"cloud": ["record"] | ||
}, | ||
"isAudienceSupported": true, | ||
"supportedConnectionModes": { | ||
"warehouse": ["cloud"] | ||
}, | ||
"destConfig": { | ||
"defaultConfig": ["siteId", "appApiKey", "apiKey"], | ||
"warehouse": [ | ||
"connectionMode", | ||
"consentManagement", | ||
"oneTrustCookieCategories", | ||
"ketchConsentPurposes" | ||
] | ||
}, | ||
"secretKeys": ["appApiKey", "apiKey"] | ||
}, | ||
"options": { | ||
"isBeta": true | ||
} | ||
} |
115 changes: 115 additions & 0 deletions
115
src/configurations/destinations/customerio_audience/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"configSchema": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"required": ["siteId", "apiKey", "appApiKey"], | ||
"type": "object", | ||
"properties": { | ||
"apiKey": { | ||
"type": "string", | ||
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" | ||
}, | ||
"appApiKey": { | ||
"type": "string", | ||
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" | ||
}, | ||
"siteId": { | ||
"type": "string", | ||
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" | ||
}, | ||
"oneTrustCookieCategories": { | ||
"type": "object", | ||
"properties": { | ||
"warehouse": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"oneTrustCookieCategory": { | ||
"type": "string", | ||
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"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"] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"connectionMode": { | ||
"type": "object", | ||
"properties": { | ||
"warehouse": { | ||
"type": "string", | ||
"enum": ["cloud"] | ||
} | ||
} | ||
}, | ||
"ketchConsentPurposes": { | ||
"type": "object", | ||
"properties": { | ||
"warehouse": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"purpose": { | ||
"type": "string", | ||
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
145 changes: 145 additions & 0 deletions
145
src/configurations/destinations/customerio_audience/ui-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
{ | ||
"uiConfig": { | ||
"baseTemplate": [ | ||
{ | ||
"title": "Initial setup", | ||
"note": "Review how this destination is set up", | ||
"sections": [ | ||
{ | ||
"groups": [ | ||
{ | ||
"title": "Connection settings", | ||
"note": "Update your connection settings here", | ||
"icon": "settings", | ||
"fields": [ | ||
{ | ||
"type": "textInput", | ||
"label": "Site ID", | ||
"note": "Settings > Account Settings > API Credentials > Track APP Keys > Site ID", | ||
"configKey": "siteId", | ||
"regex": "(^env[.].+)|^(.{1,100})$", | ||
"regexErrorMessage": "Invalid Site Id", | ||
"placeholder": "e.g: 88f02580XXXXXXXcf18" | ||
}, | ||
{ | ||
"type": "textInput", | ||
"label": "API Key", | ||
"note": "Settings > Account Settings > API Credentials > Track APP Keys > API KEY of the corresponding Site ID", | ||
"configKey": "apiKey", | ||
"regex": "(^env[.].+)|^(.{1,100})$", | ||
"regexErrorMessage": "Invalid API Key", | ||
"placeholder": "e.g: 2309XXX5483", | ||
"secret": true | ||
}, | ||
{ | ||
"type": "textInput", | ||
"label": "APP API Key", | ||
"note": "Settings > Account Settings > API Credentials > APP API Keys > API KEY", | ||
"configKey": "appApiKey", | ||
"regex": "(^env[.].+)|^(.{1,100})$", | ||
"regexErrorMessage": "Invalid App API Key", | ||
"placeholder": "e.g: 2309XXX5483", | ||
"secret": true | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"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": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"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 IDs", | ||
"note": "Input your consent category IDs by pressing 'Enter' after each entry. We recommend using IDs instead of 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": "" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
test/data/validation/destinations/customerio_audience.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[ | ||
{ | ||
"config": { | ||
"siteId": "test-site-id", | ||
"apiKey": "test-api-key", | ||
"appApiKey": "test-app-api-key" | ||
}, | ||
"result": true | ||
}, | ||
{ | ||
"config": {}, | ||
"result": false, | ||
"err": [ | ||
" must have required property 'siteId'", | ||
" must have required property 'apiKey'", | ||
" must have required property 'appApiKey'" | ||
] | ||
}, | ||
{ | ||
"config": { | ||
"siteId": "test-site-id", | ||
"apiKey": 123, | ||
"appApiKey": [] | ||
}, | ||
"result": false, | ||
"err": ["apiKey must be string", "appApiKey must be string"] | ||
} | ||
] |