Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: onboard Amazon Audience #1667

Merged
merged 11 commits into from
Oct 9, 2024
36 changes: 36 additions & 0 deletions src/configurations/destinations/amazon_audience/db-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "AMAZON_AUDIENCE",
"displayName": "Amazon Audience",
"config": {
"auth": { "type": "OAuth", "role": "amazon_audience", "rudderScopes": ["delivery"] },
"transformAtV1": "router",
"excludeKeys": [],
"supportedSourceTypes": ["cloud", "warehouse"],
anantjain45823 marked this conversation as resolved.
Show resolved Hide resolved
"supportedConnectionModes": {
"cloud": ["cloud"],
"warehouse": ["cloud"]
},
"isAudienceSupported": true,
"supportsBlankAudienceCreation": true,
"syncBehaviours": ["mirror"],
"disableJsonMapper": true,
"supportsVisualMapper": true,
"destConfig": {
"defaultConfig": [
"rudderAccountId",
"audienceId",
"authServer",
"advertiserId",
"externalAudienceId",
"ttl",
"dataSourceCountry",
"enableHash"
],
"cloud": ["connectionMode", "consentManagement"],
"warehouse": ["connectionMode", "consentManagement"]
},
"secretKeys": [],
"supportedMessageTypes": { "cloud": ["record"] }
},
"options": { "isBeta": true }
}
49 changes: 49 additions & 0 deletions src/configurations/destinations/amazon_audience/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"configSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": ["authServer"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't authServer also be required field ? It's in Initial setup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah authServer should be required field hence it is kept in required array here

"properties": {
"authServer": {
"type": "string",
"enum": ["North America"],
"default": "North America"
},
"advertiserId": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,150})$"
},
"externalAudienceId": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,50})$"
},
"ttl": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]\\d*$"
},
"enableHash": {
"type": "boolean",
"default": false
},
"dataSourceCountry": {
"type": "array",
"items": {
"type": "object",
"properties": {
"country": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
}
}
}
},
"connectionMode": {
"type": "object",
"properties": {
"cloud": { "type": "string", "enum": ["cloud"] },
"warehouse": { "type": "string", "enum": ["cloud"] }
}
}
}
}
}
150 changes: 150 additions & 0 deletions src/configurations/destinations/amazon_audience/ui-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"description": "GENERATED CODE DO NOT EDIT",
anantjain45823 marked this conversation as resolved.
Show resolved Hide resolved
"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": [
{
"configKey": "advertiserId",
"type": "nestedSelect",
"label": "Select your Account",
"apiName": "getAmazonAdvertiser",
"placeholder": "Select Advertiser Id details",
"preRequisites": {
"fields": [
{
"configKey": "rudderAccountId",
"exists": true
}
]
}
},
{
"type": "singleSelect",
"label": "Authorization servers",
"note": " Support for more servers will be supported soon",
anantjain45823 marked this conversation as resolved.
Show resolved Hide resolved
"configKey": "authServer",
"options": [
{
"name": "North America",
"value": "North America"
}
],
"default": "North America"
}
]
}
]
},
{
"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": [
{
"groups": [
{
"title": "Optional configuration settings",
"note": "Configure advanced destination-specific settings here",
"icon": "settings",
"fields": [
{
"type": "checkbox",
"label": "Enable user data hashing",
"note": [
"Enabling this will hash all the user data before sending it to X(Twitter)",
anantjain45823 marked this conversation as resolved.
Show resolved Hide resolved
"Do not enable it if you already pass hash data to rudderstack"
],
"configKey": "enableHash",
"default": false
}
]
},
{
"title": "Optional Audience Creation Configuration settings",
"icon": "settings",
"fields": [
{
krishna2020 marked this conversation as resolved.
Show resolved Hide resolved
"configKey": "externalAudienceId",
"type": "textInput",
"label": "Type External Audience Id to use while creating Audience",
"placeholder": "Default: Rudderstack Audience",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,50})$",
"regexErrorMessage": "Invalid External Audience Id",
"default": "Rudderstack Audience"
},
{
"configKey": "ttl",
"type": "textInput",
"label": "Time To Live",
"placeholder": "Default: 34300800(13 Months)",
"regexErrorMessage": "ttl should be in number",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]\\d*$",
"note": [
"Refer below link for more info",
{
"text": "Time To live",
"link": "https://advertising.amazon.com/API/docs/en-us/guides/amazon-marketing-cloud/audiences/audience-management-service#:~:text=a%20given%20invocation.-,Note,-The%20time%2Dto"
anantjain45823 marked this conversation as resolved.
Show resolved Hide resolved
}
],
"default": "34300800"
},
{
"type": "tagInput",
"label": "Data Source Countries",
"configKey": "dataSourceCountry",
"tagKey": "country",
"placeholder": "e.g: US",
"note": [
"Refer below link for more info",
{
"text": "Time To live",
"link": "https://advertising.amazon.com/API/docs/en-us/guides/amazon-marketing-cloud/audiences/audience-management-service#:~:text=a%20given%20invocation.-,Note,-The%20time%2Dto"
}
],
"default": [
{
"country": "US"
}
]
}
]
}
]
}
]
}
],
"sdkTemplate": {
"title": "Web SDK settings",
"note": "not visible in the ui",
"fields": []
}
}
}
1 change: 1 addition & 0 deletions src/configurations/destinations/x_audience/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"configKey": "accountId",
"type": "nestedSelect",
"label": "Select your Account",
"note": "Select Account -> Account Settings -> General -> AccountId",
"apiName": "getXAccounts",
"placeholder": "Select account details",
"preRequisites": {
Expand Down
33 changes: 33 additions & 0 deletions test/data/validation/destinations/amazon_audience.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"testTitle": "With all required configs",
"config": {
"rudderAccountId": "test-host",
"ttl": "1230",
"enableHash": true,
"dataSourceCountry": [
{
"country": "US"
},
{
"country": "CAN"
}
],
"advertiserId": "test-advertiser-id",
"audienceId": "test-audience-id"
},
"result": true
},
{
"testTitle": "With missing accountId",
"config": {
"rudderAccountId": "test-host",
"audienceId": "test-audience-id",
"advertiserId": ""
},
"result": false,
"err": [
"advertiserId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,150})$\""
]
}
]
Loading