diff --git a/CHANGELOG.md b/CHANGELOG.md index cce72191c..e56a94717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ 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.20.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.19.0...v1.20.0) (2023-04-04) + + +### Features + +* **klaviyo:** make private API kay mandatory ([#501](https://github.com/rudderlabs/rudder-config-schema/issues/501)) ([a2d26b8](https://github.com/rudderlabs/rudder-config-schema/commit/a2d26b8d3a1e8faa463585545411b329ee1b950e)) + + +### Bug Fixes + +* impact error message and test update ([#499](https://github.com/rudderlabs/rudder-config-schema/issues/499)) ([de7d78f](https://github.com/rudderlabs/rudder-config-schema/commit/de7d78f67554f16c35bb0509fe0fd8f37a6adca2)) + ## 1.19.0 (2023-04-03) diff --git a/package-lock.json b/package-lock.json index 7b5a58d89..83560f82a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-config-schema", - "version": "1.19.0", + "version": "1.20.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-config-schema", - "version": "1.19.0", + "version": "1.20.0", "license": "MIT", "dependencies": { "ajv": "^8.12.0", diff --git a/package.json b/package.json index 0584f4d3e..b82af2e39 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-config-schema", - "version": "1.19.0", + "version": "1.20.0", "description": "", "main": "src/index.ts", "private": true, diff --git a/src/configurations/destinations/impact/schema.json b/src/configurations/destinations/impact/schema.json index af10b3861..cd8ea1ea0 100644 --- a/src/configurations/destinations/impact/schema.json +++ b/src/configurations/destinations/impact/schema.json @@ -2,7 +2,7 @@ "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "required": ["apiKey"], + "required": ["apiKey", "accountSID", "campaignId"], "properties": { "accountSID": { "type": "string", diff --git a/src/configurations/destinations/impact/ui-config.json b/src/configurations/destinations/impact/ui-config.json index 4b3e62640..4b5068795 100644 --- a/src/configurations/destinations/impact/ui-config.json +++ b/src/configurations/destinations/impact/ui-config.json @@ -7,7 +7,7 @@ "type": "textInput", "label": "Account SID", "value": "accountSID", - "regex": "^(.{1,100})$", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", "regexErrorMessage": "Invalid Account SID", "required": true, "placeholder": "e.g. saDbFeVZicnpPeGJ6M0JOTXFxTVN2QkdpWTJ3NENpNUlZ", @@ -18,7 +18,7 @@ "type": "textInput", "label": "API Key", "value": "apiKey", - "regex": "^(.{1,100})$", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", "regexErrorMessage": "Invalid API Key", "required": true, "placeholder": "e.g: npPeGJ6M0JOjgAvfCs-XAYkh~dpWTJ", @@ -29,7 +29,7 @@ "type": "textInput", "label": "Campaign Id", "value": "campaignId", - "regex": "^[0-9]+$", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]+$", "regexErrorMessage": "Invalid Campaign Id", "required": true, "placeholder": "e.g: 34343", @@ -40,7 +40,7 @@ "type": "textInput", "label": "Impact App Id", "value": "impactAppId", - "regex": "^[0-9]+$", + "regex": "(^\\{\\{.*\\|\\|(.*?)\\}\\}$)|(^env[.].+)|^[0-9]+$|^$", "regexErrorMessage": "Invalid Impact App Id", "required": false, "placeholder": "e.g: 34343", @@ -56,8 +56,8 @@ "type": "textInput", "label": "Event Type Id", "value": "eventTypeId", - "regex": "^[0-9]+$", - "regexErrorMessage": "Invalid Account SID", + "regex": "(^\\{\\{.*\\|\\|(.*?)\\}\\}$)|(^env[.].+)|^[0-9]+$|^$", + "regexErrorMessage": "Invalid Event Type Id", "required": false, "placeholder": "e.g. 35355", "secret": false, diff --git a/src/configurations/destinations/klaviyo/schema.json b/src/configurations/destinations/klaviyo/schema.json index e98631006..375b85aa0 100644 --- a/src/configurations/destinations/klaviyo/schema.json +++ b/src/configurations/destinations/klaviyo/schema.json @@ -2,12 +2,16 @@ "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "required": ["publicApiKey"], + "required": ["publicApiKey", "privateApiKey"], "properties": { "publicApiKey": { "type": "string", "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" }, + "privateApiKey": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + }, "listId": { "type": "string", "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" diff --git a/src/configurations/destinations/klaviyo/ui-config.json b/src/configurations/destinations/klaviyo/ui-config.json index 8d95f8183..4e12b7f0e 100644 --- a/src/configurations/destinations/klaviyo/ui-config.json +++ b/src/configurations/destinations/klaviyo/ui-config.json @@ -18,8 +18,8 @@ "type": "textInput", "label": "Private API Key", "value": "privateApiKey", - "regex": ".*", - "required": false, + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "required": true, "placeholder": "e.g. c59e3838", "secret": true, "footerNote": "Your Private API Key" diff --git a/test/data/validation/destinations/impact.json b/test/data/validation/destinations/impact.json index eb8a3182d..333b82d0b 100644 --- a/test/data/validation/destinations/impact.json +++ b/test/data/validation/destinations/impact.json @@ -32,7 +32,7 @@ "accountSID": "dfsgertrtff3erfc34rfwf", "apiKey": "fghsdfgegvcergfvfdfsag", "campaignId": "23224", - "impactAppId": "rtfjb", + "impactAppId": false, "eventTypeId": "56446", "enableEmailHashing": true, "rudderToImpactProperty": [ @@ -54,9 +54,7 @@ "installEventNames": [{ "eventName": "App Installed" }] }, "result": false, - "err": [ - "impactAppId must match pattern \"(^\\{\\{.*\\|\\|(.*?)\\}\\}$)|(^env[.].+)|^[0-9]+$|^$\"" - ] + "err": ["impactAppId must be string"] }, { "config": { @@ -64,7 +62,7 @@ "apiKey": "fghsdfgegvcergfvfdfsag", "campaignId": "23224", "impactAppId": "56446", - "eventTypeId": "rtfjb", + "eventTypeId": 43434, "enableEmailHashing": true, "rudderToImpactProperty": [ { @@ -85,9 +83,7 @@ "installEventNames": [{ "eventName": "App Installed" }] }, "result": false, - "err": [ - "eventTypeId must match pattern \"(^\\{\\{.*\\|\\|(.*?)\\}\\}$)|(^env[.].+)|^[0-9]+$|^$\"" - ] + "err": ["eventTypeId must be string"] }, { "config": { diff --git a/test/data/validation/destinations/klaviyo.json b/test/data/validation/destinations/klaviyo.json index 2e3adbaed..fbab64aaf 100644 --- a/test/data/validation/destinations/klaviyo.json +++ b/test/data/validation/destinations/klaviyo.json @@ -1,6 +1,7 @@ [ { "config": { + "privateApiKey": "WfO9dsffsf1", "listId": "ior6v5j", "enforceEmailAsPrimary": true, "consent": "directmail", @@ -31,6 +32,25 @@ "useNativeSDK": { "web": true }, "oneTrustCookieCategories": [{ "oneTrustCookieCategory": "" }] }, + "result": false, + "err": [" must have required property 'privateApiKey'"] + }, + { + "config": { + "publicApiKey": "WfO9f1", + "privateApiKey": "WfO9dsffsf1", + "listId": "ior6v5j", + "enforceEmailAsPrimary": true, + "consent": "directmail", + "smsConsent": false, + "sendPageAsTrack": true, + "additionalPageInfo": true, + "eventFilteringOption": "disable", + "whitelistedEvents": [{ "eventName": "" }], + "blacklistedEvents": [{ "eventName": "" }], + "useNativeSDK": { "web": true }, + "oneTrustCookieCategories": [{ "oneTrustCookieCategory": "" }] + }, "result": true } ]