diff --git a/src/configurations/destinations/mp/schema.json b/src/configurations/destinations/mp/schema.json index 0b796dc76..942246cb8 100644 --- a/src/configurations/destinations/mp/schema.json +++ b/src/configurations/destinations/mp/schema.json @@ -6,7 +6,7 @@ "properties": { "token": { "type": "string", - "pattern": "(^env[.].+)|^(.{1,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{1,100}$" }, "dataResidency": { "type": "string", @@ -54,7 +54,7 @@ "properties": { "property": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -66,7 +66,7 @@ "properties": { "property": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -78,7 +78,7 @@ "properties": { "property": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -90,7 +90,7 @@ "properties": { "property": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -102,7 +102,7 @@ "properties": { "property": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -121,14 +121,14 @@ }, "sourceName": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" }, "sessionReplayPercentage": { "type": "object", "properties": { "web": { "type": "string", - "pattern": "(^env[.].+)|^(100|[1-9]?[0-9])$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\})(100|[1-9]?[0-9])$" } } }, @@ -143,7 +143,7 @@ }, "persistenceName": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" }, "secureCookie": { "type": "boolean", @@ -185,7 +185,7 @@ "properties": { "eventName": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -197,7 +197,7 @@ "properties": { "eventName": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -212,7 +212,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -224,7 +224,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -236,7 +236,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -248,7 +248,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -260,7 +260,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -272,7 +272,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -284,7 +284,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -296,7 +296,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -308,7 +308,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -320,7 +320,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -332,7 +332,7 @@ "properties": { "oneTrustCookieCategory": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -349,7 +349,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -361,7 +361,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -373,7 +373,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -385,7 +385,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -397,7 +397,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -409,7 +409,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -421,7 +421,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -433,7 +433,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -445,7 +445,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -457,7 +457,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -469,7 +469,7 @@ "properties": { "purpose": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -496,7 +496,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -542,7 +542,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -588,7 +588,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -634,7 +634,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -680,7 +680,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -726,7 +726,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -772,7 +772,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -818,7 +818,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -864,7 +864,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -910,7 +910,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -956,7 +956,7 @@ "properties": { "consent": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$" } } } @@ -1051,7 +1051,7 @@ "properties": { "gdprApiToken": { "type": "string", - "pattern": "(^env[.].+)|^(.{1,100})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{1,100}$" } }, "required": ["gdprApiToken"] @@ -1070,7 +1070,7 @@ "properties": { "userDefinedPageEventTemplate": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,200})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,200}$" } }, "required": ["userDefinedPageEventTemplate"] @@ -1089,7 +1089,7 @@ "properties": { "userDefinedScreenEventTemplate": { "type": "string", - "pattern": "(^env[.].+)|^(.{0,200})$" + "pattern": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,200}$" } }, "required": ["userDefinedScreenEventTemplate"] diff --git a/src/configurations/destinations/mp/ui-config.json b/src/configurations/destinations/mp/ui-config.json index f0093b814..17324db0e 100644 --- a/src/configurations/destinations/mp/ui-config.json +++ b/src/configurations/destinations/mp/ui-config.json @@ -15,7 +15,7 @@ "type": "textInput", "label": "Project Token", "configKey": "token", - "regex": "(^env[.].+)|^(.{1,100})$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{1,100}$", "regexErrorMessage": "Invalid Project Token", "placeholder": "c24f56ed817221606de5a5f0befe8b92", "secret": true, @@ -114,7 +114,7 @@ "type": "textInput", "label": "Page Event Name Template", "configKey": "userDefinedPageEventTemplate", - "regex": "(^env[.].+)|^(.{0,200})$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,200}$", "regexErrorMessage": "Invalid Page Event Name", "required": true, "default": "Viewed {{ category }} {{ name }} page", @@ -146,7 +146,7 @@ "type": "textInput", "label": "Screen Event Name Template", "configKey": "userDefinedScreenEventTemplate", - "regex": "(^env[.].+)|^(.{0,200})$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,200}$", "regexErrorMessage": "Invalid Screen Event Name", "required": true, "default": "Viewed {{ category }} {{ name }} screen", @@ -185,7 +185,7 @@ "configKey": "propIncrements", "label": "Properties to increment in People", "tagKey": "property", - "regex": "^(.{0,100})$", + "regex": "^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$", "regexErrorMessage": "Invalid Property Name", "placeholder": "e.g: Cart-Value" }, @@ -201,7 +201,7 @@ } ], "tagKey": "property", - "regex": "(^env[.].+)|^(.{0,100})$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$", "regexErrorMessage": "Invalid Property Name", "placeholder": "e.g: joiningDate" } @@ -296,7 +296,7 @@ }, "label": "GDPR API Token", "configKey": "gdprApiToken", - "regex": "(^env[.].+)|^(.{1,100})$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{1,100}$", "regexErrorMessage": "Invalid GDPR API Token", "required": true, "placeholder": "e.g: 7vwaux7et2tkXXXX1o0qtbt1x97n2je", @@ -441,7 +441,7 @@ "type": "textInput", "label": "Source Name", "configKey": "sourceName", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$", "regexErrorMessage": "Invalid Source Name", "required": false, "placeholder": "e.g: Rudder-JS", @@ -451,7 +451,7 @@ "type": "textInput", "label": "Percentage of SDK initializations that will qualify for replay data capture", "configKey": "sessionReplayPercentage", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(100|[1-9]?[0-9])$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\})(100|[1-9]?[0-9])$", "regexErrorMessage": "Invalid Percentage", "placeholder": "e.g: 1", "default": "0", @@ -489,7 +489,7 @@ "type": "textInput", "label": "Persistence Name", "configKey": "persistenceName", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "regex": "(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$", "note": "Enter a persistence name for the Mixpanel cookie." }, { @@ -504,7 +504,7 @@ "configKey": "superProperties", "label": "Property to send as super Properties", "tagKey": "property", - "regex": "^(.{0,100})$", + "regex": "^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$", "regexErrorMessage": "Invalid Property Name", "placeholder": "e.g: residence" }, @@ -513,7 +513,7 @@ "configKey": "peopleProperties", "label": "Traits to set as People Properties", "tagKey": "property", - "regex": "^(.{0,100})$", + "regex": "^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$", "regexErrorMessage": "Invalid Property Name", "placeholder": "e.g: address" }, @@ -522,7 +522,7 @@ "configKey": "eventIncrements", "label": "Events to increment in People", "tagKey": "property", - "regex": "^(.{0,100})$", + "regex": "^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$", "regexErrorMessage": "Invalid Property Name", "placeholder": "e.g: Added-to-cart" } diff --git a/test/data/validation/destinations/mp.json b/test/data/validation/destinations/mp.json index 28df2859f..2bf358660 100644 --- a/test/data/validation/destinations/mp.json +++ b/test/data/validation/destinations/mp.json @@ -157,7 +157,9 @@ } }, "result": false, - "err": ["sourceName must match pattern \"(^env[.].+)|^(.{0,100})$\""] + "err": [ + "sourceName must match pattern \"(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$\"" + ] }, { "config": { @@ -512,7 +514,11 @@ ] } }, - "result": true + "result": false, + "err": [ + "oneTrustCookieCategories.cloud.0.oneTrustCookieCategory must match pattern \"(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$\"", + "ketchConsentPurposes.cloud.0.purpose must match pattern \"(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$\"" + ] }, { "config": { @@ -729,12 +735,12 @@ }, "result": false, "err": [ - "sessionReplayPercentage.web must match pattern \"(^env[.].+)|^(100|[1-9]?[0-9])$\"", - "oneTrustCookieCategories.android.0.oneTrustCookieCategory must match pattern \"(^env[.].+)|^(.{0,100})$\"", + "sessionReplayPercentage.web must match pattern \"(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\})(100|[1-9]?[0-9])$\"", + "oneTrustCookieCategories.android.0.oneTrustCookieCategory must match pattern \"(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$\"", "oneTrustCookieCategories.ios.0.oneTrustCookieCategory must be string", "oneTrustCookieCategories.web must be array", "oneTrustCookieCategories.unity.0 must be object", - "ketchConsentPurposes.android.0.purpose must match pattern \"(^env[.].+)|^(.{0,100})$\"", + "ketchConsentPurposes.android.0.purpose must match pattern \"(^env[.].+)|^(?!.*\\{\\{.*\\|\\|(.*)\\}\\}).{0,100}$\"", "ketchConsentPurposes.ios.0.purpose must be string", "ketchConsentPurposes.web must be array", "ketchConsentPurposes.unity.0 must be object"