From 5bfe85cb5c8419095da7613486db745cc0c8fa07 Mon Sep 17 00:00:00 2001 From: Sanjay <71065320+Sanjay-Veernala@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:30:13 +0530 Subject: [PATCH 1/7] chore(test-suite): moved destinations to new test suite component --- package-lock.json | 126 +- test/__tests__/data/localScript.js | 29 + test/__tests__/data/redis.json | 511 +++ test/__tests__/data/redis_input.json | 405 --- test/__tests__/data/redis_output.json | 90 - test/__tests__/data/revenue_cat.json | 709 ++++ test/__tests__/data/revenue_cat_input.json | 449 --- test/__tests__/data/revenue_cat_output.json | 424 --- test/__tests__/data/rockerbox_router.json | 330 ++ .../data/rockerbox_router_input.json | 168 - .../data/rockerbox_router_output.json | 158 - test/__tests__/data/routerCommon.json | 85 + test/__tests__/data/salesforce.json | 997 ++++++ test/__tests__/data/salesforce_input.json | 793 ----- test/__tests__/data/salesforce_output.json | 320 -- test/__tests__/data/salesforce_router.json | 514 +++ .../data/salesforce_router_input.json | 277 -- .../data/salesforce_router_metadata.json | 122 + .../salesforce_router_metadata_input.json | 98 - .../salesforce_router_metadata_output.json | 20 - .../data/salesforce_router_output.json | 233 -- test/__tests__/data/segment.json | 446 +++ test/__tests__/data/slack.json | 1263 +++++++ test/__tests__/data/slack_router.json | 422 +++ .../data/snapchat_conversion_router.json | 397 +++ .../snapchat_conversion_router_input.json | 321 -- .../snapchat_conversion_router_output.json | 72 - .../data/snapchat_custom_audience_router.json | 99 + ...snapchat_custom_audience_router_input.json | 46 - ...napchat_custom_audience_router_output.json | 49 - test/__tests__/data/splitio.json | 1 + test/__tests__/data/splitio_input.json | 367 -- test/__tests__/data/splitio_output.json | 261 -- test/__tests__/data/splitio_router.json | 176 + test/__tests__/data/splitio_router_input.json | 82 - .../__tests__/data/splitio_router_output.json | 90 - ...{statsig_output.json => stats_output.json} | 266 +- test/__tests__/data/statsig.json | 953 +++++ test/__tests__/data/statsig_input.json | 1150 +++--- test/__tests__/data/stormly_router.json | 122 + test/__tests__/data/stormly_router_input.json | 55 - .../__tests__/data/stormly_router_output.json | 63 - test/__tests__/data/tiktok_ads.json | 3090 +++++++++++++++++ test/__tests__/data/tiktok_ads_input.json | 2500 ------------- .../tiktok_ads_offline_events_router.json | 339 ++ ...iktok_ads_offline_events_router_input.json | 142 - ...ktok_ads_offline_events_router_output.json | 193 - test/__tests__/data/tiktok_ads_output.json | 1545 --------- test/__tests__/data/tiktok_ads_router.json | 730 ++++ .../data/tiktok_ads_router_input.json | 439 --- .../data/tiktok_ads_router_output.json | 287 -- test/__tests__/data/variance.json | 719 ++++ test/__tests__/data/variance_input.json | 410 --- test/__tests__/data/variance_output.json | 421 --- test/__tests__/data/vero_router.json | 265 ++ test/__tests__/data/vero_router_input.json | 88 - test/__tests__/data/vero_router_output.json | 175 - test/__tests__/redis.test.js | 34 +- test/__tests__/revenue_cat.test.js | 24 +- test/__tests__/rockerbox.test.js | 22 +- test/__tests__/salesforce.test.js | 62 +- test/__tests__/segment.test.js | 34 +- test/__tests__/slack.test.js | 41 +- test/__tests__/snapchat_conversion.test.js | 20 +- .../snapchat_custom_audience.test.js | 25 +- test/__tests__/splitio.test.js | 51 +- test/__tests__/statsig-cdk.test.ts | 19 +- test/__tests__/statsig.test.js | 32 +- test/__tests__/stormly.test.js | 18 +- test/__tests__/tiktok_ads.test.js | 40 +- .../tiktok_ads_offline_events.test.js | 20 +- test/__tests__/variance-cdk.test.ts | 19 +- test/__tests__/variance.test.js | 33 +- test/__tests__/vero.test.js | 16 +- 74 files changed, 13318 insertions(+), 12094 deletions(-) create mode 100644 test/__tests__/data/localScript.js create mode 100644 test/__tests__/data/redis.json delete mode 100644 test/__tests__/data/redis_input.json delete mode 100644 test/__tests__/data/redis_output.json create mode 100644 test/__tests__/data/revenue_cat.json delete mode 100644 test/__tests__/data/revenue_cat_input.json delete mode 100644 test/__tests__/data/revenue_cat_output.json create mode 100644 test/__tests__/data/rockerbox_router.json delete mode 100644 test/__tests__/data/rockerbox_router_input.json delete mode 100644 test/__tests__/data/rockerbox_router_output.json create mode 100644 test/__tests__/data/routerCommon.json create mode 100644 test/__tests__/data/salesforce.json delete mode 100644 test/__tests__/data/salesforce_input.json delete mode 100644 test/__tests__/data/salesforce_output.json create mode 100644 test/__tests__/data/salesforce_router.json delete mode 100644 test/__tests__/data/salesforce_router_input.json create mode 100644 test/__tests__/data/salesforce_router_metadata.json delete mode 100644 test/__tests__/data/salesforce_router_metadata_input.json delete mode 100644 test/__tests__/data/salesforce_router_metadata_output.json delete mode 100644 test/__tests__/data/salesforce_router_output.json create mode 100644 test/__tests__/data/segment.json create mode 100644 test/__tests__/data/slack.json create mode 100644 test/__tests__/data/slack_router.json create mode 100644 test/__tests__/data/snapchat_conversion_router.json delete mode 100644 test/__tests__/data/snapchat_conversion_router_input.json delete mode 100644 test/__tests__/data/snapchat_conversion_router_output.json create mode 100644 test/__tests__/data/snapchat_custom_audience_router.json delete mode 100644 test/__tests__/data/snapchat_custom_audience_router_input.json delete mode 100644 test/__tests__/data/snapchat_custom_audience_router_output.json create mode 100644 test/__tests__/data/splitio.json delete mode 100644 test/__tests__/data/splitio_input.json delete mode 100644 test/__tests__/data/splitio_output.json create mode 100644 test/__tests__/data/splitio_router.json delete mode 100644 test/__tests__/data/splitio_router_input.json delete mode 100644 test/__tests__/data/splitio_router_output.json rename test/__tests__/data/{statsig_output.json => stats_output.json} (82%) create mode 100644 test/__tests__/data/statsig.json create mode 100644 test/__tests__/data/stormly_router.json delete mode 100644 test/__tests__/data/stormly_router_input.json delete mode 100644 test/__tests__/data/stormly_router_output.json create mode 100644 test/__tests__/data/tiktok_ads.json delete mode 100644 test/__tests__/data/tiktok_ads_input.json create mode 100644 test/__tests__/data/tiktok_ads_offline_events_router.json delete mode 100644 test/__tests__/data/tiktok_ads_offline_events_router_input.json delete mode 100644 test/__tests__/data/tiktok_ads_offline_events_router_output.json delete mode 100644 test/__tests__/data/tiktok_ads_output.json create mode 100644 test/__tests__/data/tiktok_ads_router.json delete mode 100644 test/__tests__/data/tiktok_ads_router_input.json delete mode 100644 test/__tests__/data/tiktok_ads_router_output.json create mode 100644 test/__tests__/data/variance.json delete mode 100644 test/__tests__/data/variance_input.json delete mode 100644 test/__tests__/data/variance_output.json create mode 100644 test/__tests__/data/vero_router.json delete mode 100644 test/__tests__/data/vero_router_input.json delete mode 100644 test/__tests__/data/vero_router_output.json diff --git a/package-lock.json b/package-lock.json index d1334cb0f6..5881d320d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,6 @@ "ajv": "^8.12.0", "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", - "aws-sdk": "^2.1354.0", "axios": "^1.4.0", "btoa": "^1.2.1", "component-each": "^0.2.6", @@ -8146,6 +8145,7 @@ }, "node_modules/available-typed-arrays": { "version": "1.0.5", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -8158,52 +8158,6 @@ "version": "1.1.2", "license": "MIT" }, - "node_modules/aws-sdk": { - "version": "2.1462.0", - "license": "Apache-2.0", - "dependencies": { - "buffer": "4.9.2", - "events": "1.1.1", - "ieee754": "1.1.13", - "jmespath": "0.16.0", - "querystring": "0.2.0", - "sax": "1.2.1", - "url": "0.10.3", - "util": "^0.12.4", - "uuid": "8.0.0", - "xml2js": "0.5.0" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/aws-sdk/node_modules/buffer": { - "version": "4.9.2", - "license": "MIT", - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "node_modules/aws-sdk/node_modules/events": { - "version": "1.1.1", - "license": "MIT", - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/aws-sdk/node_modules/ieee754": { - "version": "1.1.13", - "license": "BSD-3-Clause" - }, - "node_modules/aws-sdk/node_modules/uuid": { - "version": "8.0.0", - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/axios": { "version": "1.4.0", "license": "MIT", @@ -12429,6 +12383,7 @@ }, "node_modules/for-each": { "version": "0.3.3", + "dev": true, "license": "MIT", "dependencies": { "is-callable": "^1.1.3" @@ -13031,6 +12986,7 @@ }, "node_modules/gopd": { "version": "1.0.1", + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" @@ -13619,20 +13575,6 @@ "node": "*" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.1", "dev": true, @@ -13696,6 +13638,7 @@ }, "node_modules/is-callable": { "version": "1.2.7", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -13994,6 +13937,7 @@ }, "node_modules/is-typed-array": { "version": "1.1.10", + "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", @@ -14073,6 +14017,7 @@ }, "node_modules/isarray": { "version": "1.0.0", + "dev": true, "license": "MIT" }, "node_modules/iserror": { @@ -14780,13 +14725,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jmespath": { - "version": "0.16.0", - "license": "Apache-2.0", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/joi": { "version": "17.9.2", "license": "BSD-3-Clause", @@ -17482,12 +17420,6 @@ "node": ">=0.10.0" } }, - "node_modules/querystring": { - "version": "0.2.0", - "engines": { - "node": ">=0.4.x" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "dev": true, @@ -18115,10 +18047,6 @@ "dev": true, "license": "MIT" }, - "node_modules/sax": { - "version": "1.2.1", - "license": "ISC" - }, "node_modules/semver": { "version": "7.5.3", "license": "ISC", @@ -19588,14 +19516,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url": { - "version": "0.10.3", - "license": "MIT", - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, "node_modules/url-parse-lax": { "version": "3.0.0", "dev": true, @@ -19615,10 +19535,6 @@ "node": ">= 4" } }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "license": "MIT" - }, "node_modules/utf8-byte-length": { "version": "1.0.4", "license": "WTFPL" @@ -19627,17 +19543,6 @@ "version": "0.0.1", "license": "MIT" }, - "node_modules/util": { - "version": "0.12.5", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "license": "MIT" @@ -19776,6 +19681,7 @@ }, "node_modules/which-typed-array": { "version": "1.1.9", + "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", @@ -19915,24 +19821,6 @@ "version": "1.0.2", "license": "ISC" }, - "node_modules/xml2js": { - "version": "0.5.0", - "license": "MIT", - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "license": "MIT", - "engines": { - "node": ">=4.0" - } - }, "node_modules/xtend": { "version": "4.0.2", "dev": true, diff --git a/test/__tests__/data/localScript.js b/test/__tests__/data/localScript.js new file mode 100644 index 0000000000..850403534e --- /dev/null +++ b/test/__tests__/data/localScript.js @@ -0,0 +1,29 @@ +const fs = require('fs'); + +function parseJSONFile(integration) { + try { + const inputFilePath = `${integration}_input.json` + const outputFiltPath = `${integration}_output.json` + + // Read the JSON file synchronously + const inputJsonData = JSON.parse(fs.readFileSync(inputFilePath, 'utf8')); + const outputJsonData = JSON.parse(fs.readFileSync(outputFiltPath, 'utf8')); + + const finalData = []; + // Parse the JSON data + const size = inputJsonData.length; + + for(let i=0;i" + }, + "DestinationDefinition": { + "DisplayName": "Kochava", + "ID": "1WTpBSTiL3iAUHUdW7rHT4sawgU", + "Name": "KOCHAVA" + }, + "Enabled": true, + "ID": "1WTpIHpH7NTBgjeiUPW1kCUgZGI", + "Name": "kochava test", + "Transformations": [] + } + }, + "output": [ + { + "metadata": null, + "batched": false, + "statusCode": 400, + "error": "Invalid event array", + "statTags": "undefined" + } + ] + } +] diff --git a/test/__tests__/data/salesforce.json b/test/__tests__/data/salesforce.json new file mode 100644 index 0000000000..814e65c247 --- /dev/null +++ b/test/__tests__/data/salesforce.json @@ -0,0 +1,997 @@ +[ + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp" + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp", + "LeadSource": "RudderLabs" + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech", + "LeadSource": "RudderLabs" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp", + "LeadSource": "RudderLabs" + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "track", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": { "statusCode": 400, "message": "message type track is not supported" } + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp", + "LeadSource": "RudderLabs", + "customKey": "customValue", + "customNullValue": null + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech", + "LeadSource": "RudderLabs", + "customKey__c": "customValue" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp", + "LeadSource": "RudderLabs", + "customKey": "customValue", + "customNullValue": null + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "PostalCode": "94115", + "LastName": "n/a", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "n/a", + "LeadSource": "RudderLabs", + "customKey__c": "customValue" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "traits": { + "City": "east greenwich", + "Company": "Initech", + "Country": "USA", + "Email": "peter.gibbons@initech.com", + "FirstName": "Peter", + "LastName": "Gibbons", + "Phone": "570-690-4150", + "PostalCode": "94115", + "Rating": "Hot", + "State": "California", + "Street": "19123 forest lane", + "Title": "VP of Derp" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", + "externalId": [{ "type": "Salesforce-Contact", "id": "sf-contact-id" }] + }, + "integrations": { "All": true }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Contact/sf-contact-id?_HttpMethod=PATCH", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email__c": "peter.gibbons@initech.com", + "Phone__c": "570-690-4150", + "Rating__c": "Hot", + "Title__c": "VP of Derp", + "FirstName__c": "Peter", + "LastName": "n/a", + "LastName__c": "Gibbons", + "PostalCode__c": "94115", + "City__c": "east greenwich", + "Country__c": "USA", + "State__c": "California", + "Street__c": "19123 forest lane", + "Company__c": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com", + "mapProperty": false + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "traits": { + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", + "externalId": [{ "type": "Salesforce-Lead", "id": "sf-contact-id" }] + }, + "integrations": { "All": true }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/sf-contact-id?_HttpMethod=PATCH", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", + "password": "dummyPassword2", + "userName": "test.c97-qvpd@force.com.test", + "sandbox": true + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", + "Name": "Test SF", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", + "password": "dummyPassword2", + "userName": "test.c97-qvpd@force.com.test", + "sandbox": true + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", + "Name": "Test SF", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "mappedToDestination": true, + "externalId": [ + { + "id": "a005g0000383kmUAAQ", + "type": "SALESFORCE-custom_object__c", + "identifierType": "Id" + } + ], + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "traits": { "email": "john@rs.com", "firstname": "john doe" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { "email": "john@rs.com", "firstname": "john doe" }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "destination": { + "Config": { + "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", + "password": "dummyPassword2", + "userName": "test.c97-qvpd@force.com.test", + "sandbox": true + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", + "Name": "Test SF", + "Transformations": [] + }, + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "mappedToDestination": true, + "externalId": [ + { + "id": "a005g0000383kmUAAQ", + "type": "SALESFORCE-custom_object__c", + "identifierType": "Id" + } + ], + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "traits": { "email": "john@rs.com", "firstname": "john doe", "Id": "some-id" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { "email": "john@rs.com", "firstname": "john doe" }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ] + } +] diff --git a/test/__tests__/data/salesforce_input.json b/test/__tests__/data/salesforce_input.json deleted file mode 100644 index 32115abf15..0000000000 --- a/test/__tests__/data/salesforce_input.json +++ /dev/null @@ -1,793 +0,0 @@ -[ - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "track", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs", - "customKey": "customValue", - "customNullValue": null - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs", - "customKey": "customValue", - "customNullValue": null - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "City": "east greenwich", - "Company": "Initech", - "Country": "USA", - "Email": "peter.gibbons@initech.com", - "FirstName": "Peter", - "LastName": "Gibbons", - "Phone": "570-690-4150", - "PostalCode": "94115", - "Rating": "Hot", - "State": "California", - "Street": "19123 forest lane", - "Title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", - "externalId": [ - { - "type": "Salesforce-Contact", - "id": "sf-contact-id" - } - ] - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com", - "mapProperty": false - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", - "externalId": [ - { - "type": "Salesforce-Lead", - "id": "sf-contact-id" - } - ] - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", - "password": "dummyPassword2", - "userName": "test.c97-qvpd@force.com.test", - "sandbox": true - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", - "Name": "Test SF", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", - "password": "dummyPassword2", - "userName": "test.c97-qvpd@force.com.test", - "sandbox": true - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", - "Name": "Test SF", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "id": "a005g0000383kmUAAQ", - "type": "SALESFORCE-custom_object__c", - "identifierType": "Id" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "john@rs.com", - "firstname": "john doe" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", - "password": "dummyPassword2", - "userName": "test.c97-qvpd@force.com.test", - "sandbox": true - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", - "Name": "Test SF", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "id": "a005g0000383kmUAAQ", - "type": "SALESFORCE-custom_object__c", - "identifierType": "Id" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "john@rs.com", - "firstname": "john doe", - "Id": "some-id" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - } -] diff --git a/test/__tests__/data/salesforce_output.json b/test/__tests__/data/salesforce_output.json deleted file mode 100644 index 69b383d23a..0000000000 --- a/test/__tests__/data/salesforce_output.json +++ /dev/null @@ -1,320 +0,0 @@ -[ - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech", - "LeadSource": "RudderLabs" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "message type track is not supported" - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech", - "LeadSource": "RudderLabs", - "customKey__c": "customValue" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "PostalCode": "94115", - "LastName": "n/a", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "n/a", - "LeadSource": "RudderLabs", - "customKey__c": "customValue" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Contact/sf-contact-id?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email__c": "peter.gibbons@initech.com", - "Phone__c": "570-690-4150", - "Rating__c": "Hot", - "Title__c": "VP of Derp", - "FirstName__c": "Peter", - "LastName": "n/a", - "LastName__c": "Gibbons", - "PostalCode__c": "94115", - "City__c": "east greenwich", - "Country__c": "USA", - "State__c": "California", - "Street__c": "19123 forest lane", - "Company__c": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/sf-contact-id?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "email": "john@rs.com", - "firstname": "john doe" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "email": "john@rs.com", - "firstname": "john doe" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ] -] diff --git a/test/__tests__/data/salesforce_router.json b/test/__tests__/data/salesforce_router.json new file mode 100644 index 0000000000..866346dc15 --- /dev/null +++ b/test/__tests__/data/salesforce_router.json @@ -0,0 +1,514 @@ +[ + { + "input": [ + { + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + }, + "metadata": { + "jobId": 1 + }, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + }, + { + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "ddv_ua+{{1234*245}}@bugFix.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + }, + "metadata": { + "jobId": 2 + }, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + }, + { + "message": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" + }, + "integrations": { + "All": true + }, + "traits": { + "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", + "company": "Initech", + "address": { + "city": "east greenwich", + "country": "USA", + "state": "California", + "street": "19123 forest lane", + "postalCode": "94115" + }, + "email": "peter.gibbons@initech.com", + "name": "Peter Gibbons", + "phone": "570-690-4150", + "rating": "Hot", + "title": "VP of Derp" + }, + "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", + "originalTimestamp": "2020-01-27T12:20:55.301Z", + "receivedAt": "2020-01-27T17:50:58.657+05:30", + "request_ip": "14.98.244.60", + "sentAt": "2020-01-27T12:20:56.849Z", + "timestamp": "2020-01-27T17:50:57.109+05:30", + "type": "identify", + "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" + }, + "metadata": { + "jobId": 3 + }, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + }, + { + "message": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + }, + "metadata": { + "jobId": 4 + }, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + } + ], + "output": [ + { + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ], + "metadata": [ + { + "jobId": 1 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + }, + { + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/leadId?_HttpMethod=PATCH", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "ddv_ua+{{1234*245}}@bugFix.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ], + "metadata": [ + { + "jobId": 2 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + }, + { + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + } + ], + "metadata": [ + { + "jobId": 3 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + }, + "metadata": [ + { + "jobId": 4 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "initialAccessToken": "dummyInitialAccessToken", + "password": "dummyPassword1", + "userName": "testsalesforce1453@gmail.com" + }, + "DestinationDefinition": { + "DisplayName": "Salesforce", + "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", + "Name": "SALESFORCE" + }, + "Enabled": true, + "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", + "Name": "tst", + "Transformations": [] + } + } + ] + } +] diff --git a/test/__tests__/data/salesforce_router_input.json b/test/__tests__/data/salesforce_router_input.json deleted file mode 100644 index 39451af0f1..0000000000 --- a/test/__tests__/data/salesforce_router_input.json +++ /dev/null @@ -1,277 +0,0 @@ -[ - { - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "ddv_ua+{{1234*245}}@bugFix.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "message": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - } -] diff --git a/test/__tests__/data/salesforce_router_metadata.json b/test/__tests__/data/salesforce_router_metadata.json new file mode 100644 index 0000000000..d137f7438b --- /dev/null +++ b/test/__tests__/data/salesforce_router_metadata.json @@ -0,0 +1,122 @@ +[ + { + "input": { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer 00D2v000002lXbX!ARcA12345.MbUdtmlREscrN_nmytokenAzNkhT1XZIF0yPqyCQSnezWO3osqwerty12O7q41E9.LvedWY" + }, + "params": {}, + "body": { + "JSON": { + "Email": "peter.gibbons@initech.com", + "Phone": "570-690-4150", + "Rating": "Hot", + "Title": "VP of Derp", + "FirstName": "Peter", + "LastName": "Gibbons", + "PostalCode": "94115", + "City": "east greenwich", + "Country": "USA", + "State": "California", + "Street": "19123 forest lane", + "Company": "Initech" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "jobId": 1 + }, + { + "jobId": 2 + }, + { + "jobId": 3 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "initialAccessToken": "9f58ryaInitToken1343dsu73", + "password": "dummyPassword3", + "userName": "testsalesforce1453@gmail.com" + }, + "secretConfig": {}, + "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", + "name": "Marketo", + "enabled": true, + "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", + "deleted": false, + "createdAt": "2020-12-30T08:39:32.005Z", + "updatedAt": "2021-02-03T16:22:31.374Z", + "destinationDefinition": { + "config": { + "supportsVisualMapper": true, + "transformAt": "router", + "transformAtV1": "router", + "saveDestinationResponse": true, + "includeKeys": [], + "excludeKeys": [], + "supportedSourceTypes": [ + "android", + "ios", + "web", + "unity", + "amp", + "cloud", + "warehouse", + "reactnative", + "flutter", + "cordova" + ], + "supportedMessageTypes": ["identify"], + "destConfig": { + "defaultConfig": [ + "userName", + "password", + "initialAccessToken", + "mapProperties", + "sandbox", + "useContactId" + ] + }, + "secretKeys": ["password", "initialAccessToken"] + } + }, + "transformations": [], + "isConnectionEnabled": true, + "isProcessorEnabled": true + } + }, + "output": [ + { + "destInfo": { + "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe" + }, + "jobId": 1 + }, + { + "destInfo": { + "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe" + }, + "jobId": 2 + }, + { + "destInfo": { + "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe" + }, + "jobId": 3 + } + ] + } +] diff --git a/test/__tests__/data/salesforce_router_metadata_input.json b/test/__tests__/data/salesforce_router_metadata_input.json deleted file mode 100644 index 4c8c62301d..0000000000 --- a/test/__tests__/data/salesforce_router_metadata_input.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcA12345.MbUdtmlREscrN_nmytokenAzNkhT1XZIF0yPqyCQSnezWO3osqwerty12O7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - }, - { - "jobId": 3 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "9f58ryaInitToken1343dsu73", - "password": "dummyPassword3", - "userName": "testsalesforce1453@gmail.com" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Marketo", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "config": { - "supportsVisualMapper": true, - "transformAt": "router", - "transformAtV1": "router", - "saveDestinationResponse": true, - "includeKeys": [], - "excludeKeys": [], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportedMessageTypes": ["identify"], - "destConfig": { - "defaultConfig": [ - "userName", - "password", - "initialAccessToken", - "mapProperties", - "sandbox", - "useContactId" - ] - }, - "secretKeys": ["password", "initialAccessToken"] - } - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } -} diff --git a/test/__tests__/data/salesforce_router_metadata_output.json b/test/__tests__/data/salesforce_router_metadata_output.json deleted file mode 100644 index bc560d73a7..0000000000 --- a/test/__tests__/data/salesforce_router_metadata_output.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe" - }, - "jobId": 1 - }, - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe" - }, - "jobId": 2 - }, - { - "destInfo": { - "authKey": "1mMy5cqbtfuaKZv1IhVQKnBdVwe" - }, - "jobId": 3 - } -] diff --git a/test/__tests__/data/salesforce_router_output.json b/test/__tests__/data/salesforce_router_output.json deleted file mode 100644 index 698b4fa821..0000000000 --- a/test/__tests__/data/salesforce_router_output.json +++ /dev/null @@ -1,233 +0,0 @@ -[ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/leadId?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "ddv_ua+{{1234*245}}@bugFix.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 3 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - } -] diff --git a/test/__tests__/data/segment.json b/test/__tests__/data/segment.json new file mode 100644 index 0000000000..42db242fd5 --- /dev/null +++ b/test/__tests__/data/segment.json @@ -0,0 +1,446 @@ +[ + { + "input": { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { "writeKey": "abcdefghijklmnopqrstuvwxyz" }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.2" }, + "locale": "en-GB", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { "density": 2 }, + "traits": { "age": 23, "email": "testmp@rudderstack.com", "firstname": "Test Kafka" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "258b77c6-442d-4bdc-8729-f0e4cef41353", + "name": "home", + "originalTimestamp": "2020-04-17T14:55:31.367Z", + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "receivedAt": "2020-04-17T20:25:31.381+05:30", + "request_ip": "[::1]:57363", + "sentAt": "2020-04-17T14:55:31.367Z", + "timestamp": "2020-04-17T20:25:31.381+05:30", + "type": "page", + "userId": "user12345" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "userId": "user12345", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "page", + "userId": "user12345", + "traits": { "age": 23, "email": "testmp@rudderstack.com", "firstname": "Test Kafka" }, + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "timeStamp": "2020-04-17T20:25:31.381+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { "writeKey": "abcdefghijklmnopqrstuvwxyz" }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.2" }, + "locale": "en-GB", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { "density": 2 }, + "traits": { "age": 23, "email": "testmp@email.com", "firstname": "Test Transformer" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "023a3a48-190a-4968-9394-a8e99b81a3c0", + "originalTimestamp": "2020-04-17T14:55:31.37Z", + "receivedAt": "2020-04-17T20:25:31.401+05:30", + "request_ip": "[::1]:57364", + "sentAt": "2020-04-17T14:55:31.37Z", + "timestamp": "2020-04-17T20:25:31.401+05:30", + "type": "identify", + "userId": "user12345" + } + }, + "output": { + "version": "1", + "type": "REST", + "userId": "user12345", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "identify", + "userId": "user12345", + "traits": { "age": 23, "email": "testmp@email.com", "firstname": "Test Transformer" }, + "timeStamp": "2020-04-17T20:25:31.401+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { "writeKey": "abcdefghijklmnopqrstuvwxyz" }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.2" }, + "locale": "en-GB", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { "density": 2 }, + "traits": { "age": 23, "email": "testmp@email.com", "firstname": "Test Transformer" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "event": "test track with property", + "integrations": { "All": true }, + "messageId": "584fde02-901a-4964-a4a0-4078b999d5b2", + "originalTimestamp": "2020-04-17T14:55:31.372Z", + "properties": { "test_prop_1": "test prop", "test_prop_2": 1232 }, + "receivedAt": "2020-04-17T20:25:31.401+05:30", + "request_ip": "[::1]:57365", + "sentAt": "2020-04-17T14:55:31.372Z", + "timestamp": "2020-04-17T20:25:31.401+05:30", + "type": "track", + "userId": "user12345" + } + }, + "output": { + "version": "1", + "type": "REST", + "userId": "user12345", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "track", + "userId": "user12345", + "event": "test track with property", + "traits": { "age": 23, "email": "testmp@email.com", "firstname": "Test Transformer" }, + "properties": { "test_prop_1": "test prop", "test_prop_2": 1232 }, + "timeStamp": "2020-04-17T20:25:31.401+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { "writeKey": "abcdefghijklmnopqrstuvwxyz" }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.2" }, + "locale": "en-GB", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { "density": 2 }, + "traits": { "age": 23, "email": "testmp@rudderstack.com", "firstname": "Test Kafka" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "258b77c6-442d-4bdc-8729-f0e4cef41353", + "name": "home", + "originalTimestamp": "2020-04-17T14:55:31.367Z", + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "receivedAt": "2020-04-17T20:25:31.381+05:30", + "request_ip": "[::1]:57363", + "sentAt": "2020-04-17T14:55:31.367Z", + "timestamp": "2020-04-17T20:25:31.381+05:30", + "type": "page", + "userId": "user12345" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "type": "page", + "userId": "user12345", + "traits": { "age": 23, "email": "testmp@rudderstack.com", "firstname": "Test Kafka" }, + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "timeStamp": "2020-04-17T20:25:31.381+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "userId": "user12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { "writeKey": "abcdefghijklmnopqrstuvwxyz" }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.2" }, + "locale": "en-GB", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { "density": 2 }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "event": "test track with property", + "integrations": { "All": true }, + "messageId": "584fde02-901a-4964-a4a0-4078b999d5b2", + "originalTimestamp": "2020-04-17T14:55:31.372Z", + "properties": { "test_prop_1": "test prop", "test_prop_2": 1232 }, + "receivedAt": "2020-04-17T20:25:31.401+05:30", + "request_ip": "[::1]:57365", + "sentAt": "2020-04-17T14:55:31.372Z", + "timestamp": "2020-04-17T20:25:31.401+05:30", + "type": "track", + "userId": "user12345" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "track", + "userId": "user12345", + "event": "test track with property", + "properties": { "test_prop_1": "test prop", "test_prop_2": 1232 }, + "timeStamp": "2020-04-17T20:25:31.401+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "userId": "user12345", + "statusCode": 200 + } + } +] diff --git a/test/__tests__/data/slack.json b/test/__tests__/data/slack.json new file mode 100644 index 0000000000..d53e3ad2e3 --- /dev/null +++ b/test/__tests__/data/slack.json @@ -0,0 +1,1263 @@ +[ + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "originalTimestamp": "2020-03-23T03:46:30.916Z", + "properties": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "receivedAt": "2020-03-23T09:16:31.041+05:30", + "request_ip": "[::1]:52056", + "sentAt": "2020-03-23T03:46:30.916Z", + "timestamp": "2020-03-23T09:16:31.041+05:30", + "type": "identify", + "userId": "12345" + }, + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "payload": "{\"text\":\"Identified my-namehiji: hulala \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }], + "denyListOfEvents": [{ "eventName": "black_event" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "originalTimestamp": "2020-03-23T03:46:30.916Z", + "properties": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "receivedAt": "2020-03-23T09:16:31.041+05:30", + "request_ip": "[::1]:52056", + "sentAt": "2020-03-23T03:46:30.916Z", + "timestamp": "2020-03-23T09:16:31.041+05:30", + "type": "page", + "userId": "12345" + }, + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { "error": "Event type page is not supported" } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "12345", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { "path": "", "referrer": "", "search": "", "title": "", "url": "" }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "traits": { + "country": "USA", + "email": "test@domain.com", + "hiji": "hulala-1", + "name": "my-name-1" + }, + "integrations": { "All": true }, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "originalTimestamp": "2020-03-23T03:41:46.122Z", + "receivedAt": "2020-03-23T09:11:46.244+05:30", + "request_ip": "[::1]:52055", + "sentAt": "2020-03-23T03:41:46.123Z", + "timestamp": "2020-03-23T09:11:46.243+05:30", + "type": "identify", + "userId": "12345" + }, + "metadata": { + "anonymousId": "12345", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 123, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "payload": "{\"text\":\"identified my-name-1 with hiji: hulala-1 \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "incomingWebhooksType": "modern", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }], + "denyListOfEvents": [{ "eventName": "black_event" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_isent1", + "integrations": { "All": true }, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "originalTimestamp": "2020-03-23T03:46:30.921Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52057", + "sentAt": "2020-03-23T03:46:30.921Z", + "timestamp": "2020-03-23T09:16:31.064+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/id1/id2/demo", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "incomingWebhooksType": "modern", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "is", + "eventChannel": "example_channel", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "is", + "eventChannel": "example_channel", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }], + "denyListOfEvents": [{ "eventName": "black_event" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_testis", + "integrations": { "All": true }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/id1/id2/example", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "incomingWebhooksType": "modern", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "test_eventing_test", + "eventChannel": "example_channel", + "eventRegex": false + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "", + "eventChannel": "example_channel", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }], + "denyListOfEvents": [{ "eventName": "black_event" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_test", + "integrations": { "All": true }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/id1/id2/example", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { "payload": "{\"text\":\"my-name did test_eventing_test\"}" } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "incomingWebhooksType": "legacy", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }], + "denyListOfEvents": [{ "eventName": "black_event" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_isent1", + "integrations": { "All": true }, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "originalTimestamp": "2020-03-23T03:46:30.921Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52057", + "sentAt": "2020-03-23T03:46:30.921Z", + "timestamp": "2020-03-23T09:16:31.064+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "incomingWebhooksType": "legacy", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventChannel": "example-of-legacy", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }], + "denyListOfEvents": [{ "eventName": "black_event" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_testis", + "integrations": { "All": true }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "payload": "{\"channel\":\"example-of-legacy\",\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_testis", + "integrations": { "All": true }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { "error": "Event type is required" } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "integrations": { "All": true }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { "error": "Event name is required" } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.1-rc.1" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { "density": 1.7999999523162842 }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_isent1", + "integrations": { "All": true }, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "originalTimestamp": "2020-03-23T03:46:30.921Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52057", + "sentAt": "2020-03-23T03:46:30.921Z", + "timestamp": "2020-03-23T09:16:31.064+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { + "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'" + } + }, + { + "input": { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { "excludeKeys": [], "includeKeys": [] } + }, + "Config": { + "incomingWebhooksType": "legacy", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventChannel": "example-of-legacy", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { "eventName": "", "eventRegex": false, "eventTemplate": "" } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [{ "trait": "hiji" }, { "trait": "" }], + "denyListOfEvents": [{ "eventName": "black_event" }] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": {}, + "event": "black_event", + "integrations": { "All": true }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + "output": { "error": "Event is denied. Please check configuration." } + } +] diff --git a/test/__tests__/data/slack_router.json b/test/__tests__/data/slack_router.json new file mode 100644 index 0000000000..ae822cf8f3 --- /dev/null +++ b/test/__tests__/data/slack_router.json @@ -0,0 +1,422 @@ +[{ + "input": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannel": "#slack_integration", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "originalTimestamp": "2020-03-23T03:46:30.916Z", + "properties": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "receivedAt": "2020-03-23T09:16:31.041+05:30", + "request_ip": "[::1]:52056", + "sentAt": "2020-03-23T03:46:30.916Z", + "timestamp": "2020-03-23T09:16:31.041+05:30", + "type": "page", + "userId": "12345" + }, + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + }, + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannel": "#slack_integration", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "12345", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "", + "referrer": "", + "search": "", + "title": "", + "url": "" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "traits": { + "country": "USA", + "email": "test@domain.com", + "hiji": "hulala-1", + "name": "my-name-1" + }, + "integrations": { + "All": true + }, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "originalTimestamp": "2020-03-23T03:41:46.122Z", + "receivedAt": "2020-03-23T09:11:46.244+05:30", + "request_ip": "[::1]:52055", + "sentAt": "2020-03-23T03:41:46.123Z", + "timestamp": "2020-03-23T09:11:46.243+05:30", + "type": "identify", + "userId": "12345" + }, + "metadata": { + "anonymousId": "12345", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 123, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ], + "output": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannel": "#slack_integration", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "metadata": [ + { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + ], + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation" + }, + "batched": false, + "statusCode": 400, + "error": "Event type page is not supported" + }, + { + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "payload": "{\"text\":\"identified my-name-1 with hiji: hulala-1 \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + } + ], + "metadata": [ + { + "anonymousId": "12345", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 123, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannel": "#slack_integration", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + }, + { + "eventChannel": "", + "eventName": "", + "eventRegex": false + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + } + } + ] +} +] diff --git a/test/__tests__/data/snapchat_conversion_router.json b/test/__tests__/data/snapchat_conversion_router.json new file mode 100644 index 0000000000..e369276854 --- /dev/null +++ b/test/__tests__/data/snapchat_conversion_router.json @@ -0,0 +1,397 @@ +[ + { + "input": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", + "context": { + "traits": { + "email": "test@email.com", + "phone": "+91 2111111 " + }, + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "device": { + "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", + "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "ios", + "attTrackingStatus": 3 + }, + + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "locale": "en-US", + "os": { + "name": "iOS", + "version": "14.4.1" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "ga4AppInstanceId", + "id": "f0dd99v4f979fb997ce453373900f891" + } + ], + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" + }, + "type": "track", + "event": "Products Searched", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "metadata": { + "jobId": 1 + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + }, + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", + "context": { + "traits": { + "email": "test@email.com", + "phone": "+91 2111111 " + }, + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "device": { + "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", + "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "ios", + "attTrackingStatus": 3 + }, + + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "locale": "en-US", + "os": { + "name": "iOS", + "version": "14.4.1" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "ga4AppInstanceId", + "id": "f0dd99v4f979fb997ce453373900f891" + } + ], + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" + }, + "type": "track", + "event": "Products Searched", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "metadata": { + "jobId": 2 + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + }, + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", + "context": { + "traits": { + "email": "test@email.com", + "phone": "+91 2111111 " + }, + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "device": { + "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", + "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "ios", + "attTrackingStatus": 3 + }, + + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "locale": "en-US", + "os": { + "name": "iOS", + "version": "14.4.1" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "ga4AppInstanceId", + "id": "f0dd99v4f979fb997ce453373900f891" + } + ], + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" + }, + "type": "track", + "event": "Products Searched", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "metadata": { + "jobId": 3 + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + }, + { + "message": { + "type": "track", + "event": "Product List Viewed", + "sentAt": "2022-08-01T15:04:58.764Z", + "userId": "d131b5f1fc@nana.sa", + "channel": "mobile", + "context": { + "os": { + "name": "iOS", + "version": "15.5" + }, + "app": { + "name": "CFBundleDisplayName", + "build": "12.43.0.16", + "version": "12.43.0", + "namespace": "iShopCloud.com" + }, + "device": { + "id": "f244e389-d899-40a0-9673-1db87a8db7d3", + "name": "iPhone Monerah", + "type": "iOS", + "model": "iPhone", + "manufacturer": "Apple" + }, + "locale": "ar-SA", + "screen": { + "width": 896, + "height": 414, + "density": 2 + }, + "traits": { + "email": "m@gmail.com", + "phone": "00966556747779", + "userId": "d131b5f1fc@nana.sa", + "address": { + "city": "الرياض", + "country": "sa" + }, + "country": "sa", + "lastName": "", + "firstName": "منيرة ام عمر", + "anonymousId": "f244e389-d899-40a0-9673-1db87a8db7d3", + "Mobile Number": "00966556747779", + "Last App Close": "2022-07-29T21:43:30.342Z", + "Activation code": "9997", + "Activation date": "2022-03-24 19:37:42", + "First App Close": "2022-05-18 07:53:03", + "Mobile Number Status": "Active", + "Last Activated Device": { + "UUID": "F244E389-D899-40A0-9673-1DB87A8DB7D3", + "Platform": "IOS", + "App Version": "12.38.0", + "App Language": "AR", + "Platform Version": "15.4" + }, + "ml_availability_segment": -1 + }, + "library": { + "name": "rudder-ios-library", + "version": "1.0.7" + }, + "network": { + "wifi": true, + "carrier": "unavailable", + "cellular": false, + "bluetooth": false + }, + "timezone": "Asia/Riyadh", + "userAgent": "unknown", + "externalId": [ + { + "id": "CBEDC847-F22C-447C-85DE-2BB693240F8E", + "type": "brazeExternalId" + } + ] + }, + "rudderId": "8fd7a036-fcbd-4ec3-b498-ea2cbf1df629", + "messageId": "1659366289-4126c107-c1e1-4ee1-b534-fb49afca197b", + "timestamp": "2022-08-01T15:04:49.593Z", + "properties": { + "Parent": "Testing", + "List ID": "CAT00002903", + "store_id": "STR00001959", + "List Name": "User", + "session_id": "", + "Viewed From": "home", + "Category Position": 2, + "Banner Position Segment": "B", + "category_personalise_segment": "B" + }, + "receivedAt": "2022-08-01T15:04:59.091Z", + "request_ip": "78.95.64.84", + "anonymousId": "f244e389-d899-40a0-9673-1db87a8db7d3", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-01T15:04:49.266Z" + }, + "metadata": { + "jobId": 4 + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey", + "appId": "jahsdfjk-5487-asdfa-9957-7c74eb8d3e80", + "snapAppId": "", + "enableDeduplication": false, + "rudderEventsToSnapEvents": [ + { + "from": "Product List Viewed", + "to": "product_list_viewed" + } + ] + } + } + } + ], + "output": [ + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://tr.snapchat.com/v2/conversion", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer dummyApiKey" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": { + "batch": "[{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"}]" + }, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "jobId": 1 + }, + { + "jobId": 2 + }, + { + "jobId": 3 + } + ], + "batched": true, + "statusCode": 200, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + }, + { + "metadata": [ + { + "jobId": 4 + } + ], + "batched": false, + "statusCode": 400, + "error": "Snap App Id is required for app events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey", + "appId": "jahsdfjk-5487-asdfa-9957-7c74eb8d3e80", + "snapAppId": "", + "enableDeduplication": false, + "rudderEventsToSnapEvents": [ + { + "from": "Product List Viewed", + "to": "product_list_viewed" + } + ] + } + } + } + ] + } +] diff --git a/test/__tests__/data/snapchat_conversion_router_input.json b/test/__tests__/data/snapchat_conversion_router_input.json deleted file mode 100644 index cc2110f775..0000000000 --- a/test/__tests__/data/snapchat_conversion_router_input.json +++ /dev/null @@ -1,321 +0,0 @@ -[ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "message": { - "type": "track", - "event": "Product List Viewed", - "sentAt": "2022-08-01T15:04:58.764Z", - "userId": "d131b5f1fc@nana.sa", - "channel": "mobile", - "context": { - "os": { - "name": "iOS", - "version": "15.5" - }, - "app": { - "name": "CFBundleDisplayName", - "build": "12.43.0.16", - "version": "12.43.0", - "namespace": "iShopCloud.com" - }, - "device": { - "id": "f244e389-d899-40a0-9673-1db87a8db7d3", - "name": "iPhone Monerah", - "type": "iOS", - "model": "iPhone", - "manufacturer": "Apple" - }, - "locale": "ar-SA", - "screen": { - "width": 896, - "height": 414, - "density": 2 - }, - "traits": { - "email": "m@gmail.com", - "phone": "00966556747779", - "userId": "d131b5f1fc@nana.sa", - "address": { - "city": "الرياض", - "country": "sa" - }, - "country": "sa", - "lastName": "", - "firstName": "منيرة ام عمر", - "anonymousId": "f244e389-d899-40a0-9673-1db87a8db7d3", - "Mobile Number": "00966556747779", - "Last App Close": "2022-07-29T21:43:30.342Z", - "Activation code": "9997", - "Activation date": "2022-03-24 19:37:42", - "First App Close": "2022-05-18 07:53:03", - "Mobile Number Status": "Active", - "Last Activated Device": { - "UUID": "F244E389-D899-40A0-9673-1DB87A8DB7D3", - "Platform": "IOS", - "App Version": "12.38.0", - "App Language": "AR", - "Platform Version": "15.4" - }, - "ml_availability_segment": -1 - }, - "library": { - "name": "rudder-ios-library", - "version": "1.0.7" - }, - "network": { - "wifi": true, - "carrier": "unavailable", - "cellular": false, - "bluetooth": false - }, - "timezone": "Asia/Riyadh", - "userAgent": "unknown", - "externalId": [ - { - "id": "CBEDC847-F22C-447C-85DE-2BB693240F8E", - "type": "brazeExternalId" - } - ] - }, - "rudderId": "8fd7a036-fcbd-4ec3-b498-ea2cbf1df629", - "messageId": "1659366289-4126c107-c1e1-4ee1-b534-fb49afca197b", - "timestamp": "2022-08-01T15:04:49.593Z", - "properties": { - "Parent": "Testing", - "List ID": "CAT00002903", - "store_id": "STR00001959", - "List Name": "User", - "session_id": "", - "Viewed From": "home", - "Category Position": 2, - "Banner Position Segment": "B", - "category_personalise_segment": "B" - }, - "receivedAt": "2022-08-01T15:04:59.091Z", - "request_ip": "78.95.64.84", - "anonymousId": "f244e389-d899-40a0-9673-1db87a8db7d3", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-01T15:04:49.266Z" - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "appId": "jahsdfjk-5487-asdfa-9957-7c74eb8d3e80", - "snapAppId": "", - "enableDeduplication": false, - "rudderEventsToSnapEvents": [ - { - "from": "Product List Viewed", - "to": "product_list_viewed" - } - ] - } - } - } -] diff --git a/test/__tests__/data/snapchat_conversion_router_output.json b/test/__tests__/data/snapchat_conversion_router_output.json deleted file mode 100644 index bd3268230a..0000000000 --- a/test/__tests__/data/snapchat_conversion_router_output.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": { - "batch": "[{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"}]" - }, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - }, - { - "jobId": 3 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statusCode": 400, - "error": "Snap App Id is required for app events", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "appId": "jahsdfjk-5487-asdfa-9957-7c74eb8d3e80", - "snapAppId": "", - "enableDeduplication": false, - "rudderEventsToSnapEvents": [ - { - "from": "Product List Viewed", - "to": "product_list_viewed" - } - ] - } - } - } -] diff --git a/test/__tests__/data/snapchat_custom_audience_router.json b/test/__tests__/data/snapchat_custom_audience_router.json new file mode 100644 index 0000000000..668534df37 --- /dev/null +++ b/test/__tests__/data/snapchat_custom_audience_router.json @@ -0,0 +1,99 @@ +[ + { + "input": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "add": [ + { + "email": "test@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ], + "output": [ + { + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer dummyAccessToken" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]], + "schema": ["EMAIL_SHA256"] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ], + "metadata": [ + { + "secret": { + "access_token": "dummyAccessToken", + "developer_token": "dummyDeveloperToken", + "refresh_token": "dummyRefreshToken" + } + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "disableHashing": false, + "schema": "email", + "segmentId": "123" + } + } + } + ] + } +] diff --git a/test/__tests__/data/snapchat_custom_audience_router_input.json b/test/__tests__/data/snapchat_custom_audience_router_input.json deleted file mode 100644 index a36eb21365..0000000000 --- a/test/__tests__/data/snapchat_custom_audience_router_input.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } -] diff --git a/test/__tests__/data/snapchat_custom_audience_router_output.json b/test/__tests__/data/snapchat_custom_audience_router_output.json deleted file mode 100644 index 2d0eac36a1..0000000000 --- a/test/__tests__/data/snapchat_custom_audience_router_output.json +++ /dev/null @@ -1,49 +0,0 @@ -[ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyAccessToken" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]], - "schema": ["EMAIL_SHA256"] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "secret": { - "access_token": "dummyAccessToken", - "developer_token": "dummyDeveloperToken", - "refresh_token": "dummyRefreshToken" - } - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "disableHashing": false, - "schema": "email", - "segmentId": "123" - } - } - } -] diff --git a/test/__tests__/data/splitio.json b/test/__tests__/data/splitio.json new file mode 100644 index 0000000000..15af126d9f --- /dev/null +++ b/test/__tests__/data/splitio.json @@ -0,0 +1 @@ +[{"input":{"message":{"traits":{"martin":21.565,"trafficTypeName":"user","vertical":"restaurant","eventTypeId":"page_load end to end","timestamp":1513357833000,"GMV":false},"userId":"user123","messageId":"c73198a8-41d8-4426-9fd9-de167194d5f3","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","context":{"ip":"14.5.67.21","traits":{"abc":"new-val","key":"key_user_0","value":"0.93"},"library":{"name":"http"}},"type":"group","groupId":"group1","timestamp":"2020-01-21T00:21:34.208Z","writeKey":"1pe7u01A7rYOrvacE6WSgI6ESXh","receivedAt":"2021-04-19T14:53:18.215+05:30","requestIP":"[::1]"},"destination":{"Config":{"apiKey":"abcde","environment":"staging","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"group","key":"user123","timestamp":1579566094208,"environmentName":"staging","trafficTypeName":"user","properties":{"martin":21.565,"vertical":"restaurant","GMV":false}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}},{"input":{"message":{"traits":{"martin":21.565,"trafficTypeName":"user","eventTypeId":"page_load end to end","timestamp":1513357833000,"address":{"city":"San Francisco","state":"CA","country":"USA"},"key1":{"a":"a"},"key2":[1,2,3],"key3":{"key4":{}},"key5":null},"userId":"user123","messageId":"c73198a8-41d8-4426-9fd9-de167194d5f3","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","context":{"ip":"14.5.67.21","traits":{"abc":"new-val","key":"key_user_0"},"library":{"name":"http"}},"type":"identify","timestamp":"2020-01-21T00:21:34.208Z","writeKey":"1pe7u01A7rYOrvacE6WSgI6ESXh","receivedAt":"2021-04-19T14:53:18.215+05:30","requestIP":"[::1]"},"destination":{"Config":{"apiKey":"abcde","environment":"staging","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"identify","key":"user123","timestamp":1579566094208,"environmentName":"staging","trafficTypeName":"user","properties":{"martin":21.565,"address.city":"San Francisco","address.state":"CA","address.country":"USA","key1.a":"a","key2[0]":1,"key2[1]":2,"key2[2]":3}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}},{"input":{"message":{"event":"splitio_test_1","messageId":"9b200548-5961-4448-9dbc-098b7ce85751","properties":{"eventTypeId":"page_load","trafficTypeName":"user","key":"key_user_0","timestamp":1513357833000,"value":"0.93","martin":21.565,"vertical":"restaurant","GMV":true,"abc":"new-val","property1":{"property2":1,"property3":"test","property4":{"subProp1":{"a":"a","b":"b"},"subProp2":["a","b"],"subProp3":{"prop":{}}}},"properties5":null},"receivedAt":"2021-03-01T22:55:54.806Z","rudderId":"6886eb9e-215d-4f61-a651-4b8ef18aaea3","timestamp":"2021-03-01T22:55:54.771Z","type":"track","userId":"user 1"},"destination":{"Config":{"apiKey":"abcde","environment":"production","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"splitio_test_1","key":"user 1","timestamp":1614639354771,"value":0.93,"environmentName":"production","trafficTypeName":"user","properties":{"martin":21.565,"vertical":"restaurant","GMV":true,"abc":"new-val","property1.property2":1,"property1.property3":"test","property1.property4.subProp1.a":"a","property1.property4.subProp1.b":"b","property1.property4.subProp2[0]":"a","property1.property4.subProp2[1]":"b"}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}},{"input":{"message":{"name":"splitio_test_1","messageId":"9b200548-5961-4448-9dbc-098b7ce85751","properties":{"eventTypeId":"page_load","trafficTypeName":"user","key":"key_user_0","timestamp":1513357833000,"value":"0.93","martin":21.565,"vertical":"restaurant","GMV":true,"abc":"new-val"},"receivedAt":"2021-03-01T22:55:54.806Z","rudderId":"6886eb9e-215d-4f61-a651-4b8ef18aaea3","timestamp":"2021-03-01T22:55:54.771Z","type":"page","userId":"user 1"},"destination":{"Config":{"apiKey":"abcde","environment":"production","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"Viewed_splitio_test_1_page","key":"user 1","timestamp":1614639354771,"value":0.93,"environmentName":"production","trafficTypeName":"user","properties":{"martin":21.565,"vertical":"restaurant","GMV":true,"abc":"new-val"}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}},{"input":{"message":{"name":"splitio_test_1","messageId":"9b200548-5961-4448-9dbc-098b7ce85751","properties":{"eventTypeId":"page_load","trafficTypeName":"user","key":"key_user_0","timestamp":1513357833000,"value":"0.93","martin":21.565,"vertical":"restaurant","GMV":true,"abc":"new-val"},"receivedAt":"2021-03-01T22:55:54.806Z","rudderId":"6886eb9e-215d-4f61-a651-4b8ef18aaea3","timestamp":"2021-03-01T22:55:54.771Z","type":"screen","userId":"user 1"},"destination":{"Config":{"apiKey":"abcde","environment":"staging","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"Viewed_splitio_test_1_screen","key":"user 1","timestamp":1614639354771,"value":0.93,"environmentName":"staging","trafficTypeName":"user","properties":{"martin":21.565,"vertical":"restaurant","GMV":true,"abc":"new-val"}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}},{"input":{"message":{"userId":"user123","messageId":"c73198a8-41d8-4426-9fd9-de167194d5f3","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","context":{"ip":"14.5.67.21","traits":{"abc":"new-val","key":"key_user_0","newProperty":"1","martin":21.565,"vertical":"restaurant","GMV":false},"library":{"name":"http"}},"type":"identify","timestamp":"2020-01-21T00:21:34.208Z","writeKey":"1pe7u01A7rYOrvacE6WSgI6ESXh","receivedAt":"2021-04-19T14:53:18.215+05:30","requestIP":"[::1]"},"destination":{"Config":{"apiKey":"abcde","environment":"staging","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"identify","key":"user123","timestamp":1579566094208,"environmentName":"staging","trafficTypeName":"user","properties":{"abc":"new-val","newProperty":"1","martin":21.565,"vertical":"restaurant","GMV":false}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}},{"input":{"message":{"userId":"user123","messageId":"c73198a8-41d8-4426-9fd9-de167194d5f3","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","context":{"ip":"14.5.67.21","traits":{"abc":"new-val","key":"key_user_0","newProperty":"1"},"library":{"name":"http"}},"timestamp":"2020-01-21T00:21:34.208Z","writeKey":"1pe7u01A7rYOrvacE6WSgI6ESXh","receivedAt":"2021-04-19T14:53:18.215+05:30","requestIP":"[::1]"},"destination":{"Config":{"apiKey":"abcde","environment":"staging","trafficType":"user"}}},"output":{"error":"Event type is required"}},{"input":{"message":{"userId":"user123","messageId":"c73198a8-41d8-4426-9fd9-de167194d5f3","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","context":{"ip":"14.5.67.21","traits":{"abc":"new-val","key":"key_user_0","newProperty":"1"},"library":{"name":"http"}},"type":"abc","timestamp":"2020-01-21T00:21:34.208Z","writeKey":"1pe7u01A7rYOrvacE6WSgI6ESXh","receivedAt":"2021-04-19T14:53:18.215+05:30","requestIP":"[::1]"},"destination":{"Config":{"apiKey":"abcde","environment":"staging","trafficType":"user"}}},"output":{"error":"Event type abc is not supported"}},{"input":{"message":{"name":"@$%%^&","messageId":"9b200548-5961-4448-9dbc-098b7ce85751","properties":{"eventTypeId":"page_load","trafficTypeName":"user","key":"key_user_0","timestamp":1513357833000,"value":"0.93","martin":21.565,"vertical":"restaurant","GMV":true,"abc":"new-val"},"receivedAt":"2021-03-01T22:55:54.806Z","rudderId":"6886eb9e-215d-4f61-a651-4b8ef18aaea3","timestamp":"2021-03-01T22:55:54.771Z","type":"page","userId":"user 1"},"destination":{"Config":{"apiKey":"abcde","environment":"production","trafficType":"user"}}},"output":{"error":"eventTypeId does not match with ideal format /^[\\dA-Za-z][\\w.-]{0,79}$/"}},{"input":{"message":{"name":"1pplication accepted","messageId":"9b200548-5961-4448-9dbc-098b7ce85751","category":"food","properties":{"eventTypeId":"page_load","trafficTypeName":"user","key":"key_user_0","timestamp":1513357833000,"value":"bc2","martin":21.565,"vertical":["restaurant","mall"],"GMV":true,"abc":"new-val"},"receivedAt":"2021-03-01T22:55:54.806Z","rudderId":"6886eb9e-215d-4f61-a651-4b8ef18aaea3","timestamp":"2021-03-01T22:55:54.771Z","type":"page","userId":"user 1"},"destination":{"Config":{"apiKey":"abcde","environment":"production","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"Viewed_1pplication_accepted_page","key":"user 1","timestamp":1614639354771,"environmentName":"production","trafficTypeName":"user","properties":{"martin":21.565,"GMV":true,"abc":"new-val","category":"food","vertical[0]":"restaurant","vertical[1]":"mall"}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}},{"input":{"message":{"userId":"user123","messageId":"c73198a8-41d8-4426-9fd9-de167194d5f3","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","context":{"ip":"14.5.67.21","library":{"name":"http"}},"type":"identify","timestamp":"2020-01-21T00:21:34.208Z","writeKey":"1pe7u01A7rYOrvacE6WSgI6ESXh","receivedAt":"2021-04-19T14:53:18.215+05:30","requestIP":"[::1]"},"destination":{"Config":{"apiKey":"abcde","environment":"staging","trafficType":"user"}}},"output":{"version":"1","type":"REST","method":"POST","endpoint":"https://events.split.io/api/events","headers":{"Content-Type":"application/json","Authorization":"Bearer abcde"},"params":{},"body":{"JSON":{"eventTypeId":"identify","key":"user123","timestamp":1579566094208,"environmentName":"staging","trafficTypeName":"user","properties":{}},"XML":{},"JSON_ARRAY":{},"FORM":{}},"files":{}}}] \ No newline at end of file diff --git a/test/__tests__/data/splitio_input.json b/test/__tests__/data/splitio_input.json deleted file mode 100644 index a8b8f5480d..0000000000 --- a/test/__tests__/data/splitio_input.json +++ /dev/null @@ -1,367 +0,0 @@ -[ - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "vertical": "restaurant", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000, - "GMV": false - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "value": "0.93" - }, - "library": { - "name": "http" - } - }, - "type": "group", - "groupId": "group1", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000, - "address": { - "city": "San Francisco", - "state": "CA", - "country": "USA" - }, - "key1": { - "a": "a" - }, - "key2": [1, 2, 3], - "key3": { - "key4": {} - }, - "key5": null - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0" - }, - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "event": "splitio_test_1", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val", - "property1": { - "property2": 1, - "property3": "test", - "property4": { - "subProp1": { - "a": "a", - "b": "b" - }, - "subProp2": ["a", "b"], - "subProp3": { - "prop": {} - } - } - }, - "properties5": null - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "track", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "splitio_test_1", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "page", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "splitio_test_1", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "screen", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "newProperty": "1", - "martin": 21.565000000000001, - "vertical": "restaurant", - "GMV": false - }, - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "newProperty": "1" - }, - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "newProperty": "1" - }, - "library": { - "name": "http" - } - }, - "type": "abc", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "@$%%^&", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "page", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "1pplication accepted", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "category": "food", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "bc2", - "martin": 21.565, - "vertical": ["restaurant", "mall"], - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "page", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - } -] diff --git a/test/__tests__/data/splitio_output.json b/test/__tests__/data/splitio_output.json deleted file mode 100644 index bb51be1d17..0000000000 --- a/test/__tests__/data/splitio_output.json +++ /dev/null @@ -1,261 +0,0 @@ -[ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "group", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": false - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "address.city": "San Francisco", - "address.state": "CA", - "address.country": "USA", - "key1.a": "a", - "key2[0]": 1, - "key2[1]": 2, - "key2[2]": 3 - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "splitio_test_1", - "key": "user 1", - "timestamp": 1614639354771, - "value": 0.93, - "environmentName": "production", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val", - "property1.property2": 1, - "property1.property3": "test", - "property1.property4.subProp1.a": "a", - "property1.property4.subProp1.b": "b", - "property1.property4.subProp2[0]": "a", - "property1.property4.subProp2[1]": "b" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "Viewed_splitio_test_1_page", - "key": "user 1", - "timestamp": 1614639354771, - "value": 0.93, - "environmentName": "production", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "Viewed_splitio_test_1_screen", - "key": "user 1", - "timestamp": 1614639354771, - "value": 0.93, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "abc": "new-val", - "newProperty": "1", - "martin": 21.565000000000001, - "vertical": "restaurant", - "GMV": false - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "error": "Event type is required" - }, - { - "error": "Event type abc is not supported" - }, - { - "error": "eventTypeId does not match with ideal format /^[\\dA-Za-z][\\w.-]{0,79}$/" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "Viewed_1pplication_accepted_page", - "key": "user 1", - "timestamp": 1614639354771, - "environmentName": "production", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "GMV": true, - "abc": "new-val", - "category": "food", - "vertical[0]": "restaurant", - "vertical[1]": "mall" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": {} - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } -] diff --git a/test/__tests__/data/splitio_router.json b/test/__tests__/data/splitio_router.json new file mode 100644 index 0000000000..d0895b7880 --- /dev/null +++ b/test/__tests__/data/splitio_router.json @@ -0,0 +1,176 @@ +[ + { + "input": [ + { + "message": { + "traits": { + "martin": 21.565000000000001, + "trafficTypeName": "user", + "vertical": "restaurant", + "eventTypeId": "page_load end to end", + "timestamp": 1513357833000, + "GMV": false + }, + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "traits": { + "abc": "new-val", + "key": "key_user_0", + "value": "0.93" + }, + "library": { + "name": "http" + } + }, + "type": "group", + "groupId": "group1", + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "metadata": { + "jobId": 1 + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + }, + { + "message": { + "traits": { + "martin": 21.565000000000001, + "trafficTypeName": "user", + "eventTypeId": "page_load end to end", + "timestamp": 1513357833000 + }, + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "traits": { + "abc": "new-val", + "key": "key_user_0" + }, + "library": { + "name": "http" + } + }, + "type": "identify", + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "metadata": { + "jobId": 2 + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ], + "output": [ + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "group", + "key": "user123", + "timestamp": 1579566094208, + "environmentName": "staging", + "trafficTypeName": "user", + "properties": { + "martin": 21.565, + "vertical": "restaurant", + "GMV": false + } + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "jobId": 1 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "identify", + "key": "user123", + "timestamp": 1579566094208, + "environmentName": "staging", + "trafficTypeName": "user", + "properties": { + "martin": 21.565 + } + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "jobId": 2 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } +] diff --git a/test/__tests__/data/splitio_router_input.json b/test/__tests__/data/splitio_router_input.json deleted file mode 100644 index b84fccb474..0000000000 --- a/test/__tests__/data/splitio_router_input.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "vertical": "restaurant", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000, - "GMV": false - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "value": "0.93" - }, - "library": { - "name": "http" - } - }, - "type": "group", - "groupId": "group1", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000 - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0" - }, - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - } -] diff --git a/test/__tests__/data/splitio_router_output.json b/test/__tests__/data/splitio_router_output.json deleted file mode 100644 index 9f07c02d08..0000000000 --- a/test/__tests__/data/splitio_router_output.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "group", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": false - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565 - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - } -] diff --git a/test/__tests__/data/statsig_output.json b/test/__tests__/data/stats_output.json similarity index 82% rename from test/__tests__/data/statsig_output.json rename to test/__tests__/data/stats_output.json index 11b3553f4c..1740bc9d50 100644 --- a/test/__tests__/data/statsig_output.json +++ b/test/__tests__/data/stats_output.json @@ -1,9 +1,6 @@ [ - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { + { + "message": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -84,24 +81,19 @@ "type": "track", "userId": "sample_user_id" }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { + { + "message": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -175,24 +167,19 @@ "type": "identify", "userId": "sample_user_id" }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { + { + "message": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -266,24 +253,19 @@ "type": "page", "userId": "sample_user_id" }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { + { + "message": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -357,24 +339,19 @@ "type": "screen", "userId": "sample_user_id" }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { + { + "message": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -448,24 +425,19 @@ "type": "screen", "userId": "sample_user_id" }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-4n07h3rsecr3t" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-4n07h3rsecr3t" + } + } }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { + { + "message": { "channel": "web", "context": { "app": { @@ -525,24 +497,19 @@ "previousId": "sampleusrRudder3", "sentAt": "2020-10-20T08:14:28.778Z" }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { + { + "message": { "channel": "web", "context": { "app": { @@ -588,20 +555,73 @@ }, "sentAt": "2019-10-14T09:03:22.563Z" }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "error": "message type \"NOT_A_TYPE\" not supported for \"statsig\"" - } -] + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "NOT_A_TYPE", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } + } + ] \ No newline at end of file diff --git a/test/__tests__/data/statsig.json b/test/__tests__/data/statsig.json new file mode 100644 index 0000000000..1d7ca50e30 --- /dev/null +++ b/test/__tests__/data/statsig.json @@ -0,0 +1,953 @@ +[ + { + "input": { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSPonIAEmulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9112340345", + "username": "john_sparrow" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "Product Clicked", + "integrations": { "All": true }, + "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", + "properties": { + "revenue": "30", + "currency": "USD", + "quantity": "5", + "test_key_2": { "test_child_key_1": "test_child_value_1" }, + "price": "58.0" + }, + "originalTimestamp": "2020-05-25T18:37:10.917Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "track", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-tHe5ecr37" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSPonIAEmulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9112340345", + "username": "john_sparrow" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "Product Clicked", + "integrations": { "All": true }, + "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", + "properties": { + "revenue": "30", + "currency": "USD", + "quantity": "5", + "test_key_2": { "test_child_key_1": "test_child_value_1" }, + "price": "58.0" + }, + "originalTimestamp": "2020-05-25T18:37:10.917Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "track", + "userId": "sample_user_id" + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { "content-type": "application/json", "STATSIG-API-KEY": "secret-tHe5ecr37" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "identify", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "identify", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-tHe5ecr37" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "identify", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "identify", + "userId": "sample_user_id" + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { "content-type": "application/json", "STATSIG-API-KEY": "secret-tHe5ecr37" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "page@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "page", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "page", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-tHe5ecr37" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "page@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "page", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "page", + "userId": "sample_user_id" + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { "content-type": "application/json", "STATSIG-API-KEY": "secret-tHe5ecr37" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "screen", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-tHe5ecr37" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "screen", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { "content-type": "application/json", "STATSIG-API-KEY": "secret-tHe5ecr37" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "screen", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-4n07h3rsecr3t" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { "name": "com.rudderstack.android.sdk.core", "version": "1.0.2" }, + "locale": "en-US", + "network": { "carrier": "Android", "bluetooth": false, "cellular": true, "wifi": true }, + "os": { "name": "Android", "version": "9" }, + "screen": { "density": 420, "height": 1794, "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "screen", + "integrations": { "All": true }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { "content-type": "application/json", "STATSIG-API-KEY": "secret-4n07h3rsecr3t" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.5" + }, + "traits": { + "name": "Shehan Study", + "category": "SampleIdentify", + "email": "test@rudderstack.com", + "plan": "Open source", + "logins": 5, + "createdAt": 1599264000 + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.5" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 0.8999999761581421 }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content", + "name": "some campaign", + "test": "other value" + }, + "page": { + "path": "/destinations/amplitude", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/amplitude", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "alias", + "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", + "originalTimestamp": "2020-10-20T08:14:28.778Z", + "anonymousId": "my-anonymous-id-new", + "userId": "newUserIdAlias", + "integrations": { "All": true }, + "previousId": "sampleusrRudder3", + "sentAt": "2020-10-20T08:14:28.778Z" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-tHe5ecr37" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.5" + }, + "traits": { + "name": "Shehan Study", + "category": "SampleIdentify", + "email": "test@rudderstack.com", + "plan": "Open source", + "logins": 5, + "createdAt": 1599264000 + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.1.5" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 0.8999999761581421 }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content", + "name": "some campaign", + "test": "other value" + }, + "page": { + "path": "/destinations/amplitude", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/amplitude", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "alias", + "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", + "originalTimestamp": "2020-10-20T08:14:28.778Z", + "anonymousId": "my-anonymous-id-new", + "userId": "newUserIdAlias", + "integrations": { "All": true }, + "previousId": "sampleusrRudder3", + "sentAt": "2020-10-20T08:14:28.778Z" + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { "content-type": "application/json", "STATSIG-API-KEY": "secret-tHe5ecr37" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "group", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-tHe5ecr37" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "group", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { "content-type": "application/json", "STATSIG-API-KEY": "secret-tHe5ecr37" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "NOT_A_TYPE", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "secretKey": "secret-tHe5ecr37" } + } + }, + "output": { "error": "Event type NOT_A_TYPE is not supported" } + } +] diff --git a/test/__tests__/data/statsig_input.json b/test/__tests__/data/statsig_input.json index dbcf0666e9..1740bc9d50 100644 --- a/test/__tests__/data/statsig_input.json +++ b/test/__tests__/data/statsig_input.json @@ -1,627 +1,627 @@ [ - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSPonIAEmulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSPonIAEmulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9112340345", + "username": "john_sparrow" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 + "event": "Product Clicked", + "integrations": { + "All": true }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9112340345", - "username": "john_sparrow" + "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", + "properties": { + "revenue": "30", + "currency": "USD", + "quantity": "5", + "test_key_2": { + "test_child_key_1": "test_child_value_1" + }, + "price": "58.0" }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + "originalTimestamp": "2020-05-25T18:37:10.917Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "track", + "userId": "sample_user_id" }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", - "properties": { - "revenue": "30", - "currency": "USD", - "quantity": "5", - "test_key_2": { - "test_child_key_1": "test_child_value_1" + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } }, - "price": "58.0" - }, - "originalTimestamp": "2020-05-25T18:37:10.917Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "track", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { "Config": { - "cdkEnabled": true + "secretKey": "secret-tHe5ecr37" } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" + "event": "identify", + "integrations": { + "All": true }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "identify", - "integrations": { - "All": true + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "identify", + "userId": "sample_user_id" }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "identify", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, "Config": { - "cdkEnabled": true + "secretKey": "secret-tHe5ecr37" } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "page@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "page@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" + "event": "page", + "integrations": { + "All": true }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "page", - "integrations": { - "All": true + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "page", + "userId": "sample_user_id" }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "page", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, "Config": { - "cdkEnabled": true + "secretKey": "secret-tHe5ecr37" } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" + "event": "screen", + "integrations": { + "All": true }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "screen", - "integrations": { - "All": true + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, "Config": { - "cdkEnabled": true + "secretKey": "secret-tHe5ecr37" } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" + }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" + "event": "screen", + "integrations": { + "All": true }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" }, - "event": "screen", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, "Config": { - "cdkEnabled": true + "secretKey": "secret-4n07h3rsecr3t" } - }, - "Config": { - "secretKey": "secret-4n07h3rsecr3t" } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.5" - }, - "traits": { - "name": "Shehan Study", - "category": "SampleIdentify", - "email": "test@rudderstack.com", - "plan": "Open source", - "logins": 5, - "createdAt": 1599264000 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.5" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 0.8999999761581421 - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign", - "test": "other value" - }, - "page": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "alias", - "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", - "originalTimestamp": "2020-10-20T08:14:28.778Z", - "anonymousId": "my-anonymous-id-new", - "userId": "newUserIdAlias", - "integrations": { - "All": true - }, - "previousId": "sampleusrRudder3", - "sentAt": "2020-10-20T08:14:28.778Z" }, - "destination": { - "DestinationDefinition": { + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.5" + }, + "traits": { + "name": "Shehan Study", + "category": "SampleIdentify", + "email": "test@rudderstack.com", + "plan": "Open source", + "logins": 5, + "createdAt": 1599264000 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.5" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 0.8999999761581421 + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content", + "name": "some campaign", + "test": "other value" + }, + "page": { + "path": "/destinations/amplitude", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/amplitude", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "alias", + "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", + "originalTimestamp": "2020-10-20T08:14:28.778Z", + "anonymousId": "my-anonymous-id-new", + "userId": "newUserIdAlias", + "integrations": { + "All": true + }, + "previousId": "sampleusrRudder3", + "sentAt": "2020-10-20T08:14:28.778Z" + }, + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, "Config": { - "cdkEnabled": true + "secretKey": "secret-tHe5ecr37" } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" + }, + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "group", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" + "integrations": { + "All": true }, - "screen": { - "density": 2 - } + "sentAt": "2019-10-14T09:03:22.563Z" }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "group", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "DestinationDefinition": { + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, "Config": { - "cdkEnabled": true + "secretKey": "secret-tHe5ecr37" } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" + }, + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "NOT_A_TYPE", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" + "integrations": { + "All": true }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "NOT_A_TYPE", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true + "sentAt": "2019-10-14T09:03:22.563Z" }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "DestinationDefinition": { + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, "Config": { - "cdkEnabled": true + "secretKey": "secret-tHe5ecr37" } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" } } - } -] + ] \ No newline at end of file diff --git a/test/__tests__/data/stormly_router.json b/test/__tests__/data/stormly_router.json new file mode 100644 index 0000000000..723b8be114 --- /dev/null +++ b/test/__tests__/data/stormly_router.json @@ -0,0 +1,122 @@ +[ + { + "input": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey" + }, + "ID": "stormly123" + }, + "metadata": { + "jobId": 1 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "channel": "web", + "userId": "5136633649", + "context": { + "traits": { + "name": "John Doe", + "email": "johndoe@gmail.com", + "age": 25 + } + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "apiKey": "dummyApiKey" + }, + "ID": "stormly123" + }, + "metadata": { + "jobId": 2 + }, + "message": { + "type": "track", + "event": "Product Reviewed", + "properties": { + "review_id": "12345", + "product_id": "123", + "rating": 3.0, + "review_body": "Average product, expected much more.", + "groupId": "91Yb32830" + }, + "context": {}, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ], + "output": [ + { + "batched": false, + "batchedRequest": { + "body": { + "FORM": {}, + "JSON": { + "timestamp": "2022-01-20T13:39:21.032Z", + "traits": { + "age": 25, + "email": "johndoe@gmail.com", + "name": "John Doe" + }, + "userId": "5136633649" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/identify", + "files": {}, + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json" + }, + "method": "POST", + "params": {}, + "type": "REST", + "version": "1" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey" + }, + "ID": "stormly123" + }, + "metadata": [ + { + "jobId": 1 + } + ], + "statusCode": 200 + }, + { + "destination": { + "Config": { + "apiKey": "dummyApiKey" + }, + "ID": "stormly123" + }, + "batched": false, + "error": "Missing required value from \"userIdOnly\"", + "metadata": [ + { + "jobId": 2 + } + ], + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation" + }, + "statusCode": 400 + } + ] + } +] diff --git a/test/__tests__/data/stormly_router_input.json b/test/__tests__/data/stormly_router_input.json deleted file mode 100644 index 3fa583ebc3..0000000000 --- a/test/__tests__/data/stormly_router_input.json +++ /dev/null @@ -1,55 +0,0 @@ -[ - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "metadata": { - "jobId": 1 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "channel": "web", - "userId": "5136633649", - "context": { - "traits": { - "name": "John Doe", - "email": "johndoe@gmail.com", - "age": 25 - } - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "metadata": { - "jobId": 2 - }, - "message": { - "type": "track", - "event": "Product Reviewed", - "properties": { - "review_id": "12345", - "product_id": "123", - "rating": 3.0, - "review_body": "Average product, expected much more.", - "groupId": "91Yb32830" - }, - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } -] diff --git a/test/__tests__/data/stormly_router_output.json b/test/__tests__/data/stormly_router_output.json deleted file mode 100644 index 2a129dfbaf..0000000000 --- a/test/__tests__/data/stormly_router_output.json +++ /dev/null @@ -1,63 +0,0 @@ -[ - { - "batched": false, - "batchedRequest": { - "body": { - "FORM": {}, - "JSON": { - "timestamp": "2022-01-20T13:39:21.032Z", - "traits": { - "age": 25, - "email": "johndoe@gmail.com", - "name": "John Doe" - }, - "userId": "5136633649" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://rudderstack.t.stormly.com/webhook/rudderstack/identify", - "files": {}, - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "metadata": [ - { - "jobId": 1 - } - ], - "statusCode": 200 - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - }, - "ID": "stormly123" - }, - "batched": false, - "error": "Missing required value from \"userIdOnly\"", - "metadata": [ - { - "jobId": 2 - } - ], - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "statusCode": 400 - } -] diff --git a/test/__tests__/data/tiktok_ads.json b/test/__tests__/data/tiktok_ads.json new file mode 100644 index 0000000000..592fb1d165 --- /dev/null +++ b/test/__tests__/data/tiktok_ads.json @@ -0,0 +1,3090 @@ +[ + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout started", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "InitiateCheckout", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist1", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": { + "statusCode": 400, + "message": "Event name (product added to wishlist1) is not valid, must be mapped to one of standard events", + "statTags": { "destination": "tiktok_ads", "stage": "transform", "scope": "exception" } + } + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [{ "type": "tiktokExternalId", "id": "1234" }] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "SubscriBe", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { "phone_number": "+868987675687", "email": "sample@sample.com" } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + } + }, + "output": [ + { + "body": { + "FORM": {}, + "JSON": { + "context": { + "ad": { "callback": "123ATXSfe" }, + "ip": "13.57.97.131", + "page": { + "referrer": "http://demo.mywebsite.com", + "url": "http://demo.mywebsite.com/purchase" + }, + "user": { + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", + "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4", + "phone_number": "1d96e70d2bf54087e33586457cde2790825bee7b1a3b05d26481cb12ec8e63fd" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "event": "Subscribe", + "event_id": "1616318632825_357", + "partner_name": "RudderStack", + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "properties": { + "contents": [ + { "content_id": "1077218", "content_type": "socks", "price": 8, "quantity": 2 }, + { "content_id": "1197218", "content_type": "dress", "price": 30, "quantity": 1 } + ], + "currency": "USD", + "value": 46 + }, + "timestamp": "2020-09-17T19:49:27Z" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "files": {}, + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "method": "POST", + "params": {}, + "type": "REST", + "version": "1" + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "payment info entered", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "AddPaymentInfo", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": { + "statusCode": 400, + "message": "Event name is required", + "statTags": { "destination": "tiktok_ads", "stage": "transform", "scope": "exception" } + } + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": { + "statusCode": 400, + "message": "Event type is required", + "statTags": { "destination": "tiktok_ads", "stage": "transform", "scope": "exception" } + } + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "type": "track", + "event": "payment info entered", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "AddPaymentInfo", + "event_id": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "submitform", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "SubmitForm", + "event_id": "16163186328257", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "submitform", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "SubmitForm", + "event_id": "16163186328257", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "contact", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "Contact", + "event_id": "16163186328257", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "identify", + "event": "contact", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": { + "statusCode": 400, + "message": "Event type identify is not supported", + "statTags": { "destination": "tiktok_ads", "stage": "transform", "scope": "exception" } + } + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "order completed", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "PlaceAnOrder", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "traits": { "email": "user@sample.com", "phone": "+919912345678" }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "SubscriBe", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "TEST0000000011", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { "phone_number": "+918987674657", "email": "sample@rudder.com" } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "Subscribe", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "TEST0000000011", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "1b6abcebb79b2208929967160ba291656f3fcd4f00e93b6a846c1e56c0e177c6", + "email": "02e47a94635c1ffd6f6a69fe2c7a92dbfbb9d5e2ebddb54810520b34989b66a7", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "traits": { "email": "user@sample.com", "phone": "+919912345678" }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "SubscriBe", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "TEST0000000011", + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { "phone_number": "", "email": "" } + }, + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "Subscribe", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "TEST0000000011", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "241102c24fa8a642e3d1346a31fbce3dd312563c015ae577a2253cb8652581eb", + "email": "a344da1fac6201ed1c1f20a07e1b55bb896a5ac0abd269c1e9daf1afbbffca3b", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "ad": { "callback": "999ATXSfe" }, + "page": { + "url": "http://rudder.mywebsite.com/purchase", + "referrer": "http://rudder.mywebsite.com" + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46, + "context": { + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "999ATXSfe" }, + "page": { + "url": "http://rudder.mywebsite.com/purchase", + "referrer": "http://rudder.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false, + "eventsToStandard": [ + { "from": "abc", "to": "download" }, + { "from": "abc", "to": "search" }, + { "from": "def", "to": "search" } + ] + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "search", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false, + "eventsToStandard": [{ "from": "def", "to": "download" }] + } + } + }, + "output": { + "statusCode": 400, + "message": "Event name (abc) is not valid, must be mapped to one of standard events", + "statTags": { "destination": "tiktok_ads", "stage": "transform", "scope": "exception" } + } + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false, + "eventsToStandard": [ + { "from": "abc", "to": "download" }, + { "from": "def", "to": "download" } + ] + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { "phone_number": "+371234567890123", "email": "sample@sample.com" } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true, + "eventsToStandard": [ + { "from": "abc", "to": "download" }, + { "from": "def", "to": "download" } + ] + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "6080191ec608e10062e9257702cbca694cfe1bfa53944ba5701119d8f8b99ad6", + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { "phone_number": "+3712345678", "email": "sample@sample.com" } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true, + "eventsToStandard": [ + { "from": "abc", "to": "download" }, + { "from": "def", "to": "download" } + ] + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "6e6c1bb39126b3ecf537e62847909b1372a1a22de9b28d85960e12c78f322035", + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "products": [ + { + "product_id": 123, + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { "price": 8, "quantity": 2, "content_type": "socks", "content_id": "1077218" }, + { "price": 30, "quantity": 1, "content_type": "dress", "content_id": "1197218" } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "products": [ + { + "product_id": 123, + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "contentType": "product_group", + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "product_id": 345, + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "contentType": "product_group", + "quantity": 2 + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "content_id": "123", + "content_type": "product_group", + "content_name": "Monopoly", + "price": 14, + "quantity": 1, + "content_category": "Games" + }, + { + "content_id": "345", + "content_type": "product_group", + "content_name": "UNO", + "price": 3.45, + "quantity": 2 + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "products": [ + { + "contentType": "product_group", + "product_id": "123", + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "contentType": "product_group", + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "currency": "USD", + "value": 46, + "contents": [ + { + "content_type": "product_group", + "content_id": "123", + "content_category": "Games", + "content_name": "Monopoly", + "price": 14, + "quantity": 1 + }, + { + "content_type": "product_group", + "content_id": "345", + "content_category": "Games", + "content_name": "UNO", + "price": 3.45, + "quantity": 2 + } + ] + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + }, + { + "input": { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { "name": "RudderLabs JavaScript SDK", "version": "1.0.0" }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { "name": "", "version": "" }, + "screen": { "density": 2 }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "category": "Urban", + "status": "processed", + "name": "games", + "contentType": "product_group", + "productId": "qqw21221341234", + "eventId": "1616318632825_357", + "products": [ + { + "product_id": "123", + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { "All": true }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + "output": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { "Access-Token": "dummyAccessToken", "Content-Type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "content_category": "Urban", + "status": "processed", + "content_name": "games", + "content_id": "qqw21221341234", + "content_type": "product_group", + "currency": "USD", + "value": 46, + "contents": [ + { + "content_type": "product_group", + "content_id": "123", + "content_category": "Games", + "content_name": "Monopoly", + "price": 14, + "quantity": 1 + }, + { + "content_type": "product_group", + "content_id": "345", + "content_category": "Games", + "content_name": "UNO", + "price": 3.45, + "quantity": 2 + } + ] + }, + "context": { + "ad": { "callback": "123ATXSfe" }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ] + } +] diff --git a/test/__tests__/data/tiktok_ads_input.json b/test/__tests__/data/tiktok_ads_input.json deleted file mode 100644 index 89919e866f..0000000000 --- a/test/__tests__/data/tiktok_ads_input.json +++ /dev/null @@ -1,2500 +0,0 @@ -[ - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout started", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist1", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "1234" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "SubscriBe", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+868987675687", - "email": "sample@sample.com" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "payment info entered", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "payment info entered", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "submitform", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "submitform", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "contact", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "identify", - "event": "contact", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "order completed", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "user@sample.com", - "phone": "+919912345678" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "SubscriBe", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "TEST0000000011", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+918987674657", - "email": "sample@rudder.com" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "user@sample.com", - "phone": "+919912345678" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "SubscriBe", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "TEST0000000011", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "", - "email": "" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "ad": { - "callback": "999ATXSfe" - }, - "page": { - "url": "http://rudder.mywebsite.com/purchase", - "referrer": "http://rudder.mywebsite.com" - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "abc", - "to": "search" - }, - { - "from": "def", - "to": "search" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false, - "eventsToStandard": [ - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+371234567890123", - "email": "sample@sample.com" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+3712345678", - "email": "sample@sample.com" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "products": [ - { - "product_id": 123, - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "products": [ - { - "product_id": 123, - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "contentType": "product_group", - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "product_id": 345, - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "contentType": "product_group", - "quantity": 2 - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "products": [ - { - "contentType": "product_group", - "product_id": "123", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "contentType": "product_group", - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "category": "Urban", - "status": "processed", - "name": "games", - "contentType": "product_group", - "productId": "qqw21221341234", - "eventId": "1616318632825_357", - "products": [ - { - "product_id": "123", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - } -] diff --git a/test/__tests__/data/tiktok_ads_offline_events_router.json b/test/__tests__/data/tiktok_ads_offline_events_router.json new file mode 100644 index 0000000000..0f9b4f0457 --- /dev/null +++ b/test/__tests__/data/tiktok_ads_offline_events_router.json @@ -0,0 +1,339 @@ +[ + { + "input": [ + { + "metadata": { + "jobId": 1 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "1234567890" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7181537436256731137", + "eventId": "1616318632825_352", + "order_id": "abc_xyz", + "shop_id": "123abc", + "currency": "USD", + "value": 46.0, + "price": 8, + "quantity": 2, + "content_type": "product1234", + "product_id": "1077218", + "name": "socks", + "category": "Men's cloth" + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + }, + { + "metadata": { + "jobId": 2 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "1234567890", + "email": "random@mail.com" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7181537436256731137", + "eventId": "1616318632825_352", + "products": [ + { + "price": 8, + "quantity": 2, + "content_type": "product1", + "product_id": "1077218", + "name": "socks", + "category": "Men's cloth" + }, + { + "price": 18, + "quantity": 12, + "content_type": "product2", + "product_id": "1077219", + "name": "socks1", + "category": "Men's cloth1" + } + ] + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + }, + { + "metadata": { + "jobId": 3 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "1234567890" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "6071537445256731123", + "eventId": "1616318632825_352", + "currency": "USD", + "value": 46.0, + "price": 8, + "content_type": "product1234" + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + }, + { + "metadata": { + "jobId": 4 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "context": { + "traits": { + "phone": "1234567890" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "2345676543", + "eventId": "1616318632825_352" + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + } + ], + "output": [ + { + "batched": true, + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/batch/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7181537436256731137", + "partner_name": "RudderStack", + "batch": [ + { + "event_set_id": "7181537436256731137", + "event": "Subscribe", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + }, + "properties": { + "order_id": "abc_xyz", + "shop_id": "123abc", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "product1234", + "content_id": "1077218", + "content_name": "socks", + "content_category": "Men's cloth" + } + ], + "event_channel": "web", + "currency": "USD", + "value": 46.0 + } + }, + { + "event_set_id": "7181537436256731137", + "event": "Subscribe", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ], + "emails": ["d9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16"] + } + }, + "properties": { + "event_channel": "web", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "product1", + "content_id": "1077218", + "content_name": "socks", + "content_category": "Men's cloth" + }, + { + "price": 18, + "quantity": 12, + "content_type": "product2", + "content_id": "1077219", + "content_name": "socks1", + "content_category": "Men's cloth1" + } + ] + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "metadata": [ + { + "jobId": 1 + }, + { + "jobId": 2 + } + ], + "statusCode": 200 + }, + { + "batched": true, + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/batch/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "6071537445256731123", + "partner_name": "RudderStack", + "batch": [ + { + "event_set_id": "6071537445256731123", + "event": "Subscribe", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + }, + "properties": { + "contents": [ + { + "price": 8, + "content_type": "product1234" + } + ], + "event_channel": "web", + "currency": "USD", + "value": 46.0 + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "metadata": [ + { + "jobId": 3 + } + ], + "statusCode": 200 + }, + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "batched": false, + "error": "Event name is required", + "metadata": [ + { + "jobId": 4 + } + ], + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation" + }, + "statusCode": 400 + } + ] + } +] diff --git a/test/__tests__/data/tiktok_ads_offline_events_router_input.json b/test/__tests__/data/tiktok_ads_offline_events_router_input.json deleted file mode 100644 index 2986efa804..0000000000 --- a/test/__tests__/data/tiktok_ads_offline_events_router_input.json +++ /dev/null @@ -1,142 +0,0 @@ -[ - { - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "1234567890" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7181537436256731137", - "eventId": "1616318632825_352", - "order_id": "abc_xyz", - "shop_id": "123abc", - "currency": "USD", - "value": 46.0, - "price": 8, - "quantity": 2, - "content_type": "product1234", - "product_id": "1077218", - "name": "socks", - "category": "Men's cloth" - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - }, - { - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "1234567890", - "email": "random@mail.com" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7181537436256731137", - "eventId": "1616318632825_352", - "products": [ - { - "price": 8, - "quantity": 2, - "content_type": "product1", - "product_id": "1077218", - "name": "socks", - "category": "Men's cloth" - }, - { - "price": 18, - "quantity": 12, - "content_type": "product2", - "product_id": "1077219", - "name": "socks1", - "category": "Men's cloth1" - } - ] - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - }, - { - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "1234567890" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "6071537445256731123", - "eventId": "1616318632825_352", - "currency": "USD", - "value": 46.0, - "price": 8, - "content_type": "product1234" - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - }, - { - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "context": { - "traits": { - "phone": "1234567890" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "2345676543", - "eventId": "1616318632825_352" - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - } -] diff --git a/test/__tests__/data/tiktok_ads_offline_events_router_output.json b/test/__tests__/data/tiktok_ads_offline_events_router_output.json deleted file mode 100644 index 9fc45461be..0000000000 --- a/test/__tests__/data/tiktok_ads_offline_events_router_output.json +++ /dev/null @@ -1,193 +0,0 @@ -[ - { - "batched": true, - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/batch/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_set_id": "7181537436256731137", - "partner_name": "RudderStack", - "batch": [ - { - "event_set_id": "7181537436256731137", - "event": "Subscribe", - "event_id": "1616318632825_352", - "timestamp": "2023-01-03", - "partner_name": "RudderStack", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ] - } - }, - "properties": { - "order_id": "abc_xyz", - "shop_id": "123abc", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "product1234", - "content_id": "1077218", - "content_name": "socks", - "content_category": "Men's cloth" - } - ], - "event_channel": "web", - "currency": "USD", - "value": 46.0 - } - }, - { - "event_set_id": "7181537436256731137", - "event": "Subscribe", - "event_id": "1616318632825_352", - "timestamp": "2023-01-03", - "partner_name": "RudderStack", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ], - "emails": ["d9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16"] - } - }, - "properties": { - "event_channel": "web", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "product1", - "content_id": "1077218", - "content_name": "socks", - "content_category": "Men's cloth" - }, - { - "price": 18, - "quantity": 12, - "content_type": "product2", - "content_id": "1077219", - "content_name": "socks1", - "content_category": "Men's cloth1" - } - ] - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - } - ], - "statusCode": 200 - }, - { - "batched": true, - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/batch/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_set_id": "6071537445256731123", - "partner_name": "RudderStack", - "batch": [ - { - "event_set_id": "6071537445256731123", - "event": "Subscribe", - "event_id": "1616318632825_352", - "timestamp": "2023-01-03", - "partner_name": "RudderStack", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ] - } - }, - "properties": { - "contents": [ - { - "price": 8, - "content_type": "product1234" - } - ], - "event_channel": "web", - "currency": "USD", - "value": 46.0 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "metadata": [ - { - "jobId": 3 - } - ], - "statusCode": 200 - }, - { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "batched": false, - "error": "Event name is required", - "metadata": [ - { - "jobId": 4 - } - ], - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "statusCode": 400 - } -] diff --git a/test/__tests__/data/tiktok_ads_output.json b/test/__tests__/data/tiktok_ads_output.json deleted file mode 100644 index a5ca42e5cb..0000000000 --- a/test/__tests__/data/tiktok_ads_output.json +++ /dev/null @@ -1,1545 +0,0 @@ -[ - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "InitiateCheckout", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event name (product added to wishlist1) is not valid, must be mapped to one of standard events", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "body": { - "FORM": {}, - "JSON": { - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "referrer": "http://demo.mywebsite.com", - "url": "http://demo.mywebsite.com/purchase" - }, - "user": { - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", - "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4", - "phone_number": "1d96e70d2bf54087e33586457cde2790825bee7b1a3b05d26481cb12ec8e63fd" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "event": "Subscribe", - "event_id": "1616318632825_357", - "partner_name": "RudderStack", - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "properties": { - "contents": [ - { - "content_id": "1077218", - "content_type": "socks", - "price": 8, - "quantity": 2 - }, - { - "content_id": "1197218", - "content_type": "dress", - "price": 30, - "quantity": 1 - } - ], - "currency": "USD", - "value": 46 - }, - "timestamp": "2020-09-17T19:49:27Z" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "files": {}, - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddPaymentInfo", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event name is required", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - { - "statusCode": 400, - "error": "Event type is required", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddPaymentInfo", - "event_id": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "SubmitForm", - "event_id": "16163186328257", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "SubmitForm", - "event_id": "16163186328257", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "Contact", - "event_id": "16163186328257", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event type identify is not supported", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "PlaceAnOrder", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "Subscribe", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "TEST0000000011", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "1b6abcebb79b2208929967160ba291656f3fcd4f00e93b6a846c1e56c0e177c6", - "email": "02e47a94635c1ffd6f6a69fe2c7a92dbfbb9d5e2ebddb54810520b34989b66a7", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "Subscribe", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "TEST0000000011", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "241102c24fa8a642e3d1346a31fbce3dd312563c015ae577a2253cb8652581eb", - "email": "a344da1fac6201ed1c1f20a07e1b55bb896a5ac0abd269c1e9daf1afbbffca3b", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "999ATXSfe" - }, - "page": { - "url": "http://rudder.mywebsite.com/purchase", - "referrer": "http://rudder.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "search", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event name (abc) is not valid, must be mapped to one of standard events", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "6080191ec608e10062e9257702cbca694cfe1bfa53944ba5701119d8f8b99ad6", - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "6e6c1bb39126b3ecf537e62847909b1372a1a22de9b28d85960e12c78f322035", - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "content_id": "123", - "content_type": "product_group", - "content_name": "Monopoly", - "price": 14, - "quantity": 1, - "content_category": "Games" - }, - { - "content_id": "345", - "content_type": "product_group", - "content_name": "UNO", - "price": 3.45, - "quantity": 2 - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "currency": "USD", - "value": 46, - "contents": [ - { - "content_type": "product_group", - "content_id": "123", - "content_category": "Games", - "content_name": "Monopoly", - "price": 14, - "quantity": 1 - }, - { - "content_type": "product_group", - "content_id": "345", - "content_category": "Games", - "content_name": "UNO", - "price": 3.45, - "quantity": 2 - } - ] - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "partner_name": "RudderStack" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "content_category": "Urban", - "status": "processed", - "content_name": "games", - "content_id": "qqw21221341234", - "content_type": "product_group", - "currency": "USD", - "value": 46, - "contents": [ - { - "content_type": "product_group", - "content_id": "123", - "content_category": "Games", - "content_name": "Monopoly", - "price": 14, - "quantity": 1 - }, - { - "content_type": "product_group", - "content_id": "345", - "content_category": "Games", - "content_name": "UNO", - "price": 3.45, - "quantity": 2 - } - ] - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "partner_name": "RudderStack" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] -] diff --git a/test/__tests__/data/tiktok_ads_router.json b/test/__tests__/data/tiktok_ads_router.json new file mode 100644 index 0000000000..2613654cca --- /dev/null +++ b/test/__tests__/data/tiktok_ads_router.json @@ -0,0 +1,730 @@ +[ + { + "input": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46.0, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "metadata": { + "jobId": 5 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout started", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46.0 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "metadata": { + "jobId": 1 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "download", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46.0 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "metadata": { + "jobId": 2 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "search", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46.0 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "metadata": { + "jobId": 4 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "1234" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "+858987675687", + "email": "sample@sample.com" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46.0 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "metadata": { + "jobId": 3 + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + } + } + ], + "output": [ + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/batch/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "batch": [ + { + "event": "CompletePayment", + "event_id": "1616318632825_357", + "type": "track", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + } + }, + { + "event": "InitiateCheckout", + "event_id": "1616318632825_357", + "type": "track", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "ip": "13.57.97.131", + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "properties": { + "value": 46, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_id": "1077218", + "content_type": "socks" + }, + { + "price": 30, + "quantity": 1, + "content_id": "1197218", + "content_type": "dress" + } + ], + "currency": "USD" + } + }, + { + "event": "Download", + "event_id": "1616318632825_357", + "type": "track", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "ip": "13.57.97.131", + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "properties": { + "value": 46, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_id": "1077218", + "content_type": "socks" + }, + { + "price": 30, + "quantity": 1, + "content_id": "1197218", + "content_type": "dress" + } + ], + "currency": "USD" + } + }, + { + "event": "Search", + "event_id": "1616318632825_357", + "type": "track", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "ip": "13.57.97.131", + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "properties": { + "value": 46, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_id": "1077218", + "content_type": "socks" + }, + { + "price": 30, + "quantity": 1, + "content_id": "1197218", + "content_type": "dress" + } + ], + "currency": "USD" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "metadata": [ + { + "jobId": 5 + }, + { + "jobId": 1 + }, + { + "jobId": 2 + }, + { + "jobId": 4 + } + ], + "batched": true, + "statusCode": 200, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + }, + { + "batched": false, + "batchedRequest": [ + { + "body": { + "FORM": {}, + "JSON": { + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "ip": "13.57.97.131", + "page": { + "referrer": "http://demo.mywebsite.com", + "url": "http://demo.mywebsite.com/purchase" + }, + "user": { + "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4", + "phone_number": "4443dd476f2be18201447ef046731c1a715accee4edc5192641a3b4c3ba921c7", + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa" + }, + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "event": "AddToWishlist", + "event_id": "1616318632825_357", + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "partner_name": "RudderStack", + "properties": { + "contents": [ + { + "content_id": "1077218", + "content_type": "socks", + "price": 8, + "quantity": 2 + }, + { + "content_id": "1197218", + "content_type": "dress", + "price": 30, + "quantity": 1 + } + ], + "currency": "USD", + "value": 46 + }, + "test_event_code": "sample rudder test_event_code", + "timestamp": "2020-09-17T19:49:27Z" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "files": {}, + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "method": "POST", + "params": {}, + "type": "REST", + "version": "1" + } + ], + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + }, + "metadata": [ + { + "jobId": 3 + } + ], + "statusCode": 200 + } + ] + } +] diff --git a/test/__tests__/data/tiktok_ads_router_input.json b/test/__tests__/data/tiktok_ads_router_input.json deleted file mode 100644 index 7ed27e8fcf..0000000000 --- a/test/__tests__/data/tiktok_ads_router_input.json +++ /dev/null @@ -1,439 +0,0 @@ -[ - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 5 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout started", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "download", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "search", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "1234" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+858987675687", - "email": "sample@sample.com" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - } -] diff --git a/test/__tests__/data/tiktok_ads_router_output.json b/test/__tests__/data/tiktok_ads_router_output.json deleted file mode 100644 index c13c2b9c13..0000000000 --- a/test/__tests__/data/tiktok_ads_router_output.json +++ /dev/null @@ -1,287 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/batch/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "batch": [ - { - "event": "CompletePayment", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - { - "event": "InitiateCheckout", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "properties": { - "value": 46, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_id": "1077218", - "content_type": "socks" - }, - { - "price": 30, - "quantity": 1, - "content_id": "1197218", - "content_type": "dress" - } - ], - "currency": "USD" - } - }, - { - "event": "Download", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "properties": { - "value": 46, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_id": "1077218", - "content_type": "socks" - }, - { - "price": 30, - "quantity": 1, - "content_id": "1197218", - "content_type": "dress" - } - ], - "currency": "USD" - } - }, - { - "event": "Search", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "properties": { - "value": 46, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_id": "1077218", - "content_type": "socks" - }, - { - "price": 30, - "quantity": 1, - "content_id": "1197218", - "content_type": "dress" - } - ], - "currency": "USD" - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 5 - }, - { - "jobId": 1 - }, - { - "jobId": 2 - }, - { - "jobId": 4 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "batched": false, - "batchedRequest": [ - { - "body": { - "FORM": {}, - "JSON": { - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "referrer": "http://demo.mywebsite.com", - "url": "http://demo.mywebsite.com/purchase" - }, - "user": { - "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4", - "phone_number": "4443dd476f2be18201447ef046731c1a715accee4edc5192641a3b4c3ba921c7", - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "properties": { - "contents": [ - { - "content_id": "1077218", - "content_type": "socks", - "price": 8, - "quantity": 2 - }, - { - "content_id": "1197218", - "content_type": "dress", - "price": 30, - "quantity": 1 - } - ], - "currency": "USD", - "value": 46 - }, - "test_event_code": "sample rudder test_event_code", - "timestamp": "2020-09-17T19:49:27Z" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "files": {}, - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - ], - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - }, - "metadata": [ - { - "jobId": 3 - } - ], - "statusCode": 200 - } -] diff --git a/test/__tests__/data/variance.json b/test/__tests__/data/variance.json new file mode 100644 index 0000000000..f9523c0d86 --- /dev/null +++ b/test/__tests__/data/variance.json @@ -0,0 +1,719 @@ +[ + { + "input": { + "message": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "manufacturer": "Xiaomi", + "model": "Redmi 6", + "name": "xiaomi" + }, + "network": { "carrier": "Banglalink" }, + "os": { "name": "android", "version": "8.1.0" }, + "traits": { + "address": { "city": "Dhaka", "country": "Bangladesh" }, + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + } + }, + "event": "spin_result", + "integrations": { "All": true }, + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "properties": { + "additional_bet_index": 0, + "battle_id": "N/A", + "bet_amount": 9, + "bet_level": 1, + "bet_multiplier": 1, + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "days_in_game": 0, + "extra_param": "N/A", + "fb_profile": "0", + "featureGameType": "N/A", + "game_fps": 30, + "game_id": "fireEagleBase", + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": "False", + "is_auto_spin": "False", + "is_turbo": "False", + "isf": "False", + "ishighroller": "False", + "jackpot_win_amount": 90, + "jackpot_win_type": "Silver", + "level": 6, + "lifetime_gem_balance": 0, + "no_of_spin": 1, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "tournament_id": "T1561970819", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2, + "win_amount": 0 + }, + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "type": "track", + "user_properties": { + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "fb_profile": "0", + "game_fps": 30, + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": false, + "level": 6, + "lifetime_gem_balance": 0, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2 + } + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "webhookUrl": "http://6b0e6a60.ngrok.io", "authHeader": "Basic MVA4dUtGOF=" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "user_properties": { + "total_payments": 0, + "internetReachability": "ReachableViaLocalAreaNetwork", + "level": 6, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "coin_balance": 9466052, + "player_total_shields": 0, + "isLowEndDevice": false, + "game_fps": 30, + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "graphicsQuality": "HD", + "current_module_name": "CasinoGameModule", + "player_total_battles": 0, + "lifetime_gem_balance": 0, + "gem_balance": 0, + "fb_profile": "0", + "start_date": "2019-08-01", + "versionSessionCount": 2, + "game_name": "FireEagleSlots" + }, + "integrations": { "All": true }, + "event": "spin_result", + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "model": "Redmi 6", + "manufacturer": "Xiaomi", + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "name": "xiaomi" + }, + "traits": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "address": { "city": "Dhaka", "country": "Bangladesh" } + }, + "os": { "version": "8.1.0", "name": "android" }, + "network": { "carrier": "Banglalink" } + }, + "type": "track", + "properties": { + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "jackpot_win_type": "Silver", + "coin_balance": 9466052, + "bet_level": 1, + "ishighroller": "False", + "tournament_id": "T1561970819", + "battle_id": "N/A", + "bet_amount": 9, + "fb_profile": "0", + "player_total_shields": 0, + "is_turbo": "False", + "player_total_battles": 0, + "bet_multiplier": 1, + "start_date": "2019-08-01", + "versionSessionCount": 2, + "graphicsQuality": "HD", + "is_auto_spin": "False", + "days_in_game": 0, + "additional_bet_index": 0, + "isLowEndDevice": "False", + "game_fps": 30, + "extra_param": "N/A", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "current_module_name": "CasinoGameModule", + "game_id": "fireEagleBase", + "featureGameType": "N/A", + "gem_balance": 0, + "internetReachability": "ReachableViaLocalAreaNetwork", + "total_payments": 0, + "level": 6, + "win_amount": 0, + "no_of_spin": 1, + "game_name": "FireEagleSlots", + "jackpot_win_amount": 90, + "lifetime_gem_balance": 0, + "isf": "False" + } + }, + "FORM": {} + }, + "files": {}, + "endpoint": "http://6b0e6a60.ngrok.io", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "headers": { "content-type": "application/json", "authorization": "Basic MVA4dUtGOF=" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "manufacturer": "Xiaomi", + "model": "Redmi 6", + "name": "xiaomi" + }, + "network": { "carrier": "Banglalink" }, + "os": { "name": "android", "version": "8.1.0" }, + "traits": { + "address": { "city": "Dhaka", "country": "Bangladesh" }, + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + } + }, + "event": "spin_result", + "integrations": { "All": true }, + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "properties": { + "additional_bet_index": 0, + "battle_id": "N/A", + "bet_amount": 9, + "bet_level": 1, + "bet_multiplier": 1, + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "days_in_game": 0, + "extra_param": "N/A", + "fb_profile": "0", + "featureGameType": "N/A", + "game_fps": 30, + "game_id": "fireEagleBase", + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": "False", + "is_auto_spin": "False", + "is_turbo": "False", + "isf": "False", + "ishighroller": "False", + "jackpot_win_amount": 90, + "jackpot_win_type": "Silver", + "level": 6, + "lifetime_gem_balance": 0, + "no_of_spin": 1, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "tournament_id": "T1561970819", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2, + "win_amount": 0 + }, + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "type": "track", + "user_properties": { + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "fb_profile": "0", + "game_fps": 30, + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": false, + "level": 6, + "lifetime_gem_balance": 0, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2 + } + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "webhookUrl": "https://6b0e6a60.ngrok.io/n" } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "user_properties": { + "total_payments": 0, + "internetReachability": "ReachableViaLocalAreaNetwork", + "level": 6, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "coin_balance": 9466052, + "player_total_shields": 0, + "isLowEndDevice": false, + "game_fps": 30, + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "graphicsQuality": "HD", + "current_module_name": "CasinoGameModule", + "player_total_battles": 0, + "lifetime_gem_balance": 0, + "gem_balance": 0, + "fb_profile": "0", + "start_date": "2019-08-01", + "versionSessionCount": 2, + "game_name": "FireEagleSlots" + }, + "integrations": { "All": true }, + "event": "spin_result", + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "model": "Redmi 6", + "manufacturer": "Xiaomi", + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "name": "xiaomi" + }, + "traits": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "address": { "city": "Dhaka", "country": "Bangladesh" } + }, + "os": { "version": "8.1.0", "name": "android" }, + "network": { "carrier": "Banglalink" } + }, + "type": "track", + "properties": { + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "jackpot_win_type": "Silver", + "coin_balance": 9466052, + "bet_level": 1, + "ishighroller": "False", + "tournament_id": "T1561970819", + "battle_id": "N/A", + "bet_amount": 9, + "fb_profile": "0", + "player_total_shields": 0, + "is_turbo": "False", + "player_total_battles": 0, + "bet_multiplier": 1, + "start_date": "2019-08-01", + "versionSessionCount": 2, + "graphicsQuality": "HD", + "is_auto_spin": "False", + "days_in_game": 0, + "additional_bet_index": 0, + "isLowEndDevice": "False", + "game_fps": 30, + "extra_param": "N/A", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "current_module_name": "CasinoGameModule", + "game_id": "fireEagleBase", + "featureGameType": "N/A", + "gem_balance": 0, + "internetReachability": "ReachableViaLocalAreaNetwork", + "total_payments": 0, + "level": 6, + "win_amount": 0, + "no_of_spin": 1, + "game_name": "FireEagleSlots", + "jackpot_win_amount": 90, + "lifetime_gem_balance": 0, + "isf": "False" + } + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://6b0e6a60.ngrok.io/n", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "headers": { "content-type": "application/json" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "manufacturer": "Xiaomi", + "model": "Redmi 6", + "name": "xiaomi" + }, + "network": { "carrier": "Banglalink" }, + "os": { "name": "android", "version": "8.1.0" }, + "traits": { + "address": { "city": "Dhaka", "country": "Bangladesh" }, + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + } + }, + "event": "spin_result", + "integrations": { "All": true }, + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "properties": { + "additional_bet_index": 0, + "battle_id": "N/A", + "bet_amount": 9, + "bet_level": 1, + "bet_multiplier": 1, + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "days_in_game": 0, + "extra_param": "N/A", + "fb_profile": "0", + "featureGameType": "N/A", + "game_fps": 30, + "game_id": "fireEagleBase", + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": "False", + "is_auto_spin": "False", + "is_turbo": "False", + "isf": "False", + "ishighroller": "False", + "jackpot_win_amount": 90, + "jackpot_win_type": "Silver", + "level": 6, + "lifetime_gem_balance": 0, + "no_of_spin": 1, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "tournament_id": "T1561970819", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2, + "win_amount": 0 + }, + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "type": "track", + "user_properties": { + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "fb_profile": "0", + "game_fps": 30, + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": false, + "level": 6, + "lifetime_gem_balance": 0, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2 + } + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { "webhookUrl": "https://6b0e6a60." } + } + }, + "output": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "user_properties": { + "total_payments": 0, + "internetReachability": "ReachableViaLocalAreaNetwork", + "level": 6, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "coin_balance": 9466052, + "player_total_shields": 0, + "isLowEndDevice": false, + "game_fps": 30, + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "graphicsQuality": "HD", + "current_module_name": "CasinoGameModule", + "player_total_battles": 0, + "lifetime_gem_balance": 0, + "gem_balance": 0, + "fb_profile": "0", + "start_date": "2019-08-01", + "versionSessionCount": 2, + "game_name": "FireEagleSlots" + }, + "integrations": { "All": true }, + "event": "spin_result", + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "model": "Redmi 6", + "manufacturer": "Xiaomi", + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "name": "xiaomi" + }, + "traits": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "address": { "city": "Dhaka", "country": "Bangladesh" } + }, + "os": { "version": "8.1.0", "name": "android" }, + "network": { "carrier": "Banglalink" } + }, + "type": "track", + "properties": { + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "jackpot_win_type": "Silver", + "coin_balance": 9466052, + "bet_level": 1, + "ishighroller": "False", + "tournament_id": "T1561970819", + "battle_id": "N/A", + "bet_amount": 9, + "fb_profile": "0", + "player_total_shields": 0, + "is_turbo": "False", + "player_total_battles": 0, + "bet_multiplier": 1, + "start_date": "2019-08-01", + "versionSessionCount": 2, + "graphicsQuality": "HD", + "is_auto_spin": "False", + "days_in_game": 0, + "additional_bet_index": 0, + "isLowEndDevice": "False", + "game_fps": 30, + "extra_param": "N/A", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "current_module_name": "CasinoGameModule", + "game_id": "fireEagleBase", + "featureGameType": "N/A", + "gem_balance": 0, + "internetReachability": "ReachableViaLocalAreaNetwork", + "total_payments": 0, + "level": 6, + "win_amount": 0, + "no_of_spin": 1, + "game_name": "FireEagleSlots", + "jackpot_win_amount": 90, + "lifetime_gem_balance": 0, + "isf": "False" + } + }, + "FORM": {} + }, + "files": {}, + "endpoint": "https://6b0e6a60.", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "headers": { "content-type": "application/json" }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + } + }, + { + "input": { + "message": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "manufacturer": "Xiaomi", + "model": "Redmi 6", + "name": "xiaomi" + }, + "network": { "carrier": "Banglalink" }, + "os": { "name": "android", "version": "8.1.0" }, + "traits": { + "address": { "city": "Dhaka", "country": "Bangladesh" }, + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + } + }, + "event": "spin_result", + "integrations": { "All": true }, + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "properties": { + "additional_bet_index": 0, + "battle_id": "N/A", + "bet_amount": 9, + "bet_level": 1, + "bet_multiplier": 1, + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "days_in_game": 0, + "extra_param": "N/A", + "fb_profile": "0", + "featureGameType": "N/A", + "game_fps": 30, + "game_id": "fireEagleBase", + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": "False", + "is_auto_spin": "False", + "is_turbo": "False", + "isf": "False", + "ishighroller": "False", + "jackpot_win_amount": 90, + "jackpot_win_type": "Silver", + "level": 6, + "lifetime_gem_balance": 0, + "no_of_spin": 1, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "tournament_id": "T1561970819", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2, + "win_amount": 0 + }, + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "type": "track", + "request_ip": "127.0.0.1" + }, + "destination": { + "DestinationDefinition": { "Config": { "cdkEnabled": true } }, + "Config": { + "webhookUrl": "http://6b0e6a60.ngrok.io", + "header": [ + { "from": "test1", "to": "value1" }, + { "from": "test2", "to": "value2" } + ] + } + } + }, + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "http://6b0e6a60.ngrok.io", + "headers": { "content-type": "application/json" }, + "params": {}, + "body": { + "JSON": { + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "context": { + "device": { + "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "manufacturer": "Xiaomi", + "model": "Redmi 6", + "name": "xiaomi" + }, + "network": { "carrier": "Banglalink" }, + "os": { "name": "android", "version": "8.1.0" }, + "traits": { + "address": { "city": "Dhaka", "country": "Bangladesh" }, + "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + }, + "ip": "127.0.0.1" + }, + "event": "spin_result", + "integrations": { "All": true }, + "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", + "properties": { + "additional_bet_index": 0, + "battle_id": "N/A", + "bet_amount": 9, + "bet_level": 1, + "bet_multiplier": 1, + "coin_balance": 9466052, + "current_module_name": "CasinoGameModule", + "days_in_game": 0, + "extra_param": "N/A", + "fb_profile": "0", + "featureGameType": "N/A", + "game_fps": 30, + "game_id": "fireEagleBase", + "game_name": "FireEagleSlots", + "gem_balance": 0, + "graphicsQuality": "HD", + "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", + "internetReachability": "ReachableViaLocalAreaNetwork", + "isLowEndDevice": "False", + "is_auto_spin": "False", + "is_turbo": "False", + "isf": "False", + "ishighroller": "False", + "jackpot_win_amount": 90, + "jackpot_win_type": "Silver", + "level": 6, + "lifetime_gem_balance": 0, + "no_of_spin": 1, + "player_total_battles": 0, + "player_total_shields": 0, + "start_date": "2019-08-01", + "total_payments": 0, + "tournament_id": "T1561970819", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "versionSessionCount": 2, + "win_amount": 0 + }, + "timestamp": "2019-09-01T15:46:51.693229+05:30", + "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", + "sentAt": "2019-09-01T15:46:51.693229+05:30", + "type": "track", + "request_ip": "127.0.0.1" + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + } + } +] diff --git a/test/__tests__/data/variance_input.json b/test/__tests__/data/variance_input.json deleted file mode 100644 index bb95160e9c..0000000000 --- a/test/__tests__/data/variance_input.json +++ /dev/null @@ -1,410 +0,0 @@ -[ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "user_properties": { - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "fb_profile": "0", - "game_fps": 30, - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": false, - "level": 6, - "lifetime_gem_balance": 0, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2 - } - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "http://6b0e6a60.ngrok.io", - "authHeader": "Basic MVA4dUtGOF=" - } - } - }, - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "user_properties": { - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "fb_profile": "0", - "game_fps": 30, - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": false, - "level": 6, - "lifetime_gem_balance": 0, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2 - } - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "https://6b0e6a60.ngrok.io/n" - } - } - }, - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "user_properties": { - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "fb_profile": "0", - "game_fps": 30, - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": false, - "level": 6, - "lifetime_gem_balance": 0, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2 - } - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "https://6b0e6a60." - } - } - }, - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "request_ip": "127.0.0.1" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "http://6b0e6a60.ngrok.io", - "header": [ - { - "from": "test1", - "to": "value1" - }, - { - "from": "test2", - "to": "value2" - } - ] - } - } - } -] diff --git a/test/__tests__/data/variance_output.json b/test/__tests__/data/variance_output.json deleted file mode 100644 index 2295fdbe7b..0000000000 --- a/test/__tests__/data/variance_output.json +++ /dev/null @@ -1,421 +0,0 @@ -[ - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "user_properties": { - "total_payments": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "level": 6, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "coin_balance": 9466052, - "player_total_shields": 0, - "isLowEndDevice": false, - "game_fps": 30, - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "graphicsQuality": "HD", - "current_module_name": "CasinoGameModule", - "player_total_battles": 0, - "lifetime_gem_balance": 0, - "gem_balance": 0, - "fb_profile": "0", - "start_date": "2019-08-01", - "versionSessionCount": 2, - "game_name": "FireEagleSlots" - }, - "integrations": { - "All": true - }, - "event": "spin_result", - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "model": "Redmi 6", - "manufacturer": "Xiaomi", - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "name": "xiaomi" - }, - "traits": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "address": { - "city": "Dhaka", - "country": "Bangladesh" - } - }, - "os": { - "version": "8.1.0", - "name": "android" - }, - "network": { - "carrier": "Banglalink" - } - }, - "type": "track", - "properties": { - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "jackpot_win_type": "Silver", - "coin_balance": 9466052, - "bet_level": 1, - "ishighroller": "False", - "tournament_id": "T1561970819", - "battle_id": "N/A", - "bet_amount": 9, - "fb_profile": "0", - "player_total_shields": 0, - "is_turbo": "False", - "player_total_battles": 0, - "bet_multiplier": 1, - "start_date": "2019-08-01", - "versionSessionCount": 2, - "graphicsQuality": "HD", - "is_auto_spin": "False", - "days_in_game": 0, - "additional_bet_index": 0, - "isLowEndDevice": "False", - "game_fps": 30, - "extra_param": "N/A", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "current_module_name": "CasinoGameModule", - "game_id": "fireEagleBase", - "featureGameType": "N/A", - "gem_balance": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "total_payments": 0, - "level": 6, - "win_amount": 0, - "no_of_spin": 1, - "game_name": "FireEagleSlots", - "jackpot_win_amount": 90, - "lifetime_gem_balance": 0, - "isf": "False" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "http://6b0e6a60.ngrok.io", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "content-type": "application/json", - "authorization": "Basic MVA4dUtGOF=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "user_properties": { - "total_payments": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "level": 6, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "coin_balance": 9466052, - "player_total_shields": 0, - "isLowEndDevice": false, - "game_fps": 30, - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "graphicsQuality": "HD", - "current_module_name": "CasinoGameModule", - "player_total_battles": 0, - "lifetime_gem_balance": 0, - "gem_balance": 0, - "fb_profile": "0", - "start_date": "2019-08-01", - "versionSessionCount": 2, - "game_name": "FireEagleSlots" - }, - "integrations": { - "All": true - }, - "event": "spin_result", - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "model": "Redmi 6", - "manufacturer": "Xiaomi", - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "name": "xiaomi" - }, - "traits": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "address": { - "city": "Dhaka", - "country": "Bangladesh" - } - }, - "os": { - "version": "8.1.0", - "name": "android" - }, - "network": { - "carrier": "Banglalink" - } - }, - "type": "track", - "properties": { - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "jackpot_win_type": "Silver", - "coin_balance": 9466052, - "bet_level": 1, - "ishighroller": "False", - "tournament_id": "T1561970819", - "battle_id": "N/A", - "bet_amount": 9, - "fb_profile": "0", - "player_total_shields": 0, - "is_turbo": "False", - "player_total_battles": 0, - "bet_multiplier": 1, - "start_date": "2019-08-01", - "versionSessionCount": 2, - "graphicsQuality": "HD", - "is_auto_spin": "False", - "days_in_game": 0, - "additional_bet_index": 0, - "isLowEndDevice": "False", - "game_fps": 30, - "extra_param": "N/A", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "current_module_name": "CasinoGameModule", - "game_id": "fireEagleBase", - "featureGameType": "N/A", - "gem_balance": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "total_payments": 0, - "level": 6, - "win_amount": 0, - "no_of_spin": 1, - "game_name": "FireEagleSlots", - "jackpot_win_amount": 90, - "lifetime_gem_balance": 0, - "isf": "False" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://6b0e6a60.ngrok.io/n", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "content-type": "application/json" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "user_properties": { - "total_payments": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "level": 6, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "coin_balance": 9466052, - "player_total_shields": 0, - "isLowEndDevice": false, - "game_fps": 30, - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "graphicsQuality": "HD", - "current_module_name": "CasinoGameModule", - "player_total_battles": 0, - "lifetime_gem_balance": 0, - "gem_balance": 0, - "fb_profile": "0", - "start_date": "2019-08-01", - "versionSessionCount": 2, - "game_name": "FireEagleSlots" - }, - "integrations": { - "All": true - }, - "event": "spin_result", - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "model": "Redmi 6", - "manufacturer": "Xiaomi", - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "name": "xiaomi" - }, - "traits": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "address": { - "city": "Dhaka", - "country": "Bangladesh" - } - }, - "os": { - "version": "8.1.0", - "name": "android" - }, - "network": { - "carrier": "Banglalink" - } - }, - "type": "track", - "properties": { - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "jackpot_win_type": "Silver", - "coin_balance": 9466052, - "bet_level": 1, - "ishighroller": "False", - "tournament_id": "T1561970819", - "battle_id": "N/A", - "bet_amount": 9, - "fb_profile": "0", - "player_total_shields": 0, - "is_turbo": "False", - "player_total_battles": 0, - "bet_multiplier": 1, - "start_date": "2019-08-01", - "versionSessionCount": 2, - "graphicsQuality": "HD", - "is_auto_spin": "False", - "days_in_game": 0, - "additional_bet_index": 0, - "isLowEndDevice": "False", - "game_fps": 30, - "extra_param": "N/A", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "current_module_name": "CasinoGameModule", - "game_id": "fireEagleBase", - "featureGameType": "N/A", - "gem_balance": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "total_payments": 0, - "level": 6, - "win_amount": 0, - "no_of_spin": 1, - "game_name": "FireEagleSlots", - "jackpot_win_amount": 90, - "lifetime_gem_balance": 0, - "isf": "False" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://6b0e6a60.", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "content-type": "application/json" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "http://6b0e6a60.ngrok.io", - "headers": { - "content-type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - }, - "ip": "127.0.0.1" - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "request_ip": "127.0.0.1" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } -] diff --git a/test/__tests__/data/vero_router.json b/test/__tests__/data/vero_router.json new file mode 100644 index 0000000000..004e034e69 --- /dev/null +++ b/test/__tests__/data/vero_router.json @@ -0,0 +1,265 @@ +{ + "input": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": { + "jobId": 1 + }, + "message": { + "context": { + "traits": { + "email": "user001@tech.com" + } + }, + "type": "Identify", + "userId": "user001" + } + }, + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": { + "jobId": 2 + }, + "message": { + "context": { + "traits": { + "email": "user002@tech.com" + } + }, + "type": "Identify", + "anonymousId": "b4ffheww8eisndbdjgdewifewfgerwibderv" + } + }, + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": { + "jobId": 3 + }, + "message": { + "context": { + "traits": { + "address": "Caravela Beach Goa", + "homwTown": "Mawsynram", + "email": "user005@tech.com" + } + }, + "integrations": { + "vero": { + "tags": { + "add": ["a", "b"] + } + } + }, + "type": "Identify", + "userId": "fprediruser001" + } + }, + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": { + "jobId": 4 + }, + "message": { + "event": "Random event with nonexisting userId and email", + "properties": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn02@sample.com" + }, + "type": "track", + "userId": "eventIdn01" + } + } + ], + "output": [ + { + "batched": false, + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "user001", + "email": "user001@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ], + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": [ + { + "jobId": 1 + } + ], + "statusCode": 200 + }, + { + "batched": false, + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "b4ffheww8eisndbdjgdewifewfgerwibderv", + "email": "user002@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ], + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": [ + { + "jobId": 2 + } + ], + "statusCode": 200 + }, + { + "batched": false, + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "fprediruser001", + "email": "user005@tech.com", + "data": { + "address": "Caravela Beach Goa", + "homwTown": "Mawsynram" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "auth_token": "testAuthToken", + "id": "fprediruser001", + "add": ["a", "b"] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ], + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": [ + { + "jobId": 3 + } + ], + "statusCode": 200 + }, + { + "batched": false, + "batchedRequest": [ + { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/events/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "identity": { + "id": "eventIdn01", + "email": "eventIdn02@sample.com" + }, + "event_name": "Random event with nonexisting userId and email", + "data": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn02@sample.com" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + } + ], + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "metadata": [ + { + "jobId": 4 + } + ], + "statusCode": 200 + } + ] +} diff --git a/test/__tests__/data/vero_router_input.json b/test/__tests__/data/vero_router_input.json deleted file mode 100644 index 749ea11dfd..0000000000 --- a/test/__tests__/data/vero_router_input.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 1 - }, - "message": { - "context": { - "traits": { - "email": "user001@tech.com" - } - }, - "type": "Identify", - "userId": "user001" - } - }, - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "context": { - "traits": { - "email": "user002@tech.com" - } - }, - "type": "Identify", - "anonymousId": "b4ffheww8eisndbdjgdewifewfgerwibderv" - } - }, - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 3 - }, - "message": { - "context": { - "traits": { - "address": "Caravela Beach Goa", - "homwTown": "Mawsynram", - "email": "user005@tech.com" - } - }, - "integrations": { - "vero": { - "tags": { - "add": ["a", "b"] - } - } - }, - "type": "Identify", - "userId": "fprediruser001" - } - }, - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 4 - }, - "message": { - "event": "Random event with nonexisting userId and email", - "properties": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn02@sample.com" - }, - "type": "track", - "userId": "eventIdn01" - } - } -] diff --git a/test/__tests__/data/vero_router_output.json b/test/__tests__/data/vero_router_output.json deleted file mode 100644 index 293b351251..0000000000 --- a/test/__tests__/data/vero_router_output.json +++ /dev/null @@ -1,175 +0,0 @@ -[ - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user001", - "email": "user001@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 1 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "b4ffheww8eisndbdjgdewifewfgerwibderv", - "email": "user002@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 2 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "fprediruser001", - "email": "user005@tech.com", - "data": { - "address": "Caravela Beach Goa", - "homwTown": "Mawsynram" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "auth_token": "testAuthToken", - "id": "fprediruser001", - "add": ["a", "b"] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 3 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "eventIdn01", - "email": "eventIdn02@sample.com" - }, - "event_name": "Random event with nonexisting userId and email", - "data": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn02@sample.com" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 4 - } - ], - "statusCode": 200 - } -] diff --git a/test/__tests__/redis.test.js b/test/__tests__/redis.test.js index be3a1a497f..11e5f6ae55 100644 --- a/test/__tests__/redis.test.js +++ b/test/__tests__/redis.test.js @@ -7,22 +7,22 @@ const version = "v0"; const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); -inputData.forEach((input, index) => { - it(`${name} Tests: payload - ${index}`, () => { - try { - const output = transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); -}); +describe(`${name} Tests`, () => { + describe("Processor", () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + try { + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); + } catch (error) { + expect(error.message).toEqual(dataPoint.output.message); + } + }); + }); + }); + }); \ No newline at end of file diff --git a/test/__tests__/revenue_cat.test.js b/test/__tests__/revenue_cat.test.js index 8b4487e764..b7c674f895 100644 --- a/test/__tests__/revenue_cat.test.js +++ b/test/__tests__/revenue_cat.test.js @@ -7,25 +7,21 @@ const version = "v0"; const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -// Processor Test Data -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); + describe(`${name} Tests`, () => { - describe("Processor Tests", () => { - inputData.forEach((input, index) => { - it(`${name} - payload: ${index}`, async () => { + describe("Processor", () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); } catch (error) { - expect(error.message).toEqual(expectedData[index].error); + expect(error.message).toEqual(dataPoint.output.message); } }); }); diff --git a/test/__tests__/rockerbox.test.js b/test/__tests__/rockerbox.test.js index 092b4b2806..baeb56c844 100644 --- a/test/__tests__/rockerbox.test.js +++ b/test/__tests__/rockerbox.test.js @@ -12,15 +12,11 @@ const testDataFile = fs.readFileSync( ); const testData = JSON.parse(testDataFile); -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) +// Router Test files +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); describe(`${name} Tests`, () => { describe("Processor", () => { @@ -36,10 +32,12 @@ describe(`${name} Tests`, () => { }); }); - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); + describe("Router", () => { + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); }); diff --git a/test/__tests__/salesforce.test.js b/test/__tests__/salesforce.test.js index 7315017376..2cf77a6386 100644 --- a/test/__tests__/salesforce.test.js +++ b/test/__tests__/salesforce.test.js @@ -9,62 +9,54 @@ const path = require("path"); const transformer = require(`../../src/${version}/destinations/${integration}/transform`); // Processor Test files -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); // Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); + // Router Metadata Test files -const inputRouterMetadataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_metadata_input.json`) -); -const outputRouterMetadataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_metadata_output.json`) +const routerMetadataTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router_metadata.json`) ); -const inputRouterMetadata = JSON.parse(inputRouterMetadataFile); -const expectedRouterMetadata = JSON.parse(outputRouterMetadataFile); +const routerMetadataTestData = JSON.parse(routerMetadataTestDataFile); + describe(`${name} Tests`, () => { describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); } catch (error) { - expect(error.message).toEqual(expectedData[index].error); + expect(error.message).toEqual(dataPoint.output.message); } }); }); }); - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); + describe("Router", () => { + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); describe("Router Metadata Tests", () => { - it("Payload", async () => { - const routerMetadataOutput = await transformer.processMetadataForRouter( - inputRouterMetadata - ); - expect(routerMetadataOutput).toEqual(expectedRouterMetadata); + routerMetadataTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processMetadataForRouter(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); }); diff --git a/test/__tests__/segment.test.js b/test/__tests__/segment.test.js index a1f9812f22..92daceb061 100644 --- a/test/__tests__/segment.test.js +++ b/test/__tests__/segment.test.js @@ -8,26 +8,22 @@ const version = "v0"; const transformer = require(`../../src/${version}/destinations/${integration}/transform`); // const { compareJSON } = require("./util"); -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); -inputData.forEach((input, index) => { - test(`${name} Tests: payload - ${index}`, () => { - let output, expected; - try { - output = transformer.process(input); - expected = expectedData[index]; - } catch (error) { - output = error.message; - expected = expectedData[index].message; - } - expect(output).toEqual(expected); +describe(`${name} Tests`, () => { + describe("Processor", () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + try { + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); + } catch (error) { + expect(error.message).toEqual(dataPoint.output.message); + } + }); + }); }); }); diff --git a/test/__tests__/slack.test.js b/test/__tests__/slack.test.js index eec0f4054f..ffac6bc133 100644 --- a/test/__tests__/slack.test.js +++ b/test/__tests__/slack.test.js @@ -9,40 +9,33 @@ const version = "v0"; const transformer = require(`../../src/${version}/destinations/${integration}/transform`); // const { compareJSON } = require("./util"); -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) +// Processor Test files +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) +// Router Test files +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); -inputData.forEach((input, index) => { +testData.forEach((dataPoint, index) => { test(`${name} Tests - payload: ${index}`, () => { try { - const output = transformer.process(input); - expect(output).toEqual([expectedData[index]]); + const output = transformer.process(dataPoint.input); + expect(output).toEqual([dataPoint.output]); } catch (error) { - expect(error.message).toEqual(expectedData[index].error); + expect(error.message).toEqual(dataPoint.output.error); } }); }); -describe(`${name} Tests`, () => { - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); +describe("Router", () => { + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); }); }); }); diff --git a/test/__tests__/snapchat_conversion.test.js b/test/__tests__/snapchat_conversion.test.js index 17fd363cc7..3aea4ae3bd 100644 --- a/test/__tests__/snapchat_conversion.test.js +++ b/test/__tests__/snapchat_conversion.test.js @@ -14,14 +14,10 @@ const testDataFile = fs.readFileSync( const testData = JSON.parse(testDataFile); // Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); Date.now = jest.fn(() => new Date("2022-04-22T10:57:58Z")); @@ -39,10 +35,12 @@ describe(`${name} Tests`, () => { }); }); - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); + describe("Router", () => { + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); }); diff --git a/test/__tests__/snapchat_custom_audience.test.js b/test/__tests__/snapchat_custom_audience.test.js index 41c4217562..f024987d87 100644 --- a/test/__tests__/snapchat_custom_audience.test.js +++ b/test/__tests__/snapchat_custom_audience.test.js @@ -14,14 +14,10 @@ const testDataFile = fs.readFileSync( const testData = JSON.parse(testDataFile); // Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); describe(`${name} Tests`, () => { describe("Processor", () => { @@ -36,16 +32,13 @@ describe(`${name} Tests`, () => { }); }); }); + describe("Router", () => { - it("Payload", async () => { - try { - const routerOutput = await transformer.processRouterDest( - inputRouterData - ); - expect(routerOutput).toEqual(expectedRouterData); - } catch (error) { - expect(error.message).toEqual(expectedRouterData.error); - } + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); }); diff --git a/test/__tests__/splitio.test.js b/test/__tests__/splitio.test.js index d2b226aea3..5a203ed5f1 100644 --- a/test/__tests__/splitio.test.js +++ b/test/__tests__/splitio.test.js @@ -1,7 +1,46 @@ -const { - getDestFromTestFile, - executeTransformationTest -} = require("./utilities/test-utils"); +const integration = "splitio"; +const name = "splitio"; -executeTransformationTest(getDestFromTestFile(__filename), "processor"); -executeTransformationTest(getDestFromTestFile(__filename), "router"); +const fs = require("fs"); +const path = require("path"); + +const version = "v0"; + +const transformer = require(`../../src/${version}/destinations/${integration}/transform`); +// const { compareJSON } = require("./util"); + +// Processor Test files +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) +); +const testData = JSON.parse(testDataFile); + +// Router Test files +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) +); +const routerTestData = JSON.parse(routerTestDataFile); + +describe(`${name} Tests`, () => { + describe("Processor", () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + try { + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); + } catch (error) { + expect(error.message).toEqual(dataPoint.output.error); + } + }); + }); + }); + + describe("Router", () => { + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); + }); + }); +}); \ No newline at end of file diff --git a/test/__tests__/statsig-cdk.test.ts b/test/__tests__/statsig-cdk.test.ts index 79bb3e9fae..5c2679469f 100644 --- a/test/__tests__/statsig-cdk.test.ts +++ b/test/__tests__/statsig-cdk.test.ts @@ -1,4 +1,4 @@ -import fs from 'fs'; +const fs = require("fs"); import path from 'path'; import { processCdkV2Workflow } from '../../src/cdk/v2/handler'; import tags from '../../src/v0/util/tags'; @@ -6,23 +6,18 @@ import tags from '../../src/v0/util/tags'; const integration = 'statsig'; const destName = 'Statsig'; -const inputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/${integration}_input.json`), { - encoding: 'utf8', -}); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_cdk_output.json`), - { encoding: 'utf8' }, +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); describe(`${destName} Tests`, () => { describe('Processor Tests', () => { - inputData.forEach((input, index) => { + testData.forEach((dataPoint, index) => { it(`${destName} - payload: ${index}`, async () => { - const expected = expectedData[index]; + const expected = dataPoint.output; try { - const output = await processCdkV2Workflow(integration, input, tags.FEATURES.PROCESSOR); + const output = await processCdkV2Workflow(integration, dataPoint.input, tags.FEATURES.PROCESSOR); expect(output).toEqual(expected); } catch (error: any) { expect(error.message).toEqual(expected.error); diff --git a/test/__tests__/statsig.test.js b/test/__tests__/statsig.test.js index b0b36ba187..31c52b13d8 100644 --- a/test/__tests__/statsig.test.js +++ b/test/__tests__/statsig.test.js @@ -1,3 +1,31 @@ -const { executeTransformationTest } = require("./utilities/test-utils"); +const integration = "statsig"; +const name = "statsig"; -executeTransformationTest("statsig", "processor"); +const fs = require("fs"); +const path = require("path"); + +const version = "v0"; + +const transformer = require(`../../src/${version}/destinations/${integration}/transform`); +// const { compareJSON } = require("./util"); + +// Processor Test files +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) +); +const testData = JSON.parse(testDataFile); + +describe(`${name} Tests`, () => { + describe("Processor", () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + try { + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); + } catch (error) { + expect(error.message).toEqual(dataPoint.output.error); + } + }); + }); + }); +}); diff --git a/test/__tests__/stormly.test.js b/test/__tests__/stormly.test.js index 2640440b3f..9d9e567a8d 100644 --- a/test/__tests__/stormly.test.js +++ b/test/__tests__/stormly.test.js @@ -15,14 +15,10 @@ const testDataFile = fs.readFileSync( const testData = JSON.parse(testDataFile); // Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); describe(`${name} Tests`, () => { describe("Processor", () => { @@ -39,9 +35,11 @@ describe(`${name} Tests`, () => { }); describe("Router", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); }); diff --git a/test/__tests__/tiktok_ads.test.js b/test/__tests__/tiktok_ads.test.js index 8b61fabf3d..32be504e5a 100644 --- a/test/__tests__/tiktok_ads.test.js +++ b/test/__tests__/tiktok_ads.test.js @@ -8,43 +8,37 @@ const version = "v0"; const transformer = require(`../../src/${version}/destinations/${integration}/transform`); // Processor Test files -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); // Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); describe(`${name} Tests`, () => { describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); } catch (error) { - expect(error.message).toEqual(expectedData[index].error); + expect(error.message).toEqual(dataPoint.output.message); } }); }); }); - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); + describe("Router", () => { + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); }); diff --git a/test/__tests__/tiktok_ads_offline_events.test.js b/test/__tests__/tiktok_ads_offline_events.test.js index 849f73befc..16b0f18703 100644 --- a/test/__tests__/tiktok_ads_offline_events.test.js +++ b/test/__tests__/tiktok_ads_offline_events.test.js @@ -14,14 +14,10 @@ const testDataFile = fs.readFileSync( const testData = JSON.parse(testDataFile); // Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); describe(`${name} Tests`, () => { describe("Processor", () => { @@ -37,10 +33,12 @@ describe(`${name} Tests`, () => { }); }); - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); + describe("Router", () => { + routerTestData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + const output = await transformer.processRouterDest(dataPoint.input); + expect(output).toEqual(dataPoint.output); + }); }); }); }); diff --git a/test/__tests__/variance-cdk.test.ts b/test/__tests__/variance-cdk.test.ts index 648ddaddbb..f9d49920fb 100644 --- a/test/__tests__/variance-cdk.test.ts +++ b/test/__tests__/variance-cdk.test.ts @@ -1,4 +1,4 @@ -import fs from 'fs'; +const fs = require("fs"); import path from 'path'; import { processCdkV2Workflow } from '../../src/cdk/v2/handler'; import tags from '../../src/v0/util/tags'; @@ -6,23 +6,18 @@ import tags from '../../src/v0/util/tags'; const integration = 'variance'; const destName = 'Variance'; -const inputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/${integration}_input.json`), { - encoding: 'utf8', -}); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`), - { encoding: 'utf8' }, +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) ); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); +const testData = JSON.parse(testDataFile); describe(`${destName} Tests`, () => { describe('Processor Tests', () => { - inputData.forEach((input, index) => { + testData.forEach((dataPoint, index) => { it(`${destName} - payload: ${index}`, async () => { - const expected = expectedData[index]; + const expected = dataPoint.output; try { - const output = await processCdkV2Workflow(integration, input, tags.FEATURES.PROCESSOR); + const output = await processCdkV2Workflow(integration, dataPoint.input, tags.FEATURES.PROCESSOR); expect(output).toEqual(expected); } catch (error: any) { expect(error.message).toEqual(expected.error); diff --git a/test/__tests__/variance.test.js b/test/__tests__/variance.test.js index ac6e247191..55482adf34 100644 --- a/test/__tests__/variance.test.js +++ b/test/__tests__/variance.test.js @@ -1,3 +1,32 @@ -const { executeTransformationTest } = require("./utilities/test-utils"); +const integration = "variance"; +const name = "variance"; + +const fs = require("fs"); +const path = require("path"); + +const version = "v0"; + +const transformer = require(`../../src/${version}/destinations/${integration}/transform`); +// const { compareJSON } = require("./util"); + +// Processor Test files +const testDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}.json`) +); +const testData = JSON.parse(testDataFile); + +describe(`${name} Tests`, () => { + describe("Processor", () => { + testData.forEach((dataPoint, index) => { + it(`${index}. ${integration} - ${dataPoint.description}`, async () => { + try { + const output = await transformer.process(dataPoint.input); + expect(output).toEqual(dataPoint.output); + } catch (error) { + expect(error.message).toEqual(dataPoint.output.message); + } + }); + }); + }); +}); -executeTransformationTest("variance", "processor"); diff --git a/test/__tests__/vero.test.js b/test/__tests__/vero.test.js index b0b1d130ff..8552100a30 100644 --- a/test/__tests__/vero.test.js +++ b/test/__tests__/vero.test.js @@ -13,15 +13,11 @@ const testDataFile = fs.readFileSync( ); const testData = JSON.parse(testDataFile); -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) +// Router Test files +const routerTestDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_router.json`) ); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); +const routerTestData = JSON.parse(routerTestDataFile); describe(`${name} Tests`, () => { describe("Processor", () => { @@ -39,8 +35,8 @@ describe(`${name} Tests`, () => { describe("Router Tests", () => { it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); + const routerOutput = await transformer.processRouterDest(routerTestData.input); + expect(routerOutput).toEqual(routerTestData.output); }); }); }); From 4250f837836b985ecccb3dd6ad0e3790a707fa83 Mon Sep 17 00:00:00 2001 From: Sanjay <71065320+Sanjay-Veernala@users.noreply.github.com> Date: Tue, 26 Sep 2023 19:01:01 +0530 Subject: [PATCH 2/7] chore(test-suite): moved destinations to new test suite component --- ...{stats_output.json => statisg_output.json} | 266 ++-- test/__tests__/data/statsig_input.json | 1150 ++++++++--------- test/__tests__/statsig-cdk.test.ts | 19 +- 3 files changed, 710 insertions(+), 725 deletions(-) rename test/__tests__/data/{stats_output.json => statisg_output.json} (82%) diff --git a/test/__tests__/data/stats_output.json b/test/__tests__/data/statisg_output.json similarity index 82% rename from test/__tests__/data/stats_output.json rename to test/__tests__/data/statisg_output.json index 1740bc9d50..11b3553f4c 100644 --- a/test/__tests__/data/stats_output.json +++ b/test/__tests__/data/statisg_output.json @@ -1,6 +1,9 @@ [ - { - "message": { + { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -81,19 +84,24 @@ "type": "track", "userId": "sample_user_id" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "content-type": "application/json", + "STATSIG-API-KEY": "secret-tHe5ecr37" }, - { - "message": { + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + }, + { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -167,19 +175,24 @@ "type": "identify", "userId": "sample_user_id" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } + "FORM": {} }, - { - "message": { + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "content-type": "application/json", + "STATSIG-API-KEY": "secret-tHe5ecr37" + }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + }, + { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -253,19 +266,24 @@ "type": "page", "userId": "sample_user_id" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "content-type": "application/json", + "STATSIG-API-KEY": "secret-tHe5ecr37" }, - { - "message": { + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + }, + { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -339,19 +357,24 @@ "type": "screen", "userId": "sample_user_id" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } + "FORM": {} }, - { - "message": { + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "content-type": "application/json", + "STATSIG-API-KEY": "secret-tHe5ecr37" + }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + }, + { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { "anonymousId": "8d872292709c6fbe", "channel": "mobile", "context": { @@ -425,19 +448,24 @@ "type": "screen", "userId": "sample_user_id" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-4n07h3rsecr3t" - } - } + "FORM": {} + }, + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "content-type": "application/json", + "STATSIG-API-KEY": "secret-4n07h3rsecr3t" }, - { - "message": { + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + }, + { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { "channel": "web", "context": { "app": { @@ -497,19 +525,24 @@ "previousId": "sampleusrRudder3", "sentAt": "2020-10-20T08:14:28.778Z" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } + "FORM": {} }, - { - "message": { + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "content-type": "application/json", + "STATSIG-API-KEY": "secret-tHe5ecr37" + }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + }, + { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "JSON": { "channel": "web", "context": { "app": { @@ -555,73 +588,20 @@ }, "sentAt": "2019-10-14T09:03:22.563Z" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } + "FORM": {} }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "NOT_A_TYPE", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - } - ] \ No newline at end of file + "files": {}, + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "content-type": "application/json", + "STATSIG-API-KEY": "secret-tHe5ecr37" + }, + "version": "1", + "params": {}, + "type": "REST", + "method": "POST" + }, + { + "error": "message type \"NOT_A_TYPE\" not supported for \"statsig\"" + } +] diff --git a/test/__tests__/data/statsig_input.json b/test/__tests__/data/statsig_input.json index 1740bc9d50..dbcf0666e9 100644 --- a/test/__tests__/data/statsig_input.json +++ b/test/__tests__/data/statsig_input.json @@ -1,627 +1,627 @@ [ - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSPonIAEmulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9112340345", - "username": "john_sparrow" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" }, - "event": "Product Clicked", - "integrations": { - "All": true + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSPonIAEmulator", + "name": "generic_x86_arm", + "type": "android" }, - "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", - "properties": { - "revenue": "30", - "currency": "USD", - "quantity": "5", - "test_key_2": { - "test_child_key_1": "test_child_value_1" - }, - "price": "58.0" + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" }, - "originalTimestamp": "2020-05-25T18:37:10.917Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "track", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + "os": { + "name": "Android", + "version": "9" }, - "event": "identify", - "integrations": { - "All": true + "screen": { + "density": 420, + "height": 1794, + "width": 1080 }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "identify", - "userId": "sample_user_id" + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9112340345", + "username": "john_sparrow" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "Product Clicked", + "integrations": { + "All": true }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", + "properties": { + "revenue": "30", + "currency": "USD", + "quantity": "5", + "test_key_2": { + "test_child_key_1": "test_child_value_1" }, + "price": "58.0" + }, + "originalTimestamp": "2020-05-25T18:37:10.917Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "track", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { - "secretKey": "secret-tHe5ecr37" + "cdkEnabled": true } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "page@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + } + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" }, - "event": "page", - "integrations": { - "All": true + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "page", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "identify@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "identify", + "integrations": { + "All": true + }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "identify", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { - "secretKey": "secret-tHe5ecr37" + "cdkEnabled": true } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + } + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" }, - "event": "screen", - "integrations": { - "All": true + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "page@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "page", + "integrations": { + "All": true + }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "page", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { - "secretKey": "secret-tHe5ecr37" + "cdkEnabled": true } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + } + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" }, - "event": "screen", - "integrations": { - "All": true + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "screen", + "integrations": { + "All": true + }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { - "secretKey": "secret-4n07h3rsecr3t" + "cdkEnabled": true } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.5" - }, - "traits": { - "name": "Shehan Study", - "category": "SampleIdentify", - "email": "test@rudderstack.com", - "plan": "Open source", - "logins": 5, - "createdAt": 1599264000 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.5" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 0.8999999761581421 - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign", - "test": "other value" - }, - "page": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "alias", - "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", - "originalTimestamp": "2020-10-20T08:14:28.778Z", - "anonymousId": "my-anonymous-id-new", - "userId": "newUserIdAlias", - "integrations": { - "All": true - }, - "previousId": "sampleusrRudder3", - "sentAt": "2020-10-20T08:14:28.778Z" }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } + }, + { + "message": { + "anonymousId": "8d872292709c6fbe", + "channel": "mobile", + "context": { + "app": { + "build": "1", + "name": "AMTestProject", + "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", + "version": "1.0" }, + "device": { + "id": "8d872292709c6fbe", + "manufacturer": "Google", + "model": "AOSP on IA Emulator", + "name": "generic_x86_arm", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "1.0.2" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Kolkata", + "traits": { + "address": { + "city": "Kolkata", + "country": "India", + "postalcode": "700096", + "state": "West bengal", + "street": "Park Street" + }, + "age": "30", + "anonymousId": "8d872292709c6fbe", + "birthday": "2020-05-26", + "createdat": "18th March 2020", + "description": "Premium User for 3 years", + "email": "screen@test.com", + "firstname": "John", + "userId": "sample_user_id", + "lastname": "Sparrow", + "name": "John Sparrow", + "id": "sample_user_id", + "phone": "9876543210", + "username": "john_sparrow", + "quantity": "5", + "price": "56.0" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "event": "screen", + "integrations": { + "All": true + }, + "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", + "originalTimestamp": "2020-05-25T18:37:10.865Z", + "sentAt": "2020-05-25T18:37:10.917Z", + "type": "screen", + "userId": "sample_user_id" + }, + "destination": { + "DestinationDefinition": { "Config": { - "secretKey": "secret-tHe5ecr37" + "cdkEnabled": true } + }, + "Config": { + "secretKey": "secret-4n07h3rsecr3t" } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } + } + }, + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.5" }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "group", "traits": { - "anonymousId": "123456", + "name": "Shehan Study", + "category": "SampleIdentify", "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } + "plan": "Open source", + "logins": 5, + "createdAt": 1599264000 }, - "integrations": { - "All": true + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.5" }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", + "locale": "en-US", + "os": { + "name": "", + "version": "" }, + "screen": { + "density": 0.8999999761581421 + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content", + "name": "some campaign", + "test": "other value" + }, + "page": { + "path": "/destinations/amplitude", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/amplitude", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "alias", + "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", + "originalTimestamp": "2020-10-20T08:14:28.778Z", + "anonymousId": "my-anonymous-id-new", + "userId": "newUserIdAlias", + "integrations": { + "All": true + }, + "previousId": "sampleusrRudder3", + "sentAt": "2020-10-20T08:14:28.778Z" + }, + "destination": { + "DestinationDefinition": { "Config": { - "secretKey": "secret-tHe5ecr37" + "cdkEnabled": true } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } + } + }, + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "NOT_A_TYPE", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" }, - "integrations": { - "All": true + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" }, - "sentAt": "2019-10-14T09:03:22.563Z" + "screen": { + "density": 2 + } }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "group", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "DestinationDefinition": { + "Config": { + "cdkEnabled": true + } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" + } + } + }, + { + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "123456", + "type": "NOT_A_TYPE", + "traits": { + "anonymousId": "123456", + "email": "test@rudderstack.com", + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 712136, + "state": "WB", + "street": "" + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "DestinationDefinition": { "Config": { - "secretKey": "secret-tHe5ecr37" + "cdkEnabled": true } + }, + "Config": { + "secretKey": "secret-tHe5ecr37" } } - ] \ No newline at end of file + } +] diff --git a/test/__tests__/statsig-cdk.test.ts b/test/__tests__/statsig-cdk.test.ts index 5c2679469f..79bb3e9fae 100644 --- a/test/__tests__/statsig-cdk.test.ts +++ b/test/__tests__/statsig-cdk.test.ts @@ -1,4 +1,4 @@ -const fs = require("fs"); +import fs from 'fs'; import path from 'path'; import { processCdkV2Workflow } from '../../src/cdk/v2/handler'; import tags from '../../src/v0/util/tags'; @@ -6,18 +6,23 @@ import tags from '../../src/v0/util/tags'; const integration = 'statsig'; const destName = 'Statsig'; -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) +const inputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/${integration}_input.json`), { + encoding: 'utf8', +}); +const outputDataFile = fs.readFileSync( + path.resolve(__dirname, `./data/${integration}_cdk_output.json`), + { encoding: 'utf8' }, ); -const testData = JSON.parse(testDataFile); +const inputData = JSON.parse(inputDataFile); +const expectedData = JSON.parse(outputDataFile); describe(`${destName} Tests`, () => { describe('Processor Tests', () => { - testData.forEach((dataPoint, index) => { + inputData.forEach((input, index) => { it(`${destName} - payload: ${index}`, async () => { - const expected = dataPoint.output; + const expected = expectedData[index]; try { - const output = await processCdkV2Workflow(integration, dataPoint.input, tags.FEATURES.PROCESSOR); + const output = await processCdkV2Workflow(integration, input, tags.FEATURES.PROCESSOR); expect(output).toEqual(expected); } catch (error: any) { expect(error.message).toEqual(expected.error); From 32905349fdb35d5a608d2fa24158478c20447fb0 Mon Sep 17 00:00:00 2001 From: Sanjay <71065320+Sanjay-Veernala@users.noreply.github.com> Date: Tue, 26 Sep 2023 19:13:34 +0530 Subject: [PATCH 3/7] chore(remove): remove the localscript used to onboard destinations --- test/__tests__/data/localScript.js | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 test/__tests__/data/localScript.js diff --git a/test/__tests__/data/localScript.js b/test/__tests__/data/localScript.js deleted file mode 100644 index 850403534e..0000000000 --- a/test/__tests__/data/localScript.js +++ /dev/null @@ -1,29 +0,0 @@ -const fs = require('fs'); - -function parseJSONFile(integration) { - try { - const inputFilePath = `${integration}_input.json` - const outputFiltPath = `${integration}_output.json` - - // Read the JSON file synchronously - const inputJsonData = JSON.parse(fs.readFileSync(inputFilePath, 'utf8')); - const outputJsonData = JSON.parse(fs.readFileSync(outputFiltPath, 'utf8')); - - const finalData = []; - // Parse the JSON data - const size = inputJsonData.length; - - for(let i=0;i Date: Tue, 26 Sep 2023 12:14:43 +0530 Subject: [PATCH 4/7] chore: update fb_error message for invalid type of property value (#2656) fix: fb_error message for invalid type of property value --- src/v0/destinations/fb/transform.js | 13 +++++++------ test/__tests__/data/fb_output.json | 6 +++--- test/__tests__/data/fb_router_output.json | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/v0/destinations/fb/transform.js b/src/v0/destinations/fb/transform.js index a6a8b71e8d..756c74ba83 100644 --- a/src/v0/destinations/fb/transform.js +++ b/src/v0/destinations/fb/transform.js @@ -161,7 +161,7 @@ function sanityCheckPayloadForTypesAndModifications(updatedEvent) { return clonedUpdatedEvent; } -function getCorrectedTypedValue(pathToKey, value, originalPath) { +function getCorrectedTypedValue(pathToKey, value) { const type = eventPropToTypeMapping[pathToKey]; // TODO: we should remove this eslint rule or comeup with a better way // eslint-disable-next-line valid-typeof @@ -169,10 +169,12 @@ function getCorrectedTypedValue(pathToKey, value, originalPath) { return value; } + const mappingKey = Object.keys(eventPropsMapping).find( + (key) => eventPropsMapping[key] === pathToKey, + ); + throw new InstrumentationError( - `${ - typeof originalPath === 'object' ? JSON.stringify(originalPath) : originalPath - } is not of valid type`, + `Value of ${mappingKey} is not of valid type. It should be of type ${type}`, ); } @@ -221,7 +223,6 @@ function processEventTypeGeneric(message, baseEvent, fbEventName) { updatedEvent.custom_events[0][fbEventPath][length] = getCorrectedTypedValue( fbEventPath, intendValue, - parentArray[length], ); length += 1; count -= 1; @@ -233,7 +234,7 @@ function processEventTypeGeneric(message, baseEvent, fbEventName) { set( updatedEvent.custom_events[0], fbEventPath, - getCorrectedTypedValue(fbEventPath, intendValue, rudderEventPath), + getCorrectedTypedValue(fbEventPath, intendValue), ); } } else { diff --git a/test/__tests__/data/fb_output.json b/test/__tests__/data/fb_output.json index a974fffe7e..2923e1720e 100644 --- a/test/__tests__/data/fb_output.json +++ b/test/__tests__/data/fb_output.json @@ -3,10 +3,10 @@ "message": "If properties.revenue is present, properties.currency is required." }, { - "message": "{\"product_id\":123} is not of valid type" + "message": "Value of properties.products.sub.product_id is not of valid type. It should be of type string" }, { - "message": "properties.revenue is not of valid type" + "message": "Value of properties.revenue is not of valid type. It should be of type number" }, { "body": { @@ -307,4 +307,4 @@ "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", "statusCode": 200 } -] \ No newline at end of file +] diff --git a/test/__tests__/data/fb_router_output.json b/test/__tests__/data/fb_router_output.json index 508d83cc60..5dd568cca5 100644 --- a/test/__tests__/data/fb_router_output.json +++ b/test/__tests__/data/fb_router_output.json @@ -35,6 +35,6 @@ }, "batched": false, "statusCode": 400, - "error": "{\"product_id\":123} is not of valid type" + "error": "Value of properties.products.sub.product_id is not of valid type. It should be of type string" } ] From 36d0a26e681a2e9a0e2f33e20e6bb05050994d27 Mon Sep 17 00:00:00 2001 From: Mihir Bhalala <77438541+mihir-4116@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:40:05 +0530 Subject: [PATCH 5/7] feat(iterable): user deletion support (#2621) * feat(iterable): user deletion support * feat(iterable): user deletion improvements * chore: added comments --- src/v0/destinations/iterable/deleteUsers.js | 80 ++++++++++ .../data/iterable/handler_input.json | 93 ++++++++++++ .../data/iterable/handler_output.json | 32 ++++ .../data/iterable/nw_client_data.json | 138 ++++++++++++++++++ 4 files changed, 343 insertions(+) create mode 100644 src/v0/destinations/iterable/deleteUsers.js create mode 100644 test/deleteUsers/data/iterable/handler_input.json create mode 100644 test/deleteUsers/data/iterable/handler_output.json create mode 100644 test/deleteUsers/data/iterable/nw_client_data.json diff --git a/src/v0/destinations/iterable/deleteUsers.js b/src/v0/destinations/iterable/deleteUsers.js new file mode 100644 index 0000000000..834cccd4cb --- /dev/null +++ b/src/v0/destinations/iterable/deleteUsers.js @@ -0,0 +1,80 @@ +const { httpDELETE } = require('../../../adapters/network'); +const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); +const { isHttpStatusSuccess } = require('../../util'); +const { getDynamicErrorType } = require('../../../adapters/utils/networkUtils'); +const { NetworkError, ConfigurationError } = require('../../util/errorTypes'); +const { executeCommonValidations } = require('../../util/regulation-api'); +const tags = require('../../util/tags'); +const { JSON_MIME_TYPE } = require('../../util/constant'); + +// Ref-> https://developers.intercom.com/intercom-api-reference/v1.3/reference/permanently-delete-a-user +const userDeletionHandler = async (userAttributes, config) => { + if (!config) { + throw new ConfigurationError('Config for deletion not present'); + } + const { apiKey } = config; + if (!apiKey) { + throw new ConfigurationError('api key for deletion not present'); + } + const validUserIds = []; + userAttributes.forEach((userAttribute) => { + // Dropping the user if userId is not present + if (userAttribute.userId) { + validUserIds.push(userAttribute.userId); + } + }); + const failedUserDeletions = []; + await Promise.all( + validUserIds.map(async (uId) => { + const url = `https://api.iterable.com/api/users/byUserId/${uId}`; + const requestOptions = { + headers: { + 'Content-Type': JSON_MIME_TYPE, + api_key: apiKey, + }, + }; + const resp = await httpDELETE(url, requestOptions, { + destType: 'iterable', + feature: 'deleteUsers', + }); + const handledDelResponse = processAxiosResponse(resp); + if (!isHttpStatusSuccess(handledDelResponse.status) && handledDelResponse.status !== 404) { + if (handledDelResponse.status !== 400) { + // Generic errors such as invalid api key + throw new NetworkError( + `User deletion request failed : ${handledDelResponse.response.msg}`, + handledDelResponse.status, + { + [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(handledDelResponse.status), + }, + handledDelResponse, + ); + } else { + // Specific errors such as user is not found + failedUserDeletions.push({ userId: uId, Reason: handledDelResponse.response.msg }); + } + } + }), + ); + + if (failedUserDeletions.length > 0) { + throw new NetworkError( + `User deletion request failed for userIds : ${JSON.stringify(failedUserDeletions)}`, + 400, + { + [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(400), + }, + failedUserDeletions, + ); + } + + return { statusCode: 200, status: 'successful' }; +}; +const processDeleteUsers = async (event) => { + const { userAttributes, config } = event; + executeCommonValidations(userAttributes); + const resp = await userDeletionHandler(userAttributes, config); + return resp; +}; + +module.exports = { processDeleteUsers }; diff --git a/test/deleteUsers/data/iterable/handler_input.json b/test/deleteUsers/data/iterable/handler_input.json new file mode 100644 index 0000000000..8ebc859089 --- /dev/null +++ b/test/deleteUsers/data/iterable/handler_input.json @@ -0,0 +1,93 @@ +[ + { + "request": { + "body": [ + { + "destType": "ITERABLE", + "userAttributes": [ + { + "userId": "rudder1" + } + ] + } + ] + } + }, + { + "request": { + "body": [ + { + "destType": "ITERABLE", + "userAttributes": [ + { + "userId": "rudder2" + } + ], + "config": { + "apiToken": "dummyApiKey" + } + } + ] + } + }, + { + "request": { + "body": [ + { + "destType": "ITERABLE", + "userAttributes": [ + { + "userId": "rudder1" + }, + { + "userId": "rudder2" + } + ], + "config": { + "apiKey": "dummyApiKey" + } + } + ] + } + }, + { + "request": { + "body": [ + { + "destType": "ITERABLE", + "userAttributes": [ + { + "userId": "rudder3" + }, + { + "userId": "rudder4" + } + ], + "config": { + "apiKey": "invalidKey" + } + } + ] + } + }, + { + "request": { + "body": [ + { + "destType": "ITERABLE", + "userAttributes": [ + { + "userId": "rudder5" + }, + { + "userId": "rudder6" + } + ], + "config": { + "apiKey": "dummyApiKey" + } + } + ] + } + } +] diff --git a/test/deleteUsers/data/iterable/handler_output.json b/test/deleteUsers/data/iterable/handler_output.json new file mode 100644 index 0000000000..b053d04df4 --- /dev/null +++ b/test/deleteUsers/data/iterable/handler_output.json @@ -0,0 +1,32 @@ +[ + [ + { + "statusCode": 400, + "error": "Config for deletion not present" + } + ], + [ + { + "statusCode": 400, + "error": "api key for deletion not present" + } + ], + [ + { + "statusCode": 400, + "error": "User deletion request failed for userIds : [{\"userId\":\"rudder2\",\"Reason\":\"User does not exist. Email: UserId: rudder2\"}]" + } + ], + [ + { + "error": "User deletion request failed : Invalid API key", + "statusCode": 401 + } + ], + [ + { + "statusCode": 200, + "status": "successful" + } + ] +] diff --git a/test/deleteUsers/data/iterable/nw_client_data.json b/test/deleteUsers/data/iterable/nw_client_data.json new file mode 100644 index 0000000000..159c301b11 --- /dev/null +++ b/test/deleteUsers/data/iterable/nw_client_data.json @@ -0,0 +1,138 @@ +[ + [ + { + "type": "delete", + "reqParams": [ + "https://api.iterable.com/api/users/byUserId/rudder1", + {}, + { + "Accept": "application/json", + "api_key": "dummyApiKey" + } + ], + "response": { + "response": { + "data": { + "msg": "All users associated with rudder1 were successfully deleted", + "code": "Success", + "params": null + }, + "status": 200 + } + } + }, + { + "type": "delete", + "reqParams": [ + "https://api.iterable.com/api/users/byUserId/rudder2", + {}, + { + "Accept": "application/json", + "api_key": "dummyApiKey" + } + ], + "response": { + "response": { + "data": { + "msg": "User does not exist. Email: UserId: rudder2", + "code": "BadParams", + "params": null + }, + "status": 400 + } + } + } + ], + [ + { + "type": "delete", + "reqParams": [ + "https://api.iterable.com/api/users/byUserId/rudder3", + {}, + { + "Accept": "application/json", + "api_key": "invalidKey" + } + ], + "response": { + "response": { + "data": { + "msg": "Invalid API key", + "code": "Success", + "params": { + "endpoint": "/api/users/byUserId/rudder3" + } + }, + "status": 401 + } + } + }, + { + "type": "delete", + "reqParams": [ + "https://api.iterable.com/api/users/byUserId/rudder4", + {}, + { + "Accept": "application/json", + "api_key": "invalidKey" + } + ], + "response": { + "response": { + "data": { + "msg": "Invalid API key", + "code": "Success", + "params": { + "endpoint": "/api/users/byUserId/rudder3" + } + }, + "status": 401 + } + } + } + ], + [ + { + "type": "delete", + "reqParams": [ + "https://api.iterable.com/api/users/byUserId/rudder5", + {}, + { + "Accept": "application/json", + "api_key": "dummyApiKey" + } + ], + "response": { + "response": { + "data": { + "msg": "All users associated with rudder5 were successfully deleted", + "code": "Success", + "params": null + }, + "status": 200 + } + } + }, + { + "type": "delete", + "reqParams": [ + "https://api.iterable.com/api/users/byUserId/rudder6", + {}, + { + "Accept": "application/json", + "api_key": "dummyApiKey" + } + ], + "response": { + "response": { + "data": { + "msg": "All users associated with rudder6 were successfully deleted", + "code": "Success", + "params": null + }, + "status": 200 + } + } + } + ] +] From fd0d86a0e27d666b999ad904f31f5a0a1fc1bb73 Mon Sep 17 00:00:00 2001 From: Mihir Bhalala <77438541+mihir-4116@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:09:02 +0530 Subject: [PATCH 6/7] feat(gaec): partial failures handling (#2631) * chore: partial failure handling * chore: code review changes --- .../networkHandler.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js index e79c568238..9fa0e9a3a4 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js @@ -107,7 +107,23 @@ const responseHandler = (destinationResponse) => { const message = 'Request Processed Successfully'; const { status } = destinationResponse; if (isHttpStatusSuccess(status)) { - // Mostly any error will not have a status of 2xx + // for google ads enhance conversions the partialFailureError returns with status 200 + const { partialFailureError } = destinationResponse.response; + // non-zero code signifies partialFailure + // Ref - https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto + if (partialFailureError && partialFailureError.code !== 0) { + throw new NetworkError( + `[Google Ads Offline Conversions]:: partialFailureError - ${JSON.stringify( + partialFailureError, + )}`, + 400, + { + [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(400), + }, + partialFailureError, + ); + } + return { status, message, @@ -127,7 +143,7 @@ const responseHandler = (destinationResponse) => { getAuthErrCategoryFromErrDetailsAndStCode(status, response), ); }; -// eslint-disable-next-line func-names + class networkHandler { constructor() { this.proxy = ProxyRequest; @@ -136,4 +152,5 @@ class networkHandler { this.prepareProxy = prepareProxyRequest; } } + module.exports = { networkHandler }; From 822bca326b738634c32374177cc910561a1d8267 Mon Sep 17 00:00:00 2001 From: Ujjwal Abhishek <63387036+ujjwal-ab@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:37:53 +0530 Subject: [PATCH 7/7] chore: move unit tests to correct place for mssql and postgres (#2657) * chore: move unit tests to correct place for mssql and postgres * chore: replace var to const * chore: replace var to const --- src/v0/destinations/mssql/transform.test.js | 48 ++++++++++++++++++ .../destinations/postgres/transform.test.js | 48 ++++++++++++++++++ test/__tests__/mssql.test.js | 50 ------------------- test/__tests__/postgres.test.js | 50 ------------------- 4 files changed, 96 insertions(+), 100 deletions(-) create mode 100644 src/v0/destinations/mssql/transform.test.js create mode 100644 src/v0/destinations/postgres/transform.test.js delete mode 100644 test/__tests__/mssql.test.js delete mode 100644 test/__tests__/postgres.test.js diff --git a/src/v0/destinations/mssql/transform.test.js b/src/v0/destinations/mssql/transform.test.js new file mode 100644 index 0000000000..0892651b21 --- /dev/null +++ b/src/v0/destinations/mssql/transform.test.js @@ -0,0 +1,48 @@ +const { getDataType } = require('../../../../src/warehouse/index'); +const { getDataTypeOverride } = require('./transform'); + +const testCases = [ + { + name: 'normalInt', + data: 1, + type: 'int', + }, + { + name: 'normalFloat', + data: 2.01, + type: 'float', + }, + { + name: 'normalBoolean', + data: true, + type: 'boolean', + }, + { + name: 'normalString', + data: 'mssql transformation[*007}', + type: 'string', + }, + { + name: 'violationErrors', + data: [ + { + message: + 'no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1', + meta: {}, + type: 'Unplanned-Event', + }, + ], + type: 'string', + }, +]; + +describe('MSSQL data types testing', () => { + const options = {}; + options.getDataTypeOverride = getDataTypeOverride; + testCases.forEach((testCase) => { + it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { + const dataType = getDataType(testCase.name, testCase.data, options); + expect(dataType).toEqual(testCase.type); + }); + }); +}); diff --git a/src/v0/destinations/postgres/transform.test.js b/src/v0/destinations/postgres/transform.test.js new file mode 100644 index 0000000000..9256d5bcde --- /dev/null +++ b/src/v0/destinations/postgres/transform.test.js @@ -0,0 +1,48 @@ +const { getDataType } = require('../../../../src/warehouse/index'); +const { getDataTypeOverride } = require('./transform'); + +const testCases = [ + { + name: 'normalInt', + data: 1, + type: 'int', + }, + { + name: 'normalFloat', + data: 2.01, + type: 'float', + }, + { + name: 'normalBoolean', + data: true, + type: 'boolean', + }, + { + name: 'normalString', + data: 'postgres transformation[*007}', + type: 'string', + }, + { + name: 'violationErrors', + data: [ + { + message: + 'no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1', + meta: {}, + type: 'Unplanned-Event', + }, + ], + type: 'json', + }, +]; + +describe('Postgres data types testing', () => { + const options = {}; + options.getDataTypeOverride = getDataTypeOverride; + testCases.forEach((testCase) => { + it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { + const dataType = getDataType(testCase.name, testCase.data, options); + expect(dataType).toEqual(testCase.type); + }); + }); +}); diff --git a/test/__tests__/mssql.test.js b/test/__tests__/mssql.test.js deleted file mode 100644 index 7e883d2c30..0000000000 --- a/test/__tests__/mssql.test.js +++ /dev/null @@ -1,50 +0,0 @@ -const { getDataType } = require("../../src/warehouse/index"); -const { - getDataTypeOverride -} = require("../../src/v0/destinations/mssql/transform"); - -var testCases = [ - { - name: "normalInt", - data: 1, - type: "int" - }, - { - name: "normalFloat", - data: 2.01, - type: "float" - }, - { - name: "normalBoolean", - data: true, - type: "boolean" - }, - { - name: "normalString", - data: "mssql transformation[*007}", - type: "string" - }, - { - name: "violationErrors", - data: [ - { - message: - "no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1", - meta: {}, - type: "Unplanned-Event" - } - ], - type: "string" - } -]; - -describe("MSSQL data types testing", () => { - let options = {}; - options.getDataTypeOverride = getDataTypeOverride; - testCases.forEach(testCase => { - it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { - var dataType = getDataType(testCase.name, testCase.data, options); - expect(dataType).toEqual(testCase.type); - }); - }); -}); diff --git a/test/__tests__/postgres.test.js b/test/__tests__/postgres.test.js deleted file mode 100644 index 354fedba09..0000000000 --- a/test/__tests__/postgres.test.js +++ /dev/null @@ -1,50 +0,0 @@ -const { getDataType } = require("../../src/warehouse/index"); -const { - getDataTypeOverride -} = require("../../src/v0/destinations/postgres/transform"); - -var testCases = [ - { - name: "normalInt", - data: 1, - type: "int" - }, - { - name: "normalFloat", - data: 2.01, - type: "float" - }, - { - name: "normalBoolean", - data: true, - type: "boolean" - }, - { - name: "normalString", - data: "postgres transformation[*007}", - type: "string" - }, - { - name: "violationErrors", - data: [ - { - message: - "no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1", - meta: {}, - type: "Unplanned-Event" - } - ], - type: "json" - } -]; - -describe("Postgres data types testing", () => { - let options = {}; - options.getDataTypeOverride = getDataTypeOverride; - testCases.forEach(testCase => { - it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { - var dataType = getDataType(testCase.name, testCase.data, options); - expect(dataType).toEqual(testCase.type); - }); - }); -});