Skip to content

Commit

Permalink
feat(http): added pathParams field and renamed the tab ro URL params
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs committed Dec 9, 2024
1 parent d0258b1 commit 8984b6b
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/configurations/destinations/http/db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"propertiesMapping",
"queryParams",
"headers",
"pathParams",
"isBatchingEnabled",
"maxBatchSize",
"blacklistedEvents",
Expand Down
12 changes: 12 additions & 0 deletions src/configurations/destinations/http/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
}
}
},
"pathParams": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"pattern": "^\\$(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*$|^(?!\\\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$"
}
}
}
},
"queryParams": {
"type": "array",
"items": {
Expand Down
18 changes: 17 additions & 1 deletion src/configurations/destinations/http/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,24 @@
]
},
{
"name": "Query Parameters",
"name": "URL Parameters",
"fields": [
{
"type": "mapping",
"label": "Enter your path parameters in sequence",
"columns": [
{
"key": "path",
"type": "textInput",
"label": "Path",
"placeholder": "$.userId or users",
"regex": "^\\$(\\.(\\w+|\\*)|\\[\\d+\\]|\\[('\\w+'|\"\\w+\")\\]|\\[\\*\\]|\\.\\w+\\(\\))*$|^(?!\\\\$)[A-Za-z0-9!#$%&'*+.^_`|~-]{1,100}$",
"regexErrorMessage": "Please enter a valid JSON path or a constant"
}
],
"default": [],
"configKey": "pathParams"
},
{
"type": "mapping",
"label": "Map your query parameters",
Expand Down
118 changes: 118 additions & 0 deletions test/data/validation/destinations/http.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,5 +577,123 @@
"ketchConsentPurposes.web must be array",
"ketchConsentPurposes.unity.0 must be object"
]
},
{
"testTitle": "With pathParams",
"config": {
"apiUrl": "http://sample.com/api/hooks/{{$.traits.userId}}/url/{{$.properties.event}}",
"auth": "basicAuth",
"username": "test-user",
"password": "",
"method": "POST",
"format": "JSON",
"http-connectionMode": "cloud",
"connectionMode": {
"cloud": "cloud"
},
"consentManagement": {},
"isBatchingEnabled": true,
"maxBatchSize": "10",
"headers": [
{
"from": "$.h1",
"to": "'val1'"
},
{
"from": "$.h2",
"to": "2"
},
{
"to": "testProp",
"from": "$.properties.testProp"
}
],
"queryParams": [
{
"from": "$.q1",
"to": "'val1'"
}
],
"propertiesMapping": [
{
"from": "$.properties.key1",
"to": "$.events.key2"
}
],
"pathParams": [
{
"path": "$.properties.key1"
}
],
"oneTrustCookieCategories": {
"android": [
{
"oneTrustCookieCategory": "more than 100 characters string - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"oneTrustCookieCategory": "C0004"
}
],
"ios": [
{
"oneTrustCookieCategory": {
"not": "a string"
}
},
{
"oneTrustCookieCategory": "C0004"
}
],
"web": {
"not": "an array"
},
"unity": [
"not an object",
{
"oneTrustCookieCategory": "C0004"
}
]
},
"ketchConsentPurposes": {
"android": [
{
"purpose": "more than 100 characters string - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
},
{
"purpose": "P4"
}
],
"ios": [
{
"purpose": {
"not": "a string"
}
},
{
"purpose": "P4"
}
],
"web": {
"not": "an array"
},
"unity": [
"not an object",
{
"purpose": "P4"
}
]
}
},
"result": false,
"err": [
"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.ios.0.purpose must be string",
"ketchConsentPurposes.web must be array",
"ketchConsentPurposes.unity.0 must be object"
]
}
]

0 comments on commit 8984b6b

Please sign in to comment.