From 30a17649260c9345832a9586b4b9a276dc26224c Mon Sep 17 00:00:00 2001 From: Sanjay <71065320+Sanjay-Veernala@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:35:26 +0530 Subject: [PATCH 01/22] component tests(chore): update component test data --- package-lock.json | 126 +- test/__tests__/data/redis_input.json | 405 -- test/__tests__/data/redis_output.json | 90 - test/__tests__/data/revenue_cat_input.json | 449 -- test/__tests__/data/revenue_cat_output.json | 424 -- test/__tests__/data/salesforce_input.json | 793 --- test/__tests__/data/salesforce_output.json | 320 -- .../data/salesforce_router_input.json | 277 - .../data/salesforce_router_output.json | 233 - test/__tests__/data/segment_input.json | 368 -- test/__tests__/data/segment_output.json | 187 - test/__tests__/data/shynet.json | 166 - test/__tests__/data/slack_input.json | 1415 ----- test/__tests__/data/slack_output.json | 164 - test/__tests__/data/slack_router_input.json | 247 - test/__tests__/data/slack_router_output.json | 172 - test/__tests__/data/snapchat_conversion.json | 2910 ---------- .../data/snapchat_custom_audience.json | 939 ---- test/__tests__/data/splitio_input.json | 367 -- test/__tests__/data/splitio_output.json | 261 - test/__tests__/data/splitio_router_input.json | 82 - .../__tests__/data/splitio_router_output.json | 90 - test/__tests__/data/statsig_input.json | 627 --- test/__tests__/data/statsig_output.json | 607 --- test/__tests__/data/tiktok_ads_input.json | 2500 --------- .../data/tiktok_ads_offline_events.json | 469 -- test/__tests__/data/tiktok_ads_output.json | 1545 ------ .../data/tiktok_ads_router_input.json | 439 -- .../data/tiktok_ads_router_output.json | 287 - test/__tests__/data/twitter_ads.json | 708 --- test/__tests__/data/variance_input.json | 410 -- test/__tests__/data/variance_output.json | 421 -- .../destinations/redis/processor/data.ts | 660 +++ .../revenue_cat/processor/data.ts | 1079 ++++ .../destinations/rockerbox/processor/data.ts | 749 +++ .../destinations/rockerbox/router/data.ts | 314 ++ .../destinations/salesforce/processor/data.ts | 1145 ++++ .../destinations/salesforce/router/data.ts | 425 ++ .../destinations/segment/processor/data.ts | 670 +++ .../destinations/shynet/processor/data.ts | 212 + .../destinations/slack/processor/data.ts | 1982 +++++++ .../destinations/slack/router/data.ts | 425 ++ .../snapchat_conversion/processor/data.ts | 3005 +++++++++++ .../processor/data.ts | 1404 +++++ .../destinations/splitio/processor/data.ts | 915 ++++ .../destinations/splitio/router/data.ts | 192 + .../destinations/statsig/processor/data.ts | 1428 +++++ .../destinations/tiktok_ads/processor/data.ts | 4690 +++++++++++++++++ .../destinations/tiktok_ads/router/data.ts | 892 ++++ .../processor/data.ts | 618 +++ .../twitter_ads/processor/data.ts | 884 ++++ .../destinations/variance/processor/data.ts | 921 ++++ .../destinations/vero/processor/data.ts | 818 +++ .../destinations/vero/router/data.ts | 312 ++ testScript.js | 105 + testScript_1.js | 160 + 56 files changed, 24012 insertions(+), 18491 deletions(-) delete mode 100644 test/__tests__/data/redis_input.json delete mode 100644 test/__tests__/data/redis_output.json delete mode 100644 test/__tests__/data/revenue_cat_input.json delete mode 100644 test/__tests__/data/revenue_cat_output.json delete mode 100644 test/__tests__/data/salesforce_input.json delete mode 100644 test/__tests__/data/salesforce_output.json delete mode 100644 test/__tests__/data/salesforce_router_input.json delete mode 100644 test/__tests__/data/salesforce_router_output.json delete mode 100644 test/__tests__/data/segment_input.json delete mode 100644 test/__tests__/data/segment_output.json delete mode 100644 test/__tests__/data/shynet.json delete mode 100644 test/__tests__/data/slack_input.json delete mode 100644 test/__tests__/data/slack_output.json delete mode 100644 test/__tests__/data/slack_router_input.json delete mode 100644 test/__tests__/data/slack_router_output.json delete mode 100644 test/__tests__/data/snapchat_conversion.json delete mode 100644 test/__tests__/data/snapchat_custom_audience.json delete mode 100644 test/__tests__/data/splitio_input.json delete mode 100644 test/__tests__/data/splitio_output.json delete mode 100644 test/__tests__/data/splitio_router_input.json delete mode 100644 test/__tests__/data/splitio_router_output.json delete mode 100644 test/__tests__/data/statsig_input.json delete mode 100644 test/__tests__/data/statsig_output.json delete mode 100644 test/__tests__/data/tiktok_ads_input.json delete mode 100644 test/__tests__/data/tiktok_ads_offline_events.json delete mode 100644 test/__tests__/data/tiktok_ads_output.json delete mode 100644 test/__tests__/data/tiktok_ads_router_input.json delete mode 100644 test/__tests__/data/tiktok_ads_router_output.json delete mode 100644 test/__tests__/data/twitter_ads.json delete mode 100644 test/__tests__/data/variance_input.json delete mode 100644 test/__tests__/data/variance_output.json create mode 100644 test/integrations/destinations/redis/processor/data.ts create mode 100644 test/integrations/destinations/revenue_cat/processor/data.ts create mode 100644 test/integrations/destinations/rockerbox/processor/data.ts create mode 100644 test/integrations/destinations/rockerbox/router/data.ts create mode 100644 test/integrations/destinations/salesforce/processor/data.ts create mode 100644 test/integrations/destinations/salesforce/router/data.ts create mode 100644 test/integrations/destinations/segment/processor/data.ts create mode 100644 test/integrations/destinations/shynet/processor/data.ts create mode 100644 test/integrations/destinations/slack/processor/data.ts create mode 100644 test/integrations/destinations/slack/router/data.ts create mode 100644 test/integrations/destinations/snapchat_conversion/processor/data.ts create mode 100644 test/integrations/destinations/snapchat_custom_audience/processor/data.ts create mode 100644 test/integrations/destinations/splitio/processor/data.ts create mode 100644 test/integrations/destinations/splitio/router/data.ts create mode 100644 test/integrations/destinations/statsig/processor/data.ts create mode 100644 test/integrations/destinations/tiktok_ads/processor/data.ts create mode 100644 test/integrations/destinations/tiktok_ads/router/data.ts create mode 100644 test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts create mode 100644 test/integrations/destinations/twitter_ads/processor/data.ts create mode 100644 test/integrations/destinations/variance/processor/data.ts create mode 100644 test/integrations/destinations/vero/processor/data.ts create mode 100644 test/integrations/destinations/vero/router/data.ts create mode 100644 testScript.js create mode 100644 testScript_1.js diff --git a/package-lock.json b/package-lock.json index d2bfe402a1..c2c1ecf755 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", @@ -8158,6 +8157,7 @@ }, "node_modules/available-typed-arrays": { "version": "1.0.5", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -8170,52 +8170,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", @@ -12477,6 +12431,7 @@ }, "node_modules/for-each": { "version": "0.3.3", + "dev": true, "license": "MIT", "dependencies": { "is-callable": "^1.1.3" @@ -13079,6 +13034,7 @@ }, "node_modules/gopd": { "version": "1.0.1", + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" @@ -13667,20 +13623,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, @@ -13744,6 +13686,7 @@ }, "node_modules/is-callable": { "version": "1.2.7", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -14042,6 +13985,7 @@ }, "node_modules/is-typed-array": { "version": "1.1.10", + "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", @@ -14121,6 +14065,7 @@ }, "node_modules/isarray": { "version": "1.0.0", + "dev": true, "license": "MIT" }, "node_modules/iserror": { @@ -14828,13 +14773,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", @@ -17530,12 +17468,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, @@ -18163,10 +18095,6 @@ "dev": true, "license": "MIT" }, - "node_modules/sax": { - "version": "1.2.1", - "license": "ISC" - }, "node_modules/semver": { "version": "7.5.3", "license": "ISC", @@ -19636,14 +19564,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, @@ -19663,10 +19583,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" @@ -19675,17 +19591,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" @@ -19824,6 +19729,7 @@ }, "node_modules/which-typed-array": { "version": "1.1.9", + "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", @@ -19963,24 +19869,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/redis_input.json b/test/__tests__/data/redis_input.json deleted file mode 100644 index e3407c837a..0000000000 --- a/test/__tests__/data/redis_input.json +++ /dev/null @@ -1,405 +0,0 @@ -[ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": " " - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": [{ "x": 1, "y": 2 }], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": [{ "x": 1, "y": 2 }], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "arrayProp": [{ "x": 1, "y": 2 }], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "traits": { - "country": "USA", - "firstname": "Mickey" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestEmptyKey" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "arrayProp": [{ "x": 1, "y": 2 }], - "emptyKey": "", - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "traits": { - "country": "USA", - "firstname": "Mickey" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "metadata": { - "workspaceId": "some-workspace-id" - }, - "message": { - "userId": "some-user-id", - "channel": "sources", - "context": { - "sources": { - "job_id": "some-job-id", - "version": "some-version", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg", - "profiles_model": "some-model", - "profiles_entity": "some-entity", - "profiles_id_type": "some-id-type" - } - }, - "traits": { - "MODEL_ID": "1691755780", - "VALID_AT": "2023-08-11T11:32:44.963062Z", - "USER_MAIN_ID": "rid5530313526204a95efe71d98cd17d5a1", - "CHURN_SCORE_7_DAYS": 0.027986, - "PERCENTILE_CHURN_SCORE_7_DAYS": 0 - }, - "messageId": "some-message-id", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify" - }, - "request": {} - } -] diff --git a/test/__tests__/data/redis_output.json b/test/__tests__/data/redis_output.json deleted file mode 100644 index 69d2aa20c2..0000000000 --- a/test/__tests__/data/redis_output.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "message": { - "key": "user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "message": { - "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "message": { - "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "USA", - "firstname": "Mickey", - "lastname": "Mouse", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "message": { - "key": "TestEmptyKey:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "USA", - "firstname": "Mickey", - "lastname": "Mouse", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "emptyKey": "", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "error": "context or context.traits or traits is empty" - }, - { - "message": { - "hash": "some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id", - "key": "some-model", - "value": "{\"MODEL_ID\":\"1691755780\",\"VALID_AT\":\"2023-08-11T11:32:44.963062Z\",\"USER_MAIN_ID\":\"rid5530313526204a95efe71d98cd17d5a1\",\"CHURN_SCORE_7_DAYS\":0.027986,\"PERCENTILE_CHURN_SCORE_7_DAYS\":0}" - }, - "userId": "some-user-id" - } -] diff --git a/test/__tests__/data/revenue_cat_input.json b/test/__tests__/data/revenue_cat_input.json deleted file mode 100644 index 0e56415545..0000000000 --- a/test/__tests__/data/revenue_cat_input.json +++ /dev/null @@ -1,449 +0,0 @@ -[ - { - "destination": { - "Config": { - "apiKey": "as9d920a5e75a18acb4a29abd9ec1e2e", - "xPlatform": "stripe" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "lastname": "Doe", - "density": "420", - "height": "1794", - "width": "1080", - "iterableCampaignId": "1234", - "iterableTemplateId": "1234" - } - } - }, - { - "destination": { - "Config": { - "apiKey": "a5e75dfda29abd920ec1ec8a18acb42e", - "xPlatform": "stripe" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "firstname": "James", - "density": 420, - "height": 1794, - "width": 1080, - "iterableCampaignId": "1234", - "iterableTemplateId": "1234" - } - } - }, - { - "destination": { - "Config": { - "xPlatform": "stripe" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "name": "John Doe" - } - } - }, - { - "destination": { - "Config": { - "apiKey": "a5e75d99c8a18acb4a29abd920ec1e2e" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "name": "John Doe" - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123", - "products": [ - { - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games", - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - } - ] - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "xPlatform": "stripe" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123", - "products": [ - { - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games", - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - } - ] - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "xPlatform": "stripe" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "products": [ - { - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games", - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - }, - { - "sku": "G-33", - "name": "SunGlass", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "sku": "G-35", - "product_id": "1234sb", - "name": "Real-me", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - } - ] - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "xPlatform": "stripe" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - } - } - } -] diff --git a/test/__tests__/data/revenue_cat_output.json b/test/__tests__/data/revenue_cat_output.json deleted file mode 100644 index a4e49c25d0..0000000000 --- a/test/__tests__/data/revenue_cat_output.json +++ /dev/null @@ -1,424 +0,0 @@ -[ - [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", - "headers": { - "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", - "headers": { - "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "attributes": { - "app_user_id": { - "value": "rudder1235678" - }, - "$email": { - "value": "chandan@companyname.com" - }, - "$phoneNumber": { - "value": "92374162212" - }, - "$ip": { - "value": "14.5.67.21" - }, - "$iterableCampaignId": { - "value": "1234" - }, - "$iterableTemplateId": { - "value": "1234" - }, - "$displayName": { - "value": "Doe" - }, - "lastname": { - "value": "Doe" - }, - "density": { - "value": "420" - }, - "height": { - "value": "1794" - }, - "width": { - "value": "1080" - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", - "headers": { - "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", - "headers": { - "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "attributes": { - "app_user_id": { - "value": "rudder1235678" - }, - "$email": { - "value": "chandan@companyname.com" - }, - "$phoneNumber": { - "value": "92374162212" - }, - "$ip": { - "value": "14.5.67.21" - }, - "$iterableCampaignId": { - "value": "1234" - }, - "$iterableTemplateId": { - "value": "1234" - }, - "$displayName": { - "value": "James" - }, - "firstname": { - "value": "James" - }, - "density": { - "value": "420" - }, - "height": { - "value": "1794" - }, - "width": { - "value": "1080" - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Public API Key required for Authentication", - "statTags": { - "destination": "revenue_cat", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", - "headers": { - "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", - "headers": { - "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "attributes": { - "app_user_id": { - "value": "rudder1235678" - }, - "$displayName": { - "value": "John Doe" - }, - "$email": { - "value": "chandan@companyname.com" - }, - "$phoneNumber": { - "value": "92374162212" - }, - "$ip": { - "value": "14.5.67.21" - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "X-Platform is required field", - "statTags": { - "destination": "revenue_cat", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "123", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "345", - "currency": "USD", - "price": 3.45, - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "345", - "currency": "USD", - "price": 3.45, - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "1234sb", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "price": 14, - "currency": "USD", - "is_restore": true, - "product_id": "123-sa", - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "introductory_price": "350", - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-Platform": "stripe", - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "version": "1", - "endpoint": "https://api.revenuecat.com/v1/receipts" - } -] 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_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_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_input.json b/test/__tests__/data/segment_input.json deleted file mode 100644 index c21cb93f6e..0000000000 --- a/test/__tests__/data/segment_input.json +++ /dev/null @@ -1,368 +0,0 @@ -[ - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - } -] diff --git a/test/__tests__/data/segment_output.json b/test/__tests__/data/segment_output.json deleted file mode 100644 index 0d8ca2c784..0000000000 --- a/test/__tests__/data/segment_output.json +++ /dev/null @@ -1,187 +0,0 @@ -[ - { - "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 - }, - { - "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 - }, - { - "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 - }, - { - "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 - }, - { - "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/shynet.json b/test/__tests__/data/shynet.json deleted file mode 100644 index 16673e09cf..0000000000 --- a/test/__tests__/data/shynet.json +++ /dev/null @@ -1,166 +0,0 @@ -[ - { - "description": "Page Call", - "input": { - "destination": { - "Config": { - "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js", - "heartBeat": 5000 - } - }, - "message": { - "type": "page", - "sentAt": "2022-08-22T13:39:21.034Z", - "channel": "web", - "context": { - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "12312@!fma", - "city": "Pune", - "revenue": 93889 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-22T13:39:21.032Z" - } - }, - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - } - }, - { - "description": "Page Call without heartBeat Mentioned", - "input": { - "destination": { - "Config": { - "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - } - }, - "message": { - "type": "page", - "sentAt": "2022-08-22T13:39:21.034Z", - "channel": "web", - "context": { - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "", - "loadTime": 45 - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "12312@!fma", - "city": "Pune", - "revenue": 93889 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "properties": { - "loadTime": 45 - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "675467tfhjgjhfcghjc", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-22T13:39:21.032Z" - } - }, - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "loadTime": 45, - "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - } - } -] diff --git a/test/__tests__/data/slack_input.json b/test/__tests__/data/slack_input.json deleted file mode 100644 index e29624490c..0000000000 --- a/test/__tests__/data/slack_input.json +++ /dev/null @@ -1,1415 +0,0 @@ -[ - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - }, - { - "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" - } - } -] diff --git a/test/__tests__/data/slack_output.json b/test/__tests__/data/slack_output.json deleted file mode 100644 index c772aa3b19..0000000000 --- a/test/__tests__/data/slack_output.json +++ /dev/null @@ -1,164 +0,0 @@ -[ - { - "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 - }, - { - "error": "Event type page is not supported" - }, - { - "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 - }, - { - "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 - }, - { - "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 - }, - { - "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 - }, - { - "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 - }, - { - "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 - }, - { - "error": "Event type is required" - }, - { - "error": "Event name is required" - }, - { - "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'" - }, - { - "error": "Event is denied. Please check configuration." - } -] diff --git a/test/__tests__/data/slack_router_input.json b/test/__tests__/data/slack_router_input.json deleted file mode 100644 index f2bf20466d..0000000000 --- a/test/__tests__/data/slack_router_input.json +++ /dev/null @@ -1,247 +0,0 @@ -[ - { - "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" - } - } -] diff --git a/test/__tests__/data/slack_router_output.json b/test/__tests__/data/slack_router_output.json deleted file mode 100644 index 6b1658b5e0..0000000000 --- a/test/__tests__/data/slack_router_output.json +++ /dev/null @@ -1,172 +0,0 @@ -[ - { - "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.json b/test/__tests__/data/snapchat_conversion.json deleted file mode 100644 index 930c19c98d..0000000000 --- a/test/__tests__/data/snapchat_conversion.json +++ /dev/null @@ -1,2910 +0,0 @@ -[ - { - "description": "Test case for Page event-> PAGE_VIEW ", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "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": "page", - "name": "Home Page Viewed", - "properties": { - "title": "Home | RudderStack", - "url": "http://www.rudderstack.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "PAGE_VIEW", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "WEB", - "page_url": "http://www.rudderstack.com", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Prodcuts Searched event for conversion type offline", - "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 ", - "firstName": "john", - "middleName": "victor", - "lastName": "doe", - "city": "some_city", - "state": "some_state" - }, - "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", - "number_items": 4, - "click_id": "some_click_id", - "description": "Products Searched event for conversion type offline" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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", - "number_items": 4, - "click_id": "some_click_id", - "description": "Products Searched event for conversion type offline", - "hashed_first_name_sha": "96d9632f363564cc3032521409cf22a852f2032eec099ed5967c0d000cec607a", - "hashed_last_name_sha": "799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f", - "hashed_state_sha": "6db488fc98e30afdf67a05a6da916805b02891ce58f03970c6deff79129c5f1c", - "hashed_middle_name_sha": "99bde068af2d49ed7fc8b8fa79abe13a6059e0db320bb73459fd96624bb4b33f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Track event without event Key", - "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 ", - "country": "IN", - "zicode": "Sxp-12345", - "region": "some_region" - }, - "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", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "statusCode": 400, - "error": "Event name is required" - } - }, - { - "description": "Test case for Identify event which is not supported in this destination", - "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": "identify", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "statusCode": 400, - "error": "Event type identify is not supported" - } - }, - { - "description": "Pixel id is not set as a destination config field", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "statusCode": 400, - "error": "Pixel Id is required for web and offline events" - } - }, - { - "description": "Test case for Prodcuts Searched event for conversion type web", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "WEB", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case where appId is not present in destination config", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - }, - "output": { - "statusCode": 400, - "error": "Snap App Id is required for app events" - } - }, - { - "description": "Test case where snap app id is not present in destination config", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f" - } - } - }, - "output": { - "statusCode": 400, - "error": "Snap App Id is required for app events" - } - }, - { - "description": "Product Searched event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Product List Viewed event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 ", - "country": "IN", - "zipcode": "Sxp-12345", - "region": "some_region" - }, - "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": "Product List Viewed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "VIEW_CONTENT", - "item_ids": ["123", "123"], - "price": "56", - "country": "IN", - "hashed_zip": "cbb2704f5b334a0cec32e5463d1fd9355f6ef73987bfe0ebb8389b7617452152", - "region": "some_region", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for checkout_started event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "checkout_started", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": "2" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "START_CHECKOUT", - "item_ids": ["123", "123"], - "price": "42", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Order Completed event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Order Completed", - "properties": { - "brands": ["brand01", "brand02"], - "products": [ - { - "product_id": "123", - "price": "14", - "quantity": 1 - }, - { - "product_id": "124", - "price": 14, - "quantity": 3 - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "PURCHASE", - "item_ids": ["123", "124"], - "brands": ["brand01", "brand02"], - "price": "56", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Product Added event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Product Added", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_ids": "123", - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "ADD_CART", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is web", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "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": "Product Viewed", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "number_items": 14, - "quantity": 1 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_ids": "123", - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "WEB", - "pixel_id": "dummyPixelId", - "number_items": 14 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Product Viewed", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "quantity": 1 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_ids": "123", - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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", - "number_items": 1 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Payment Info Entered event where conversion type is offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Payment Info Entered", - "properties": { - "checkout_id": "12dfdfdf3" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "transaction_id": "12dfdfdf3", - "event_type": "ADD_BILLING", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Subscribe event where conversion type is web", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "subscribe", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "SUBSCRIBE", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Promotion Viewed event for conversion type offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Promotion Viewed", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "AD_VIEW", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Promotion Clicked event for conversion type offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Promotion clicked", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "AD_CLICK", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for save event for conversion type offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "save", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "SAVE", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is web", - "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": "Product Viewed", - "properties": { - "eventConversionType": "web", - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "url": "hjhb.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "page_url": "hjhb.com", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "WEB", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is offline", - "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": "Product Viewed", - "properties": { - "eventConversionType": "offline", - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "url": "hjhb.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Searched event where conversion type is offline", - "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", - "event_tag": "offline" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "event_tag": "offline", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Product Added To Whishlist event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Product Added to Wishlist", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "item_ids": "123", - "price": "14", - "currency": "USD", - "event_type": "ADD_TO_WISHLIST", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Products Searched event using event mapping", - "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": "ProdSearched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "ProdSearched", - "to": "products_searched" - } - ] - } - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Test case event doesn't match with snapchat events", - "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": "ProdSearched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [] - } - } - }, - "output": { - "statusCode": 400, - "error": "Event ProdSearched doesn't match with Snapchat Events!" - } - }, - { - "description": "test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground", - "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 - }, - "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": "Product Added to Cart", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "Product_Added_To_Cart", - "to": "products_searched" - } - ] - } - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground - here destination config need to be modified", - "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 - }, - "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": "Product_Added_to_Cart", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "Product Added To Cart", - "to": "products_searched" - } - ] - } - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Mapping revenue to price for order completed event", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Order Completed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14", - "quantity": 1 - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ], - "revenue": "100" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "PURCHASE", - "item_ids": ["123", "123"], - "price": "100", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Mapping revenue to price for product list viewed event", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Product List Viewed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ], - "revenue": "100" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "VIEW_CONTENT", - "item_ids": ["123", "123"], - "price": "100", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "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": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - } -] diff --git a/test/__tests__/data/snapchat_custom_audience.json b/test/__tests__/data/snapchat_custom_audience.json deleted file mode 100644 index 5c06632200..0000000000 --- a/test/__tests__/data/snapchat_custom_audience.json +++ /dev/null @@ -1,939 +0,0 @@ -[ - { - "description": "adding user", - "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": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "removing user", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": true, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "remove": [ - { - "email": "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419", - "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": [ - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "adding and removing users", - "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" - } - ], - "remove": [ - { - "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": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "adding multiple users", - "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" - }, - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "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": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["EMAIL_SHA256"], - "data": [ - ["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"], - ["1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd"] - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "removing multiple users", - "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": { - "remove": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - }, - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "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": [ - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [ - ["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"], - ["1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd"] - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "message type is not audiencelist", - "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": "audience", - "properties": { - "listData": { - "add": [ - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "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": { - "statusCode": 400, - "error": "Event type audience is not supported" - } - }, - { - "description": "without message type", - "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", - "properties": { - "listData": { - "add": [ - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "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": { - "statusCode": 400, - "error": "Event type is required" - } - }, - { - "description": "without sending properties", - "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", - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "Message properties is not present. Aborting message" - } - }, - { - "description": "without listData inside properties", - "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": { - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "listData is not present inside properties. Aborting message" - } - }, - { - "description": "without add or remove lists inside listData", - "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": { - "abc": "123" - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "Neither 'add' nor 'remove' property is present inside 'listData'. Aborting message" - } - }, - { - "description": "not providing required field for chosen schema in all the cases", - "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": { - "remove": [ - { - "email": "", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - }, - { - "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": { - "statusCode": 400, - "error": "Required schema parameter email is not found from payload" - } - }, - { - "description": "not providing required field for chosen schema in some cases", - "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": { - "remove": [ - { - "email": "abcd@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - }, - { - "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": [ - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [["8c37cbc5d9abb3082303c6548571cfc7655a4546ddc1e943f041fc9126e7274a"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "schema= phone", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "phone" - } - }, - "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": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["PHONE_SHA256"], - "data": [["7619ee8cea49187f309616e30ecf54be072259b43760f1f550a644945d5572f2"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "schema= mobileAdId", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "mobileAdId" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "09876543210", - "mobileId": "1334", - "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": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["MOBILE_AD_ID_SHA256"], - "data": [["eb43272640b269219a01caf99c5a4122d6edc0916d45ac13c0ce80ca3ad2def0"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - } -] 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_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_input.json b/test/__tests__/data/statsig_input.json deleted file mode 100644 index dbcf0666e9..0000000000 --- a/test/__tests__/data/statsig_input.json +++ /dev/null @@ -1,627 +0,0 @@ -[ - { - "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" - } - } - }, - { - "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" - } - } - }, - { - "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" - } - } - }, - { - "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" - } - } - }, - { - "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" - } - } - }, - { - "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": { - "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" - } - } - }, - { - "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" - } - } - } -] diff --git a/test/__tests__/data/statsig_output.json b/test/__tests__/data/statsig_output.json deleted file mode 100644 index 11b3553f4c..0000000000 --- a/test/__tests__/data/statsig_output.json +++ /dev/null @@ -1,607 +0,0 @@ -[ - { - "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" - }, - { - "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" - }, - { - "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" - }, - { - "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" - }, - { - "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" - }, - { - "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" - }, - { - "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" - }, - { - "error": "message type \"NOT_A_TYPE\" not supported for \"statsig\"" - } -] 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.json b/test/__tests__/data/tiktok_ads_offline_events.json deleted file mode 100644 index 24bdb2ed4e..0000000000 --- a/test/__tests__/data/tiktok_ads_offline_events.json +++ /dev/null @@ -1,469 +0,0 @@ -[ - { - "description": "Identify call not supported error message", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "type": "Identify", - "userId": "yash001", - "originalTimestamp": "2019-10-14T09:03:17.562Z" - } - }, - "output": { - "error": "Event type identify is not supported" - } - }, - { - "description": "Regular track call", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": false - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - }, - "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" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "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 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "event_set_id": "7181537436256731137" - } - ] - }, - { - "description": "Track call with hashUserProperties set to true", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "1234567890" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7181537436256731137", - "eventId": "1616318632825_352", - "prop1": "val1" - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_set_id": "7181537436256731137", - "event": "Subscribe", - "event_id": "1616318632825_352", - "timestamp": "2023-01-03", - "partner_name": "RudderStack", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ] - } - }, - "properties": { - "event_channel": "web" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "event_set_id": "7181537436256731137" - } - ] - }, - { - "description": "Track call with event mapping", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "RandomEvent", - "to": "SubmitForm" - } - ] - } - }, - "message": { - "event": "RandomEvent", - "context": { - "traits": { - "phone": "1234567890" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7185009018564395009", - "eventId": "1616318632003_004", - "prop1": "val1" - }, - "userId": "eventIdn01", - "timestamp": "2023-01-03", - "type": "track" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event": "SubmitForm", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ] - } - }, - "event_id": "1616318632003_004", - "timestamp": "2023-01-03", - "properties": { - "event_channel": "web" - }, - "event_set_id": "7185009018564395009", - "partner_name": "RudderStack" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "event_set_id": "7185009018564395009" - } - ] - }, - { - "description": "Track call with no Access-Token", - "input": { - "destination": { - "Config": { - "hashUserProperties": true - } - }, - "message": { - "type": "track", - "userId": "yash001", - "originalTimestamp": "2019-10-14T09:03:17.562Z" - } - }, - "output": { - "error": "Access Token not found" - } - }, - { - "description": "Track call with product details in properties", - "input": { - "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" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "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": {}, - "event_set_id": "7181537436256731137" - } - ] - }, - { - "description": "Track call with email and phone number parameter as an array", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "CompletePayment", - "to": "Purchase" - } - ] - } - }, - "message": { - "type": "track", - "event": "CompletePayment", - "sentAt": "2023-03-22T00:02:33.802Z", - "traits": { - "email": [ - "efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900", - "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" - ], - "phone": [ - "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", - "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" - ] - }, - "userId": "60241286212", - "channel": "sources", - "context": { - "sources": { - "job_id": "2N4WuoNQpGYmCPASUvnV86QyhY4/Syncher", - "version": "v1.20.0", - "job_run_id": "cgd4a063b2fn2e1j0q90", - "task_run_id": "cgd4a063b2fn2e1j0qa0" - } - }, - "recordId": "16322", - "rudderId": "5b4ed73f-69aa-4198-88d1-3d4d509acbf1", - "messageId": "cgd4b663b2fn2e1j8th0", - "timestamp": "2023-03-22T00:02:33.170Z", - "properties": { - "phone": "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", - "value": 32.839999999999996, - "emails": "[\"efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900\",\"078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]", - "eventId": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", - "currency": "USD", - "order_id": 60241286212, - "eventSetId": "7211223771099742210", - "event_name": "CompletePayment" - }, - "receivedAt": "2023-03-22T00:02:33.171Z", - "request_ip": "10.7.78.187", - "anonymousId": "60241286212", - "originalTimestamp": "2023-03-22T00:02:33.802Z" - } - }, - "output": [ - { - "body": { - "FORM": {}, - "JSON": { - "context": { - "user": { - "emails": [ - "4dc75b075057df6f6b729e74a9feed1244dcf8ceb7903eaba13203f3268ae4b9", - "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" - ], - "phone_numbers": [ - "28b7b205c2936d2ded022d2587fb2677a76e560e921b3ad615b739b0238baa5d", - "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" - ] - } - }, - "event": "Purchase", - "event_id": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", - "event_set_id": "7211223771099742210", - "partner_name": "RudderStack", - "properties": { - "currency": "USD", - "order_id": 60241286212, - "value": 32.839999999999996 - }, - "timestamp": "2023-03-22T00:02:33.170Z" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "event_set_id": "7211223771099742210", - "files": {}, - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - ] - } -] 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_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/twitter_ads.json b/test/__tests__/data/twitter_ads.json deleted file mode 100644 index 53c7c19929..0000000000 --- a/test/__tests__/data/twitter_ads.json +++ /dev/null @@ -1,708 +0,0 @@ -[ - { - "description": "Track - success call", - "input": { - "message": { - "type": "track", - "event": "ABC Searched", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com", - "contents": [ - { - "price": "123.3345", - "quantity": "12", - "id": "12" - }, - { - "price": 200, - "quantity": 11, - "id": "4" - } - ] - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-odt2o-odt2q" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - "headers": { - "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "conversions": [ - { - "number_items": 2, - "price_currency": "USD", - "value": "25", - "conversion_id": "213123", - "contents": [ - { - "content_price": 123.3345, - "num_items": 12, - "content_id": "12" - }, - { - "content_price": 200.0, - "num_items": 11, - "content_id": "4" - } - ], - "event_id": "tw-234234324234", - "conversion_time": "2023-06-01T06:03:08.739Z", - "identifiers": [ - { - "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - }, - { - "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - }, - { - "twclid": "543" - } - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track - validation fail call", - "input": { - "message": { - "type": "track", - "event": "Home Page Viewed", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "conversionTime": "2023-06-01T06:03:08.739Z", - "eventId": "429047995", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-2dfsdf" - } - ] - } - } - }, - "output": { - "statusCode": 400, - "error": "[TWITTER ADS]: one of twclid, phone or email must be present in properties.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "TWITTER_ADS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - }, - { - "description": "Track - pixelId from payload call", - "input": { - "message": { - "type": "track", - "event": "Home Page Viewed", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "eventId": "429047995", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25.55, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - "headers": { - "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "conversions": [ - { - "number_items": 2, - "price_currency": "USD", - "value": "25.55", - "conversion_id": "213123", - "event_id": "429047995", - "conversion_time": "2023-06-01T06:03:08.739Z", - "identifiers": [ - { - "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - }, - { - "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - }, - { - "twclid": "543" - } - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track - event name with no corresponding eventId", - "input": { - "message": { - "type": "track", - "event": "Home Page", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - }, - "output": { - "statusCode": 400, - "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting" - } - }, - { - "description": "Track - event name with no corresponding eventId", - "input": { - "message": { - "type": "track", - "event": "Home Page", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": " ", - "twitterEventId": "tw-324fdsf" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - }, - "output": { - "statusCode": 400, - "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting" - } - }, - { - "description": "Track - success call", - "input": { - "message": { - "type": "track", - "event": "Home Page Viewed", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com", - "contents": [ - { - "price": "123.3345", - "quantity": "12", - "id": "12" - }, - { - "price": 200, - "quantity": 11, - "id": "4" - } - ] - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-odt2o-odt2q" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - "headers": { - "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "conversions": [ - { - "number_items": 2, - "price_currency": "USD", - "value": "25", - "conversion_id": "213123", - "contents": [ - { - "content_price": 123.3345, - "num_items": 12, - "content_id": "12" - }, - { - "content_price": 200.0, - "num_items": 11, - "content_id": "4" - } - ], - "event_id": "tw-odt2o-odt2q", - "conversion_time": "2023-06-01T06:03:08.739Z", - "identifiers": [ - { - "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - }, - { - "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - }, - { - "twclid": "543" - } - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - } -] 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/integrations/destinations/redis/processor/data.ts b/test/integrations/destinations/redis/processor/data.ts new file mode 100644 index 0000000000..b0622fd91d --- /dev/null +++ b/test/integrations/destinations/redis/processor/data.ts @@ -0,0 +1,660 @@ +export const data = [ + { + "name": "redis", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "address": "localhost:6379", + "database": "test", + "prefix": " " + }, + "DestinationDefinition": { + "DisplayName": "Redis", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "REDIS" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Redis", + "Transformations": [] + }, + "message": { + "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.5" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.5" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "country": "UK", + "lastname": "Mouse", + "omega": "test", + "omega v2": "test", + "9mega": "test", + "mega&": "test", + "ome$ga": "test", + "alpha$": "test", + "ome_ ga": "test", + "9mega________-________90": "test", + "Cízǔ": "test", + "CamelCase123Key": "test", + "1CComega": "test", + "arrayProp": [ + { + "x": 1, + "y": 2 + } + ], + "nestedProp": { + "innerProp1": "innerPropVal1", + "innerProp2": "innerPropVal2", + "innerProp3": {} + } + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", + "originalTimestamp": "2020-01-24T06:29:02.362Z", + "receivedAt": "2020-01-24T11:59:02.403+05:30", + "request_ip": "[::1]:53708", + "sentAt": "2020-01-24T06:29:02.363Z", + "timestamp": "2020-01-24T11:59:02.402+05:30", + "type": "identify", + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "request": {} + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "message": { + "key": "user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", + "fields": { + "country": "UK", + "lastname": "Mouse", + "omega": "test", + "omega v2": "test", + "9mega": "test", + "mega&": "test", + "ome$ga": "test", + "alpha$": "test", + "ome_ ga": "test", + "9mega________-________90": "test", + "Cízǔ": "test", + "CamelCase123Key": "test", + "1CComega": "test", + "arrayProp": "[{\"x\":1,\"y\":2}]", + "nestedProp.innerProp1": "innerPropVal1", + "nestedProp.innerProp2": "innerPropVal2" + } + }, + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "redis", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "address": "localhost:6379", + "database": "test", + "prefix": "TestPrefix" + }, + "DestinationDefinition": { + "DisplayName": "Redis", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "REDIS" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Redis", + "Transformations": [] + }, + "message": { + "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.5" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.5" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "country": "UK", + "lastname": "Mouse", + "omega": "test", + "omega v2": "test", + "9mega": "test", + "mega&": "test", + "ome$ga": "test", + "alpha$": "test", + "ome_ ga": "test", + "9mega________-________90": "test", + "Cízǔ": "test", + "CamelCase123Key": "test", + "1CComega": "test", + "arrayProp": [ + { + "x": 1, + "y": 2 + } + ], + "nestedProp": { + "innerProp1": "innerPropVal1", + "innerProp2": "innerPropVal2", + "innerProp3": {} + } + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", + "originalTimestamp": "2020-01-24T06:29:02.362Z", + "receivedAt": "2020-01-24T11:59:02.403+05:30", + "request_ip": "[::1]:53708", + "sentAt": "2020-01-24T06:29:02.363Z", + "timestamp": "2020-01-24T11:59:02.402+05:30", + "type": "identify", + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "request": {} + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "message": { + "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", + "fields": { + "country": "UK", + "lastname": "Mouse", + "omega": "test", + "omega v2": "test", + "9mega": "test", + "mega&": "test", + "ome$ga": "test", + "alpha$": "test", + "ome_ ga": "test", + "9mega________-________90": "test", + "Cízǔ": "test", + "CamelCase123Key": "test", + "1CComega": "test", + "arrayProp": "[{\"x\":1,\"y\":2}]", + "nestedProp.innerProp1": "innerPropVal1", + "nestedProp.innerProp2": "innerPropVal2" + } + }, + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "redis", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "address": "localhost:6379", + "database": "test", + "prefix": "TestPrefix" + }, + "DestinationDefinition": { + "DisplayName": "Redis", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "REDIS" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Redis", + "Transformations": [] + }, + "message": { + "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.5" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.5" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "country": "UK", + "lastname": "Mouse", + "arrayProp": [ + { + "x": 1, + "y": 2 + } + ], + "nestedProp": { + "innerProp1": "innerPropVal1", + "innerProp2": "innerPropVal2", + "innerProp3": {} + } + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" + }, + "traits": { + "country": "USA", + "firstname": "Mickey" + }, + "integrations": { + "All": true + }, + "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", + "originalTimestamp": "2020-01-24T06:29:02.362Z", + "receivedAt": "2020-01-24T11:59:02.403+05:30", + "request_ip": "[::1]:53708", + "sentAt": "2020-01-24T06:29:02.363Z", + "timestamp": "2020-01-24T11:59:02.402+05:30", + "type": "identify", + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "request": {} + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "message": { + "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", + "fields": { + "country": "USA", + "lastname": "Mouse", + "arrayProp": "[{\"x\":1,\"y\":2}]", + "nestedProp.innerProp1": "innerPropVal1", + "nestedProp.innerProp2": "innerPropVal2", + "firstname": "Mickey" + } + }, + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "redis", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "address": "localhost:6379", + "database": "test", + "prefix": "TestEmptyKey" + }, + "DestinationDefinition": { + "DisplayName": "Redis", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "REDIS" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Redis", + "Transformations": [] + }, + "message": { + "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.5" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.5" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": { + "country": "UK", + "lastname": "Mouse", + "arrayProp": [ + { + "x": 1, + "y": 2 + } + ], + "emptyKey": "", + "nestedProp": { + "innerProp1": "innerPropVal1", + "innerProp2": "innerPropVal2", + "innerProp3": {} + } + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" + }, + "traits": { + "country": "USA", + "firstname": "Mickey" + }, + "integrations": { + "All": true + }, + "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", + "originalTimestamp": "2020-01-24T06:29:02.362Z", + "receivedAt": "2020-01-24T11:59:02.403+05:30", + "request_ip": "[::1]:53708", + "sentAt": "2020-01-24T06:29:02.363Z", + "timestamp": "2020-01-24T11:59:02.402+05:30", + "type": "identify", + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "request": {} + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "message": { + "key": "TestEmptyKey:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", + "fields": { + "country": "USA", + "lastname": "Mouse", + "arrayProp": "[{\"x\":1,\"y\":2}]", + "emptyKey": "", + "nestedProp.innerProp1": "innerPropVal1", + "nestedProp.innerProp2": "innerPropVal2", + "firstname": "Mickey" + } + }, + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "redis", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "address": "localhost:6379", + "database": "test", + "prefix": "TestPrefix" + }, + "DestinationDefinition": { + "DisplayName": "Redis", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "REDIS" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Redis", + "Transformations": [] + }, + "message": { + "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.5" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.5" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "traits": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", + "originalTimestamp": "2020-01-24T06:29:02.362Z", + "receivedAt": "2020-01-24T11:59:02.403+05:30", + "request_ip": "[::1]:53708", + "sentAt": "2020-01-24T06:29:02.363Z", + "timestamp": "2020-01-24T11:59:02.402+05:30", + "type": "identify", + "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" + }, + "request": {} + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "context or context.traits or traits is empty", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "REDIS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "redis", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "address": "localhost:6379", + "database": "test", + "prefix": "TestPrefix" + }, + "DestinationDefinition": { + "DisplayName": "Redis", + "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", + "Name": "REDIS" + }, + "Enabled": true, + "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", + "Name": "Redis", + "Transformations": [] + }, + "metadata": { + "workspaceId": "some-workspace-id" + }, + "message": { + "userId": "some-user-id", + "channel": "sources", + "context": { + "sources": { + "job_id": "some-job-id", + "version": "some-version", + "job_run_id": "c8el40l6e87v0c4hkbl0", + "task_run_id": "c8el40l6e87v0c4hkblg", + "profiles_model": "some-model", + "profiles_entity": "some-entity", + "profiles_id_type": "some-id-type" + } + }, + "traits": { + "MODEL_ID": "1691755780", + "VALID_AT": "2023-08-11T11:32:44.963062Z", + "USER_MAIN_ID": "rid5530313526204a95efe71d98cd17d5a1", + "CHURN_SCORE_7_DAYS": 0.027986, + "PERCENTILE_CHURN_SCORE_7_DAYS": 0 + }, + "messageId": "some-message-id", + "originalTimestamp": "2020-01-24T06:29:02.362Z", + "receivedAt": "2020-01-24T11:59:02.403+05:30", + "request_ip": "[::1]:53708", + "sentAt": "2020-01-24T06:29:02.363Z", + "timestamp": "2020-01-24T11:59:02.402+05:30", + "type": "identify" + }, + "request": {} + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "message": { + "hash": "some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id", + "key": "some-model", + "value": "{\"MODEL_ID\":\"1691755780\",\"VALID_AT\":\"2023-08-11T11:32:44.963062Z\",\"USER_MAIN_ID\":\"rid5530313526204a95efe71d98cd17d5a1\",\"CHURN_SCORE_7_DAYS\":0.027986,\"PERCENTILE_CHURN_SCORE_7_DAYS\":0}" + }, + "userId": "some-user-id" + }, + "metadata": { + "workspaceId": "some-workspace-id" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/revenue_cat/processor/data.ts b/test/integrations/destinations/revenue_cat/processor/data.ts new file mode 100644 index 0000000000..45ff5d8499 --- /dev/null +++ b/test/integrations/destinations/revenue_cat/processor/data.ts @@ -0,0 +1,1079 @@ +export const data = [ + { + "name": "revenue_cat", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "as9d920a5e75a18acb4a29abd9ec1e2e", + "xPlatform": "stripe" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "lastname": "Doe", + "density": "420", + "height": "1794", + "width": "1080", + "iterableCampaignId": "1234", + "iterableTemplateId": "1234" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "GET", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", + "headers": { + "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", + "headers": { + "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "attributes": { + "app_user_id": { + "value": "rudder1235678" + }, + "$email": { + "value": "chandan@companyname.com" + }, + "$phoneNumber": { + "value": "92374162212" + }, + "$ip": { + "value": "14.5.67.21" + }, + "$iterableCampaignId": { + "value": "1234" + }, + "$iterableTemplateId": { + "value": "1234" + }, + "$displayName": { + "value": "Doe" + }, + "lastname": { + "value": "Doe" + }, + "density": { + "value": "420" + }, + "height": { + "value": "1794" + }, + "width": { + "value": "1080" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "a5e75dfda29abd920ec1ec8a18acb42e", + "xPlatform": "stripe" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "firstname": "James", + "density": 420, + "height": 1794, + "width": 1080, + "iterableCampaignId": "1234", + "iterableTemplateId": "1234" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "GET", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", + "headers": { + "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", + "headers": { + "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "attributes": { + "app_user_id": { + "value": "rudder1235678" + }, + "$email": { + "value": "chandan@companyname.com" + }, + "$phoneNumber": { + "value": "92374162212" + }, + "$ip": { + "value": "14.5.67.21" + }, + "$iterableCampaignId": { + "value": "1234" + }, + "$iterableTemplateId": { + "value": "1234" + }, + "$displayName": { + "value": "James" + }, + "firstname": { + "value": "James" + }, + "density": { + "value": "420" + }, + "height": { + "value": "1794" + }, + "width": { + "value": "1080" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "xPlatform": "stripe" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "name": "John Doe" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Public API Key required for Authentication", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "REVENUE_CAT", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "a5e75d99c8a18acb4a29abd920ec1e2e" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "name": "John Doe" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "GET", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", + "headers": { + "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", + "headers": { + "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "attributes": { + "app_user_id": { + "value": "rudder1235678" + }, + "$displayName": { + "value": "John Doe" + }, + "$email": { + "value": "chandan@companyname.com" + }, + "$phoneNumber": { + "value": "92374162212" + }, + "$ip": { + "value": "14.5.67.21" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123", + "products": [ + { + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games", + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "X-Platform is required field", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "REVENUE_CAT", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "xPlatform": "stripe" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123", + "products": [ + { + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games", + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "345", + "currency": "USD", + "price": 3.45, + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "xPlatform": "stripe" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "products": [ + { + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games", + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + }, + { + "sku": "G-33", + "name": "SunGlass", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "sku": "G-35", + "product_id": "1234sb", + "name": "Real-me", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "345", + "currency": "USD", + "price": 3.45, + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "1234sb", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "xPlatform": "stripe" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "price": 14, + "currency": "USD", + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/rockerbox/processor/data.ts b/test/integrations/destinations/rockerbox/processor/data.ts new file mode 100644 index 0000000000..ff8f6d4620 --- /dev/null +++ b/test/integrations/destinations/rockerbox/processor/data.ts @@ -0,0 +1,749 @@ +export const data = [ + { + "name": "rockerbox", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "KDH4JNDHCFJHJ57SJOWJE490W01JFNHGDSSFHDKDSDF" + } + }, + "message": { + "context": { + "traits": { + "homwTown": "kanpur", + "age": "24" + } + }, + "type": "Identify", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Message type identify is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "ROCKERBOX", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "test id", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added To Cart", + "to": "conv.add_to_cart" + } + ], + "useNativeSDK": { + "web": false + }, + "clientAuthId": { + "web": "test-client-auth-id" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "Marketing Sample" + } + ] + }, + "customDomain": { + "web": "https://cookiedomain.com" + }, + "enableCookieSync": { + "web": true + } + } + }, + "message": { + "type": "track", + "event": "Product Added", + "sentAt": "2022-08-07T20:02:19.352Z", + "userId": "userSampleX138", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "locale": "en-IN", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 584, + "innerHeight": 789 + }, + "traits": { + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "last_name": "Stack", + "first_name": "Rudder", + "subscription": "youtube" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" + }, + "rudderId": "4a47e99b-2afc-45c6-b902-ed69282ca805", + "messageId": "1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93", + "properties": { + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt" + }, + "anonymousId": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-07T20:02:19.347Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "The event is not associated to a RockerBox event. Aborting!", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "ROCKERBOX", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "test id", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added", + "to": "conv.add_to_cart" + } + ], + "useNativeSDK": { + "web": false + }, + "clientAuthId": { + "web": "test-client-auth-id" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "Marketing Sample" + } + ] + }, + "customDomain": { + "web": "https://cookiedomain.com" + }, + "enableCookieSync": { + "web": true + } + } + }, + "message": { + "type": "track", + "event": "Product Added", + "sentAt": "2022-08-07T20:02:19.352Z", + "userId": "userSampleX138", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "locale": "en-IN", + "traits": { + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "last_name": "Stack", + "first_name": "Rudder" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" + }, + "rudderId": "4a47e99b-2afc-45c6-b902-ed69282ca805", + "messageId": "1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93", + "properties": { + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt" + }, + "anonymousId": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-07T20:02:19.347Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://webhooks.getrockerbox.com/rudderstack", + "headers": {}, + "params": { + "advertiser": "test id" + }, + "body": { + "JSON": { + "customer_id": "userSampleX138", + "anonymous_id": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "timestamp": 1659902539, + "conversion_source": "RudderStack", + "action": "conv.add_to_cart", + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "test id", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added", + "to": "conv.add_to_cart" + } + ], + "useNativeSDK": { + "web": false + }, + "clientAuthId": { + "web": "test-client-auth-id" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "Marketing Sample" + } + ] + }, + "customDomain": { + "web": "https://cookiedomain.com" + }, + "enableCookieSync": { + "web": true + } + } + }, + "message": { + "type": "track", + "event": "Product Added", + "sentAt": "2022-08-07T20:02:19.352Z", + "userId": "userSampleX138", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "locale": "en-IN", + "traits": { + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "last_name": "Stack", + "first_name": "Rudder" + }, + "externalId": [ + { + "type": "rockerboxExternalId", + "id": "rbUid" + } + ], + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" + }, + "rudderId": "4a47e99b-2afc-45c6-b902-ed69282ca805", + "messageId": "1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93", + "properties": { + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt", + "externalId": "rbUid", + "countryCode": "IN", + "listingId": "10101" + }, + "anonymousId": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-07T20:02:19.347Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://webhooks.getrockerbox.com/rudderstack", + "headers": {}, + "params": { + "advertiser": "test id" + }, + "body": { + "JSON": { + "customer_id": "userSampleX138", + "anonymous_id": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "timestamp": 1659902539, + "country_code": "IN", + "listing_id": "10101", + "conversion_source": "RudderStack", + "action": "conv.add_to_cart", + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt", + "externalId": "rbUid" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "hdowhfiqhfwaiwhrdafshbfacicolsa", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added", + "to": "conv.add_to_cart" + } + ], + "customPropsMapping": [ + { + "from": "unit_id", + "to": "unitID" + }, + { + "from": "merch_id", + "to": "merch_id" + }, + { + "from": "bounce_id", + "to": "bounceID" + } + ], + "useNativeSDK": { + "web": false + }, + "useNativeSDKToSend": { + "web": false + }, + "clientAuthId": { + "web": "" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "" + } + ] + }, + "customDomain": { + "web": "" + }, + "enableCookieSync": { + "web": false + } + } + }, + "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": "anon_id", + "type": "track", + "traits": { + "userId": "anon_id", + "email": "jamesDoe@gmail.com", + "name": "James Doe", + "phone": "92374162212", + "gender": "M", + "employed": true, + "birthday": "1614775793", + "education": "Science", + "graduate": true, + "married": true, + "customerType": "Prime", + "msg_push": true, + "msgSms": true, + "msgemail": true, + "msgwhatsapp": false, + "custom_tags": [ + "Test_User", + "Interested_User", + "DIY_Hobby" + ], + "custom_mappings": { + "Office": "Trastkiv", + "Country": "Russia" + }, + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 789223, + "state": "WB", + "street": "" + } + }, + "properties": { + "unit_id": 123, + "merch_id": false, + "bounceiD": "fakefake", + "counce_id": "" + }, + "event": "Product Added", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://webhooks.getrockerbox.com/rudderstack", + "headers": {}, + "params": { + "advertiser": "hdowhfiqhfwaiwhrdafshbfacicolsa" + }, + "body": { + "JSON": { + "customer_id": "anon_id", + "anonymous_id": "anon_id", + "email": "jamesDoe@gmail.com", + "phone": "92374162212", + "timestamp": 1571043797, + "conversion_source": "RudderStack", + "action": "conv.add_to_cart", + "unit_id": 123, + "merch_id": false, + "bounceiD": "fakefake", + "counce_id": "" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "KDH4JNDHCFJHJ57SJOWJE490W01JFNHGDSSFHDKDSDF" + } + }, + "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", + "type": "track", + "traits": { + "email": "jamesDoe@gmail.com", + "name": "James Doe", + "phone": "92374162212", + "gender": "M", + "employed": true, + "birthday": "1614775793", + "education": "Science", + "graduate": true, + "married": true, + "customerType": "Prime", + "msg_push": true, + "msgSms": true, + "msgemail": true, + "msgwhatsapp": false, + "custom_tags": [ + "Test_User", + "Interested_User", + "DIY_Hobby" + ], + "custom_mappings": { + "Office": "Trastkiv", + "Country": "Russia" + }, + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 789223, + "state": "WB", + "street": "" + } + }, + "properties": { + "unit_id": 123, + "merch_id": false, + "bounceiD": "fakefake", + "counce_id": "" + }, + "event": "Product Added", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Anyone of userId or anonymousId is required to make the call", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "ROCKERBOX", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/rockerbox/router/data.ts b/test/integrations/destinations/rockerbox/router/data.ts new file mode 100644 index 0000000000..caa8f1ba08 --- /dev/null +++ b/test/integrations/destinations/rockerbox/router/data.ts @@ -0,0 +1,314 @@ +export const data = [ + { + name: 'rockerbox', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + advertiserId: 'test id', + eventFilteringOption: 'disable', + whitelistedEvents: [ + { + eventName: '', + }, + ], + blacklistedEvents: [ + { + eventName: '', + }, + ], + eventsMap: [ + { + from: 'Product Added', + to: 'conv.add_to_cart', + }, + ], + useNativeSDK: { + web: false, + }, + clientAuthId: { + web: 'test-client-auth-id', + }, + oneTrustCookieCategories: { + web: [ + { + oneTrustCookieCategory: 'Marketing Sample', + }, + ], + }, + customDomain: { + web: 'https://cookiedomain.com', + }, + enableCookieSync: { + web: true, + }, + }, + }, + metadata: { + jobId: 1, + }, + message: { + type: 'track', + event: 'Product Added', + sentAt: '2022-08-07T20:02:19.352Z', + userId: 'userSampleX138', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + locale: 'en-IN', + traits: { + email: 'userSampleX120@gmail.com', + phone: '9878764736', + last_name: 'Stack', + first_name: 'Rudder', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36', + }, + rudderId: '4a47e99b-2afc-45c6-b902-ed69282ca805', + messageId: '1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93', + properties: { + checkout_id: '12345', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + product_name: 'Red T-shirt', + }, + anonymousId: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-07T20:02:19.347Z', + }, + writeKey: '2D0yaayoBD7bp8uFomnBONdedcA', + requestIP: '[::1]', + receivedAt: '2022-08-08T01:32:19.369+05:30', + }, + ], + destType: 'rockerbox', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + action: 'conv.add_to_cart', + anonymous_id: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + checkout_id: '12345', + conversion_source: 'RudderStack', + customer_id: 'userSampleX138', + email: 'userSampleX120@gmail.com', + phone: '9878764736', + product_name: 'Red T-shirt', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + timestamp: 1659902539, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://webhooks.getrockerbox.com/rudderstack', + files: {}, + headers: {}, + method: 'POST', + params: { advertiser: 'test id' }, + type: 'REST', + version: '1', + }, + destination: { + Config: { + advertiserId: 'test id', + blacklistedEvents: [{ eventName: '' }], + clientAuthId: { web: 'test-client-auth-id' }, + customDomain: { web: 'https://cookiedomain.com' }, + enableCookieSync: { web: true }, + eventFilteringOption: 'disable', + eventsMap: [{ from: 'Product Added', to: 'conv.add_to_cart' }], + oneTrustCookieCategories: { + web: [{ oneTrustCookieCategory: 'Marketing Sample' }], + }, + useNativeSDK: { web: false }, + whitelistedEvents: [{ eventName: '' }], + }, + }, + metadata: [{ jobId: 1 }], + statusCode: 200, + }, + ], + }, + }, + }, + }, + { + name: 'rockerbox', + description: 'Test 1', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + advertiserId: 'test id', + eventFilteringOption: 'disable', + whitelistedEvents: [ + { + eventName: '', + }, + ], + blacklistedEvents: [ + { + eventName: '', + }, + ], + eventsMap: [ + { + from: 'Product Viewed', + to: 'conv.add_to_cart', + }, + ], + useNativeSDK: { + web: false, + }, + clientAuthId: { + web: 'test-client-auth-id', + }, + oneTrustCookieCategories: { + web: [ + { + oneTrustCookieCategory: 'Marketing Sample', + }, + ], + }, + customDomain: { + web: 'https://cookiedomain.com', + }, + enableCookieSync: { + web: true, + }, + }, + }, + metadata: { + jobId: 2, + }, + message: { + type: 'track', + event: 'Product Viewed', + sentAt: '2022-08-07T20:02:19.352Z', + userId: 'userSampleX138', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + locale: 'en-IN', + traits: { + email: 'userSampleX120@gmail.com', + phone: '9878764736', + last_name: 'Stack', + first_name: 'Rudder', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36', + }, + rudderId: '4a47e99b-2afc-45c6-b902-ed69282ca805', + messageId: '1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93', + properties: { + checkout_id: '12345', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + product_name: 'Red T-shirt', + }, + anonymousId: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-07T20:02:19.347Z', + }, + writeKey: '2D0yaayoBD7bp8uFomnBONdedcA', + requestIP: '[::1]', + receivedAt: '2022-08-08T01:32:19.369+05:30', + }, + ], + destType: 'rockerbox', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + action: 'conv.add_to_cart', + anonymous_id: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + checkout_id: '12345', + conversion_source: 'RudderStack', + customer_id: 'userSampleX138', + email: 'userSampleX120@gmail.com', + phone: '9878764736', + product_name: 'Red T-shirt', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + timestamp: 1659902539, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://webhooks.getrockerbox.com/rudderstack', + files: {}, + headers: {}, + method: 'POST', + params: { advertiser: 'test id' }, + type: 'REST', + version: '1', + }, + destination: { + Config: { + advertiserId: 'test id', + blacklistedEvents: [{ eventName: '' }], + clientAuthId: { web: 'test-client-auth-id' }, + customDomain: { web: 'https://cookiedomain.com' }, + enableCookieSync: { web: true }, + eventFilteringOption: 'disable', + eventsMap: [{ from: 'Product Viewed', to: 'conv.add_to_cart' }], + oneTrustCookieCategories: { + web: [{ oneTrustCookieCategory: 'Marketing Sample' }], + }, + useNativeSDK: { web: false }, + whitelistedEvents: [{ eventName: '' }], + }, + }, + metadata: [{ jobId: 2 }], + statusCode: 200, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/salesforce/processor/data.ts b/test/integrations/destinations/salesforce/processor/data.ts new file mode 100644 index 0000000000..62a91c1b54 --- /dev/null +++ b/test/integrations/destinations/salesforce/processor/data.ts @@ -0,0 +1,1145 @@ +export const data = [ + { + "name": "salesforce", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "salesforce", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", + "statTags": { + "errorCategory": "network", + "errorType": "aborted", + "destType": "SALESFORCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/salesforce/router/data.ts b/test/integrations/destinations/salesforce/router/data.ts new file mode 100644 index 0000000000..43bb5c5551 --- /dev/null +++ b/test/integrations/destinations/salesforce/router/data.ts @@ -0,0 +1,425 @@ +export const data = [ + { + name: 'salesforce', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: [], + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 1, + }, + statusCode: 400, + error: + 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', + statTags: { + errorCategory: 'network', + errorType: 'aborted', + destType: 'SALESFORCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: [], + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 2, + }, + statusCode: 400, + error: + 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', + statTags: { + errorCategory: 'network', + errorType: 'aborted', + destType: 'SALESFORCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: [], + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 3, + }, + statusCode: 400, + error: + 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', + statTags: { + errorCategory: 'network', + errorType: 'aborted', + destType: 'SALESFORCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 4, + }, + statusCode: 400, + error: + 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', + statTags: { + errorCategory: 'network', + errorType: 'aborted', + destType: 'SALESFORCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/segment/processor/data.ts b/test/integrations/destinations/segment/processor/data.ts new file mode 100644 index 0000000000..0a140e2b99 --- /dev/null +++ b/test/integrations/destinations/segment/processor/data.ts @@ -0,0 +1,670 @@ +export const data = [ + { + "name": "segment", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/shynet/processor/data.ts b/test/integrations/destinations/shynet/processor/data.ts new file mode 100644 index 0000000000..a4e10128cc --- /dev/null +++ b/test/integrations/destinations/shynet/processor/data.ts @@ -0,0 +1,212 @@ +export const data = [ + { + "name": "shynet", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js", + "heartBeat": 5000 + } + }, + "message": { + "type": "page", + "sentAt": "2022-08-22T13:39:21.034Z", + "channel": "web", + "context": { + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", + "path": "/Testing/test/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/test/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "email": "12312@!fma", + "city": "Pune", + "revenue": 93889 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "messageId": "bf412108-0357-4330-b119-7305e767823r", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-22T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/test/", + "idempotency": "bf412108-0357-4330-b119-7305e767823r" + }, + "JSON_ARRAY": {} + }, + "type": "REST", + "files": {}, + "userId": "", + "method": "POST", + "params": {}, + "headers": { + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "shynet", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" + } + }, + "message": { + "type": "page", + "sentAt": "2022-08-22T13:39:21.034Z", + "channel": "web", + "context": { + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", + "path": "/Testing/test/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/test/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "", + "loadTime": 45 + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "email": "12312@!fma", + "city": "Pune", + "revenue": 93889 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "properties": { + "loadTime": 45 + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "anonymousId": "675467tfhjgjhfcghjc", + "messageId": "bf412108-0357-4330-b119-7305e767823r", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-22T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js", + "headers": { + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "loadTime": 45, + "referrer": "http://127.0.0.1:7307/Testing/test/", + "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", + "idempotency": "bf412108-0357-4330-b119-7305e767823r" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/slack/processor/data.ts b/test/integrations/destinations/slack/processor/data.ts new file mode 100644 index 0000000000..be05a13ab5 --- /dev/null +++ b/test/integrations/destinations/slack/processor/data.ts @@ -0,0 +1,1982 @@ +export const data = [ + { + "name": "slack", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"Identified my-namehiji: hulala \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Event type page is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "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" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"my-name did test_eventing_test\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "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 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "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 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Event name is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"User 12345 did black_event\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/slack/router/data.ts b/test/integrations/destinations/slack/router/data.ts new file mode 100644 index 0000000000..87b1fe3b22 --- /dev/null +++ b/test/integrations/destinations/slack/router/data.ts @@ -0,0 +1,425 @@ +export const data = [ + { + name: 'slack', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + 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: [], + IsrouterEnabled: 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', + }, + }, + ], + destType: 'slack', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + 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: '' }], + }, + DestinationDefinition: { + Config: { excludeKeys: [], includeKeys: [] }, + DisplayName: 'Slack', + ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV', + Name: 'SLACK', + }, + Enabled: true, + ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + IsrouterEnabled: true, + Name: 'test-slack', + Transformations: [], + }, + error: 'Event type page is not supported', + metadata: [ + { + anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + destinationType: 'SLACK', + jobId: 126, + messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780', + sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp', + }, + ], + statTags: { + destType: 'SLACK', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + }, + { + name: 'slack', + description: 'Test 1', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + 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: [], + IsrouterEnabled: 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', + }, + }, + ], + destType: 'slack', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: [ + { + body: { + FORM: { + payload: + '{"text":"identified my-name-1 with hiji: hulala-1 ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + }, + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo', + files: {}, + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + method: 'POST', + params: {}, + statusCode: 200, + type: 'REST', + userId: '12345', + version: '1', + }, + ], + destination: { + 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: '' }], + }, + DestinationDefinition: { + Config: { excludeKeys: [], includeKeys: [] }, + DisplayName: 'Slack', + ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV', + Name: 'SLACK', + }, + Enabled: true, + ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + IsrouterEnabled: true, + Name: 'test-slack', + Transformations: [], + }, + metadata: [ + { + anonymousId: '12345', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + destinationType: 'SLACK', + jobId: 123, + messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777', + sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp', + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/snapchat_conversion/processor/data.ts b/test/integrations/destinations/snapchat_conversion/processor/data.ts new file mode 100644 index 0000000000..f0223d2473 --- /dev/null +++ b/test/integrations/destinations/snapchat_conversion/processor/data.ts @@ -0,0 +1,3005 @@ +export const data = [ + { + "name": "snapchat_conversion", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "web", + "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": "page", + "name": "Home Page Viewed", + "properties": { + "title": "Home | RudderStack", + "url": "http://www.rudderstack.com" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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 ", + "firstName": "john", + "middleName": "victor", + "lastName": "doe", + "city": "some_city", + "state": "some_state" + }, + "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", + "number_items": 4, + "click_id": "some_click_id", + "description": "Products Searched event for conversion type offline" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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 ", + "country": "IN", + "zicode": "Sxp-12345", + "region": "some_region" + }, + "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", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event name is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": "identify", + "event": "Products Searched", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type identify is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Pixel Id is required for web and offline events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "web", + "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" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Snap App Id is required for app events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Snap App Id is required for app events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", + "context": { + "traits": { + "email": "test@email.com", + "phone": "+91 2111111 ", + "country": "IN", + "zipcode": "Sxp-12345", + "region": "some_region" + }, + "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": "Product List Viewed", + "properties": { + "products": [ + { + "product_id": "123", + "price": "14" + }, + { + "product_id": "123", + "price": 14, + "quantity": 3 + } + ] + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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": "checkout_started", + "properties": { + "products": [ + { + "product_id": "123", + "price": "14" + }, + { + "product_id": "123", + "price": 14, + "quantity": "2" + } + ] + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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": "Order Completed", + "properties": { + "brands": [ + "brand01", + "brand02" + ], + "products": [ + { + "product_id": "123", + "price": "14", + "quantity": 1 + }, + { + "product_id": "124", + "price": 14, + "quantity": 3 + } + ] + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 12", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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": "Product Added", + "properties": { + "product_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 13", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "web", + "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": "Product Viewed", + "properties": { + "product_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD", + "number_items": 14, + "quantity": 1 + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 14", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "", + "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": "Product Viewed", + "properties": { + "product_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD", + "quantity": 1 + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 15", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "", + "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": "Payment Info Entered", + "properties": { + "checkout_id": "12dfdfdf3" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 16", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "", + "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": "subscribe", + "properties": { + "checkout_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 17", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "", + "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": "Promotion Viewed", + "properties": { + "checkout_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 18", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "", + "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": "Promotion clicked", + "properties": { + "checkout_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 19", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "", + "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": "save", + "properties": { + "checkout_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 20", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": "Product Viewed", + "properties": { + "eventConversionType": "web", + "checkout_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD", + "url": "hjhb.com" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 21", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": "Product Viewed", + "properties": { + "eventConversionType": "offline", + "checkout_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD", + "url": "hjhb.com" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 22", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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", + "event_tag": "offline" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 23", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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": "Product Added to Wishlist", + "properties": { + "product_id": "123", + "price": "14", + "category": "shoes", + "currency": "USD" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 24", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": "ProdSearched", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey", + "rudderEventsToSnapEvents": [ + { + "from": "ProdSearched", + "to": "products_searched" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 25", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": "ProdSearched", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey", + "rudderEventsToSnapEvents": [] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event ProdSearched doesn't match with Snapchat Events!", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 26", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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 + }, + "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": "Product Added to Cart", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey", + "rudderEventsToSnapEvents": [ + { + "from": "Product_Added_To_Cart", + "to": "products_searched" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 27", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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 + }, + "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": "Product_Added_to_Cart", + "properties": { + "query": "t-shirts", + "event_conversion_type": "web" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "apiKey": "dummyApiKey", + "rudderEventsToSnapEvents": [ + { + "from": "Product Added To Cart", + "to": "products_searched" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 28", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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": "Order Completed", + "properties": { + "products": [ + { + "product_id": "123", + "price": "14", + "quantity": 1 + }, + { + "product_id": "123", + "price": 14, + "quantity": 3 + } + ], + "revenue": "100" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_conversion", + "description": "Test 29", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", + "originalTimestamp": "2022-04-22T10:57:58Z", + "channel": "mobile", + "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": "Product List Viewed", + "properties": { + "products": [ + { + "product_id": "123", + "price": "14" + }, + { + "product_id": "123", + "price": 14, + "quantity": 3 + } + ], + "revenue": "100" + }, + "integrations": { + "All": true + }, + "sentAt": "2022-04-22T10:57:58Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "pixelId": "dummyPixelId", + "appId": "dhfeih44f", + "snapAppId": "hfhdhfd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Events must be sent within 28 days of their occurrence", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CONVERSION", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts new file mode 100644 index 0000000000..9ad6106c7e --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts @@ -0,0 +1,1404 @@ +export const data = [ + { + "name": "snapchat_custom_audience", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": true, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "remove": [ + { + "email": "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419", + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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" + } + ], + "remove": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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" + }, + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ], + [ + "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "remove": [ + { + "email": "test@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + }, + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ], + [ + "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": "audience", + "properties": { + "listData": { + "add": [ + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "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": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Event type audience is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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", + "properties": { + "listData": { + "add": [ + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "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": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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", + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Message properties is not present. Aborting message", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "listData is not present inside properties. Aborting message", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "abc": "123" + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Neither 'add' nor 'remove' property is present inside 'listData'. Aborting message", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "remove": [ + { + "email": "", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + }, + { + "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": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Required schema parameter email is not found from payload", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "remove": [ + { + "email": "abcd@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + }, + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "8c37cbc5d9abb3082303c6548571cfc7655a4546ddc1e943f041fc9126e7274a" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 12", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "phone" + } + }, + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "PHONE_SHA256" + ], + "data": [ + [ + "7619ee8cea49187f309616e30ecf54be072259b43760f1f550a644945d5572f2" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 13", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "mobileAdId" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "add": [ + { + "email": "test@abc.com", + "phone": "09876543210", + "mobileId": "1334", + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "MOBILE_AD_ID_SHA256" + ], + "data": [ + [ + "eb43272640b269219a01caf99c5a4122d6edc0916d45ac13c0ce80ca3ad2def0" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/splitio/processor/data.ts b/test/integrations/destinations/splitio/processor/data.ts new file mode 100644 index 0000000000..6f77c6f562 --- /dev/null +++ b/test/integrations/destinations/splitio/processor/data.ts @@ -0,0 +1,915 @@ +export const data = [ + { + "name": "splitio", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SPLITIO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type abc is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SPLITIO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "eventTypeId does not match with ideal format /^[\\dA-Za-z][\\w.-]{0,79}$/", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SPLITIO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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, + "vertical[0]": "restaurant", + "vertical[1]": "mall", + "GMV": true, + "abc": "new-val", + "category": "food" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {} + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/splitio/router/data.ts b/test/integrations/destinations/splitio/router/data.ts new file mode 100644 index 0000000000..0394ea53a8 --- /dev/null +++ b/test/integrations/destinations/splitio/router/data.ts @@ -0,0 +1,192 @@ +export const data = [ + { + name: 'splitio', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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]', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'abcde', + environment: 'staging', + trafficType: 'user', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + 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, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + jobId: 1, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'splitio', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + traits: { + martin: 21.565, + 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: { + response: { + status: 200, + body: [ + { + 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, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + jobId: 2, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/statsig/processor/data.ts b/test/integrations/destinations/statsig/processor/data.ts new file mode 100644 index 0000000000..0c70a9b507 --- /dev/null +++ b/test/integrations/destinations/statsig/processor/data.ts @@ -0,0 +1,1428 @@ +export const data = [ + { + "name": "statsig", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "STATSIG-API-KEY": "secret-tHe5ecr37", + "content-type": "application/json" + }, + "params": {}, + "body": { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "statsig", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "STATSIG-API-KEY": "secret-tHe5ecr37", + "content-type": "application/json" + }, + "params": {}, + "body": { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "statsig", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "STATSIG-API-KEY": "secret-tHe5ecr37", + "content-type": "application/json" + }, + "params": {}, + "body": { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "statsig", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "STATSIG-API-KEY": "secret-tHe5ecr37", + "content-type": "application/json" + }, + "params": {}, + "body": { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "statsig", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "STATSIG-API-KEY": "secret-4n07h3rsecr3t", + "content-type": "application/json" + }, + "params": {}, + "body": { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "statsig", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "STATSIG-API-KEY": "secret-tHe5ecr37", + "content-type": "application/json" + }, + "params": {}, + "body": { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "statsig", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", + "headers": { + "STATSIG-API-KEY": "secret-tHe5ecr37", + "content-type": "application/json" + }, + "params": {}, + "body": { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "statsig", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 500, + "error": "Cannot read properties of undefined (reading 'destinationId')", + "statTags": { + "errorCategory": "transformation", + "destType": "STATSIG", + "module": "destination", + "implementation": "cdkV1", + "feature": "processor" + } + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/tiktok_ads/processor/data.ts b/test/integrations/destinations/tiktok_ads/processor/data.ts new file mode 100644 index 0000000000..38fec1e1e0 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/processor/data.ts @@ -0,0 +1,4690 @@ +export const data = [ + { + "name": "tiktok_ads", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": { + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "InitiateCheckout", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "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" + } + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event name (product added to wishlist1) is not valid, must be mapped to one of standard events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "Subscribe", + "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": "1d96e70d2bf54087e33586457cde2790825bee7b1a3b05d26481cb12ec8e63fd", + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", + "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4" + }, + "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": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "AddPaymentInfo", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event name is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "AddPaymentInfo", + "event_id": "1616318632825_357", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "SubmitForm", + "event_id": "16163186328257", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 12", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "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": { + "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": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 13", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "Contact", + "event_id": "16163186328257", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 14", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type identify is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 15", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": { + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 16", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "PlaceAnOrder", + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 17", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 18", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 19", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": { + "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": { + "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": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 20", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "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": "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 21", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event name (abc) is not valid, must be mapped to one of standard events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 22", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 23", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 24", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 25", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": { + "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" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 26", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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_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": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 27", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 28", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/tiktok_ads/router/data.ts b/test/integrations/destinations/tiktok_ads/router/data.ts new file mode 100644 index 0000000000..be2e2b1914 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/router/data.ts @@ -0,0 +1,892 @@ +export const data = [ + { + name: 'tiktok_ads', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 5, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + 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: { + 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: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + 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: {}, + userId: '', + }, + metadata: { + jobId: 5, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + 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: 'InitiateCheckout', + 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: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + 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: {}, + userId: '', + }, + metadata: { + jobId: 1, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + 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: '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: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + 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: {}, + userId: '', + }, + metadata: { + jobId: 2, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 4, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + 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: '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: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + 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: {}, + userId: '', + }, + metadata: { + jobId: 4, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 3, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + 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: 'AddToWishlist', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + test_event_code: 'sample rudder test_event_code', + 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: + '4443dd476f2be18201447ef046731c1a715accee4edc5192641a3b4c3ba921c7', + email: '774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa', + external_id: + '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + 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: {}, + userId: '', + }, + metadata: { + jobId: 3, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts new file mode 100644 index 0000000000..a4ff796f37 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts @@ -0,0 +1,618 @@ +export const data = [ + { + "name": "tiktok_ads_offline_events", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "type": "Identify", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type identify is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS_OFFLINE_EVENTS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": false + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7181537436256731137", + "eventId": "1616318632825_352", + "order_id": "abc_xyz", + "shop_id": "123abc", + "currency": "USD", + "value": 46, + "price": 8, + "quantity": 2, + "content_type": "product1234", + "product_id": "1077218", + "name": "socks", + "category": "Men's cloth" + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7181537436256731137", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "properties": { + "order_id": "abc_xyz", + "shop_id": "123abc", + "currency": "USD", + "value": 46, + "event_channel": "web", + "contents": [ + { + "content_name": "socks", + "content_type": "product1234", + "content_category": "Men's cloth", + "content_id": "1077218", + "price": 8, + "quantity": 2 + } + ] + }, + "event": "Subscribe", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7181537436256731137", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "1234567890" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7181537436256731137", + "eventId": "1616318632825_352", + "prop1": "val1" + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7181537436256731137", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "properties": { + "event_channel": "web" + }, + "event": "Subscribe", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7181537436256731137", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true, + "eventsToStandard": [ + { + "from": "RandomEvent", + "to": "SubmitForm" + } + ] + } + }, + "message": { + "event": "RandomEvent", + "context": { + "traits": { + "phone": "1234567890" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7185009018564395009", + "eventId": "1616318632003_004", + "prop1": "val1" + }, + "userId": "eventIdn01", + "timestamp": "2023-01-03", + "type": "track" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7185009018564395009", + "event_id": "1616318632003_004", + "timestamp": "2023-01-03", + "properties": { + "event_channel": "web" + }, + "event": "SubmitForm", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7185009018564395009", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "hashUserProperties": true + } + }, + "message": { + "type": "track", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Access Token not found", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "TIKTOK_ADS_OFFLINE_EVENTS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7181537436256731137", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "properties": { + "event_channel": "web", + "contents": [ + { + "content_name": "socks", + "content_type": "product1", + "content_category": "Men's cloth", + "content_id": "1077218", + "price": 8, + "quantity": 2 + }, + { + "content_name": "socks1", + "content_type": "product2", + "content_category": "Men's cloth1", + "content_id": "1077219", + "price": 18, + "quantity": 12 + } + ] + }, + "event": "Subscribe", + "partner_name": "RudderStack", + "context": { + "user": { + "emails": [ + "d9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16" + ], + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7181537436256731137", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true, + "eventsToStandard": [ + { + "from": "CompletePayment", + "to": "Purchase" + } + ] + } + }, + "message": { + "type": "track", + "event": "CompletePayment", + "sentAt": "2023-03-22T00:02:33.802Z", + "traits": { + "email": [ + "efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900", + "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" + ], + "phone": [ + "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", + "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" + ] + }, + "userId": "60241286212", + "channel": "sources", + "context": { + "sources": { + "job_id": "2N4WuoNQpGYmCPASUvnV86QyhY4/Syncher", + "version": "v1.20.0", + "job_run_id": "cgd4a063b2fn2e1j0q90", + "task_run_id": "cgd4a063b2fn2e1j0qa0" + } + }, + "recordId": "16322", + "rudderId": "5b4ed73f-69aa-4198-88d1-3d4d509acbf1", + "messageId": "cgd4b663b2fn2e1j8th0", + "timestamp": "2023-03-22T00:02:33.170Z", + "properties": { + "phone": "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", + "value": 32.839999999999996, + "emails": "[\"efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900\",\"078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]", + "eventId": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", + "currency": "USD", + "order_id": 60241286212, + "eventSetId": "7211223771099742210", + "event_name": "CompletePayment" + }, + "receivedAt": "2023-03-22T00:02:33.171Z", + "request_ip": "10.7.78.187", + "anonymousId": "60241286212", + "originalTimestamp": "2023-03-22T00:02:33.802Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7211223771099742210", + "event_id": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", + "timestamp": "2023-03-22T00:02:33.170Z", + "properties": { + "order_id": 60241286212, + "currency": "USD", + "value": 32.839999999999996 + }, + "event": "Purchase", + "partner_name": "RudderStack", + "context": { + "user": { + "emails": [ + "4dc75b075057df6f6b729e74a9feed1244dcf8ceb7903eaba13203f3268ae4b9", + "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" + ], + "phone_numbers": [ + "28b7b205c2936d2ded022d2587fb2677a76e560e921b3ad615b739b0238baa5d", + "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7211223771099742210", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/twitter_ads/processor/data.ts b/test/integrations/destinations/twitter_ads/processor/data.ts new file mode 100644 index 0000000000..37bee1ced5 --- /dev/null +++ b/test/integrations/destinations/twitter_ads/processor/data.ts @@ -0,0 +1,884 @@ +export const data = [ + // { + // "name": "twitter_ads", + // "description": "Test 0", + // "feature": "processor", + // "module": "destination", + // "version": "v0", + // "input": { + // "request": { + // "body": [ + // { + // "message": { + // "type": "track", + // "event": "ABC Searched", + // "channel": "web", + // "context": { + // "source": "test", + // "userAgent": "chrome", + // "traits": { + // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + // "email": "abc@gmail.com", + // "phone": "+1234589947", + // "ge": "male", + // "db": "19950715", + // "lastname": "Rudderlabs", + // "firstName": "Test", + // "address": { + // "city": "Kolkata", + // "state": "WB", + // "zip": "700114", + // "country": "IN" + // } + // }, + // "device": { + // "advertisingId": "abc123" + // }, + // "library": { + // "name": "rudder-sdk-ruby-sync", + // "version": "1.0.6" + // } + // }, + // "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", + // "timestamp": "2020-08-14T05:30:30.118Z", + // "properties": { + // "conversionTime": "2023-06-01T06:03:08.739Z", + // "tax": 2, + // "total": 27.5, + // "coupon": "hasbros", + // "revenue": 48, + // "price": 25, + // "quantity": 2, + // "currency": "USD", + // "priceCurrency": "USD", + // "conversionId": "213123", + // "numberItems": "2323", + // "phone": "+919927455678", + // "twclid": "543", + // "shipping": 3, + // "subtotal": 22.5, + // "affiliation": "Google Store", + // "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", + // "email": "abc@ax.com", + // "contents": [ + // { + // "price": "123.3345", + // "quantity": "12", + // "id": "12" + // }, + // { + // "price": 200, + // "quantity": 11, + // "id": "4" + // } + // ] + // }, + // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + // "integrations": { + // "All": true + // } + // }, + // "metadata": { + // "secret": { + // "consumerKey": "qwe", + // "consumerSecret": "fdghv", + // "accessToken": "dummyAccessToken", + // "accessTokenSecret": "testAccessTokenSecret" + // } + // }, + // "destination": { + // "Config": { + // "pixelId": "dummyPixelId", + // "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", + // "twitterAdsEventNames": [ + // { + // "rudderEventName": "ABC Searched", + // "twitterEventId": "tw-234234324234" + // }, + // { + // "rudderEventName": "Home Page Viewed", + // "twitterEventId": "tw-odt2o-odt2q" + // } + // ] + // } + // } + // } + // ] + // } + // }, + // "output": { + // "response": { + // "status": 200, + // "body": [ + // { + // "output": { + // "version": "1", + // "type": "REST", + // "method": "POST", + // "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", + // "headers": { + // "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"AIpyKJTrfbJjxbmco3D9QaB3kme3zpqM\", oauth_signature=\"%2FittnOIKSEcuEusb2q8SDs3%2FB9g%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1697616446\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", + // "Content-Type": "application/json" + // }, + // "params": {}, + // "body": { + // "JSON": { + // "conversions": [ + // { + // "conversion_time": "2023-06-01T06:03:08.739Z", + // "number_items": 2, + // "price_currency": "USD", + // "value": "25", + // "conversion_id": "213123", + // "contents": [ + // { + // "content_id": "12", + // "content_price": 123.3345, + // "num_items": 12 + // }, + // { + // "content_id": "4", + // "content_price": 200, + // "num_items": 11 + // } + // ], + // "event_id": "tw-234234324234", + // "identifiers": [ + // { + // "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" + // }, + // { + // "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" + // }, + // { + // "twclid": "543" + // } + // ] + // } + // ] + // }, + // "JSON_ARRAY": {}, + // "XML": {}, + // "FORM": {} + // }, + // "files": {}, + // "userId": "" + // }, + // "metadata": { + // "secret": { + // "consumerKey": "qwe", + // "consumerSecret": "fdghv", + // "accessToken": "dummyAccessToken", + // "accessTokenSecret": "testAccessTokenSecret" + // } + // }, + // "statusCode": 200 + // } + // ] + // } + // } + // }, + { + "name": "twitter_ads", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "track", + "event": "Home Page Viewed", + "channel": "web", + "context": { + "source": "test", + "userAgent": "chrome", + "traits": { + "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + "email": "abc@gmail.com", + "phone": "+1234589947", + "ge": "male", + "db": "19950715", + "lastname": "Rudderlabs", + "firstName": "Test", + "address": { + "city": "Kolkata", + "state": "WB", + "zip": "700114", + "country": "IN" + } + }, + "device": { + "advertisingId": "abc123" + }, + "library": { + "name": "rudder-sdk-ruby-sync", + "version": "1.0.6" + } + }, + "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", + "timestamp": "2020-08-14T05:30:30.118Z", + "properties": { + "conversionTime": "2023-06-01T06:03:08.739Z", + "eventId": "429047995", + "tax": 2, + "total": 27.5, + "coupon": "hasbros", + "revenue": 48, + "price": 25, + "quantity": 2, + "currency": "USD", + "priceCurrency": "USD", + "conversionId": "213123", + "numberItems": "2323", + "shipping": 3, + "subtotal": 22.5, + "affiliation": "Google Store", + "checkout_id": "fksdjfsdjfisjf9sdfjsd9f" + }, + "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + "integrations": { + "All": true + } + }, + "metadata": { + "secret": { + "consumerKey": "qwe", + "consumerSecret": "fdghv", + "accessToken": "dummyAccessToken", + "accessTokenSecret": "testAccessTokenSecret" + } + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", + "twitterAdsEventNames": [ + { + "rudderEventName": "ABC Searched", + "twitterEventId": "tw-234234324234" + }, + { + "rudderEventName": "Home Page Viewed", + "twitterEventId": "tw-2dfsdf" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "consumerKey": "qwe", + "consumerSecret": "fdghv", + "accessToken": "dummyAccessToken", + "accessTokenSecret": "testAccessTokenSecret" + } + }, + "statusCode": 400, + "error": "[TWITTER ADS]: one of twclid, phone or email must be present in properties.", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TWITTER_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + // { + // "name": "twitter_ads", + // "description": "Test 2", + // "feature": "processor", + // "module": "destination", + // "version": "v0", + // "input": { + // "request": { + // "body": [ + // { + // "message": { + // "type": "track", + // "event": "Home Page Viewed", + // "channel": "web", + // "context": { + // "source": "test", + // "userAgent": "chrome", + // "traits": { + // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + // "email": "abc@gmail.com", + // "phone": "+1234589947", + // "ge": "male", + // "db": "19950715", + // "lastname": "Rudderlabs", + // "firstName": "Test", + // "address": { + // "city": "Kolkata", + // "state": "WB", + // "zip": "700114", + // "country": "IN" + // } + // }, + // "device": { + // "advertisingId": "abc123" + // }, + // "library": { + // "name": "rudder-sdk-ruby-sync", + // "version": "1.0.6" + // } + // }, + // "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", + // "timestamp": "2020-08-14T05:30:30.118Z", + // "properties": { + // "pixelId": "dummyPixelId", + // "conversionTime": "2023-06-01T06:03:08.739Z", + // "eventId": "429047995", + // "tax": 2, + // "total": 27.5, + // "coupon": "hasbros", + // "revenue": 48, + // "price": 25.55, + // "quantity": 2, + // "currency": "USD", + // "priceCurrency": "USD", + // "conversionId": "213123", + // "numberItems": "2323", + // "phone": "+919927455678", + // "twclid": "543", + // "shipping": 3, + // "subtotal": 22.5, + // "affiliation": "Google Store", + // "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", + // "email": "abc@ax.com" + // }, + // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + // "integrations": { + // "All": true + // } + // }, + // "metadata": { + // "secret": { + // "consumerKey": "qwe", + // "consumerSecret": "fdghv", + // "accessToken": "dummyAccessToken", + // "accessTokenSecret": "testAccessTokenSecret" + // } + // }, + // "destination": { + // "Config": { + // "pixelId": "dummyPixelId", + // "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", + // "twitterAdsEventNames": [ + // { + // "rudderEventName": "ABC Searched", + // "twitterEventId": "tw-234234324234" + // }, + // { + // "rudderEventName": "Home Page Viewed", + // "twitterEventId": "tw-324fdsf" + // } + // ] + // } + // } + // } + // ] + // } + // }, + // "output": { + // "response": { + // "status": 200, + // "body": [ + // { + // "output": { + // "version": "1", + // "type": "REST", + // "method": "POST", + // "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", + // "headers": { + // "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"4W3xnD3XFzayC0AT3a0XVRilPM8CpKM7\", oauth_signature=\"yKi8WAgZne2wnn5obJ9EjmmPbMY%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1697616446\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", "Content-Type": "application/json" + // }, + // "params": {}, + // "body": { + // "JSON": { + // "conversions": [ + // { + // "event_id": "429047995", + // "conversion_time": "2023-06-01T06:03:08.739Z", + // "number_items": 2, + // "price_currency": "USD", + // "value": "25.55", + // "conversion_id": "213123", + // "identifiers": [ + // { + // "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" + // }, + // { + // "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" + // }, + // { + // "twclid": "543" + // } + // ] + // } + // ] + // }, + // "JSON_ARRAY": {}, + // "XML": {}, + // "FORM": {} + // }, + // "files": {}, + // "userId": "" + // }, + // "metadata": { + // "secret": { + // "consumerKey": "qwe", + // "consumerSecret": "fdghv", + // "accessToken": "dummyAccessToken", + // "accessTokenSecret": "testAccessTokenSecret" + // } + // }, + // "statusCode": 200 + // } + // ] + // } + // } + // }, + { + "name": "twitter_ads", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "track", + "event": "Home Page", + "channel": "web", + "context": { + "source": "test", + "userAgent": "chrome", + "traits": { + "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + "email": "abc@gmail.com", + "phone": "+1234589947", + "ge": "male", + "db": "19950715", + "lastname": "Rudderlabs", + "firstName": "Test", + "address": { + "city": "Kolkata", + "state": "WB", + "zip": "700114", + "country": "IN" + } + }, + "device": { + "advertisingId": "abc123" + }, + "library": { + "name": "rudder-sdk-ruby-sync", + "version": "1.0.6" + } + }, + "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", + "timestamp": "2020-08-14T05:30:30.118Z", + "properties": { + "pixelId": "dummyPixelId", + "conversionTime": "2023-06-01T06:03:08.739Z", + "tax": 2, + "total": 27.5, + "coupon": "hasbros", + "revenue": 48, + "price": 25, + "quantity": 2, + "currency": "USD", + "priceCurrency": "USD", + "conversionId": "213123", + "numberItems": "2323", + "phone": "+919927455678", + "twclid": "543", + "shipping": 3, + "subtotal": 22.5, + "affiliation": "Google Store", + "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", + "email": "abc@ax.com" + }, + "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + "integrations": { + "All": true + } + }, + "metadata": { + "secret": { + "consumerKey": "qwe", + "consumerSecret": "fdghv", + "accessToken": "dummyAccessToken", + "accessTokenSecret": "testAccessTokenSecret" + } + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", + "twitterAdsEventNames": [ + { + "rudderEventName": "ABC Searched", + "twitterEventId": "tw-234234324234" + }, + { + "rudderEventName": "Home Page Viewed", + "twitterEventId": "tw-324fdsf" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "consumerKey": "qwe", + "consumerSecret": "fdghv", + "accessToken": "dummyAccessToken", + "accessTokenSecret": "testAccessTokenSecret" + } + }, + "statusCode": 400, + "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "TWITTER_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "twitter_ads", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "track", + "event": "Home Page", + "channel": "web", + "context": { + "source": "test", + "userAgent": "chrome", + "traits": { + "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + "email": "abc@gmail.com", + "phone": "+1234589947", + "ge": "male", + "db": "19950715", + "lastname": "Rudderlabs", + "firstName": "Test", + "address": { + "city": "Kolkata", + "state": "WB", + "zip": "700114", + "country": "IN" + } + }, + "device": { + "advertisingId": "abc123" + }, + "library": { + "name": "rudder-sdk-ruby-sync", + "version": "1.0.6" + } + }, + "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", + "timestamp": "2020-08-14T05:30:30.118Z", + "properties": { + "pixelId": "dummyPixelId", + "conversionTime": "2023-06-01T06:03:08.739Z", + "tax": 2, + "total": 27.5, + "coupon": "hasbros", + "revenue": 48, + "price": 25, + "quantity": 2, + "currency": "USD", + "priceCurrency": "USD", + "conversionId": "213123", + "numberItems": "2323", + "phone": "+919927455678", + "twclid": "543", + "shipping": 3, + "subtotal": 22.5, + "affiliation": "Google Store", + "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", + "email": "abc@ax.com" + }, + "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + "integrations": { + "All": true + } + }, + "metadata": { + "secret": { + "consumerKey": "qwe", + "consumerSecret": "fdghv", + "accessToken": "dummyAccessToken", + "accessTokenSecret": "testAccessTokenSecret" + } + }, + "destination": { + "Config": { + "pixelId": "dummyPixelId", + "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", + "twitterAdsEventNames": [ + { + "rudderEventName": " ", + "twitterEventId": "tw-324fdsf" + }, + { + "rudderEventName": "Home Page Viewed", + "twitterEventId": "tw-324fdsf" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "consumerKey": "qwe", + "consumerSecret": "fdghv", + "accessToken": "dummyAccessToken", + "accessTokenSecret": "testAccessTokenSecret" + } + }, + "statusCode": 400, + "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "TWITTER_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + // { + // "name": "twitter_ads", + // "description": "Test 5", + // "feature": "processor", + // "module": "destination", + // "version": "v0", + // "input": { + // "request": { + // "body": [ + // { + // "message": { + // "type": "track", + // "event": "Home Page Viewed", + // "channel": "web", + // "context": { + // "source": "test", + // "userAgent": "chrome", + // "traits": { + // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + // "email": "abc@gmail.com", + // "phone": "+1234589947", + // "ge": "male", + // "db": "19950715", + // "lastname": "Rudderlabs", + // "firstName": "Test", + // "address": { + // "city": "Kolkata", + // "state": "WB", + // "zip": "700114", + // "country": "IN" + // } + // }, + // "device": { + // "advertisingId": "abc123" + // }, + // "library": { + // "name": "rudder-sdk-ruby-sync", + // "version": "1.0.6" + // } + // }, + // "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", + // "timestamp": "2020-08-14T05:30:30.118Z", + // "properties": { + // "conversionTime": "2023-06-01T06:03:08.739Z", + // "tax": 2, + // "total": 27.5, + // "coupon": "hasbros", + // "revenue": 48, + // "price": 25, + // "quantity": 2, + // "currency": "USD", + // "priceCurrency": "USD", + // "conversionId": "213123", + // "numberItems": "2323", + // "phone": "+919927455678", + // "twclid": "543", + // "shipping": 3, + // "subtotal": 22.5, + // "affiliation": "Google Store", + // "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", + // "email": "abc@ax.com", + // "contents": [ + // { + // "price": "123.3345", + // "quantity": "12", + // "id": "12" + // }, + // { + // "price": 200, + // "quantity": 11, + // "id": "4" + // } + // ] + // }, + // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", + // "integrations": { + // "All": true + // } + // }, + // "metadata": { + // "secret": { + // "consumerKey": "qwe", + // "consumerSecret": "fdghv", + // "accessToken": "dummyAccessToken", + // "accessTokenSecret": "testAccessTokenSecret" + // } + // }, + // "destination": { + // "Config": { + // "pixelId": "dummyPixelId", + // "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", + // "twitterAdsEventNames": [ + // { + // "rudderEventName": "ABC Searched", + // "twitterEventId": "tw-234234324234" + // }, + // { + // "rudderEventName": "Home Page Viewed", + // "twitterEventId": "tw-odt2o-odt2q" + // } + // ] + // } + // } + // } + // ] + // } + // }, + // "output": { + // "response": { + // "status": 200, + // "body": [ + // { + // "output": { + // "version": "1", + // "type": "REST", + // "method": "POST", + // "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", + // "headers": { + // "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"jQ28zo1HQQv0ADTx3jbOMYfdE6J1aciC\", oauth_signature=\"INJr%2BF4v4UQJtTtztE2l%2F%2FPO6oE%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1697616446\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", "Content-Type": "application/json" + // }, + // "params": {}, + // "body": { + // "JSON": { + // "conversions": [ + // { + // "conversion_time": "2023-06-01T06:03:08.739Z", + // "number_items": 2, + // "price_currency": "USD", + // "value": "25", + // "conversion_id": "213123", + // "contents": [ + // { + // "content_id": "12", + // "content_price": 123.3345, + // "num_items": 12 + // }, + // { + // "content_id": "4", + // "content_price": 200, + // "num_items": 11 + // } + // ], + // "event_id": "tw-odt2o-odt2q", + // "identifiers": [ + // { + // "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" + // }, + // { + // "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" + // }, + // { + // "twclid": "543" + // } + // ] + // } + // ] + // }, + // "JSON_ARRAY": {}, + // "XML": {}, + // "FORM": {} + // }, + // "files": {}, + // "userId": "" + // }, + // "metadata": { + // "secret": { + // "consumerKey": "qwe", + // "consumerSecret": "fdghv", + // "accessToken": "dummyAccessToken", + // "accessTokenSecret": "testAccessTokenSecret" + // } + // }, + // "statusCode": 200 + // } + // ] + // } + // } + // } +] \ No newline at end of file diff --git a/test/integrations/destinations/variance/processor/data.ts b/test/integrations/destinations/variance/processor/data.ts new file mode 100644 index 0000000000..960ec59a86 --- /dev/null +++ b/test/integrations/destinations/variance/processor/data.ts @@ -0,0 +1,921 @@ +export const data = [ + { + "name": "variance", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "http://6b0e6a60.ngrok.io", + "headers": { + "authorization": "Basic MVA4dUtGOF=", + "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" + } + }, + "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 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "variance", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://6b0e6a60.ngrok.io/n", + "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" + } + }, + "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 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "variance", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://6b0e6a60.", + "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" + } + }, + "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 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "variance", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "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": { + "response": { + "status": 200, + "body": [ + { + "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" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/vero/processor/data.ts b/test/integrations/destinations/vero/processor/data.ts new file mode 100644 index 0000000000..7834f0a541 --- /dev/null +++ b/test/integrations/destinations/vero/processor/data.ts @@ -0,0 +1,818 @@ +export const data = [ + { + "name": "vero", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "homwTown": "kanpur", + "age": "24" + } + }, + "type": "Identify", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "yash001", + "data": { + "homwTown": "kanpur", + "age": "24" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1001@tech.com" + } + }, + "type": "Identify", + "userId": "user1001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "user1001", + "email": "user1001@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1002@tech.com" + } + }, + "type": "Identify", + "anonymousId": "b4ffheww8eisndbdjgdewifewfgerwibderv" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "b4ffheww8eisndbdjgdewifewfgerwibderv", + "email": "user1002@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "address": "Caravela Beach Goa", + "homwTown": "Mawsynram", + "email": "user1005@tech.com" + } + }, + "integrations": { + "vero": { + "tags": { + "add": [ + "a", + "b" + ] + } + } + }, + "type": "Identify", + "userId": "fprediruser001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "fprediruser001", + "email": "user1005@tech.com", + "data": { + "address": "Caravela Beach Goa", + "homwTown": "Mawsynram" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "fprediruser001", + "auth_token": "testAuthToken", + "add": [ + "a", + "b" + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "event": "Random event with nonexisting userId and email", + "properties": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "type": "track", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/events/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "identity": { + "id": "eventIdn01", + "email": "eventIdn01@sample.com" + }, + "event_name": "Random event with nonexisting userId and email", + "data": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "event": "Random event with existing userId and some tags removed", + "properties": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "integrations": { + "Vero": { + "tags": { + "remove": [ + "a" + ] + } + } + }, + "type": "track", + "userId": "fprediruser001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/events/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "identity": { + "id": "fprediruser001", + "email": "eventIdn01@sample.com" + }, + "event_name": "Random event with existing userId and some tags removed", + "data": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "fprediruser001", + "auth_token": "testAuthToken", + "remove": [ + "a" + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "type": "alias", + "userId": "sample101", + "previousId": "newsamplel01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.getvero.com/api/v2/users/reidentify", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "new_id": "sample101", + "id": "newsamplel01", + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1001@tech.com" + }, + "os": { + "name": "android" + }, + "device": { + "token": "qwertyuioiuytrewwertyu", + "name": "Mi" + } + }, + "type": "Identify", + "userId": "user1001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "user1001", + "email": "user1001@tech.com", + "data": {}, + "channels": { + "platform": "android", + "address": "qwertyuioiuytrewwertyu", + "device": "Mi", + "type": "push" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1001@tech.com" + }, + "device": { + "token": "qwertyuioiuytrewwertyu", + "name": "Mi" + } + }, + "type": "Identify", + "userId": "user1001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "user1001", + "email": "user1001@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "event": "unsubscribe", + "type": "track", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/unsubscribe", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "eventIdn01", + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "name": "Rudderstack", + "properties": { + "title": "rudderstack", + "path": "/" + }, + "type": "page", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/events/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "identity": { + "id": "eventIdn01" + }, + "event_name": "Viewed Rudderstack Page", + "data": { + "title": "rudderstack", + "path": "/" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "groupId": "1234", + "traits": { + "name": "MyGroup", + "industry": "IT", + "employees": 450, + "plan": "basic" + }, + "type": "group", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type group is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "VERO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/vero/router/data.ts b/test/integrations/destinations/vero/router/data.ts new file mode 100644 index 0000000000..1c9d87ec8e --- /dev/null +++ b/test/integrations/destinations/vero/router/data.ts @@ -0,0 +1,312 @@ +export const data = [ + { + name: 'vero', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: { + jobId: 1, + }, + message: { + context: { + traits: { + email: 'user001@tech.com', + }, + }, + type: 'Identify', + userId: 'user001', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + 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: {}, + userId: '', + }, + metadata: { + jobId: 1, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'vero', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: { + jobId: 2, + }, + message: { + context: { + traits: { + email: 'user002@tech.com', + }, + }, + type: 'Identify', + anonymousId: 'b4ffheww8eisndbdjgdewifewfgerwibderv', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + 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: {}, + userId: '', + }, + metadata: { + jobId: 2, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'vero', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + 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: {}, + userId: '', + }, + metadata: { + jobId: 3, + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.getvero.com/api/v2/users/tags/edit', + headers: {}, + params: {}, + body: { + JSON: { + id: 'fprediruser001', + auth_token: 'testAuthToken', + add: ['a', 'b'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + jobId: 3, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'vero', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + output: { + 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: {}, + userId: '', + }, + metadata: { + jobId: 4, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/testScript.js b/testScript.js new file mode 100644 index 0000000000..5c38eef957 --- /dev/null +++ b/testScript.js @@ -0,0 +1,105 @@ +const fs = require("fs"); + +const destination = 'slack'; +let input; +let output; +async function generateFile() { + input = JSON.parse( + fs.readFileSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${destination}_router_input.json`, + (err, data) => { + if (err) { + throw err; + } + input = data; + // console.log(data.toString()); + } + ) + ); + output = JSON.parse( + fs.readFileSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${destination}_router_output.json`, + (err, data) => { + if (err) { + throw err; + } + output = data; + } + ) + ); + + let outputData = []; + + const dataFormat = { + name: `${destination}`, + description: "", + feature: "processor", + module: "destination", + version: "v0", + input: { + request: { + body: [], + }, + }, + output: { + response: { + status: 200, + body: [], + }, + }, + }; + const errOutputBody = { + error: "", + statTags: { + destType: `${destination}`, + errorCategory: "dataValidation", + errorType: "instrumentation", + feature: "processor", + implementation: "native", + module: "destination", + }, + statusCode: 400, + }; + const succOutputBody = { + output: {}, + statusCode: 200, + }; + + input.forEach((element, index) => { + const tempOutput = JSON.parse(JSON.stringify(dataFormat)); + tempOutput.description = "Test " + index; + tempOutput.input.request.body.push(element); + if (output[index].message) { + const tempErrOutputBody = JSON.parse(JSON.stringify(errOutputBody)); + tempErrOutputBody.error = output[index].message; + tempOutput.output.response.body.push(tempErrOutputBody); + } else { + const tempSuccOutputBody = JSON.parse(JSON.stringify(succOutputBody)); + tempSuccOutputBody.output = output[index]; + tempOutput.output.response.body.push(tempSuccOutputBody); + } + outputData.push(tempOutput); + }); + + console.log(outputData); + const outputStr = `export const data = ${JSON.stringify( + outputData, + null, + "\t" + )}`; + + // fs.mkdirSync( + // `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${destination}` + // ); + // fs.mkdirSync( + // `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${destination}/router` + // ); + + fs.writeFileSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${destination}/router/data.ts`, + outputStr + ); +} +generateFile().then(() => { + console.log("Succeeded"); +}); \ No newline at end of file diff --git a/testScript_1.js b/testScript_1.js new file mode 100644 index 0000000000..f5cc6147d3 --- /dev/null +++ b/testScript_1.js @@ -0,0 +1,160 @@ +const fs = require('fs'); + +let input; +let output; + +const makeCall = async (data, destination) => { + var axios = require('axios'); + var data = JSON.stringify([data]); + + var config = { + method: 'post', + url: `http://localhost:9090/v0/destinations/${destination}`, + headers: { + 'Content-Type': 'application/json', + }, + data: data, + }; + let res = undefined; + await axios(config) + .then(function (response) { + console.log(JSON.stringify(response.data)); + res = response.data; + }) + .catch(function (error) { + console.log(error); + res = response.data; + }); + return res; +}; + +async function generateFile() { + const newType = !fs.existsSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_router_input.json`, + ); + input = JSON.parse( + !newType + ? fs.readFileSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_router_input.json`, + (err, data) => { + if (err) { + throw err; + } + input = data; + // console.log(data.toString()); + }, + ) + : fs.readFileSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_router.json`, + (err, data) => { + if (err) { + throw err; + } + input = data; + // console.log(data.toString()); + }, + ), + ); + + // output = JSON.parse( + // fs.readFileSync( + // `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_output.json`, + // (err, data) => { + // if (err) { + // throw err; + // } + // output = data; + // }, + // ), + // ); + + let outputData = []; + + const dataFormat = { + name: `${process.argv[2]}`, + description: '', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [], + }, + }, + output: { + response: { + status: 200, + body: [], + }, + }, + }; + const errOutputBody = { + error: '', + statTags: { + destType: `${process.argv[2]}`, + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }; + const succOutputBody = { + output: {}, + statusCode: 200, + }; + + for (let index = 0; index < input.length; index++) { + let element; + if (newType) element = input[index].input; + else element = input[index]; + const tempOutput = JSON.parse(JSON.stringify(dataFormat)); + tempOutput.description = 'Test ' + index; + tempOutput.input.request.body.push(element); + // if (output[index].message) { + // const tempErrOutputBody = JSON.parse(JSON.stringify(errOutputBody)); + // tempErrOutputBody.error = output[index].message; + // tempOutput.output.response.body.push(tempErrOutputBody); + // } else { + // const tempSuccOutputBody = JSON.parse(JSON.stringify(succOutputBody)); + // tempSuccOutputBody.output = output[index]; + // tempSuccOutputBody.output.userId = ''; + // tempSuccOutputBody.metadata = element.metadata; + // } + tempOutput.output.response.body = await makeCall(element, process.argv[2]); + outputData.push(tempOutput); + } + + // await input.forEach(async (element, index) => ); + + // console.log(outputData); + const outputStr = `export const data = ${JSON.stringify(outputData, null, '\t')}`; + + if ( + !fs.existsSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}`, + ) + ) { + fs.mkdirSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}`, + ); + } + if ( + !fs.existsSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}/router`, + ) + ) { + fs.mkdirSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}/router`, + ); + } + + fs.writeFileSync( + `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}/router/data.ts`, + outputStr, + ); +} +generateFile().then(() => { + console.log('Succeeded'); +}); \ No newline at end of file From 49d702d4dede60b9da7dd9b6bbe94453a04c4e4c Mon Sep 17 00:00:00 2001 From: Sanjay <71065320+Sanjay-Veernala@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:47:11 +0530 Subject: [PATCH 02/22] componentTestSuite(chore): remove unwanted files --- testScript.js | 105 ------------------------------- testScript_1.js | 160 ------------------------------------------------ 2 files changed, 265 deletions(-) delete mode 100644 testScript.js delete mode 100644 testScript_1.js diff --git a/testScript.js b/testScript.js deleted file mode 100644 index 5c38eef957..0000000000 --- a/testScript.js +++ /dev/null @@ -1,105 +0,0 @@ -const fs = require("fs"); - -const destination = 'slack'; -let input; -let output; -async function generateFile() { - input = JSON.parse( - fs.readFileSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${destination}_router_input.json`, - (err, data) => { - if (err) { - throw err; - } - input = data; - // console.log(data.toString()); - } - ) - ); - output = JSON.parse( - fs.readFileSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${destination}_router_output.json`, - (err, data) => { - if (err) { - throw err; - } - output = data; - } - ) - ); - - let outputData = []; - - const dataFormat = { - name: `${destination}`, - description: "", - feature: "processor", - module: "destination", - version: "v0", - input: { - request: { - body: [], - }, - }, - output: { - response: { - status: 200, - body: [], - }, - }, - }; - const errOutputBody = { - error: "", - statTags: { - destType: `${destination}`, - errorCategory: "dataValidation", - errorType: "instrumentation", - feature: "processor", - implementation: "native", - module: "destination", - }, - statusCode: 400, - }; - const succOutputBody = { - output: {}, - statusCode: 200, - }; - - input.forEach((element, index) => { - const tempOutput = JSON.parse(JSON.stringify(dataFormat)); - tempOutput.description = "Test " + index; - tempOutput.input.request.body.push(element); - if (output[index].message) { - const tempErrOutputBody = JSON.parse(JSON.stringify(errOutputBody)); - tempErrOutputBody.error = output[index].message; - tempOutput.output.response.body.push(tempErrOutputBody); - } else { - const tempSuccOutputBody = JSON.parse(JSON.stringify(succOutputBody)); - tempSuccOutputBody.output = output[index]; - tempOutput.output.response.body.push(tempSuccOutputBody); - } - outputData.push(tempOutput); - }); - - console.log(outputData); - const outputStr = `export const data = ${JSON.stringify( - outputData, - null, - "\t" - )}`; - - // fs.mkdirSync( - // `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${destination}` - // ); - // fs.mkdirSync( - // `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${destination}/router` - // ); - - fs.writeFileSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${destination}/router/data.ts`, - outputStr - ); -} -generateFile().then(() => { - console.log("Succeeded"); -}); \ No newline at end of file diff --git a/testScript_1.js b/testScript_1.js deleted file mode 100644 index f5cc6147d3..0000000000 --- a/testScript_1.js +++ /dev/null @@ -1,160 +0,0 @@ -const fs = require('fs'); - -let input; -let output; - -const makeCall = async (data, destination) => { - var axios = require('axios'); - var data = JSON.stringify([data]); - - var config = { - method: 'post', - url: `http://localhost:9090/v0/destinations/${destination}`, - headers: { - 'Content-Type': 'application/json', - }, - data: data, - }; - let res = undefined; - await axios(config) - .then(function (response) { - console.log(JSON.stringify(response.data)); - res = response.data; - }) - .catch(function (error) { - console.log(error); - res = response.data; - }); - return res; -}; - -async function generateFile() { - const newType = !fs.existsSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_router_input.json`, - ); - input = JSON.parse( - !newType - ? fs.readFileSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_router_input.json`, - (err, data) => { - if (err) { - throw err; - } - input = data; - // console.log(data.toString()); - }, - ) - : fs.readFileSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_router.json`, - (err, data) => { - if (err) { - throw err; - } - input = data; - // console.log(data.toString()); - }, - ), - ); - - // output = JSON.parse( - // fs.readFileSync( - // `/Users/sanjayv/Desktop/automation/rudder-transformer/test/__tests__/data/${process.argv[2]}_output.json`, - // (err, data) => { - // if (err) { - // throw err; - // } - // output = data; - // }, - // ), - // ); - - let outputData = []; - - const dataFormat = { - name: `${process.argv[2]}`, - description: '', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [], - }, - }, - output: { - response: { - status: 200, - body: [], - }, - }, - }; - const errOutputBody = { - error: '', - statTags: { - destType: `${process.argv[2]}`, - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }; - const succOutputBody = { - output: {}, - statusCode: 200, - }; - - for (let index = 0; index < input.length; index++) { - let element; - if (newType) element = input[index].input; - else element = input[index]; - const tempOutput = JSON.parse(JSON.stringify(dataFormat)); - tempOutput.description = 'Test ' + index; - tempOutput.input.request.body.push(element); - // if (output[index].message) { - // const tempErrOutputBody = JSON.parse(JSON.stringify(errOutputBody)); - // tempErrOutputBody.error = output[index].message; - // tempOutput.output.response.body.push(tempErrOutputBody); - // } else { - // const tempSuccOutputBody = JSON.parse(JSON.stringify(succOutputBody)); - // tempSuccOutputBody.output = output[index]; - // tempSuccOutputBody.output.userId = ''; - // tempSuccOutputBody.metadata = element.metadata; - // } - tempOutput.output.response.body = await makeCall(element, process.argv[2]); - outputData.push(tempOutput); - } - - // await input.forEach(async (element, index) => ); - - // console.log(outputData); - const outputStr = `export const data = ${JSON.stringify(outputData, null, '\t')}`; - - if ( - !fs.existsSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}`, - ) - ) { - fs.mkdirSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}`, - ); - } - if ( - !fs.existsSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}/router`, - ) - ) { - fs.mkdirSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}/router`, - ); - } - - fs.writeFileSync( - `/Users/sanjayv/Desktop/automation/rudder-transformer/test/integrations/destinations/${process.argv[2]}/router/data.ts`, - outputStr, - ); -} -generateFile().then(() => { - console.log('Succeeded'); -}); \ No newline at end of file From 9ce3ecae8ba7d83e94f706349f02a232ece047e1 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Tue, 24 Oct 2023 05:26:36 +0100 Subject: [PATCH 03/22] chore: clean-up un-used tests Signed-off-by: Sai Sankeerth --- test/__tests__/redis.test.js | 28 -------- test/__tests__/revenue_cat.test.js | 33 --------- test/__tests__/salesforce.test.js | 70 ------------------- test/__tests__/segment.test.js | 33 --------- test/__tests__/shynet.test.js | 29 -------- test/__tests__/slack.test.js | 48 ------------- test/__tests__/snapchat_conversion.test.js | 48 ------------- .../snapchat_custom_audience.test.js | 51 -------------- test/__tests__/splitio.test.js | 7 -- test/__tests__/tiktok_ads.test.js | 50 ------------- .../tiktok_ads_offline_events.test.js | 46 ------------ test/__tests__/twitter_ads.test.js | 44 ------------ test/__tests__/variance.test.js | 3 - 13 files changed, 490 deletions(-) delete mode 100644 test/__tests__/redis.test.js delete mode 100644 test/__tests__/revenue_cat.test.js delete mode 100644 test/__tests__/salesforce.test.js delete mode 100644 test/__tests__/segment.test.js delete mode 100644 test/__tests__/shynet.test.js delete mode 100644 test/__tests__/slack.test.js delete mode 100644 test/__tests__/snapchat_conversion.test.js delete mode 100644 test/__tests__/snapchat_custom_audience.test.js delete mode 100644 test/__tests__/splitio.test.js delete mode 100644 test/__tests__/tiktok_ads.test.js delete mode 100644 test/__tests__/tiktok_ads_offline_events.test.js delete mode 100644 test/__tests__/twitter_ads.test.js delete mode 100644 test/__tests__/variance.test.js diff --git a/test/__tests__/redis.test.js b/test/__tests__/redis.test.js deleted file mode 100644 index be3a1a497f..0000000000 --- a/test/__tests__/redis.test.js +++ /dev/null @@ -1,28 +0,0 @@ -const integration = "redis"; -const name = "Redis"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -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); - } - }); -}); diff --git a/test/__tests__/revenue_cat.test.js b/test/__tests__/revenue_cat.test.js deleted file mode 100644 index 8b4487e764..0000000000 --- a/test/__tests__/revenue_cat.test.js +++ /dev/null @@ -1,33 +0,0 @@ -const integration = "revenue_cat"; -const name = "revenue_cat"; - -const fs = require("fs"); -const path = require("path"); -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 outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -describe(`${name} Tests`, () => { - describe("Processor Tests", () => { - inputData.forEach((input, index) => { - it(`${name} - payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); -}); diff --git a/test/__tests__/salesforce.test.js b/test/__tests__/salesforce.test.js deleted file mode 100644 index 7315017376..0000000000 --- a/test/__tests__/salesforce.test.js +++ /dev/null @@ -1,70 +0,0 @@ -jest.mock("axios"); -const integration = "salesforce"; -const name = "Salesforce"; -const version = "v0"; - -const fs = require("fs"); -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 outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// 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 inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -// 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 inputRouterMetadata = JSON.parse(inputRouterMetadataFile); -const expectedRouterMetadata = JSON.parse(outputRouterMetadataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); - - describe("Router Metadata Tests", () => { - it("Payload", async () => { - const routerMetadataOutput = await transformer.processMetadataForRouter( - inputRouterMetadata - ); - expect(routerMetadataOutput).toEqual(expectedRouterMetadata); - }); - }); -}); diff --git a/test/__tests__/segment.test.js b/test/__tests__/segment.test.js deleted file mode 100644 index a1f9812f22..0000000000 --- a/test/__tests__/segment.test.js +++ /dev/null @@ -1,33 +0,0 @@ -const integration = "segment"; -const name = "Segment"; - -const fs = require("fs"); -const path = require("path"); -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 outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -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); - }); -}); diff --git a/test/__tests__/shynet.test.js b/test/__tests__/shynet.test.js deleted file mode 100644 index b7027d14c3..0000000000 --- a/test/__tests__/shynet.test.js +++ /dev/null @@ -1,29 +0,0 @@ -const integration = "shynet"; -const name = "shynet"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -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 { - let output = await transformer.process(dataPoint.input); - delete output.body.JSON.idempotency; - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); -}); diff --git a/test/__tests__/slack.test.js b/test/__tests__/slack.test.js deleted file mode 100644 index eec0f4054f..0000000000 --- a/test/__tests__/slack.test.js +++ /dev/null @@ -1,48 +0,0 @@ -const integration = "slack"; -const name = "Slack"; - -const fs = require("fs"); -const path = require("path"); - -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 outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// 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`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -inputData.forEach((input, index) => { - test(`${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("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/snapchat_conversion.test.js b/test/__tests__/snapchat_conversion.test.js deleted file mode 100644 index 17fd363cc7..0000000000 --- a/test/__tests__/snapchat_conversion.test.js +++ /dev/null @@ -1,48 +0,0 @@ -const integration = "snapchat_conversion"; -const name = "Snapchat Conversion"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -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 inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -Date.now = jest.fn(() => new Date("2022-04-22T10:57:58Z")); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, () => { - try { - const output = transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/snapchat_custom_audience.test.js b/test/__tests__/snapchat_custom_audience.test.js deleted file mode 100644 index 41c4217562..0000000000 --- a/test/__tests__/snapchat_custom_audience.test.js +++ /dev/null @@ -1,51 +0,0 @@ -const integration = "snapchat_custom_audience"; -const name = "Snapchat Custom Audience"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -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 inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -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", () => { - it("Payload", async () => { - try { - const routerOutput = await transformer.processRouterDest( - inputRouterData - ); - expect(routerOutput).toEqual(expectedRouterData); - } catch (error) { - expect(error.message).toEqual(expectedRouterData.error); - } - }); - }); -}); diff --git a/test/__tests__/splitio.test.js b/test/__tests__/splitio.test.js deleted file mode 100644 index d2b226aea3..0000000000 --- a/test/__tests__/splitio.test.js +++ /dev/null @@ -1,7 +0,0 @@ -const { - getDestFromTestFile, - executeTransformationTest -} = require("./utilities/test-utils"); - -executeTransformationTest(getDestFromTestFile(__filename), "processor"); -executeTransformationTest(getDestFromTestFile(__filename), "router"); diff --git a/test/__tests__/tiktok_ads.test.js b/test/__tests__/tiktok_ads.test.js deleted file mode 100644 index 8b61fabf3d..0000000000 --- a/test/__tests__/tiktok_ads.test.js +++ /dev/null @@ -1,50 +0,0 @@ -const integration = "tiktok_ads"; -const name = "TikTok"; - -const fs = require("fs"); -const path = require("path"); -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 outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// 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 inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/tiktok_ads_offline_events.test.js b/test/__tests__/tiktok_ads_offline_events.test.js deleted file mode 100644 index 849f73befc..0000000000 --- a/test/__tests__/tiktok_ads_offline_events.test.js +++ /dev/null @@ -1,46 +0,0 @@ -const integration = "tiktok_ads_offline_events"; -const name = "TikTok Ads Offline Events"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -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`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -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 Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/twitter_ads.test.js b/test/__tests__/twitter_ads.test.js deleted file mode 100644 index 08811aad52..0000000000 --- a/test/__tests__/twitter_ads.test.js +++ /dev/null @@ -1,44 +0,0 @@ -const integration = "twitter_ads"; -const name = "twitter_ads"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -const authHeaderConstant = "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\""; - -jest.mock("../../src/v0/destinations/twitter_ads/util", () => { - const originalModule = jest.requireActual("../../src/v0/destinations/twitter_ads/util"); - return { - ...originalModule, - getAuthHeaderForRequest: jest.fn(() => { - return { - Authorization: authHeaderConstant - } - }) - } -}) - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - let output = await transformer.process(dataPoint.input); - delete output.body.JSON.idempotency; - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); -}); diff --git a/test/__tests__/variance.test.js b/test/__tests__/variance.test.js deleted file mode 100644 index ac6e247191..0000000000 --- a/test/__tests__/variance.test.js +++ /dev/null @@ -1,3 +0,0 @@ -const { executeTransformationTest } = require("./utilities/test-utils"); - -executeTransformationTest("variance", "processor"); From 095a563e9fac8b860f4b3ce777dfa09b75362633 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Tue, 24 Oct 2023 05:33:15 +0100 Subject: [PATCH 04/22] chore: clean-up vero tests Signed-off-by: Sai Sankeerth --- test/__tests__/data/vero.json | 559 -------------------- test/__tests__/data/vero_router_input.json | 88 --- test/__tests__/data/vero_router_output.json | 175 ------ test/__tests__/vero.test.js | 46 -- 4 files changed, 868 deletions(-) delete mode 100644 test/__tests__/data/vero.json delete mode 100644 test/__tests__/data/vero_router_input.json delete mode 100644 test/__tests__/data/vero_router_output.json delete mode 100644 test/__tests__/vero.test.js diff --git a/test/__tests__/data/vero.json b/test/__tests__/data/vero.json deleted file mode 100644 index 7a524a7da0..0000000000 --- a/test/__tests__/data/vero.json +++ /dev/null @@ -1,559 +0,0 @@ -[ - { - "description": "Identify Call with userId only", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "homwTown": "kanpur", - "age": "24" - } - }, - "type": "Identify", - "userId": "yash001", - "originalTimestamp": "2019-10-14T09:03:17.562Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "yash001", - "data": { - "homwTown": "kanpur", - "age": "24" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify Call with both userId and email", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1001@tech.com" - } - }, - "type": "Identify", - "userId": "user1001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user1001", - "email": "user1001@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify Call with anonymousId and email only", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1002@tech.com" - } - }, - "type": "Identify", - "anonymousId": "b4ffheww8eisndbdjgdewifewfgerwibderv" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "b4ffheww8eisndbdjgdewifewfgerwibderv", - "email": "user1002@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Add tags in identify call", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "address": "Caravela Beach Goa", - "homwTown": "Mawsynram", - "email": "user1005@tech.com" - } - }, - "integrations": { - "vero": { - "tags": { - "add": ["a", "b"] - } - } - }, - "type": "Identify", - "userId": "fprediruser001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "fprediruser001", - "email": "user1005@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": {} - } - ] - }, - { - "description": "Track Call with nonexistent userId- Creates new user with event", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "event": "Random event with nonexisting userId and email", - "properties": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "type": "track", - "userId": "eventIdn01" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "eventIdn01", - "email": "eventIdn01@sample.com" - }, - "event_name": "Random event with nonexisting userId and email", - "data": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Track Call with already existing userId and removing tags", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "event": "Random event with existing userId and some tags removed", - "properties": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "integrations": { - "Vero": { - "tags": { - "remove": ["a"] - } - } - }, - "type": "track", - "userId": "fprediruser001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "fprediruser001", - "email": "eventIdn01@sample.com" - }, - "event_name": "Random event with existing userId and some tags removed", - "data": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "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", - "remove": ["a"] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Alias Call - Merge two user profiles", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "type": "alias", - "userId": "sample101", - "previousId": "newsamplel01" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.getvero.com/api/v2/users/reidentify", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "new_id": "sample101", - "id": "newsamplel01", - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Identify Call with valid channels", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1001@tech.com" - }, - "os": { - "name": "android" - }, - "device": { - "token": "qwertyuioiuytrewwertyu", - "name": "Mi" - } - }, - "type": "Identify", - "userId": "user1001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user1001", - "email": "user1001@tech.com", - "channels": { - "platform": "android", - "address": "qwertyuioiuytrewwertyu", - "device": "Mi", - "type": "push" - }, - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify Call with invalid channels", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1001@tech.com" - }, - "device": { - "token": "qwertyuioiuytrewwertyu", - "name": "Mi" - } - }, - "type": "Identify", - "userId": "user1001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user1001", - "email": "user1001@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Track Call to unsubscribe a userId", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "event": "unsubscribe", - "type": "track", - "userId": "eventIdn01" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/unsubscribe", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "eventIdn01", - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Page Call with an existing userID", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "name": "Rudderstack", - "properties": { - "title": "rudderstack", - "path": "/" - }, - "type": "page", - "userId": "eventIdn01" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "eventIdn01" - }, - "event_name": "Viewed Rudderstack Page", - "data": { - "title": "rudderstack", - "path": "/" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Error flow - message type not supported", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "groupId": "1234", - "traits": { - "name": "MyGroup", - "industry": "IT", - "employees": 450, - "plan": "basic" - }, - "type": "group", - "userId": "eventIdn01" - } - }, - "output": { - "error": "Event type group is not supported" - } - } -] 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__/vero.test.js b/test/__tests__/vero.test.js deleted file mode 100644 index b0b1d130ff..0000000000 --- a/test/__tests__/vero.test.js +++ /dev/null @@ -1,46 +0,0 @@ -const integration = "vero"; -const name = "vero"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -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`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -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 Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); From 49e21bc24245b44aa12427dcc60fd3e6102af8d9 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Tue, 24 Oct 2023 09:51:46 +0100 Subject: [PATCH 05/22] fix: snapchat tests, remove unnecessary tests for snapchat - remove ts-ignore for attentive_tag processor tests Signed-off-by: Sai Sankeerth --- .../snapchat_conversion_router_input.json | 315 - .../snapchat_conversion_router_output.json | 72 - ...snapchat_custom_audience_router_input.json | 46 - ...napchat_custom_audience_router_output.json | 49 - .../attentive_tag/processor/data.ts | 1 - .../snapchat_conversion/processor/data.ts | 7303 ++++++++++------- .../snapchat_conversion/router/data.ts | 449 + .../snapchat_custom_audience/router/data.ts | 124 + 8 files changed, 4872 insertions(+), 3487 deletions(-) delete mode 100644 test/__tests__/data/snapchat_conversion_router_input.json delete mode 100644 test/__tests__/data/snapchat_conversion_router_output.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/integrations/destinations/snapchat_conversion/router/data.ts create mode 100644 test/integrations/destinations/snapchat_custom_audience/router/data.ts 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 2833dce9d5..0000000000 --- a/test/__tests__/data/snapchat_conversion_router_input.json +++ /dev/null @@ -1,315 +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", - "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", - "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", - "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 bc68d01086..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\",\"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\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"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\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"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\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"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_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/integrations/destinations/attentive_tag/processor/data.ts b/test/integrations/destinations/attentive_tag/processor/data.ts index 42e6492d10..f585fb58d8 100644 --- a/test/integrations/destinations/attentive_tag/processor/data.ts +++ b/test/integrations/destinations/attentive_tag/processor/data.ts @@ -1,5 +1,4 @@ export const mockFns = (_) => { - // @ts-ignore jest.useFakeTimers().setSystemTime(new Date('2023-10-14')); }; diff --git a/test/integrations/destinations/snapchat_conversion/processor/data.ts b/test/integrations/destinations/snapchat_conversion/processor/data.ts index f0223d2473..ed38673d95 100644 --- a/test/integrations/destinations/snapchat_conversion/processor/data.ts +++ b/test/integrations/destinations/snapchat_conversion/processor/data.ts @@ -1,3005 +1,4300 @@ export const data = [ - { - "name": "snapchat_conversion", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "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": "page", - "name": "Home Page Viewed", - "properties": { - "title": "Home | RudderStack", - "url": "http://www.rudderstack.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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 ", - "firstName": "john", - "middleName": "victor", - "lastName": "doe", - "city": "some_city", - "state": "some_state" - }, - "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", - "number_items": 4, - "click_id": "some_click_id", - "description": "Products Searched event for conversion type offline" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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 ", - "country": "IN", - "zicode": "Sxp-12345", - "region": "some_region" - }, - "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", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Event name is required", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": "identify", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Event type identify is not supported", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Pixel Id is required for web and offline events", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Snap App Id is required for app events", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Snap App Id is required for app events", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 ", - "country": "IN", - "zipcode": "Sxp-12345", - "region": "some_region" - }, - "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": "Product List Viewed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "checkout_started", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": "2" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 11", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Order Completed", - "properties": { - "brands": [ - "brand01", - "brand02" - ], - "products": [ - { - "product_id": "123", - "price": "14", - "quantity": 1 - }, - { - "product_id": "124", - "price": 14, - "quantity": 3 - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 12", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Product Added", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 13", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "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": "Product Viewed", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "number_items": 14, - "quantity": 1 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 14", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Product Viewed", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "quantity": 1 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 15", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Payment Info Entered", - "properties": { - "checkout_id": "12dfdfdf3" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 16", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "subscribe", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 17", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Promotion Viewed", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 18", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "Promotion clicked", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 19", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "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": "save", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 20", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": "Product Viewed", - "properties": { - "eventConversionType": "web", - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "url": "hjhb.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 21", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": "Product Viewed", - "properties": { - "eventConversionType": "offline", - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "url": "hjhb.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 22", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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", - "event_tag": "offline" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 23", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Product Added to Wishlist", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 24", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": "ProdSearched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "ProdSearched", - "to": "products_searched" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 25", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": "ProdSearched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Event ProdSearched doesn't match with Snapchat Events!", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 26", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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 - }, - "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": "Product Added to Cart", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "Product_Added_To_Cart", - "to": "products_searched" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 27", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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 - }, - "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": "Product_Added_to_Cart", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "Product Added To Cart", - "to": "products_searched" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 28", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Order Completed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14", - "quantity": 1 - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ], - "revenue": "100" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "snapchat_conversion", - "description": "Test 29", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "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": "Product List Viewed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ], - "revenue": "100" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Events must be sent within 28 days of their occurrence", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "SNAPCHAT_CONVERSION", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - } -] \ No newline at end of file + { + name: 'snapchat_conversion', + description: 'Test case for Page event-> PAGE_VIEW ', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'web', + 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', + 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: 'page', + name: 'Home Page Viewed', + properties: { + title: 'Home | RudderStack', + url: 'http://www.rudderstack.com', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + }, + }, + metadata: { + jobId: 20, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 20, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'PAGE_VIEW', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'WEB', + page_url: 'http://www.rudderstack.com', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Prodcuts Searched event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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 ', + firstName: 'john', + middleName: 'victor', + lastName: 'doe', + city: 'some_city', + state: 'some_state', + }, + 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', + 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: { + brands: 'abc', + query: 't-shirts', + event_conversion_type: 'web', + number_items: 4, + click_id: 'some_click_id', + description: 'Products Searched event for conversion type offline', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 21, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 21, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + number_items: 4, + click_id: 'some_click_id', + description: 'Products Searched event for conversion type offline', + hashed_first_name_sha: + '96d9632f363564cc3032521409cf22a852f2032eec099ed5967c0d000cec607a', + hashed_last_name_sha: + '799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f', + hashed_state_sha: + '6db488fc98e30afdf67a05a6da916805b02891ce58f03970c6deff79129c5f1c', + hashed_middle_name_sha: + '99bde068af2d49ed7fc8b8fa79abe13a6059e0db320bb73459fd96624bb4b33f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Track event without event Key', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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 ', + country: 'IN', + zicode: 'Sxp-12345', + region: 'some_region', + }, + 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', + 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', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 22, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event name is required', + metadata: { + jobId: 22, + destinationId: 'd2', + workspaceId: 'w2', + }, + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Identify event which is not supported in this destination', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: 'identify', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 23, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 23, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Event type identify is not supported', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Pixel id is not set as a destination config field', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 24, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 24, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Pixel Id is required for web and offline events', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Prodcuts Searched event for conversion type web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'web', + 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', + 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', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + }, + }, + metadata: { + jobId: 25, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 25, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'WEB', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case where appId is not present in destination config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + }, + }, + metadata: { + jobId: 26, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 26, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Snap App Id is required for app events', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case where snap app id is not present in destination config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + }, + }, + metadata: { + jobId: 27, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 27, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Snap App Id is required for app events', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Product Searched event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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: { + delivery_method: 'in_store', + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 28, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 28, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + delivery_method: 'in_store', + device_model: 'AOSP on IA Emulator', + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test Case for Product List Viewed event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + country: 'IN', + zipcode: 'Sxp-12345', + region: 'some_region', + }, + 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', + 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: 'Product List Viewed', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 29, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 29, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'VIEW_CONTENT', + item_ids: ['123', '123'], + price: '56', + country: 'IN', + hashed_zip: 'cbb2704f5b334a0cec32e5463d1fd9355f6ef73987bfe0ebb8389b7617452152', + region: 'some_region', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for checkout_started event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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: 'checkout_started', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: '2', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 30, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 30, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'START_CHECKOUT', + item_ids: ['123', '123'], + price: '42', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test Case for Order Completed event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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: 'Order Completed', + properties: { + brands: ['brand01', 'brand02'], + products: [ + { + product_id: '123', + price: '14', + quantity: 1, + }, + { + product_id: '124', + price: 14, + quantity: 3, + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 31, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 31, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'PURCHASE', + item_ids: ['123', '124'], + brands: ['brand01', 'brand02'], + price: '56', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test Case for Product Added event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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: 'Product Added', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 32, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 32, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_ids: '123', + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'ADD_CART', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'web', + 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', + 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: 'Product Viewed', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + number_items: 14, + quantity: 1, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 33, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 33, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_ids: '123', + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'WEB', + pixel_id: 'dummyPixelId', + number_items: 14, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + 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', + 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: 'Product Viewed', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + quantity: 1, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 34, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 34, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_ids: '123', + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + number_items: 1, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Payment Info Entered event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + 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', + 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: 'Payment Info Entered', + properties: { + checkout_id: '12dfdfdf3', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 35, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 35, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + transaction_id: '12dfdfdf3', + event_type: 'ADD_BILLING', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Subscribe event where conversion type is web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + 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', + 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: 'subscribe', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 36, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 36, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'SUBSCRIBE', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Promotion Viewed event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + 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', + 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: 'Promotion Viewed', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 37, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 37, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'AD_VIEW', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Promotion Clicked event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + 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', + 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: 'Promotion clicked', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 38, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 38, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'AD_CLICK', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for save event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + 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', + 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: 'save', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 39, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 39, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'SAVE', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + 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: 'Product Viewed', + properties: { + eventConversionType: 'web', + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + url: 'hjhb.com', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 40, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 40, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + page_url: 'hjhb.com', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'WEB', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + 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: 'Product Viewed', + properties: { + eventConversionType: 'offline', + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + url: 'hjhb.com', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 41, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 41, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Searched event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + 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', + event_tag: 'offline', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 42, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 42, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + event_tag: 'offline', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: + 'Test Case for Product Added To Whishlist event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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: 'Product Added to Wishlist', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 43, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 43, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + item_ids: '123', + price: '14', + currency: 'USD', + event_type: 'ADD_TO_WISHLIST', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Products Searched event using event mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + 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: 'ProdSearched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [ + { + from: 'ProdSearched', + to: 'products_searched', + }, + ], + }, + }, + metadata: { + jobId: 44, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 44, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + userId: '', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: "Test case event doesn't match with snapchat events", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + 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: 'ProdSearched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [], + }, + }, + metadata: { + jobId: 45, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 45, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: "Event ProdSearched doesn't match with Snapchat Events!", + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: + 'test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + 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, + }, + 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: 'Product Added to Cart', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [ + { + from: 'Product_Added_To_Cart', + to: 'products_searched', + }, + ], + }, + }, + metadata: { + jobId: 46, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 46, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: + 'test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground - here destination config need to be modified', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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', + 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, + }, + 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: 'Product_Added_to_Cart', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [ + { + from: 'Product Added To Cart', + to: 'products_searched', + }, + ], + }, + }, + metadata: { + jobId: 47, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 47, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Enable deduplication with duplication key as email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + request_ip: '127.0.0.1', + 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', + 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: 'Order Completed', + properties: { + products: [ + { + product_id: '123', + price: '14', + quantity: 1, + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + revenue: '100', + custom_dedup_id: '1234', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + deduplicationKey: 'properties.custom_dedup_id', + enableDeduplication: true, + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 48, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 48, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'PURCHASE', + item_ids: ['123', '123'], + client_dedup_id: '1234', + hashed_ip_address: + '12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0', + price: '100', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Mapping revenue to price for product list viewed event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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: 'Product List Viewed', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + revenue: '100', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 49, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 49, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'VIEW_CONTENT', + item_ids: ['123', '123'], + price: '100', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Mapping revenue to price for product list viewed event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + 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', + 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: 'Product List Viewed', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + revenue: '100', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 50, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 50, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'VIEW_CONTENT', + item_ids: ['123', '123'], + price: '100', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + 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: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: (_) => { + // @ts-ignore + Date.now = jest.fn(() => new Date('2022-04-23T10:57:58Z')); + }, +})); diff --git a/test/integrations/destinations/snapchat_conversion/router/data.ts b/test/integrations/destinations/snapchat_conversion/router/data.ts new file mode 100644 index 0000000000..bfa9acd4d2 --- /dev/null +++ b/test/integrations/destinations/snapchat_conversion/router/data.ts @@ -0,0 +1,449 @@ +import { FEATURES, IMPLEMENTATIONS, MODULES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'snapchat_conversion', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + 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', + 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', + 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', + 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', + }, + }, + }, + ], + destType: 'snapchat_conversion', + }, + }, + }, + output: { + response: { + status: 200, + body: { + 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","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","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","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","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","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","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","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', + }, + }, + }, + ], + }, + }, + }, + mockFns: (_) => { + // @ts-ignore + Date.now = jest.fn(() => new Date('2022-04-22T10:57:58Z')); + }, + }, + { + name: 'snapchat_conversion', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + input: [ + { + 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', + }, + ], + }, + }, + }, + ], + destType: 'snapchat_conversion', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [ + { + jobId: 4, + }, + ], + batched: false, + statusCode: 400, + error: 'Snap App Id is required for app events', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: FEATURES.ROUTER, + implementation: IMPLEMENTATIONS.NATIVE, + module: MODULES.DESTINATION, + destType: 'SNAPCHAT_CONVERSION', + }, + 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/integrations/destinations/snapchat_custom_audience/router/data.ts b/test/integrations/destinations/snapchat_custom_audience/router/data.ts new file mode 100644 index 0000000000..2807201e73 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/router/data.ts @@ -0,0 +1,124 @@ +import { FEATURES, MODULES } from '../../../../../src/v0/util/tags'; + +const DEST_TYPE = 'snapchat_custom_audience'; + +export const data = [ + { + name: DEST_TYPE, + description: 'Test 0', + feature: FEATURES.ROUTER, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + 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', + }, + }, + ], + destType: DEST_TYPE, + }, + }, + }, + output: { + response: { + status: 200, + body: { + 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', + }, + }, + }, + ], + }, + }, + }, + }, +]; From eec51f5dadd2b30b288efbe21276da1416683ec9 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 26 Oct 2023 13:22:31 +0530 Subject: [PATCH 06/22] fix: data-delivery component tests for salesforce --- test/integrations/component.test.ts | 9 +- .../salesforce/dataDelivery/data.ts | 807 ++++++++++++++++++ .../destinations/salesforce/network.ts | 326 +++++++ 3 files changed, 1137 insertions(+), 5 deletions(-) create mode 100644 test/integrations/destinations/salesforce/dataDelivery/data.ts create mode 100644 test/integrations/destinations/salesforce/network.ts diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 8b2a2ec7bd..847dd4c91f 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -73,18 +73,17 @@ afterAll(async () => { } await createHttpTerminator({ server }).terminate(); }); -let mock; +let mockAdapter; if (!opts.generate || opts.generate === 'false') { // unmock already existing axios-mocking - mock = new MockAxiosAdapter(axios, { onNoMatch: 'passthrough' }); + mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); const registerAxiosMocks = (axiosMocks: MockHttpCallsData[]) => { - axiosMocks.forEach((axiosMock) => addMock(mock, axiosMock)); + axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); }; // // all the axios requests will be stored in this map const allTestMockDataFilePaths = getAllTestMockDataFilePaths(__dirname, opts.destination); const allAxiosRequests = allTestMockDataFilePaths - .filter((d) => !d.includes('/af/')) .map((currPath) => { const mockNetworkCallsData: MockHttpCallsData[] = getMockHttpCallsData(currPath); return mockNetworkCallsData; @@ -184,7 +183,7 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { } describe(`${testData[0].name} ${testData[0].module}`, () => { test.each(testData)('$feature -> $description', async (tcData) => { - tcData?.mockFns?.(mock); + tcData?.mockFns?.(mockAdapter); switch (tcData.module) { case tags.MODULES.DESTINATION: diff --git a/test/integrations/destinations/salesforce/dataDelivery/data.ts b/test/integrations/destinations/salesforce/dataDelivery/data.ts new file mode 100644 index 0000000000..82c02c31c6 --- /dev/null +++ b/test/integrations/destinations/salesforce/dataDelivery/data.ts @@ -0,0 +1,807 @@ + +import { AxiosError } from 'axios'; +import MockAdapter from 'axios-mock-adapter'; + +export const data = [ + { + "name": "salesforce", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request for destination: salesforce Processed Successfully", + "destinationResponse": { + "response": { + "statusText": "No Content" + }, + "status": 204, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + } + } + } + } + } + }, + { + "name": "salesforce", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Salesforce Request Failed - due to \"INVALID_SESSION_ID\", (Retryable) during Salesforce Response Handling", + "destinationResponse": { + "response": [ + { + "message": "Session expired or invalid", + "errorCode": "INVALID_SESSION_ID" + } + ], + "status": 401, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + }, + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "salesforce", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer Incorrect_token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Salesforce Request Failed: \"401\" due to \"INVALID_HEADER_TYPE\", (Aborted) during Salesforce Response Handling", + "destinationResponse": { + "response": [ + { + "message": "INVALID_HEADER_TYPE", + "errorCode": "INVALID_AUTH_HEADER" + } + ], + "status": 401, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + }, + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "salesforce", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 429, + "body": { + "output": { + "status": 429, + "message": "Salesforce Request Failed - due to \"REQUEST_LIMIT_EXCEEDED\", (Throttled) during Salesforce Response Handling", + "destinationResponse": { + "response": [ + { + "message": "Request limit exceeded", + "errorCode": "REQUEST_LIMIT_EXCEEDED" + } + ], + "status": 403, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + }, + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "throttled", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "salesforce", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Salesforce Request Failed - due to \"Server Unavailable\", (Retryable) during Salesforce Response Handling", + "destinationResponse": { + "response": [ + { + "message": "Server Unavailable", + "errorCode": "SERVER_UNAVAILABLE" + } + ], + "status": 503, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + }, + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "salesforce", + "description": "Test 5", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) during Salesforce Response Handling", + "destinationResponse": { + "response": { + "error": "invalid_grant", + "error_description": "authentication failure" + }, + "status": 400, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + }, + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "salesforce", + "description": "Test 6", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "destinationResponse": { + "response": { + "errorCode": "SERVER_UNAVAILABLE", + "message": "Server Unavailable" + }, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "status": 503 + }, + "message": "Salesforce Request Failed - due to \"{\"message\":\"Server Unavailable\",\"errorCode\":\"SERVER_UNAVAILABLE\"}\", (Retryable) during Salesforce Response Handling", + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "status": 500 + } + } + } + } + }, + { + "name": "salesforce", + "description": "Test 7", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "method": "POST", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "body": { + "JSON": { + "Planning_Categories__c": "pc", + "External_ID__c": 123 + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request for destination: salesforce Processed Successfully", + "destinationResponse": { + "response": {"searchRecords":[{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA"},"Id":"a0J75100002w97gEAA","External_ID__c":"external_id"},{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI"},"Id":"a0J75200002w9ZsEAI","External_ID__c":"external_id TEST"}]}, + "status": 200, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + } + } + } + } + } + }, + { + name: 'salesforce', + description: 'Test 8', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to ""[ECONNABORTED] :: Connection aborted"", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: '[ECONNABORTED] :: Connection aborted', + status: 500, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + // params has `{ destination: salesforce }` + mockAdapter + .onPost( + 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101', + { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + Accept: 'application/json, text/plain, */*', + }, + ) + .abortRequestOnce(); + }, + }, + { + name: 'salesforce', + description: 'Test 9', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudder.my.salesforce.com/services/data/v50.0/sobjects/Lead/102', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to ""[EAI_AGAIN] :: Temporary failure in name resolution"", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: '[EAI_AGAIN] :: Temporary failure in name resolution', + status: 500, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + // params has `{ destination: salesforce }` + mockAdapter + .onPost( + 'https://rudder.my.salesforce.com/services/data/v50.0/sobjects/Lead/102', + { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + Accept: 'application/json, text/plain, */*', + }, + ).replyOnce((config) => { + // @ts-ignore + const err = AxiosError.from('DNS not found', 'EAI_AGAIN', config) + return Promise.reject(err); + }); + }, + }, +] \ No newline at end of file diff --git a/test/integrations/destinations/salesforce/network.ts b/test/integrations/destinations/salesforce/network.ts new file mode 100644 index 0000000000..396fad9d69 --- /dev/null +++ b/test/integrations/destinations/salesforce/network.ts @@ -0,0 +1,326 @@ +const tfProxyMocksData = [ + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { statusText: 'No Content' }, + status: 204, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }], + status: 401, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer Incorrect_token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'INVALID_HEADER_TYPE', errorCode: 'INVALID_AUTH_HEADER' }], + status: 401, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'Request limit exceeded', errorCode: 'REQUEST_LIMIT_EXCEEDED' }], + status: 403, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'Server Unavailable', errorCode: 'SERVER_UNAVAILABLE' }], + status: 503, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { error: 'invalid_grant', error_description: 'authentication failure' }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + message: 'Server Unavailable', + errorCode: 'SERVER_UNAVAILABLE', + }, + status: 503, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c', + data: { Planning_Categories__c: 'pc', External_ID__c: 123 }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + searchRecords: [ + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA', + }, + Id: 'a0J75100002w97gEAA', + External_ID__c: 'external_id', + }, + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI', + }, + Id: 'a0J75200002w9ZsEAI', + External_ID__c: 'external_id TEST', + }, + ], + }, + status: 200, + }, + }, +]; + +const transformationMocksData = [ + { + httpReq: { + url: 'https://login.salesforce.com/services/oauth2/token?username=testsalesforce1453@gmail.com&password=dummyPassword1dummyInitialAccessToken&client_id=undefined&client_secret=undefined&grant_type=password', + method: 'POST', + }, + httpRes: { + status: 200, + data: { + access_token: + '00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + instance_url: 'https://ap15.salesforce.com', + id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', + token_type: 'Bearer', + issued_at: '1582343657644', + signature: 'XRgUHXVBSWhLHZVoVFZby/idWXdAPA5lMW/ZdLMzB8o=', + }, + }, + }, + { + httpReq: { + url: 'https://test.salesforce.com/services/oauth2/token?username=test.c97-qvpd@force.com.test&password=dummyPassword27fiy1FKcO9sohsxq1v6J88sg&client_id=undefined&client_secret=undefined&grant_type=password', + method: 'POST', + }, + httpRes: { + status: 200, + data: { + access_token: + '00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + instance_url: 'https://ap15.salesforce.com', + id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', + token_type: 'Bearer', + issued_at: '1582343657644', + signature: 'XRgUHXVBSWhLHZVoVFZby/idWXdAPA5lMW/ZdLMzB8o=', + abc: '123', + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons%40initech.com&sobject=Lead&Lead.fields=id', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons%40initech.com&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons%40initech.com&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons1%40initech.com&sobject=Lead&Lead.fields=id', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [ + { + attributes: { + type: 'Lead', + url: '/services/data/v50.0/sobjects/Lead/leadId', + }, + Id: 'leadId', + }, + ], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=ddv_ua%2B%7B%7B1234*245%7D%7D%40bugFix.com&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [ + { + attributes: { + type: 'Lead', + url: '/services/data/v50.0/sobjects/Lead/leadId', + }, + Id: 'leadId', + }, + ], + }, + }, + }, +]; +export const networkCallsData = [...tfProxyMocksData, ...transformationMocksData]; From 9f2780aadf4a6870ea16995f3e8832caffd191a2 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 26 Oct 2023 14:10:26 +0530 Subject: [PATCH 07/22] fix: remove salesforce from original proxy tests & correct the migrated transformation tests Signed-off-by: Sai Sankeerth --- .../data/salesforce_proxy_input.json | 326 --- .../data/salesforce_proxy_output.json | 260 -- test/__tests__/proxy.test.ts | 1 - test/integrations/component.test.ts | 2 +- .../destinations/salesforce/processor/data.ts | 2527 +++++++++-------- .../destinations/salesforce/router/data.ts | 160 +- 6 files changed, 1454 insertions(+), 1822 deletions(-) delete mode 100644 test/__tests__/data/salesforce_proxy_input.json delete mode 100644 test/__tests__/data/salesforce_proxy_output.json diff --git a/test/__tests__/data/salesforce_proxy_input.json b/test/__tests__/data/salesforce_proxy_input.json deleted file mode 100644 index f1aeef71ab..0000000000 --- a/test/__tests__/data/salesforce_proxy_input.json +++ /dev/null @@ -1,326 +0,0 @@ -[ - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/102", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer Incorrect_token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "body": { - "JSON": { - "Planning_Categories__c": "pc", - "External_ID__c": 123 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - } -] diff --git a/test/__tests__/data/salesforce_proxy_output.json b/test/__tests__/data/salesforce_proxy_output.json deleted file mode 100644 index c900661b75..0000000000 --- a/test/__tests__/data/salesforce_proxy_output.json +++ /dev/null @@ -1,260 +0,0 @@ -[ - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"\"[ECONNABORTED] :: Connection aborted\"\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": "[ECONNABORTED] :: Connection aborted", - "status": 500, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"\"[EAI_AGAIN] :: Temporary failure in name resolution\"\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": "[EAI_AGAIN] :: Temporary failure in name resolution", - "status": 500, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 200, - "message": "Request for destination: salesforce Processed Successfully", - "destinationResponse": { - "response": { - "statusText": "No Content" - }, - "status": 204, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - } - } - }, - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"INVALID_SESSION_ID\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "Session expired or invalid", - "errorCode": "INVALID_SESSION_ID" - } - ], - "status": 401, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Salesforce Request Failed: \"401\" due to \"INVALID_HEADER_TYPE\", (Aborted) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "INVALID_HEADER_TYPE", - "errorCode": "INVALID_AUTH_HEADER" - } - ], - "status": 401, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 429, - "message": "Salesforce Request Failed - due to \"REQUEST_LIMIT_EXCEEDED\", (Throttled) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "Request limit exceeded", - "errorCode": "REQUEST_LIMIT_EXCEEDED" - } - ], - "status": 403, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "throttled", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"Server Unavailable\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "Server Unavailable", - "errorCode": "SERVER_UNAVAILABLE" - } - ], - "status": 503, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) during Salesforce Response Handling", - "destinationResponse": { - "response": { - "error": "invalid_grant", - "error_description": "authentication failure" - }, - "status": 400, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "destinationResponse": { - "response": { - "errorCode": "SERVER_UNAVAILABLE", - "message": "Server Unavailable" - }, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "status": 503 - }, - "message": "Salesforce Request Failed - due to \"{\"message\":\"Server Unavailable\",\"errorCode\":\"SERVER_UNAVAILABLE\"}\", (Retryable) during Salesforce Response Handling", - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - }, - "status": 500 - } - }, - { - "output": { - "status": 200, - "message": "Request for destination: salesforce Processed Successfully", - "destinationResponse": { - "response": "", - "status": 200, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - } - } - } -] \ No newline at end of file diff --git a/test/__tests__/proxy.test.ts b/test/__tests__/proxy.test.ts index abccf8dbb4..db28ef1bb9 100644 --- a/test/__tests__/proxy.test.ts +++ b/test/__tests__/proxy.test.ts @@ -42,7 +42,6 @@ const destinations = [ 'fb', 'snapchat_custom_audience', 'clevertap', - 'salesforce', 'marketo_static_list', 'criteo_audience', 'tiktok_ads', diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 847dd4c91f..364211328b 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -76,7 +76,7 @@ afterAll(async () => { let mockAdapter; if (!opts.generate || opts.generate === 'false') { // unmock already existing axios-mocking - mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); + mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'passthrough' }); const registerAxiosMocks = (axiosMocks: MockHttpCallsData[]) => { axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); }; diff --git a/test/integrations/destinations/salesforce/processor/data.ts b/test/integrations/destinations/salesforce/processor/data.ts index 62a91c1b54..ad0dbb6843 100644 --- a/test/integrations/destinations/salesforce/processor/data.ts +++ b/test/integrations/destinations/salesforce/processor/data.ts @@ -1,1145 +1,1384 @@ export const data = [ - { - "name": "salesforce", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "salesforce", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "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": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) :- authentication failed during fetching access token.", - "statTags": { - "errorCategory": "network", - "errorType": "aborted", - "destType": "SALESFORCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - } -] \ No newline at end of file + { + name: 'salesforce', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + 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: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + 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: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + userId: '', + 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: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'message type track is not supported', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'SALESFORCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + userId: '', + 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: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + 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: {}, + userId: '', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + 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: {}, + userId: '', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + 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: {}, + userId: '', + 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: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + 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: {}, + userId: '', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + userId: '', + 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: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + 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: { + response: { + status: 200, + body: [ + { + statusCode: 200, + 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: {}, + userId: '', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/salesforce/router/data.ts b/test/integrations/destinations/salesforce/router/data.ts index 43bb5c5551..c45a50116b 100644 --- a/test/integrations/destinations/salesforce/router/data.ts +++ b/test/integrations/destinations/salesforce/router/data.ts @@ -94,16 +94,39 @@ export const data = [ metadata: { jobId: 1, }, - statusCode: 400, - error: - 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', - statTags: { - errorCategory: 'network', - errorType: 'aborted', - destType: 'SALESFORCE', - module: 'destination', - implementation: 'native', - feature: 'processor', + statusCode: 200, + 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: {}, + userId: '', }, }, ], @@ -205,16 +228,40 @@ export const data = [ metadata: { jobId: 2, }, - statusCode: 400, - error: - 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', - statTags: { - errorCategory: 'network', - errorType: 'aborted', - destType: 'SALESFORCE', - module: 'destination', - implementation: 'native', - feature: 'processor', + statusCode: 200, + output: { + 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: {}, + userId: '', }, }, ], @@ -316,33 +363,9 @@ export const data = [ metadata: { jobId: 3, }, - statusCode: 400, - error: - 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', - statTags: { - errorCategory: 'network', - errorType: 'aborted', - destType: 'SALESFORCE', - module: 'destination', - implementation: 'native', - feature: 'processor', - }, - }, - ], - }, - }, - }, - { - name: 'salesforce', - description: 'Test 3', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { + statusCode: 200, + output: { + userId: '', version: '1', type: 'REST', method: 'POST', @@ -373,49 +396,6 @@ export const data = [ 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: { - response: { - status: 200, - body: [ - { - metadata: { - jobId: 4, - }, - statusCode: 400, - error: - 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) :- authentication failed during fetching access token.', - statTags: { - errorCategory: 'network', - errorType: 'aborted', - destType: 'SALESFORCE', - module: 'destination', - implementation: 'native', - feature: 'processor', }, }, ], From bcd31afee2fca4542535f9becd1371ca7e3dc52d Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Thu, 26 Oct 2023 16:24:08 +0530 Subject: [PATCH 08/22] migrate marketo-proxy tests to component tests --- .../data/marketo/proxy_response.json | 282 ---------- test/__tests__/data/marketo_proxy_input.json | 272 ---------- test/__tests__/data/marketo_proxy_output.json | 193 ------- test/__tests__/proxy.test.ts | 1 - .../destinations/marketo/dataDelivery/data.ts | 490 ++++++++++++++++++ .../destinations/marketo/network.ts | 244 +++++++++ 6 files changed, 734 insertions(+), 748 deletions(-) delete mode 100644 test/__mocks__/data/marketo/proxy_response.json delete mode 100644 test/__tests__/data/marketo_proxy_input.json delete mode 100644 test/__tests__/data/marketo_proxy_output.json create mode 100644 test/integrations/destinations/marketo/dataDelivery/data.ts create mode 100644 test/integrations/destinations/marketo/network.ts diff --git a/test/__mocks__/data/marketo/proxy_response.json b/test/__mocks__/data/marketo/proxy_response.json deleted file mode 100644 index 4f5bfea7a6..0000000000 --- a/test/__mocks__/data/marketo/proxy_response.json +++ /dev/null @@ -1,282 +0,0 @@ -{ - "https://testMunchkin3.mktorest.com/bulk/v1/leads/batch/12345/warnings.json": { - "status": 200 - }, - "https://testMunchkin3.mktorest.com/bulk/v1/leads/batch/12345/failures.json": { - "status": 200 - }, - "https://a.mktorest.com/bulk/v1/leads/batch/12345/warnings.json": { - "status": 200, - "data": "data" - }, - "https://a.mktorest.com/bulk/v1/leads/batch/12345/failures.json": { - "status": 200, - "data": "data" - }, - "https://testMunchkin3.mktorest.com/bulk/v1/leads/batch/1234.json": { - "status": 200, - "data": { - "errors": [ - { - "message": "Any 400 error", - "code": 500 - } - ] - }, - "response": { - "statusText": "Any 500 error", - "status": 502 - } - }, - "https://testMunchkin4.mktorest.com/bulk/v1/leads/batch/1234.json": { - "status": 200, - "data": { - "errors": [ - { - "message": "Any 400 error", - "code": 1000 - } - ] - } - }, - "https://a.mktorest.com/bulk/v1/leads/batch/1234.json": { - "status": 200, - "data": { - "requestId": "13402#17e7238a1b9", - "result": [ - { - "batchId": 1234, - "importId": "1234", - "status": "Complete", - "numOfLeadsProcessed": 1, - "numOfRowsFailed": 0, - "numOfRowsWithWarning": 0, - "message": "Import succeeded, 1 records imported (1 members)" - } - ], - "success": true - } - }, - "https://testMunchkin4.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "message": "Any other error" - } - ] - } - }, - "https://testMunchkin4.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin3.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "message": "Empty file" - } - ] - } - }, - "https://testMunchkin3.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin2.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "message": "There are 10 imports currently being processed. Please try again later" - } - ] - } - }, - "https://testMunchkin2.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin1.mktorest.com/bulk/v1/leads.json": { - "status": 400 - }, - "https://testMunchkin1.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "code": "1006", - "message": "Header field 'a' not found" - } - ] - } - }, - "https://testMunchkin.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://a.mktorest.com/identity/oauth/token?client_id=b&client_secret=forThrottle&grant_type=client_credentials": { - "status": 500, - "response": { - "status": 502, - "statusText": "throttled" - } - }, - "https://a.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=c&grant_type=client_credentials": { - "status": 400, - "code": 401, - "statusText": "Unauthorized" - }, - "https://wrongMunchkin.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 400, - "code": "ENOTFOUND" - }, - "https://a.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://a.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "success": true, - "result": [ - { - "importId": "TestImportId" - } - ], - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test1": { - "data": { - "requestId": "664#17dae8c3d48", - "result": [ - { - "id": 1328328, - "status": "updated" - } - ], - "success": true - }, - "status": 200, - "statusText": "OK" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test2": { - "data": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "601", - "message": "Access token invalid" - } - ] - }, - "status": 200, - "statusText": "OK" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test3": { - "data": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "610", - "message": "Requested resource not found" - } - ] - }, - "status": 200, - "statusText": "OK" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test4": { - "response": { - "data": { - "code": 413, - "payload_size_bytes": 86321233, - "message": "Payload exceeded 1MB limit." - }, - "status": 413, - "statusText": "Request Entity Too Large", - "headers": { - "date": "Sat, 11 Dec 2021 15:08:22 GMT", - "content-type": "application/json", - "content-length": "93", - "connection": "keep-alive", - "access-control-allow-origin": "*", - "access-control-allow-methods": "GET, POST", - "strict-transport-security": "max-age=15768000" - } - } - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test5": { - "response": {} - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test6": { - "response": "" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test7": { - "code": "[ENOTFOUND] :: DNS lookup failed" - }, - "https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json": { - "data": { - "requestId": "142e4#1835b117b76", - "success": false, - "errors": [ - { - "code": "random_marketo_code", - "message": "problem" - } - ] - }, - "status": 200, - "statusText": "OK" - } -} diff --git a/test/__tests__/data/marketo_proxy_input.json b/test/__tests__/data/marketo_proxy_input.json deleted file mode 100644 index b846f02419..0000000000 --- a/test/__tests__/data/marketo_proxy_input.json +++ /dev/null @@ -1,272 +0,0 @@ -[ - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test1", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test2", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test3", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test4", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test5", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test6", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test7", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer access_token_success" - }, - "body": { - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "Email": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail", - "FirstName": "A", - "LastName": "M", - "id": 4, - "userId": "e17c5a5e-5e2f-430b-b497-fe3f1ea3a704" - } - ], - "lookupField": "id" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - } -] \ No newline at end of file diff --git a/test/__tests__/data/marketo_proxy_output.json b/test/__tests__/data/marketo_proxy_output.json deleted file mode 100644 index a17eb1d47d..0000000000 --- a/test/__tests__/data/marketo_proxy_output.json +++ /dev/null @@ -1,193 +0,0 @@ -[ - { - "output": { - "status": 200, - "message": "Request Processed Successfully", - "destinationResponse": { - "response": { - "requestId": "664#17dae8c3d48", - "result": [ - { - "id": 1328328, - "status": "updated" - } - ], - "success": true - }, - "status": 200 - } - } - }, - { - "output": { - "status": 500, - "message": "Request Failed for marketo, Access token invalid (Retryable).during Marketo Response Handling", - "destinationResponse": { - "response": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "601", - "message": "Access token invalid" - } - ] - }, - "status": 200 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Request Failed for marketo, Requested resource not found (Aborted).during Marketo Response Handling", - "destinationResponse": { - "response": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "610", - "message": "Requested resource not found" - } - ] - }, - "status": 200 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 413, - "message": "Request failed with status: 413", - "destinationResponse": { - "response": { - "code": 413, - "payload_size_bytes": 86321233, - "message": "Payload exceeded 1MB limit." - }, - "status": 413 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Request failed with status: 500", - "destinationResponse": { - "response": "", - "status": 500 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Request failed with status: 500", - "destinationResponse": { - "response": "", - "status": 500 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Request failed with status: 400", - "destinationResponse": { - "response": "[[ENOTFOUND] :: DNS lookup failed]", - "status": 400 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Error occurred during Marketo Response Handling -> problem", - "destinationResponse": { - "response": { - "requestId": "142e4#1835b117b76", - "success": false, - "errors": [ - { - "code": "random_marketo_code", - "message": "problem" - } - ] - }, - "status": 200 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "meta": "unhandledStatusCode", - "module": "destination" - } - } - } -] \ No newline at end of file diff --git a/test/__tests__/proxy.test.ts b/test/__tests__/proxy.test.ts index abccf8dbb4..bf151321f1 100644 --- a/test/__tests__/proxy.test.ts +++ b/test/__tests__/proxy.test.ts @@ -36,7 +36,6 @@ jest.mock('axios', () => jest.fn(mockedAxiosClient)); const version = '1'; const destinations = [ - 'marketo', 'braze', 'facebook_pixel', 'fb', diff --git a/test/integrations/destinations/marketo/dataDelivery/data.ts b/test/integrations/destinations/marketo/dataDelivery/data.ts new file mode 100644 index 0000000000..47dd8e9236 --- /dev/null +++ b/test/integrations/destinations/marketo/dataDelivery/data.ts @@ -0,0 +1,490 @@ +export const data = [ + { + name: 'marketo', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test1', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_1', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + message: 'Request Processed Successfully', + destinationResponse: { + response: { + requestId: '664#17dae8c3d48', + result: [ + { + id: 1328328, + status: 'updated', + }, + ], + success: true, + }, + status: 200, + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test2', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_2', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + message: + 'Request Failed for marketo, Access token invalid (Retryable).during Marketo Response Handling', + destinationResponse: { + response: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '601', + message: 'Access token invalid', + }, + ], + }, + status: 200, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test3', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_3', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + message: + 'Request Failed for marketo, Requested resource not found (Aborted).during Marketo Response Handling', + destinationResponse: { + response: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '610', + message: 'Requested resource not found', + }, + ], + }, + status: 200, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test4', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_4', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + message: 'Request failed with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test5', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_5', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + message: 'Request failed with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test6', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_6', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + message: 'Request failed with status: 400', + destinationResponse: { + response: '[[ENOTFOUND] :: DNS lookup failed]', + status: 400, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 6', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer access_token_success', + }, + body: { + JSON: { + action: 'createOrUpdate', + input: [ + { + Email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + FirstName: 'A', + LastName: 'M', + id: 4, + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + }, + ], + lookupField: 'id', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + }, + }, + output: { + response: { + status: 400, + message: 'Error occurred during Marketo Response Handling -> problem', + destinationResponse: { + response: { + requestId: '142e4#1835b117b76', + success: false, + errors: [ + { + code: 'random_marketo_code', + message: 'problem', + }, + ], + }, + status: 200, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + meta: 'unhandledStatusCode', + module: 'destination', + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/marketo/network.ts b/test/integrations/destinations/marketo/network.ts new file mode 100644 index 0000000000..b0c6174281 --- /dev/null +++ b/test/integrations/destinations/marketo/network.ts @@ -0,0 +1,244 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test1', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_1', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '664#17dae8c3d48', + result: [ + { + id: 1328328, + status: 'updated', + }, + ], + success: true, + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test2', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_2', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '601', + message: 'Access token invalid', + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test3', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_3', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '610', + message: 'Requested resource not found', + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test4', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_4', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: {}, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test5', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_5', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: '', + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test6', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_6', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + code: '[ENOTFOUND] :: DNS lookup failed', + status: 400, + }, + }, + { + httpReq: { + url: 'https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json', + data: { + action: 'createOrUpdate', + input: [ + { + Email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + FirstName: 'A', + LastName: 'M', + id: 4, + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer access_token_success', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '142e4#1835b117b76', + success: false, + errors: [ + { + code: 'random_marketo_code', + message: 'problem', + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, +]; From 48e40b3f10a6dd040248a6bf6d938ccf2b6f191c Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 26 Oct 2023 19:19:59 +0530 Subject: [PATCH 09/22] chore: migrating intercom, braze, marketo_static_list, snapchat_custom_audience, fb, fbpixel, clevertap, criteo_audience --- test/__tests__/proxy.test.ts | 10 +- .../destinations/braze/dataDelivery/data.ts | 488 +++++++++++++++ .../destinations/braze/network.ts | 230 ++++++- .../clevertap/dataDelivery/data.ts | 227 +++++++ .../destinations/clevertap/network.ts | 91 ++- .../criteo_audience/dataDelivery/data.ts | 530 ++++++++++++++++ .../destinations/criteo_audience/network.ts | 230 +++++++ .../facebook_pixel/dataDelivery/data.ts | 585 ++++++++++++++++++ .../destinations/facebook_pixel/network.ts | 190 ++++++ .../destinations/fb/dataDelivery/data.ts | 357 +++++++++++ test/integrations/destinations/fb/network.ts | 52 ++ .../intercom/dataDelivery/data.ts | 90 +++ .../destinations/intercom/network.ts | 54 +- .../marketo_static_list/dataDelivery/data.ts | 368 +++++++++++ .../marketo_static_list/network.ts | 180 ++++++ .../dataDelivery/data.ts | 222 +++++++ .../snapchat_custom_audience/network.ts | 84 +++ 17 files changed, 3976 insertions(+), 12 deletions(-) create mode 100644 test/integrations/destinations/braze/dataDelivery/data.ts create mode 100644 test/integrations/destinations/clevertap/dataDelivery/data.ts create mode 100644 test/integrations/destinations/criteo_audience/dataDelivery/data.ts create mode 100644 test/integrations/destinations/criteo_audience/network.ts create mode 100644 test/integrations/destinations/facebook_pixel/dataDelivery/data.ts create mode 100644 test/integrations/destinations/facebook_pixel/network.ts create mode 100644 test/integrations/destinations/fb/dataDelivery/data.ts create mode 100644 test/integrations/destinations/fb/network.ts create mode 100644 test/integrations/destinations/intercom/dataDelivery/data.ts create mode 100644 test/integrations/destinations/marketo_static_list/dataDelivery/data.ts create mode 100644 test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts create mode 100644 test/integrations/destinations/snapchat_custom_audience/network.ts diff --git a/test/__tests__/proxy.test.ts b/test/__tests__/proxy.test.ts index 70fbdfcae2..dabc84bab9 100644 --- a/test/__tests__/proxy.test.ts +++ b/test/__tests__/proxy.test.ts @@ -36,15 +36,7 @@ jest.mock('axios', () => jest.fn(mockedAxiosClient)); const version = '1'; const destinations = [ - 'braze', - 'facebook_pixel', - 'fb', - 'snapchat_custom_audience', - 'clevertap', - 'marketo_static_list', - 'criteo_audience', - 'tiktok_ads', - 'intercom', + 'tiktok_ads' ]; // start of generic tests diff --git a/test/integrations/destinations/braze/dataDelivery/data.ts b/test/integrations/destinations/braze/dataDelivery/data.ts new file mode 100644 index 0000000000..3e1805c01d --- /dev/null +++ b/test/integrations/destinations/braze/dataDelivery/data.ts @@ -0,0 +1,488 @@ +import MockAdapter from "axios-mock-adapter"; + +export const data = [ + { + "name": "braze", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test1", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request for braze Processed Successfully", + "destinationResponse": { + "response": { + "aliases_processed": 1, + "message": "success" + }, + "status": 201 + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test2", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request for braze Processed Successfully", + "destinationResponse": { + "response": { + "message": "success", + "errors": [ + "minor error message" + ] + }, + "status": 201 + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test3", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request failed for braze with status: 201", + "destinationResponse": { + "response": { + "message": "fatal error message", + "errors": [ + "minor error message" + ] + }, + "status": 201 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test4", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request for braze Processed Successfully", + "destinationResponse": { + "response": "", + "status": 201 + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test5", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request failed for braze with status: 500", + "destinationResponse": { + "response": "", + "status": 500 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 5", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test6", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request failed for braze with status: 500", + "destinationResponse": { + "response": "", + "status": 500 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + }, + mockFns: (mockAdapter: MockAdapter) => { + // params has `{ destination: salesforce }` + mockAdapter + .onPost( + 'https://rest.iad-03.braze.com/users/identify/test6', + { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + ).replyOnce((config) => { + // @ts-ignore + const err = AxiosError.from('DNS not found', 'ENOTFOUND', config) + return Promise.reject(err); + }); + } + }, + { + "name": "braze", + "description": "Test 6", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test7", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request failed for braze with status: 500", + "destinationResponse": { + "response": "", + "status": 500 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/braze/network.ts b/test/integrations/destinations/braze/network.ts index 4dfd5fa2a5..b907ce48c9 100644 --- a/test/integrations/destinations/braze/network.ts +++ b/test/integrations/destinations/braze/network.ts @@ -1,3 +1,231 @@ +import { AxiosError } from "axios"; + +const dataDeliveryMocksData = [ + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test5', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'any' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { response: {} }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test6', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'any' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: {}, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test1', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { aliases_processed: 1, message: 'success' }, status: 201 }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test2', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { message: 'success', errors: ['minor error message'] }, status: 201 }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test3', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { message: 'fatal error message', errors: ['minor error message'] }, + status: 201, + }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test4', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: '', status: 201 }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test5', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: {}, + }, + // { + // httpReq: { + // url: 'https://rest.iad-03.braze.com/users/identify/test6', + // data: { + // aliases_to_identify: [ + // { + // external_id: 'gabi_userId_45', + // user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + // }, + // ], + // }, + // params: { destination: 'braze' }, + // headers: { + // Accept: 'application/json', + // Authorization: 'Bearer api_key', + // 'Content-Type': 'application/json', + // 'User-Agent': 'RudderLabs', + // }, + // method: 'POST', + // }, + // httpRes: AxiosError.from('DNS not found', 'ENOTFOUND'), + // }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test7', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { response: {} }, + }, +]; + const deleteNwData = [ { httpReq: { @@ -188,4 +416,4 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; +export const networkCallsData = [...deleteNwData, ...dataDeliveryMocksData]; diff --git a/test/integrations/destinations/clevertap/dataDelivery/data.ts b/test/integrations/destinations/clevertap/dataDelivery/data.ts new file mode 100644 index 0000000000..bc8866823e --- /dev/null +++ b/test/integrations/destinations/clevertap/dataDelivery/data.ts @@ -0,0 +1,227 @@ +export const data = [ + { + "name": "clevertap", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.clevertap.com/1/upload/test1", + "headers": { + "X-CleverTap-Account-Id": "476550467", + "X-CleverTap-Passcode": "fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "d": [ + { + "type": "profile", + "profileData": { + "Email": "jamesDoe@gmail.com", + "Name": "James Doe", + "Phone": "92374162212", + "Gender": "M", + "Employed": true, + "DOB": "1614775793", + "Education": "Science", + "Married": "Y", + "Customer Type": "Prime", + "graduate": true, + "msg_push": true, + "msgSms": true, + "msgemail": true, + "msgwhatsapp": false, + "custom_tags": "[\"Test_User\",\"Interested_User\",\"DIY_Hobby\"]", + "custom_mappings": "{\"Office\":\"Trastkiv\",\"Country\":\"Russia\"}", + "address": "{\"city\":\"kolkata\",\"country\":\"India\",\"postalCode\":789223,\"state\":\"WB\",\"street\":\"\"}" + }, + "identity": "anon_id" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "clevertap" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "status": "success", + "processed": 1, + "unprocessed": [] + }, + "status": 200 + } + } + } + } + } + }, + { + "name": "clevertap", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "d": [ + { + "identity": "anon-id-new", + "type": "event", + "evtName": "Web Page Viewed: Rudder", + "evtData": { + "title": "Home", + "path": "/" + } + } + ] + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "headers": { + "X-CleverTap-Account-Id": "fakeId123", + "X-CleverTap-Passcode": "fakePasscode123", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.clevertap.com/1/upload/test2", + "params": { + "destination": "clevertap" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 401, + "body": { + "output": { + "status": 401, + "message": "Request failed with status: 401", + "destinationResponse": { + "response": { + "status": "fail", + "error": "Invalid Credentials", + "code": 401 + }, + "status": 401 + }, + "statTags": { + "destType": "CLEVERTAP", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "clevertap", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "d": [ + { + "identity": "anon-id-new", + "type": "event", + "evtData": { + "title": "Home", + "path": "/" + } + } + ] + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "headers": { + "X-CleverTap-Account-Id": "476550467", + "X-CleverTap-Passcode": "fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.clevertap.com/1/upload/test3", + "params": { + "destination": "clevertap" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Request failed with status: 200", + "destinationResponse": { + "response": { + "status": "fail", + "processed": 0, + "unprocessed": [] + }, + "status": 200 + }, + "statTags": { + "destType": "CLEVERTAP", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/clevertap/network.ts b/test/integrations/destinations/clevertap/network.ts index 458d6faba0..c4eb23ee39 100644 --- a/test/integrations/destinations/clevertap/network.ts +++ b/test/integrations/destinations/clevertap/network.ts @@ -1,3 +1,92 @@ +const dataDeliveryMocksData = [ + { + httpReq: { + url: 'https://api.clevertap.com/1/upload/test1', + data: { + d: [ + { + type: 'profile', + profileData: { + Email: 'jamesDoe@gmail.com', + Name: 'James Doe', + Phone: '92374162212', + Gender: 'M', + Employed: true, + DOB: '1614775793', + Education: 'Science', + Married: 'Y', + 'Customer Type': 'Prime', + graduate: true, + msg_push: true, + msgSms: true, + msgemail: true, + msgwhatsapp: false, + custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', + custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', + address: + '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + }, + identity: 'anon_id', + }, + ], + }, + params: { destination: 'clevertap' }, + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': + 'fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { status: 'success', processed: 1, unprocessed: [] }, status: 200 }, + }, + { + httpReq: { + url: 'https://api.clevertap.com/1/upload/test2', + data: { + d: [ + { + identity: 'anon-id-new', + type: 'event', + evtName: 'Web Page Viewed: Rudder', + evtData: { title: 'Home', path: '/' }, + }, + ], + }, + params: { destination: 'clevertap' }, + headers: { + 'X-CleverTap-Account-Id': 'fakeId123', + 'X-CleverTap-Passcode': 'fakePasscode123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { status: 'fail', error: 'Invalid Credentials', code: 401 }, status: 401 + }, + }, + { + httpReq: { + url: 'https://api.clevertap.com/1/upload/test3', + data: { + d: [{ identity: 'anon-id-new', type: 'event', evtData: { title: 'Home', path: '/' } }], + }, + params: { destination: 'clevertap' }, + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': + 'fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { status: 'fail', processed: 0, unprocessed: [] }, status: 200 }, + }, +]; const deleteNwData = [ { httpReq: { @@ -172,4 +261,4 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; +export const networkCallsData = [...deleteNwData, ...dataDeliveryMocksData]; diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/data.ts b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts new file mode 100644 index 0000000000..bc3af8f22d --- /dev/null +++ b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts @@ -0,0 +1,530 @@ +export const data = [ + { + "name": "criteo_audience", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34894/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "remove", + "identifierType": "gum", + "identifiers": [ + "sample_gum3" + ], + "internalIdentifiers": false, + "gumCallerId": "329739" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": "", + "status": 200 + } + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/3485/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 401, + "body": { + "output": { + "status": 401, + "authErrorCategory": "REFRESH_TOKEN", + "destinationResponse": { + "errors": [ + { + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization", + "code": "authorization-token-expired", + "instance": "/2022-10/audiences/123/contactlist", + "title": "The authorization token has expired" + } + ] + }, + "message": "The authorization token has expired during criteo_audience response transformation", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34895/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 401, + "body": { + "output": { + "status": 401, + "authErrorCategory": "REFRESH_TOKEN", + "destinationResponse": { + "errors": [ + { + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization", + "code": "authorization-token-invalid", + "instance": "/2022-10/audiences/123/contactlist", + "title": "The authorization header is invalid" + } + ] + }, + "message": "The authorization header is invalid during criteo_audience response transformation", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34896/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "message": "AudienceId is Invalid. Please Provide Valid AudienceId", + "destinationResponse": { + "response": { + "errors": [ + { + "code": "audience-invalid", + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization" + } + ] + }, + "status": 404 + }, + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "meta": "instrumentation", + "module": "destination" + }, + "status": 400 + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34897/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "destinationResponse": { + "response": { + "errors": [ + { + "code": "audience-invalid", + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization" + } + ] + }, + "status": 503 + }, + "message": "Request Failed: during criteo_audience response transformation (Retryable)", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "feature": "dataDelivery", + "implementation": "native", + "errorType": "retryable", + "module": "destination" + }, + "status": 500 + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 5", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34898/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 429, + "body": { + "output": { + "destinationResponse": { + "response": {}, + "status": 429 + }, + "message": "Request Failed: during criteo_audience response transformation - due to Request Limit exceeded, (Throttled)", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "throttled", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "status": 429 + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 6", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34899/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "destinationResponse": { + "response": { + "message": "unknown error" + }, + "status": 410 + }, + "message": "Request Failed: during criteo_audience response transformation with status \"410\" due to \"{\"message\":\"unknown error\"}\", (Aborted) ", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "status": 400 + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/criteo_audience/network.ts b/test/integrations/destinations/criteo_audience/network.ts new file mode 100644 index 0000000000..959e8a2112 --- /dev/null +++ b/test/integrations/destinations/criteo_audience/network.ts @@ -0,0 +1,230 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'remove', + identifierType: 'gum', + identifiers: ['sample_gum3'], + internalIdentifiers: false, + gumCallerId: '329739', + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { status: 200 }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/3485/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '400', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'authorization-token-expired', + instance: '/2022-10/audiences/123/contactlist', + title: 'The authorization token has expired', + }, + ], + }, + status: 401, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34895/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '400', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'authorization-token-invalid', + instance: '/2022-10/audiences/123/contactlist', + title: 'The authorization header is invalid', + }, + ], + }, + status: 401, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34896/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '400', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'audience-invalid', + }, + ], + }, + status: 404, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34897/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '500', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'audience-invalid', + }, + ], + }, + status: 503, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34898/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { code: '429', data: {}, status: 429 }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34899/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { code: '400', data: { message: 'unknown error' }, status: 410 }, + }, +]; diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts new file mode 100644 index 0000000000..e4e4a7d4c8 --- /dev/null +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts @@ -0,0 +1,585 @@ +export const data = [ + { + name: 'facebook_pixel', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654773112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Invalid OAuth 2.0 access token', + destinationResponse: { + error: { + message: 'The access token could not be decrypted', + type: 'OAuthException', + code: 190, + fbtrace_id: 'fbpixel_trace_id', + }, + status: 500, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654773112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Request Processed Successfully', + destinationResponse: { + events_received: 1, + fbtrace_id: 'facebook_trace_id', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Event Timestamp Too Old', + destinationResponse: { + error: { + message: 'Invalid parameter', + type: 'OAuthException', + code: 100, + error_subcode: 2804003, + is_transient: false, + error_user_title: 'Event Timestamp Too Old', + error_user_msg: + 'The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.', + fbtrace_id: 'A6UyEgg_HdoiRX9duxcBOjb', + }, + status: 400, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 429, + body: { + output: { + status: 429, + message: 'API User Too Many Calls', + destinationResponse: { + error: { + message: 'User request limit reached', + type: 'OAuthException', + code: 17, + fbtrace_id: 'facebook_px_trace_id_4', + }, + status: 500, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + "Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation", + destinationResponse: { + error: { + message: + "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", + type: 'GraphMethodException', + code: 100, + error_subcode: 33, + fbtrace_id: 'facebook_px_trace_id_5', + }, + status: 400, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"d58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Invalid Parameter', + destinationResponse: { + error: { + message: 'Invalid Parameter', + type: 'GraphMethodException', + code: 100, + error_subcode: 34, + fbtrace_id: 'facebook_px_trace_id_6', + }, + status: 404, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 6', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + destination: 'facebook_pixel', + }, + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Invalid Parameter', + destinationResponse: { + error: { + message: 'Unsupported post request. some problem with sent parameters', + type: 'GraphMethodException', + code: 100, + error_subcode: 38, + fbtrace_id: 'facebook_px_trace_id_6', + }, + status: 400, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 7', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + destination: 'facebook_pixel', + }, + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Capability or permissions issue.', + destinationResponse: { + error: { + message: 'Some error in permission', + type: 'GraphMethodException', + code: 3, + error_subcode: 10, + fbtrace_id: 'facebook_px_trace_id_7', + }, + status: 500, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 8', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + destination: 'facebook_pixel', + }, + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: 'Unhandled random error', + destinationResponse: { + error: { + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }, + status: 412, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + meta: 'unhandledStatusCode', + }, + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/facebook_pixel/network.ts b/test/integrations/destinations/facebook_pixel/network.ts new file mode 100644 index 0000000000..a63970c4c6 --- /dev/null +++ b/test/integrations/destinations/facebook_pixel/network.ts @@ -0,0 +1,190 @@ +import { data } from './dataDelivery/data'; +import { getFormData } from '../../../../src/adapters/network'; + +export const networkCallsData = [ + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token', + data: getFormData(data[0].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'The access token could not be decrypted', + type: 'OAuthException', + code: 190, + fbtrace_id: 'fbpixel_trace_id', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token', + data: getFormData(data[2].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Invalid parameter', + type: 'OAuthException', + code: 100, + error_subcode: 2804003, + is_transient: false, + error_user_title: 'Event Timestamp Too Old', + error_user_msg: + 'The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.', + fbtrace_id: 'A6UyEgg_HdoiRX9duxcBOjb', + }, + }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token', + data: getFormData(data[3].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'User request limit reached', + type: 'OAuthException', + code: 17, + fbtrace_id: 'facebook_px_trace_id_4', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token', + data: getFormData(data[4].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: + "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", + type: 'GraphMethodException', + code: 100, + error_subcode: 33, + fbtrace_id: 'facebook_px_trace_id_5', + }, + }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token', + data: getFormData(data[5].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Invalid Parameter', + type: 'GraphMethodException', + code: 100, + error_subcode: 34, + fbtrace_id: 'facebook_px_trace_id_6', + }, + }, + status: 404, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token', + data: getFormData(data[6].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Unsupported post request. some problem with sent parameters', + type: 'GraphMethodException', + code: 100, + error_subcode: 38, + fbtrace_id: 'facebook_px_trace_id_6', + }, + }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token', + data: getFormData(data[7].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Some error in permission', + type: 'GraphMethodException', + code: 3, + error_subcode: 10, + fbtrace_id: 'facebook_px_trace_id_7', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response', + data: getFormData(data[8].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }, + }, + status: 412, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token', + data: getFormData(data[1].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { events_received: 1, fbtrace_id: 'facebook_trace_id' }, + status: 200, + statusText: 'OK', + }, + }, +]; diff --git a/test/integrations/destinations/fb/dataDelivery/data.ts b/test/integrations/destinations/fb/dataDelivery/data.ts new file mode 100644 index 0000000000..70538a6ea0 --- /dev/null +++ b/test/integrations/destinations/fb/dataDelivery/data.ts @@ -0,0 +1,357 @@ +export const data = [ + { + "name": "fb", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "event": "CUSTOM_APP_EVENTS", + "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", + "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", + "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", + "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"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,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0" + }, + "JSON": {} + }, + "endpoint": "https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=invalid_access_token", + "files": {}, + "headers": { + "x-forwarded-for": "1.2.3.4" + }, + "method": "POST", + "statusCode": 200, + "type": "REST", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "version": "1", + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Invalid OAuth 2.0 access token", + "destinationResponse": { + "error": { + "message": "The access token could not be decrypted", + "type": "OAuthException", + "code": 190, + "fbtrace_id": "fbpixel_trace_id" + }, + "status": 500 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "fb", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "event": "CUSTOM_APP_EVENTS", + "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", + "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", + "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", + "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"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,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0" + }, + "JSON": {} + }, + "endpoint": "https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=my_access_token", + "files": {}, + "headers": { + "x-forwarded-for": "1.2.3.4" + }, + "method": "POST", + "statusCode": 200, + "type": "REST", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "version": "1", + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "events_received": 1, + "fbtrace_id": "facebook_trace_id" + } + } + } + } + } + }, + + { + "name": "fb", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "event": "CUSTOM_APP_EVENTS", + "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", + "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", + "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", + "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"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,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0" + }, + "JSON": {} + }, + "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token", + "files": {}, + "headers": { + "x-forwarded-for": "1.2.3.4" + }, + "method": "POST", + "statusCode": 200, + "type": "REST", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "version": "1", + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Event Timestamp Too Old", + "destinationResponse": { + "error": { + "message": "Invalid parameter", + "type": "OAuthException", + "code": 100, + "error_subcode": 2804003, + "is_transient": false, + "error_user_title": "Event Timestamp Too Old", + "error_user_msg": "The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.", + "fbtrace_id": "A6UyEgg_HdoiRX9duxcBOjb" + }, + "status": 400 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "fb", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token", + "headers": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",0,100,\"50.00\",0,0,0,\"\"]", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"Viewed Screen\",\"fb_description\":\"Main.1233\"}]", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0", + "event": "CUSTOM_APP_EVENTS" + } + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "statusCode": 200, + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 429, + "body": { + "output": { + "status": 429, + "message": "API User Too Many Calls", + "destinationResponse": { + "error": { + "message": "User request limit reached", + "type": "OAuthException", + "code": 17, + "fbtrace_id": "facebook_px_trace_id_4" + }, + "status": 500 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "throttled", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "fb", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token", + "headers": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",0,100,\"50.00\",0,0,0,\"\"]", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"Viewed Screen\",\"fb_description\":\"Main.1233\"}]", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0", + "event": "CUSTOM_APP_EVENTS" + } + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "statusCode": 200, + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation", + "destinationResponse": { + "error": { + "message": "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", + "type": "GraphMethodException", + "code": 100, + "error_subcode": 33, + "fbtrace_id": "facebook_px_trace_id_5" + }, + "status": 400 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/fb/network.ts b/test/integrations/destinations/fb/network.ts new file mode 100644 index 0000000000..4bf870f535 --- /dev/null +++ b/test/integrations/destinations/fb/network.ts @@ -0,0 +1,52 @@ +import { getFormData } from '../../../../src/adapters/network'; +import * as fbPixelNw from '../facebook_pixel/network'; +import { data } from './dataDelivery/data'; + +const fbPixelTcs = data + .filter((_, i) => [2, 3, 4].includes(i)) + .map((d) => { + const fbendpoint = d.input.request.body.endpoint; + const fbpTc = fbPixelNw.networkCallsData.filter((nw) => { + return nw.httpReq.url === fbendpoint; + })[0]; + fbpTc.httpReq.data = getFormData(d.input.request.body.body.FORM).toString(); + return fbpTc; + }); + +export const networkCallsData = [ + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=invalid_access_token', + data: getFormData(data[0].input.request.body.body.FORM).toString(), + params: { destination: 'fb' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'The access token could not be decrypted', + type: 'OAuthException', + code: 190, + fbtrace_id: 'fbpixel_trace_id', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=my_access_token', + data: getFormData(data[1].input.request.body.body.FORM).toString(), + params: { destination: 'fb' }, + headers: { 'x-forwarded-for': '1.2.3.4', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { events_received: 1, fbtrace_id: 'facebook_trace_id' }, + status: 200, + statusText: 'OK', + }, + }, + ...fbPixelTcs, +]; diff --git a/test/integrations/destinations/intercom/dataDelivery/data.ts b/test/integrations/destinations/intercom/dataDelivery/data.ts new file mode 100644 index 0000000000..23bcdc6af2 --- /dev/null +++ b/test/integrations/destinations/intercom/dataDelivery/data.ts @@ -0,0 +1,90 @@ +export const data = [ + { + "name": "intercom", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.intercom.io/users/test1", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer intercomApiKey", + "Accept": "application/json", + "Intercom-Version": "1.4" + }, + "params": {}, + "body": { + "JSON": { + "email": "test_1@test.com", + "phone": "9876543210", + "name": "Test Name", + "signed_up_at": 1601493060, + "last_seen_user_agent": "unknown", + "update_last_request_at": true, + "user_id": "test_user_id_1", + "custom_attributes": { + "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", + "key1": "value1", + "address.city": "Kolkata", + "address.state": "West Bengal", + "originalArray[0].nested_field": "nested value", + "originalArray[0].tags[0]": "tag_1", + "originalArray[0].tags[1]": "tag_2", + "originalArray[0].tags[2]": "tag_3", + "originalArray[1].nested_field": "nested value", + "originalArray[1].tags[0]": "tag_1", + "originalArray[2].nested_field": "nested value" + } + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "userId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33" + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "[Intercom Response Handler] Request failed for destination intercom with status: 408", + "destinationResponse": { + "response": { + "type": "error.list", + "request_id": "000on04msi4jpk7d3u60", + "errors": [ + { + "code": "Request Timeout", + "message": "The server would not wait any longer for the client" + } + ] + }, + "status": 408 + }, + "statTags": { + "destType": "INTERCOM", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/intercom/network.ts b/test/integrations/destinations/intercom/network.ts index 9f064d63ea..e3bba3f260 100644 --- a/test/integrations/destinations/intercom/network.ts +++ b/test/integrations/destinations/intercom/network.ts @@ -90,4 +90,56 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; +const deliveryCallsData = [ + { + httpReq: { + url: 'https://api.intercom.io/users/test1', + data: { + email: 'test_1@test.com', + phone: '9876543210', + name: 'Test Name', + signed_up_at: 1601493060, + last_seen_user_agent: 'unknown', + update_last_request_at: true, + user_id: 'test_user_id_1', + custom_attributes: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + key1: 'value1', + 'address.city': 'Kolkata', + 'address.state': 'West Bengal', + 'originalArray[0].nested_field': 'nested value', + 'originalArray[0].tags[0]': 'tag_1', + 'originalArray[0].tags[1]': 'tag_2', + 'originalArray[0].tags[2]': 'tag_3', + 'originalArray[1].nested_field': 'nested value', + 'originalArray[1].tags[0]': 'tag_1', + 'originalArray[2].nested_field': 'nested value', + }, + }, + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer intercomApiKey', + Accept: 'application/json', + 'Intercom-Version': '1.4', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + type: 'error.list', + request_id: '000on04msi4jpk7d3u60', + errors: [ + { + code: 'Request Timeout', + message: 'The server would not wait any longer for the client', + }, + ], + }, + status: 408, + }, + }, +]; +export const networkCallsData = [...deleteNwData, ...deliveryCallsData]; + diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts new file mode 100644 index 0000000000..e3deebca9b --- /dev/null +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts @@ -0,0 +1,368 @@ +export const data = [ + { + "name": "marketo_static_list", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer Incorrect_token", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "marketo_static_list" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "requestId": "b6d1#18a8d2c10e7", + "result": [ + { + "id": 110, + "status": "skipped", + "reasons": [ + { + "code": "1015", + "message": "Lead not in list" + } + ] + }, + { + "id": 111, + "status": "removed" + }, + { + "id": 112, + "status": "removed" + } + ], + "success": true + }, + "status": 200 + }, + "status": 200 + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer Incorrect_token", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "marketo_static_list" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request Failed for Marketo Static List, Access token invalid (Retryable).during Marketo Static List Response Handling", + "destinationResponse": { + "response": { + "requestId": "68d8#1846058ee27", + "success": false, + "errors": [ + { + "code": "601", + "message": "Access token invalid" + } + ] + }, + "status": 200 + }, + "statTags": { + "destType": "MARKETO_STATIC_LIST", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer token", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "action": "createOrUpdate", + "input": [ + { + "City": "Tokyo", + "Country": "JP", + "Email": "gabi29@gmail.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328328, + "userId": "gabi_userId_45" + } + ], + "lookupField": "id" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "marketo_static_list" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "requestId": "12d3c#1846057dce2", + "success": true, + "result": [ + { + "id": 1, + "status": "added" + }, + { + "id": 2, + "status": "added" + } + ] + }, + "status": 200 + } + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer token", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "FORM": {}, + "JSON": { + "action": "createOrUpdate", + "input": [ + { + "City": "Tokyo", + "Country": "JP", + "Email": "gabi29@gmail.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328328, + "userId": "gabi_userId_45" + }, + { + "City": "Tokyo", + "Country": "JP", + "Email": "b@s.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328329, + "userId": "ben_userId_45" + } + ], + "lookupField": "id" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {} + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "destinationResponse": "", + "message": "Request failed during: during Marketo Static List Response Handling, error: [{\"code\":\"1004\",\"message\":\"Lead not found\"}]", + "statTags": { + "destType": "MARKETO_STATIC_LIST", + "errorCategory": "dataValidation", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "instrumentation", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "status": 400 + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer token", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "FORM": {}, + "JSON": { + "action": "createOrUpdate", + "input": [ + { + "City": "Tokyo", + "Country": "JP", + "Email": "gabi29@gmail.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328328, + "userId": "gabi_userId_45" + }, + { + "City": "Tokyo", + "Country": "JP", + "Email": "b@s.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328329, + "userId": "ben_userId_45" + } + ], + "lookupField": "id" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {} + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "requestId": "12d3c#1846057dce2", + "result": { + "id": 5, + "status": "skipped", + "reasons": [ + { + "code": "1015", + "message": "Lead not in list" + } + ] + }, + "success": true + }, + "status": 200 + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/marketo_static_list/network.ts b/test/integrations/destinations/marketo_static_list/network.ts index c369e1af26..5c13273859 100644 --- a/test/integrations/destinations/marketo_static_list/network.ts +++ b/test/integrations/destinations/marketo_static_list/network.ts @@ -1,3 +1,182 @@ +const deliveryCallsData = [ + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + params: { destination: 'marketo_static_list' }, + headers: { + Authorization: 'Bearer Incorrect_token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: 'b6d1#18a8d2c10e7', + result: [ + { id: 110, status: 'skipped', reasons: [{ code: '1015', message: 'Lead not in list' }] }, + { id: 111, status: 'removed' }, + { id: 112, status: 'removed' }, + ], + success: true, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + params: { destination: 'marketo_static_list' }, + headers: { + Authorization: 'Bearer Incorrect_token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '68d8#1846058ee27', + success: false, + errors: [{ code: '601', message: 'Access token invalid' }], + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + params: { destination: 'marketo_static_list' }, + headers: { + Authorization: 'Bearer token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '12d3c#1846057dce2', + result: [ + { id: 1, status: 'added' }, + { id: 2, status: 'added' }, + ], + success: true, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + { + City: 'Tokyo', + Country: 'JP', + Email: 'b@s.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328329, + userId: 'ben_userId_45', + }, + ], + lookupField: 'id', + }, + params: {}, + headers: { + Authorization: 'Bearer token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '12d3c#1846057dce2', + result: [ + { id: 1, status: 'added' }, + { id: 4, status: 'skipped', reasons: [{ code: '1004', message: 'Lead not found' }] }, + ], + success: true, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + { + City: 'Tokyo', + Country: 'JP', + Email: 'b@s.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328329, + userId: 'ben_userId_45', + }, + ], + lookupField: 'id', + }, + params: {}, + headers: { + Authorization: 'Bearer token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '12d3c#1846057dce2', + result: { + id: 5, + status: 'skipped', + reasons: [{ code: '1015', message: 'Lead not in list' }], + }, + success: true, + }, + status: 200, + }, + }, +]; export const networkCallsData = [ { httpReq: { @@ -19,4 +198,5 @@ export const networkCallsData = [ status: 200, }, }, + ...deliveryCallsData, ]; diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts new file mode 100644 index 0000000000..2ed5625fe8 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts @@ -0,0 +1,222 @@ +export const data = [ + { + "name": "snapchat_custom_audience", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer abcd123", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "snapchat_custom_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "request_status": "SUCCESS", + "request_id": "12345", + "users": [ + { + "sub_request_status": "SUCCESS", + "user": { + "number_uploaded_users": 1 + } + } + ] + }, + "status": 200 + } + } + } + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/456/users", + "headers": { + "Authorization": "Bearer abcd123", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "snapchat_custom_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "destinationResponse": { + "response": "unauthorized", + "status": 401 + }, + "message": "Failed with unauthorized during snapchat_custom_audience response transformation", + "statTags": { + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "authErrorCategory": "REFRESH_TOKEN" + } + } + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/789/users", + "headers": { + "Authorization": "Bearer abcd123", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "users": [ + { + "id": "123456", + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "snapchat_custom_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "authErrorCategory": "AUTH_STATUS_INACTIVE", + "status": 400, + "destinationResponse": { + "response": { + "request_status": "ERROR", + "request_id": "98e2a602-3cf4-4596-a8f9-7f034161f89a", + "debug_message": "Caller does not have permission", + "display_message": "We're sorry, but the requested resource is not available at this time", + "error_code": "E3002" + }, + "status": 403 + }, + "message": "undefined during snapchat_custom_audience response transformation", + "statTags": { + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/snapchat_custom_audience/network.ts b/test/integrations/destinations/snapchat_custom_audience/network.ts new file mode 100644 index 0000000000..9be134c202 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/network.ts @@ -0,0 +1,84 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://adsapi.snapchat.com/v1/segments/123/users', + data: { + users: [ + { + schema: ['EMAIL_SHA256'], + data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], + }, + ], + }, + params: { destination: 'snapchat_custom_audience' }, + headers: { + Authorization: 'Bearer abcd123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + request_status: 'SUCCESS', + request_id: '12345', + users: [{ sub_request_status: 'SUCCESS', user: { number_uploaded_users: 1 } }], + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://adsapi.snapchat.com/v1/segments/456/users', + data: { + users: [ + { + schema: ['EMAIL_SHA256'], + data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], + }, + ], + }, + params: { destination: 'snapchat_custom_audience' }, + headers: { + Authorization: 'Bearer abcd123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: 'unauthorized', status: 401, statusText: 'Unauthorized' }, + }, + { + httpReq: { + url: 'https://adsapi.snapchat.com/v1/segments/789/users', + data: { + users: [ + { + id: '123456', + schema: ['EMAIL_SHA256'], + data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], + }, + ], + }, + params: { destination: 'snapchat_custom_audience' }, + headers: { + Authorization: 'Bearer abcd123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'DELETE', + }, + httpRes: { + data: { + request_status: 'ERROR', + request_id: '98e2a602-3cf4-4596-a8f9-7f034161f89a', + debug_message: 'Caller does not have permission', + display_message: "We're sorry, but the requested resource is not available at this time", + error_code: 'E3002', + }, + status: 403, + statusText: 'Forbidden', + }, + }, +]; From 3ed965d5ef96fe612e36e9dd1e6371f55fe7d276 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 26 Oct 2023 21:47:35 +0530 Subject: [PATCH 10/22] fix: move tiktok_ads data-delivery tests to component test suite Signed-off-by: Sai Sankeerth --- .../tiktok_ads/dataDelivery/data.ts | 672 ++++++++++++++++++ .../destinations/tiktok_ads/network.ts | 241 +++++++ 2 files changed, 913 insertions(+) create mode 100644 test/integrations/destinations/tiktok_ads/dataDelivery/data.ts create mode 100644 test/integrations/destinations/tiktok_ads/network.ts diff --git a/test/integrations/destinations/tiktok_ads/dataDelivery/data.ts b/test/integrations/destinations/tiktok_ads/dataDelivery/data.ts new file mode 100644 index 0000000000..810e1de475 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/dataDelivery/data.ts @@ -0,0 +1,672 @@ +import { AxiosError } from 'axios'; +import MockAxiosAdapter from 'axios-mock-adapter'; +import lodash from 'lodash'; + +export const data = [ + { + name: 'tiktok_ads', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'successResponse', + }, + 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: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[TIKTOK_ADS Response Handler] - Request Processed Successfully', + destinationResponse: { + response: { + code: 0, + message: 'OK', + }, + status: 200, + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidDataTypeResponse', + }, + 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: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Request failed with status: 40002', + destinationResponse: { + response: { + code: 40002, + message: 'Batch.0.properties.contents.0.content_id: Not a valid string', + }, + status: 200, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidPermissionsResponse', + }, + 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: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Request failed with status: 40001', + destinationResponse: { + response: { + code: 40001, + message: + 'No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account.', + }, + status: 200, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'tooManyRequests', + }, + 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: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 429, + body: { + output: { + status: 429, + message: 'Request failed with status: 40100', + destinationResponse: { + response: { + code: 40100, + message: 'Too many requests. Please retry in some time.', + }, + status: 200, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': '502-BadGateway', + }, + params: { + destination: 'tiktok_ads', + }, + 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: {}, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 502, + body: { + output: { + status: 502, + message: 'Request failed with status: 502', + destinationResponse: { + response: + '\r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
nginx
\r\n\r\n\r\n', + status: 502, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }, + params: { + destination: 'tiktok_ads', + }, + 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: {}, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: 'Request failed with status: 500', + destinationResponse: { + response: '[ECONNRESET] :: Connection reset by peer', + status: 500, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAxiosAdapter) => { + mockAdapter + .onPost( + 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + { + asymmetricMatch: (actual) => { + const expected = { + 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, // casted to string + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: 1197218, // casted to string + }, + ], + 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', + }, + }; + const isMatched = lodash.isMatch(actual, expected); + return isMatched; + }, + }, + { + asymmetricMatch: (actualHeader) => { + const isMatched = lodash.isMatch(actualHeader, { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }); + return isMatched; + }, + }, + ) + .reply((config) => { + // @ts-ignore + const err = AxiosError.from('Connection reset by peer', 'ECONNRESET', config); + return Promise.reject(err); + }); + }, + }, +]; diff --git a/test/integrations/destinations/tiktok_ads/network.ts b/test/integrations/destinations/tiktok_ads/network.ts new file mode 100644 index 0000000000..1cf0920259 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/network.ts @@ -0,0 +1,241 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + 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', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'successResponse', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { code: 0, message: 'OK' }, status: 200 }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + 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', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidDataTypeResponse', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + code: 40002, + message: 'Batch.0.properties.contents.0.content_id: Not a valid string', + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + 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', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidPermissionsResponse', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + code: 40001, + message: + 'No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account.', + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + 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', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'tooManyRequests', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { code: 40100, message: 'Too many requests. Please retry in some time.' }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + 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', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': '502-BadGateway', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: '\r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
nginx
\r\n\r\n\r\n', + status: 502, + }, + }, +]; From a6ec298bc887a91a99ac2e1a5d44953469701ff0 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 26 Oct 2023 21:51:44 +0530 Subject: [PATCH 11/22] fix: mock clone Signed-off-by: Sai Sankeerth --- test/integrations/destinations/fb/network.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/integrations/destinations/fb/network.ts b/test/integrations/destinations/fb/network.ts index 4bf870f535..07a84a7e66 100644 --- a/test/integrations/destinations/fb/network.ts +++ b/test/integrations/destinations/fb/network.ts @@ -1,3 +1,4 @@ +import { cloneDeep } from 'lodash'; import { getFormData } from '../../../../src/adapters/network'; import * as fbPixelNw from '../facebook_pixel/network'; import { data } from './dataDelivery/data'; @@ -9,8 +10,10 @@ const fbPixelTcs = data const fbpTc = fbPixelNw.networkCallsData.filter((nw) => { return nw.httpReq.url === fbendpoint; })[0]; - fbpTc.httpReq.data = getFormData(d.input.request.body.body.FORM).toString(); - return fbpTc; + const clonedFbpTc = cloneDeep(fbpTc); + const clonedFormData = cloneDeep(d.input.request.body.body.FORM); + clonedFbpTc.httpReq.data = getFormData(clonedFormData).toString(); + return clonedFbpTc; }); export const networkCallsData = [ From a877a3c069f3e50e0110a96656ef0cae5f52f6c2 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 26 Oct 2023 22:11:40 +0530 Subject: [PATCH 12/22] chore: decreasing the code-coverage to 75% Signed-off-by: Sai Sankeerth --- jest.config.js | 6 +++--- jest.default.config.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jest.config.js b/jest.config.js index 875c8f8893..412d8d2733 100644 --- a/jest.config.js +++ b/jest.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 80, - lines: 80, - statements: 80, + functions: 75, + lines: 75, + statements: 75, }, }, diff --git a/jest.default.config.js b/jest.default.config.js index 895b8aa075..fed1dcef31 100644 --- a/jest.default.config.js +++ b/jest.default.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 80, - lines: 80, - statements: 80, + functions: 75, + lines: 75, + statements: 75, }, }, From 37fb0919d2801e5cc839349d461920b20838828a Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 13:13:46 +0530 Subject: [PATCH 13/22] chore: moving am to component test suite to cover generic handler tests Signed-off-by: Sai Sankeerth --- test/integrations/component.test.ts | 2 +- .../destinations/am/dataDelivery/data.ts | 547 ++++++++ test/integrations/destinations/am/network.ts | 209 ++- test/integrations/destinations/mp/network.ts | 18 + .../salesforce/dataDelivery/data.ts | 1156 +++++++++-------- 5 files changed, 1365 insertions(+), 567 deletions(-) create mode 100644 test/integrations/destinations/am/dataDelivery/data.ts diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 364211328b..847dd4c91f 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -76,7 +76,7 @@ afterAll(async () => { let mockAdapter; if (!opts.generate || opts.generate === 'false') { // unmock already existing axios-mocking - mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'passthrough' }); + mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); const registerAxiosMocks = (axiosMocks: MockHttpCallsData[]) => { axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); }; diff --git a/test/integrations/destinations/am/dataDelivery/data.ts b/test/integrations/destinations/am/dataDelivery/data.ts new file mode 100644 index 0000000000..a4faa7e60c --- /dev/null +++ b/test/integrations/destinations/am/dataDelivery/data.ts @@ -0,0 +1,547 @@ +import { AxiosError } from 'axios'; +import MockAdapter from 'axios-mock-adapter'; +import { isMatch } from 'lodash'; + +// Note: This destination makes use of generic network handler +export const data = [ + { + name: 'am', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test1', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: + '[Generic Response Handler] Request for destination: am Processed Successfully', + destinationResponse: { + response: { + code: 200, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 1, + }, + status: 200, + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test2', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + '[Generic Response Handler] Request failed for destination am with status: 400', + destinationResponse: { + response: { + code: 400, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 0, + }, + status: 400, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test3', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + '[Generic Response Handler] Request failed for destination am with status: 400', + destinationResponse: { + response: '[ENOTFOUND] :: DNS lookup failed', + status: 400, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + mockAdapter + .onPost( + 'https://api.amplitude.com/2/httpapi/test3', + { + asymmetricMatch: (actual) => { + const expected = { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }; + const isMatched = isMatch(actual, expected); + return isMatched; + }, + }, + { + asymmetricMatch: (actual) => { + const expected = { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }; + const isMatched = isMatch(actual, expected); + return isMatched; + }, + }, + ) + .replyOnce((config) => { + // @ts-ignore + const err = AxiosError.from('DNS not found', 'ENOTFOUND', config); + return Promise.reject(err); + }); + }, + }, + { + name: 'am', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test4', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + '[Generic Response Handler] Request failed for destination am with status: 400', + destinationResponse: { + response: '', + status: 400, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test5', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + '[Generic Response Handler] Request failed for destination am with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test6', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + '[Generic Response Handler] Request failed for destination am with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/am/network.ts b/test/integrations/destinations/am/network.ts index 81daa29621..5cd016069c 100644 --- a/test/integrations/destinations/am/network.ts +++ b/test/integrations/destinations/am/network.ts @@ -206,4 +206,211 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; + +const deliveryNwData = [ + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test1', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + code: 200, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 1, + }, + status: 200, + statusText: 'OK', + headers: { + date: 'Sat, 11 Dec 2021 15:08:22 GMT', + 'content-type': 'application/json', + 'content-length': '93', + connection: 'keep-alive', + 'access-control-allow-origin': '*', + 'access-control-allow-methods': 'GET, POST', + 'strict-transport-security': 'max-age=15768000', + }, + }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test2', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + code: 400, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 0, + }, + status: 400, + statusText: 'Bad Request', + headers: { + date: 'Sat, 11 Dec 2021 15:08:22 GMT', + 'content-type': 'application/json', + 'content-length': '93', + connection: 'keep-alive', + 'access-control-allow-origin': '*', + 'access-control-allow-methods': 'GET, POST', + 'strict-transport-security': 'max-age=15768000', + }, + }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test4', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { status: 400, statusText: 'Bad Request' }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test5', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: {}, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test6', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: {}, + }, +]; + +export const networkCallsData = [...deleteNwData, ...deliveryNwData]; diff --git a/test/integrations/destinations/mp/network.ts b/test/integrations/destinations/mp/network.ts index a386451a21..cc5e265f43 100644 --- a/test/integrations/destinations/mp/network.ts +++ b/test/integrations/destinations/mp/network.ts @@ -1146,5 +1146,23 @@ const deleteNwData = [ }, }, }, + { + httpReq: { + method: 'post', + url: 'https://api-eu.mixpanel.com/engage', + data: [{ $distinct_id: 'rudder1', $token: 'test_token', $delete: null, $ignore_alias: true }], + headers: { + 'Content-Type': 'application/json', + Accept: 'text/plain', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': '1', + }, + }, + }, ]; export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/salesforce/dataDelivery/data.ts b/test/integrations/destinations/salesforce/dataDelivery/data.ts index 82c02c31c6..504159cc6f 100644 --- a/test/integrations/destinations/salesforce/dataDelivery/data.ts +++ b/test/integrations/destinations/salesforce/dataDelivery/data.ts @@ -1,609 +1,634 @@ - import { AxiosError } from 'axios'; import MockAdapter from 'axios-mock-adapter'; export const data = [ { - "name": "salesforce", - "description": "Test 0", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 200, - "body": { - "output": { - "status": 200, - "message": "Request for destination: salesforce Processed Successfully", - "destinationResponse": { - "response": { - "statusText": "No Content" + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Request for destination: salesforce Processed Successfully', + destinationResponse: { + response: { + statusText: 'No Content', }, - "status": 204, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - } - } - } - } - } + status: 204, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + }, + }, + }, + }, }, { - "name": "salesforce", - "description": "Test 1", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 500, - "body": { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"INVALID_SESSION_ID\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": [ + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to "INVALID_SESSION_ID", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: [ { - "message": "Session expired or invalid", - "errorCode": "INVALID_SESSION_ID" - } + message: 'Session expired or invalid', + errorCode: 'INVALID_SESSION_ID', + }, ], - "status": 401, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + status: 401, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, }, { - "name": "salesforce", - "description": "Test 2", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer Incorrect_token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer Incorrect_token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 400, - "body": { - "output": { - "status": 400, - "message": "Salesforce Request Failed: \"401\" due to \"INVALID_HEADER_TYPE\", (Aborted) during Salesforce Response Handling", - "destinationResponse": { - "response": [ + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + 'Salesforce Request Failed: "401" due to "INVALID_HEADER_TYPE", (Aborted) during Salesforce Response Handling', + destinationResponse: { + response: [ { - "message": "INVALID_HEADER_TYPE", - "errorCode": "INVALID_AUTH_HEADER" - } + message: 'INVALID_HEADER_TYPE', + errorCode: 'INVALID_AUTH_HEADER', + }, ], - "status": 401, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + status: 401, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, }, { - "name": "salesforce", - "description": "Test 3", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 429, - "body": { - "output": { - "status": 429, - "message": "Salesforce Request Failed - due to \"REQUEST_LIMIT_EXCEEDED\", (Throttled) during Salesforce Response Handling", - "destinationResponse": { - "response": [ + output: { + response: { + status: 429, + body: { + output: { + status: 429, + message: + 'Salesforce Request Failed - due to "REQUEST_LIMIT_EXCEEDED", (Throttled) during Salesforce Response Handling', + destinationResponse: { + response: [ { - "message": "Request limit exceeded", - "errorCode": "REQUEST_LIMIT_EXCEEDED" - } + message: 'Request limit exceeded', + errorCode: 'REQUEST_LIMIT_EXCEEDED', + }, ], - "status": 403, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "throttled", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + status: 403, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, }, { - "name": "salesforce", - "description": "Test 4", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 500, - "body": { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"Server Unavailable\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": [ + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to "Server Unavailable", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: [ { - "message": "Server Unavailable", - "errorCode": "SERVER_UNAVAILABLE" - } + message: 'Server Unavailable', + errorCode: 'SERVER_UNAVAILABLE', + }, ], - "status": 503, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + status: 503, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, }, { - "name": "salesforce", - "description": "Test 5", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 400, - "body": { - "output": { - "status": 400, - "message": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) during Salesforce Response Handling", - "destinationResponse": { - "response": { - "error": "invalid_grant", - "error_description": "authentication failure" + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) during Salesforce Response Handling', + destinationResponse: { + response: { + error: 'invalid_grant', + error_description: 'authentication failure', }, - "status": 400, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - } - } - } + status: 400, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, }, { - "name": "salesforce", - "description": "Test 6", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 6', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, }, - "output": { - "response": { - "status": 500, - "body": { - "output": { - "destinationResponse": { - "response": { - "errorCode": "SERVER_UNAVAILABLE", - "message": "Server Unavailable" + output: { + response: { + status: 500, + body: { + output: { + destinationResponse: { + response: { + errorCode: 'SERVER_UNAVAILABLE', + message: 'Server Unavailable', }, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, }, - "status": 503 - }, - "message": "Salesforce Request Failed - due to \"{\"message\":\"Server Unavailable\",\"errorCode\":\"SERVER_UNAVAILABLE\"}\", (Retryable) during Salesforce Response Handling", - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - }, - "status": 500 - } - } - } - } + status: 503, + }, + message: + 'Salesforce Request Failed - due to "{"message":"Server Unavailable","errorCode":"SERVER_UNAVAILABLE"}", (Retryable) during Salesforce Response Handling', + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + status: 500, + }, + }, + }, + }, }, { - "name": "salesforce", - "description": "Test 7", - "feature": "dataDelivery", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": { - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "body": { - "JSON": { - "Planning_Categories__c": "pc", - "External_ID__c": 123 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } + name: 'salesforce', + description: 'Test 7', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + method: 'POST', + endpoint: + 'https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + body: { + JSON: { + Planning_Categories__c: 'pc', + External_ID__c: 123, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, }, - "method": "POST" - } + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Request for destination: salesforce Processed Successfully', + destinationResponse: { + response: { + searchRecords: [ + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA', + }, + Id: 'a0J75100002w97gEAA', + External_ID__c: 'external_id', + }, + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI', + }, + Id: 'a0J75200002w9ZsEAI', + External_ID__c: 'external_id TEST', + }, + ], + }, + status: 200, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + }, + }, + }, }, - "output": { - "response": { - "status": 200, - "body": { - "output": { - "status": 200, - "message": "Request for destination: salesforce Processed Successfully", - "destinationResponse": { - "response": {"searchRecords":[{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA"},"Id":"a0J75100002w97gEAA","External_ID__c":"external_id"},{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI"},"Id":"a0J75200002w9ZsEAI","External_ID__c":"external_id TEST"}]}, - "status": 200, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - } - } - } - } - } }, { name: 'salesforce', @@ -700,7 +725,7 @@ export const data = [ Accept: 'application/json, text/plain, */*', }, ) - .abortRequestOnce(); + .abortRequest(); }, }, { @@ -797,11 +822,12 @@ export const data = [ 'User-Agent': 'RudderLabs', Accept: 'application/json, text/plain, */*', }, - ).replyOnce((config) => { - // @ts-ignore - const err = AxiosError.from('DNS not found', 'EAI_AGAIN', config) - return Promise.reject(err); + ) + .reply((config) => { + // @ts-ignore + const err = AxiosError.from('DNS not found', 'EAI_AGAIN', config); + return Promise.reject(err); }); }, }, -] \ No newline at end of file +]; From d53eec9f2939ecd63ec55032d61568f4a907b147 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 13:38:36 +0530 Subject: [PATCH 14/22] chore: remove proxy.test Signed-off-by: Sai Sankeerth --- test/__tests__/proxy.test.ts | 96 ------------------------------------ 1 file changed, 96 deletions(-) delete mode 100644 test/__tests__/proxy.test.ts diff --git a/test/__tests__/proxy.test.ts b/test/__tests__/proxy.test.ts deleted file mode 100644 index dabc84bab9..0000000000 --- a/test/__tests__/proxy.test.ts +++ /dev/null @@ -1,96 +0,0 @@ -const name = 'Proxy'; -import fs, { appendFileSync } from 'fs'; -import path, { join } from 'path'; -import request from 'supertest'; -import { createHttpTerminator } from 'http-terminator'; -import { mockedAxiosClient } from '../__mocks__/network'; -import Koa from 'koa'; -import bodyParser from 'koa-bodyparser'; -import { applicationRoutes } from '../../src/routes'; -import { responses } from '../testHelper'; - -let server: any; -const OLD_ENV = process.env; - -beforeAll(async () => { - process.env = { ...OLD_ENV }; // Make a copy - const app = new Koa(); - app.use( - bodyParser({ - jsonLimit: '200mb', - }), - ); - applicationRoutes(app); - server = app.listen(9090); -}); - -afterAll(async () => { - process.env = OLD_ENV; // Restore old environment - const httpTerminator = createHttpTerminator({ - server, - }); - await httpTerminator.terminate(); -}); - -jest.mock('axios', () => jest.fn(mockedAxiosClient)); - -const version = '1'; -const destinations = [ - 'tiktok_ads' -]; - -// start of generic tests -const inputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/proxy_input.json`)); -const outputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/proxy_output.json`)); -const inputData = JSON.parse(inputDataFile.toString()); -const expectedData = JSON.parse(outputDataFile.toString()); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload - ${index}`, async () => { - const response = await request(server) - .post(`/${version}/destinations/any/proxy`) - .set('Accept', 'application/json') - .send(input); - expect(response.body).toEqual(expectedData[index]); - }); -}); -// end of generic tests - -// destination tests start -destinations.forEach((destination) => { - const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${destination}_proxy_input.json`), - ); - const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${destination}_proxy_output.json`), - ); - const inputData = JSON.parse(inputDataFile.toString()); - const expectedData = JSON.parse(outputDataFile.toString()); - - describe(`Proxy Test for ${destination}`, () => { - inputData.forEach((input, index) => { - it(`${name} Tests: ${destination} - Payload ${index}`, async () => { - const response = await request(server) - .post(`/${version}/destinations/${destination}/proxy`) - .set('Accept', 'application/json') - .send(input); - expect(response.body).toEqual(expectedData[index]); - }); - }); - afterAll(() => { - if (process.env.GEN_AXIOS_FOR_TESTS === 'true') { - const callsDataStr = responses.join('\n'); - const calls = ` - export const networkCallsData = [ - ${callsDataStr} - ] - `; - appendFileSync( - join(__dirname, '..', 'integrations', 'destinations', destination, 'network.ts'), - calls, - ); - } - }); - }); -}); -// destination tests end From ce25191f4b614a6fd78cf7f0db2c0fc10c778b9c Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 16:56:08 +0530 Subject: [PATCH 15/22] chore: clean-up braze mocks, un-comment twitter_ads processor test-cases Signed-off-by: Sai Sankeerth --- .../destinations/braze/network.ts | 24 - .../twitter_ads/processor/data.ts | 1788 +++++++++-------- 2 files changed, 905 insertions(+), 907 deletions(-) diff --git a/test/integrations/destinations/braze/network.ts b/test/integrations/destinations/braze/network.ts index b907ce48c9..1c39a247e4 100644 --- a/test/integrations/destinations/braze/network.ts +++ b/test/integrations/destinations/braze/network.ts @@ -1,5 +1,3 @@ -import { AxiosError } from "axios"; - const dataDeliveryMocksData = [ { httpReq: { @@ -180,28 +178,6 @@ const dataDeliveryMocksData = [ }, httpRes: {}, }, - // { - // httpReq: { - // url: 'https://rest.iad-03.braze.com/users/identify/test6', - // data: { - // aliases_to_identify: [ - // { - // external_id: 'gabi_userId_45', - // user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, - // }, - // ], - // }, - // params: { destination: 'braze' }, - // headers: { - // Accept: 'application/json', - // Authorization: 'Bearer api_key', - // 'Content-Type': 'application/json', - // 'User-Agent': 'RudderLabs', - // }, - // method: 'POST', - // }, - // httpRes: AxiosError.from('DNS not found', 'ENOTFOUND'), - // }, { httpReq: { url: 'https://rest.iad-03.braze.com/users/identify/test7', diff --git a/test/integrations/destinations/twitter_ads/processor/data.ts b/test/integrations/destinations/twitter_ads/processor/data.ts index 37bee1ced5..b6a7512880 100644 --- a/test/integrations/destinations/twitter_ads/processor/data.ts +++ b/test/integrations/destinations/twitter_ads/processor/data.ts @@ -1,884 +1,906 @@ +const authHeaderConstant = + 'OAuth oauth_consumer_key="qwe", oauth_nonce="V1kMh028kZLLhfeYozuL0B45Pcx6LvuW", oauth_signature="Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1685603652", oauth_token="dummyAccessToken", oauth_version="1.0"'; + export const data = [ - // { - // "name": "twitter_ads", - // "description": "Test 0", - // "feature": "processor", - // "module": "destination", - // "version": "v0", - // "input": { - // "request": { - // "body": [ - // { - // "message": { - // "type": "track", - // "event": "ABC Searched", - // "channel": "web", - // "context": { - // "source": "test", - // "userAgent": "chrome", - // "traits": { - // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - // "email": "abc@gmail.com", - // "phone": "+1234589947", - // "ge": "male", - // "db": "19950715", - // "lastname": "Rudderlabs", - // "firstName": "Test", - // "address": { - // "city": "Kolkata", - // "state": "WB", - // "zip": "700114", - // "country": "IN" - // } - // }, - // "device": { - // "advertisingId": "abc123" - // }, - // "library": { - // "name": "rudder-sdk-ruby-sync", - // "version": "1.0.6" - // } - // }, - // "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - // "timestamp": "2020-08-14T05:30:30.118Z", - // "properties": { - // "conversionTime": "2023-06-01T06:03:08.739Z", - // "tax": 2, - // "total": 27.5, - // "coupon": "hasbros", - // "revenue": 48, - // "price": 25, - // "quantity": 2, - // "currency": "USD", - // "priceCurrency": "USD", - // "conversionId": "213123", - // "numberItems": "2323", - // "phone": "+919927455678", - // "twclid": "543", - // "shipping": 3, - // "subtotal": 22.5, - // "affiliation": "Google Store", - // "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - // "email": "abc@ax.com", - // "contents": [ - // { - // "price": "123.3345", - // "quantity": "12", - // "id": "12" - // }, - // { - // "price": 200, - // "quantity": 11, - // "id": "4" - // } - // ] - // }, - // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - // "integrations": { - // "All": true - // } - // }, - // "metadata": { - // "secret": { - // "consumerKey": "qwe", - // "consumerSecret": "fdghv", - // "accessToken": "dummyAccessToken", - // "accessTokenSecret": "testAccessTokenSecret" - // } - // }, - // "destination": { - // "Config": { - // "pixelId": "dummyPixelId", - // "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - // "twitterAdsEventNames": [ - // { - // "rudderEventName": "ABC Searched", - // "twitterEventId": "tw-234234324234" - // }, - // { - // "rudderEventName": "Home Page Viewed", - // "twitterEventId": "tw-odt2o-odt2q" - // } - // ] - // } - // } - // } - // ] - // } - // }, - // "output": { - // "response": { - // "status": 200, - // "body": [ - // { - // "output": { - // "version": "1", - // "type": "REST", - // "method": "POST", - // "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - // "headers": { - // "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"AIpyKJTrfbJjxbmco3D9QaB3kme3zpqM\", oauth_signature=\"%2FittnOIKSEcuEusb2q8SDs3%2FB9g%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1697616446\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", - // "Content-Type": "application/json" - // }, - // "params": {}, - // "body": { - // "JSON": { - // "conversions": [ - // { - // "conversion_time": "2023-06-01T06:03:08.739Z", - // "number_items": 2, - // "price_currency": "USD", - // "value": "25", - // "conversion_id": "213123", - // "contents": [ - // { - // "content_id": "12", - // "content_price": 123.3345, - // "num_items": 12 - // }, - // { - // "content_id": "4", - // "content_price": 200, - // "num_items": 11 - // } - // ], - // "event_id": "tw-234234324234", - // "identifiers": [ - // { - // "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - // }, - // { - // "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - // }, - // { - // "twclid": "543" - // } - // ] - // } - // ] - // }, - // "JSON_ARRAY": {}, - // "XML": {}, - // "FORM": {} - // }, - // "files": {}, - // "userId": "" - // }, - // "metadata": { - // "secret": { - // "consumerKey": "qwe", - // "consumerSecret": "fdghv", - // "accessToken": "dummyAccessToken", - // "accessTokenSecret": "testAccessTokenSecret" - // } - // }, - // "statusCode": 200 - // } - // ] - // } - // } - // }, - { - "name": "twitter_ads", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "track", - "event": "Home Page Viewed", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "conversionTime": "2023-06-01T06:03:08.739Z", - "eventId": "429047995", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-2dfsdf" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "statusCode": 400, - "error": "[TWITTER ADS]: one of twclid, phone or email must be present in properties.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "TWITTER_ADS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - // { - // "name": "twitter_ads", - // "description": "Test 2", - // "feature": "processor", - // "module": "destination", - // "version": "v0", - // "input": { - // "request": { - // "body": [ - // { - // "message": { - // "type": "track", - // "event": "Home Page Viewed", - // "channel": "web", - // "context": { - // "source": "test", - // "userAgent": "chrome", - // "traits": { - // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - // "email": "abc@gmail.com", - // "phone": "+1234589947", - // "ge": "male", - // "db": "19950715", - // "lastname": "Rudderlabs", - // "firstName": "Test", - // "address": { - // "city": "Kolkata", - // "state": "WB", - // "zip": "700114", - // "country": "IN" - // } - // }, - // "device": { - // "advertisingId": "abc123" - // }, - // "library": { - // "name": "rudder-sdk-ruby-sync", - // "version": "1.0.6" - // } - // }, - // "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - // "timestamp": "2020-08-14T05:30:30.118Z", - // "properties": { - // "pixelId": "dummyPixelId", - // "conversionTime": "2023-06-01T06:03:08.739Z", - // "eventId": "429047995", - // "tax": 2, - // "total": 27.5, - // "coupon": "hasbros", - // "revenue": 48, - // "price": 25.55, - // "quantity": 2, - // "currency": "USD", - // "priceCurrency": "USD", - // "conversionId": "213123", - // "numberItems": "2323", - // "phone": "+919927455678", - // "twclid": "543", - // "shipping": 3, - // "subtotal": 22.5, - // "affiliation": "Google Store", - // "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - // "email": "abc@ax.com" - // }, - // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - // "integrations": { - // "All": true - // } - // }, - // "metadata": { - // "secret": { - // "consumerKey": "qwe", - // "consumerSecret": "fdghv", - // "accessToken": "dummyAccessToken", - // "accessTokenSecret": "testAccessTokenSecret" - // } - // }, - // "destination": { - // "Config": { - // "pixelId": "dummyPixelId", - // "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - // "twitterAdsEventNames": [ - // { - // "rudderEventName": "ABC Searched", - // "twitterEventId": "tw-234234324234" - // }, - // { - // "rudderEventName": "Home Page Viewed", - // "twitterEventId": "tw-324fdsf" - // } - // ] - // } - // } - // } - // ] - // } - // }, - // "output": { - // "response": { - // "status": 200, - // "body": [ - // { - // "output": { - // "version": "1", - // "type": "REST", - // "method": "POST", - // "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - // "headers": { - // "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"4W3xnD3XFzayC0AT3a0XVRilPM8CpKM7\", oauth_signature=\"yKi8WAgZne2wnn5obJ9EjmmPbMY%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1697616446\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", "Content-Type": "application/json" - // }, - // "params": {}, - // "body": { - // "JSON": { - // "conversions": [ - // { - // "event_id": "429047995", - // "conversion_time": "2023-06-01T06:03:08.739Z", - // "number_items": 2, - // "price_currency": "USD", - // "value": "25.55", - // "conversion_id": "213123", - // "identifiers": [ - // { - // "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - // }, - // { - // "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - // }, - // { - // "twclid": "543" - // } - // ] - // } - // ] - // }, - // "JSON_ARRAY": {}, - // "XML": {}, - // "FORM": {} - // }, - // "files": {}, - // "userId": "" - // }, - // "metadata": { - // "secret": { - // "consumerKey": "qwe", - // "consumerSecret": "fdghv", - // "accessToken": "dummyAccessToken", - // "accessTokenSecret": "testAccessTokenSecret" - // } - // }, - // "statusCode": 200 - // } - // ] - // } - // } - // }, - { - "name": "twitter_ads", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "track", - "event": "Home Page", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "statusCode": 400, - "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "TWITTER_ADS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "twitter_ads", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "track", - "event": "Home Page", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": " ", - "twitterEventId": "tw-324fdsf" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "statusCode": 400, - "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "TWITTER_ADS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - // { - // "name": "twitter_ads", - // "description": "Test 5", - // "feature": "processor", - // "module": "destination", - // "version": "v0", - // "input": { - // "request": { - // "body": [ - // { - // "message": { - // "type": "track", - // "event": "Home Page Viewed", - // "channel": "web", - // "context": { - // "source": "test", - // "userAgent": "chrome", - // "traits": { - // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - // "email": "abc@gmail.com", - // "phone": "+1234589947", - // "ge": "male", - // "db": "19950715", - // "lastname": "Rudderlabs", - // "firstName": "Test", - // "address": { - // "city": "Kolkata", - // "state": "WB", - // "zip": "700114", - // "country": "IN" - // } - // }, - // "device": { - // "advertisingId": "abc123" - // }, - // "library": { - // "name": "rudder-sdk-ruby-sync", - // "version": "1.0.6" - // } - // }, - // "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - // "timestamp": "2020-08-14T05:30:30.118Z", - // "properties": { - // "conversionTime": "2023-06-01T06:03:08.739Z", - // "tax": 2, - // "total": 27.5, - // "coupon": "hasbros", - // "revenue": 48, - // "price": 25, - // "quantity": 2, - // "currency": "USD", - // "priceCurrency": "USD", - // "conversionId": "213123", - // "numberItems": "2323", - // "phone": "+919927455678", - // "twclid": "543", - // "shipping": 3, - // "subtotal": 22.5, - // "affiliation": "Google Store", - // "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - // "email": "abc@ax.com", - // "contents": [ - // { - // "price": "123.3345", - // "quantity": "12", - // "id": "12" - // }, - // { - // "price": 200, - // "quantity": 11, - // "id": "4" - // } - // ] - // }, - // "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - // "integrations": { - // "All": true - // } - // }, - // "metadata": { - // "secret": { - // "consumerKey": "qwe", - // "consumerSecret": "fdghv", - // "accessToken": "dummyAccessToken", - // "accessTokenSecret": "testAccessTokenSecret" - // } - // }, - // "destination": { - // "Config": { - // "pixelId": "dummyPixelId", - // "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - // "twitterAdsEventNames": [ - // { - // "rudderEventName": "ABC Searched", - // "twitterEventId": "tw-234234324234" - // }, - // { - // "rudderEventName": "Home Page Viewed", - // "twitterEventId": "tw-odt2o-odt2q" - // } - // ] - // } - // } - // } - // ] - // } - // }, - // "output": { - // "response": { - // "status": 200, - // "body": [ - // { - // "output": { - // "version": "1", - // "type": "REST", - // "method": "POST", - // "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - // "headers": { - // "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"jQ28zo1HQQv0ADTx3jbOMYfdE6J1aciC\", oauth_signature=\"INJr%2BF4v4UQJtTtztE2l%2F%2FPO6oE%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1697616446\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", "Content-Type": "application/json" - // }, - // "params": {}, - // "body": { - // "JSON": { - // "conversions": [ - // { - // "conversion_time": "2023-06-01T06:03:08.739Z", - // "number_items": 2, - // "price_currency": "USD", - // "value": "25", - // "conversion_id": "213123", - // "contents": [ - // { - // "content_id": "12", - // "content_price": 123.3345, - // "num_items": 12 - // }, - // { - // "content_id": "4", - // "content_price": 200, - // "num_items": 11 - // } - // ], - // "event_id": "tw-odt2o-odt2q", - // "identifiers": [ - // { - // "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - // }, - // { - // "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - // }, - // { - // "twclid": "543" - // } - // ] - // } - // ] - // }, - // "JSON_ARRAY": {}, - // "XML": {}, - // "FORM": {} - // }, - // "files": {}, - // "userId": "" - // }, - // "metadata": { - // "secret": { - // "consumerKey": "qwe", - // "consumerSecret": "fdghv", - // "accessToken": "dummyAccessToken", - // "accessTokenSecret": "testAccessTokenSecret" - // } - // }, - // "statusCode": 200 - // } - // ] - // } - // } - // } -] \ No newline at end of file + { + name: 'twitter_ads', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + contents: [ + { + price: '123.3345', + quantity: '12', + id: '12', + }, + { + price: 200, + quantity: 11, + id: '4', + }, + ], + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2023-06-01T06:03:08.739Z', + number_items: 2, + price_currency: 'USD', + value: '25', + conversion_id: '213123', + contents: [ + { + content_id: '12', + content_price: 123.3345, + num_items: 12, + }, + { + content_id: '4', + content_price: 200, + num_items: 11, + }, + ], + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + }, + { + twclid: '543', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + conversionTime: '2023-06-01T06:03:08.739Z', + eventId: '429047995', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-2dfsdf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 400, + error: '[TWITTER ADS]: one of twclid, phone or email must be present in properties.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + pixelId: 'dummyPixelId', + conversionTime: '2023-06-01T06:03:08.739Z', + eventId: '429047995', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25.55, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-324fdsf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + event_id: '429047995', + conversion_time: '2023-06-01T06:03:08.739Z', + number_items: 2, + price_currency: 'USD', + value: '25.55', + conversion_id: '213123', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + }, + { + twclid: '543', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + pixelId: 'dummyPixelId', + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-324fdsf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 400, + error: + "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + pixelId: 'dummyPixelId', + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: ' ', + twitterEventId: 'tw-324fdsf', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-324fdsf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 400, + error: + "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + contents: [ + { + price: '123.3345', + quantity: '12', + id: '12', + }, + { + price: 200, + quantity: 11, + id: '4', + }, + ], + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2023-06-01T06:03:08.739Z', + number_items: 2, + price_currency: 'USD', + value: '25', + conversion_id: '213123', + contents: [ + { + content_id: '12', + content_price: 123.3345, + num_items: 12, + }, + { + content_id: '4', + content_price: 200, + num_items: 11, + }, + ], + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + }, + { + twclid: '543', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: (_) => { + jest.mock('../../../../../src/v0/destinations/twitter_ads/util', () => ({ + getAuthHeaderForRequest: (_a, _b) => { + return { Authorization: authHeaderConstant }; + }, + })); + }, +})); From d118c34a2a19e3f35b13a5f502bd649c944ea17c Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 18:27:23 +0530 Subject: [PATCH 16/22] chore: add router component tests for tiktok offline events Signed-off-by: Sai Sankeerth --- .../tiktok_ads_offline_events/router/data.ts | 416 ++++++++++++++++++ 1 file changed, 416 insertions(+) create mode 100644 test/integrations/destinations/tiktok_ads_offline_events/router/data.ts diff --git a/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts new file mode 100644 index 0000000000..c479da741b --- /dev/null +++ b/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts @@ -0,0 +1,416 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'tiktok_ads_offline_events', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + 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', + }, + }, + ], + destType: 'tiktok_ads_offline_events', + }, + }, + }, + output: { + response: { + status: 200, + body: { + 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, + }, + ], + }, + }, + }, + }, + { + name: 'tiktok_ads_offline_events', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + 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', + }, + }, + ], + destType: 'tiktok_ads_offline_events', + }, + }, + }, + output: { + response: { + status: 200, + body: { + 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: '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, + }, + ], + }, + }, + }, + }, + { + name: 'tiktok_ads_offline_events', + description: 'Test 2', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + 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', + }, + }, + ], + destType: 'tiktok_ads_offline_events', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + batched: false, + error: 'Event name is required', + metadata: [ + { + jobId: 4, + }, + ], + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TIKTOK_ADS_OFFLINE_EVENTS', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + }, +]; From 012635cc434adb46f761413f38c191310f47f7b3 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 18:39:33 +0530 Subject: [PATCH 17/22] fix: salesforce router test-case format for router component tests Signed-off-by: Sai Sankeerth --- .../destinations/salesforce/router/data.ts | 870 +++++++++++------- 1 file changed, 550 insertions(+), 320 deletions(-) diff --git a/test/integrations/destinations/salesforce/router/data.ts b/test/integrations/destinations/salesforce/router/data.ts index c45a50116b..8c36d3a785 100644 --- a/test/integrations/destinations/salesforce/router/data.ts +++ b/test/integrations/destinations/salesforce/router/data.ts @@ -1,170 +1,372 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + export const data = [ { name: 'salesforce', description: 'Test 0', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - 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', + body: { + 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', }, - email: 'peter.gibbons@initech.com', - name: 'Peter Gibbons', - phone: '570-690-4150', - rating: 'Hot', - title: 'VP of Derp', + 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, }, - 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', + 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', }, - integrations: { - All: true, + 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: [], }, - 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, + ], + destType: 'salesforce', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + 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: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + 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: [], + }, }, - destination: { - Config: { - initialAccessToken: 'dummyInitialAccessToken', - password: 'dummyPassword1', - userName: 'testsalesforce1453@gmail.com', + ], + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + 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: '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', }, - DestinationDefinition: { - DisplayName: 'Salesforce', - ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', - Name: 'SALESFORCE', + 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: [], }, - Enabled: true, - ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', - Name: 'tst', - Transformations: [], }, - }, - ], + ], + destType: 'salesforce', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - metadata: { - jobId: 1, - }, - statusCode: 200, - 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: {}, + body: { + output: [ + { + 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: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + 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: [], }, - files: {}, - userId: '', }, - }, - ], + ], + }, }, }, }, { name: 'salesforce', - description: 'Test 1', - feature: 'processor', + description: 'Test 2', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - 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, + body: { + 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, + }, + 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', @@ -176,229 +378,257 @@ export const data = [ street: '19123 forest lane', postalCode: '94115', }, - email: 'ddv_ua+{{1234*245}}@bugFix.com', + 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', + 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', }, - integrations: { - All: true, + metadata: { + jobId: 3, }, - 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', + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], }, - Enabled: true, - ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', - Name: 'tst', - Transformations: [], }, - }, - ], + ], + destType: 'salesforce', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - metadata: { - jobId: 2, - }, - statusCode: 200, - output: { - 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: {}, + body: { + 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: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + 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: [], }, - files: {}, - userId: '', }, - }, - ], + ], + }, }, }, }, { name: 'salesforce', - description: 'Test 2', - feature: 'processor', + description: 'Test 3', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - 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', + body: { + input: [ + { + 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, }, - 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', + metadata: { + jobId: 4, }, - DestinationDefinition: { - DisplayName: 'Salesforce', - ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', - Name: 'SALESFORCE', + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], }, - Enabled: true, - ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', - Name: 'tst', - Transformations: [], }, - }, - ], + ], + destType: 'salesforce', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - metadata: { - jobId: 3, - }, - statusCode: 200, - output: { - userId: '', - 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', + body: { + 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: {}, + statusCode: 200, }, - 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: {}, + metadata: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + 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: [], }, - files: {}, }, - }, - ], + ], + }, }, }, }, From e0594ad6cc969b24751ab95fb7517f3fed1bfedc Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 18:54:29 +0530 Subject: [PATCH 18/22] fix: tiktok_ads router test-case format in component tests Signed-off-by: Sai Sankeerth --- .../destinations/tiktok_ads/router/data.ts | 1413 ++++++++--------- 1 file changed, 665 insertions(+), 748 deletions(-) diff --git a/test/integrations/destinations/tiktok_ads/router/data.ts b/test/integrations/destinations/tiktok_ads/router/data.ts index be2e2b1914..60bb5628ca 100644 --- a/test/integrations/destinations/tiktok_ads/router/data.ts +++ b/test/integrations/destinations/tiktok_ads/router/data.ts @@ -1,143 +1,73 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + export const data = [ { name: 'tiktok_ads', description: 'Test 0', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - 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, + body: { + input: [ + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', context: { - ad: { - callback: '123ATXSfe', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', }, - page: { - url: 'http://demo.mywebsite.com/purchase', - referrer: 'http://demo.mywebsite.com', - }, - user: { - phone_number: - '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', - email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + 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', + }, + ], }, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - metadata: { - jobId: 5, - }, - destination: { - Config: { - accessToken: 'dummyAccessToken', - pixelCode: 'A1T8T4UYGVIQA8ORZMX9', - hashUserProperties: false, - }, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - 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: { - 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, - }, + 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', @@ -150,170 +80,66 @@ export const data = [ phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', - 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: {}, - userId: '', - }, - metadata: { - jobId: 5, - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'tiktok_ads', - description: 'Test 1', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - anonymousId: '21e13f4bc7ceddad', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', + integrations: { + All: true, }, - 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, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 5, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, }, - 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', + }, + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', context: { - ad: { - callback: '123ATXSfe', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', }, - page: { - url: 'http://demo.mywebsite.com/purchase', - referrer: 'http://demo.mywebsite.com', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', }, - user: { - phone_number: - '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', - email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', - }, - }, - contents: [ - { - price: 8, - quantity: 2, - content_type: 'socks', - content_id: '1077218', + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + locale: 'en-US', + ip: '13.57.97.131', + os: { + name: '', + version: '', }, - { - price: 30, - quantity: 1, - content_type: 'dress', - content_id: '1197218', - }, - ], - currency: 'USD', - value: 46, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - metadata: { - jobId: 1, - }, - destination: { - Config: { - accessToken: 'dummyAccessToken', - pixelCode: 'A1T8T4UYGVIQA8ORZMX9', - hashUserProperties: false, - }, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - 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: 'InitiateCheckout', - 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, + 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', @@ -326,173 +152,82 @@ export const data = [ phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', - 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: {}, - userId: '', - }, - metadata: { - jobId: 1, - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'tiktok_ads', - description: 'Test 2', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - 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', + 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, }, - userAgent: - 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', - locale: 'en-US', - ip: '13.57.97.131', - os: { - name: '', - version: '', + integrations: { + All: true, }, - screen: { - density: 2, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, }, - 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', + }, + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', context: { - ad: { - callback: '123ATXSfe', - }, - page: { - url: 'http://demo.mywebsite.com/purchase', - referrer: 'http://demo.mywebsite.com', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', }, - user: { - phone_number: - '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', - email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + 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', - }, - contents: [ - { - price: 8, - quantity: 2, - content_type: 'socks', - content_id: '1077218', + os: { + name: '', + version: '', }, - { - price: 30, - quantity: 1, - content_type: 'dress', - content_id: '1197218', - }, - ], - currency: 'USD', - value: 46, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - metadata: { - jobId: 2, - }, - destination: { - Config: { - accessToken: 'dummyAccessToken', - pixelCode: 'A1T8T4UYGVIQA8ORZMX9', - hashUserProperties: false, - }, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - 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: '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, + 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', @@ -505,173 +240,85 @@ export const data = [ phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', - external_id: - 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', }, - ip: '13.57.97.131', - user_agent: + userAgent: 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + ip: '13.57.97.131', }, - partner_name: 'RudderStack', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - metadata: { - jobId: 2, - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'tiktok_ads', - description: 'Test 3', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - 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', + 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, }, - userAgent: - 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', - locale: 'en-US', - ip: '13.57.97.131', - os: { - name: '', - version: '', + integrations: { + All: true, }, - screen: { - density: 2, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, }, - 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', + }, + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', context: { - ad: { - callback: '123ATXSfe', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', }, - page: { - url: 'http://demo.mywebsite.com/purchase', - referrer: 'http://demo.mywebsite.com', - }, - user: { - phone_number: - '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', - email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + 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', - }, - contents: [ - { - price: 8, - quantity: 2, - content_type: 'socks', - content_id: '1077218', + os: { + name: '', + version: '', }, - { - price: 30, - quantity: 1, - content_type: 'dress', - content_id: '1197218', - }, - ], - currency: 'USD', - value: 46, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - metadata: { - jobId: 4, - }, - destination: { - Config: { - accessToken: 'dummyAccessToken', - pixelCode: 'A1T8T4UYGVIQA8ORZMX9', - hashUserProperties: false, - }, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - 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: '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, + 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', @@ -684,174 +331,336 @@ export const data = [ phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', - external_id: - 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', }, - ip: '13.57.97.131', - user_agent: + userAgent: 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + ip: '13.57.97.131', }, - partner_name: 'RudderStack', + 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, }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', }, - metadata: { - jobId: 4, + ], + destType: 'tiktok_ads', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + 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, + }, + }, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, { name: 'tiktok_ads', - description: 'Test 4', - feature: 'processor', + description: 'Test 1', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - 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', + body: { + input: [ + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', context: { - ad: { - callback: '123ATXSfe', - }, - page: { - url: 'http://demo.mywebsite.com/purchase', - referrer: 'http://demo.mywebsite.com', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', }, - user: { - phone_number: '+858987675687', - email: 'sample@sample.com', + 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', - }, - contents: [ - { - price: 8, - quantity: 2, - content_type: 'socks', - content_id: '1077218', - }, - { - price: 30, - quantity: 1, - content_type: 'dress', - content_id: '1197218', + os: { + name: '', + version: '', }, - ], - currency: 'USD', - value: 46, - }, - integrations: { - All: true, - }, - sentAt: '2019-10-14T09:03:22.563Z', - }, - metadata: { - jobId: 3, - }, - destination: { - Config: { - accessToken: 'dummyAccessToken', - pixelCode: 'A1T8T4UYGVIQA8ORZMX9', - hashUserProperties: true, - }, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - 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: 'AddToWishlist', - event_id: '1616318632825_357', - timestamp: '2020-09-17T19:49:27Z', - test_event_code: 'sample rudder test_event_code', - 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, + 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', @@ -861,31 +670,139 @@ export const data = [ referrer: 'http://demo.mywebsite.com', }, user: { - phone_number: - '4443dd476f2be18201447ef046731c1a715accee4edc5192641a3b4c3ba921c7', - email: '774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa', - external_id: - '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + phone_number: '+858987675687', + email: 'sample@sample.com', }, - ip: '13.57.97.131', - user_agent: + userAgent: 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + ip: '13.57.97.131', }, - partner_name: 'RudderStack', + 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, }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', }, - metadata: { - jobId: 3, + ], + destType: 'tiktok_ads', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + 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, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, From 48303e3e3bf5bb7cfccbaacf6178ce6c021f4879 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 19:04:27 +0530 Subject: [PATCH 19/22] fix: vero, splitio router test-case format in component tests Signed-off-by: Sai Sankeerth --- .../destinations/splitio/router/data.ts | 312 ++++++----- .../destinations/vero/router/data.ts | 491 ++++++++++-------- 2 files changed, 445 insertions(+), 358 deletions(-) diff --git a/test/integrations/destinations/splitio/router/data.ts b/test/integrations/destinations/splitio/router/data.ts index 0394ea53a8..1004756812 100644 --- a/test/integrations/destinations/splitio/router/data.ts +++ b/test/integrations/destinations/splitio/router/data.ts @@ -1,191 +1,223 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + export const data = [ { name: 'splitio', description: 'Test 0', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - 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', + body: { + input: [ + { + message: { traits: { - abc: 'new-val', - key: 'key_user_0', - value: '0.93', + martin: 21.565000000000001, + trafficTypeName: 'user', + vertical: 'restaurant', + eventTypeId: 'page_load end to end', + timestamp: 1513357833000, + GMV: false, }, - library: { - name: 'http', + 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]', }, - 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', + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'abcde', + environment: 'staging', + trafficType: 'user', + }, }, }, - }, - ], + ], + destType: 'splitio', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - 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, + body: { + 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', }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', - }, - metadata: { - jobId: 1, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, { name: 'splitio', description: 'Test 1', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - message: { - traits: { - martin: 21.565, - 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', + body: { + input: [ + { + message: { traits: { - abc: 'new-val', - key: 'key_user_0', + martin: 21.565000000000001, + trafficTypeName: 'user', + eventTypeId: 'page_load end to end', + timestamp: 1513357833000, }, - library: { - name: 'http', + 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]', }, - 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', + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'abcde', + environment: 'staging', + trafficType: 'user', + }, }, }, - }, - ], + ], + destType: 'splitio', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - 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, + body: { + 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: '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', }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', - }, - metadata: { - jobId: 2, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, diff --git a/test/integrations/destinations/vero/router/data.ts b/test/integrations/destinations/vero/router/data.ts index 1c9d87ec8e..17aba359d1 100644 --- a/test/integrations/destinations/vero/router/data.ts +++ b/test/integrations/destinations/vero/router/data.ts @@ -1,311 +1,366 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + export const data = [ { name: 'vero', description: 'Test 0', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - destination: { - Config: { - authToken: 'testAuthToken', + body: { + input: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, }, - }, - metadata: { - jobId: 1, - }, - message: { - context: { - traits: { - email: 'user001@tech.com', + metadata: { + jobId: 1, + }, + message: { + context: { + traits: { + email: 'user001@tech.com', + }, }, + type: 'Identify', + userId: 'user001', }, - type: 'Identify', - userId: 'user001', }, - }, - ], + ], + destType: 'vero', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - output: { - 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', + body: { + 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', }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', - }, - metadata: { - jobId: 1, + metadata: [ + { + jobId: 1, + }, + ], + statusCode: 200, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, { name: 'vero', description: 'Test 1', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - destination: { - Config: { - authToken: 'testAuthToken', + body: { + input: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, }, - }, - metadata: { - jobId: 2, - }, - message: { - context: { - traits: { - email: 'user002@tech.com', + metadata: { + jobId: 2, + }, + message: { + context: { + traits: { + email: 'user002@tech.com', + }, }, + type: 'Identify', + anonymousId: 'b4ffheww8eisndbdjgdewifewfgerwibderv', }, - type: 'Identify', - anonymousId: 'b4ffheww8eisndbdjgdewifewfgerwibderv', }, - }, - ], + ], + destType: 'vero', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - output: { - 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', + body: { + output: [ + { + 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', }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', - }, - metadata: { - jobId: 2, + metadata: [ + { + jobId: 2, + }, + ], + statusCode: 200, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, { name: 'vero', description: 'Test 2', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - destination: { - Config: { - authToken: 'testAuthToken', - }, - }, - metadata: { - jobId: 3, - }, - message: { - context: { - traits: { - address: 'Caravela Beach Goa', - homwTown: 'Mawsynram', - email: 'user005@tech.com', + body: { + input: [ + { + destination: { + Config: { + authToken: 'testAuthToken', }, }, - integrations: { - vero: { - tags: { - add: ['a', 'b'], + 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', }, - type: 'Identify', - userId: 'fprediruser001', }, - }, - ], + ], + destType: 'vero', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - output: { - 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', + body: { + output: [ + { + 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: {}, }, - auth_token: 'testAuthToken', + files: {}, }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: '', - }, - metadata: { - jobId: 3, - }, - statusCode: 200, - }, - { - output: { - version: '1', - type: 'REST', - method: 'PUT', - endpoint: 'https://api.getvero.com/api/v2/users/tags/edit', - headers: {}, - params: {}, - body: { - JSON: { - id: 'fprediruser001', - auth_token: 'testAuthToken', - add: ['a', 'b'], + { + 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', }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', - }, - metadata: { - jobId: 3, + metadata: [ + { + jobId: 3, + }, + ], + statusCode: 200, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, { name: 'vero', description: 'Test 3', - feature: 'processor', + feature: FEATURES.ROUTER, module: 'destination', version: 'v0', input: { request: { - body: [ - { - destination: { - Config: { - authToken: 'testAuthToken', + body: { + input: [ + { + 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', + 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', }, - type: 'track', - userId: 'eventIdn01', }, - }, - ], + ], + destType: 'vero', + }, + method: 'POST', }, }, output: { response: { status: 200, - body: [ - { - output: { - 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', + body: { + output: [ + { + 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: {}, }, - auth_token: 'testAuthToken', + files: {}, + }, + ], + destination: { + Config: { + authToken: 'testAuthToken', }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', - }, - metadata: { - jobId: 4, + metadata: [ + { + jobId: 4, + }, + ], + statusCode: 200, }, - statusCode: 200, - }, - ], + ], + }, }, }, }, From 7f618b40d4f12db2fc99c736adb8093b545560d1 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 19:11:32 +0530 Subject: [PATCH 20/22] chore: move back threshold for coverage to 80 Signed-off-by: Sai Sankeerth --- jest.config.js | 6 +++--- jest.default.config.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jest.config.js b/jest.config.js index 412d8d2733..875c8f8893 100644 --- a/jest.config.js +++ b/jest.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 75, - lines: 75, - statements: 75, + functions: 80, + lines: 80, + statements: 80, }, }, diff --git a/jest.default.config.js b/jest.default.config.js index fed1dcef31..895b8aa075 100644 --- a/jest.default.config.js +++ b/jest.default.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 75, - lines: 75, - statements: 75, + functions: 80, + lines: 80, + statements: 80, }, }, From 20de3f00a51125a88fe13cfbdfe2ba505b9aa292 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 27 Oct 2023 19:18:06 +0530 Subject: [PATCH 21/22] chore: move threshold for coverage to 75 Signed-off-by: Sai Sankeerth --- jest.config.js | 6 +++--- jest.default.config.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jest.config.js b/jest.config.js index 875c8f8893..412d8d2733 100644 --- a/jest.config.js +++ b/jest.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 80, - lines: 80, - statements: 80, + functions: 75, + lines: 75, + statements: 75, }, }, diff --git a/jest.default.config.js b/jest.default.config.js index 895b8aa075..fed1dcef31 100644 --- a/jest.default.config.js +++ b/jest.default.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 80, - lines: 80, - statements: 80, + functions: 75, + lines: 75, + statements: 75, }, }, From 2a08ca9f646a8e2eba7a3689392a86b3f2a96580 Mon Sep 17 00:00:00 2001 From: krishnachaitanya Date: Fri, 27 Oct 2023 16:15:48 +0530 Subject: [PATCH 22/22] chore: updated test case descriptions --- src/v0/destinations/redis/transform.js | 2 +- .../destinations/redis/processor/data.ts | 1319 +++++++++-------- .../destinations/shynet/processor/data.ts | 428 +++--- 3 files changed, 878 insertions(+), 871 deletions(-) diff --git a/src/v0/destinations/redis/transform.js b/src/v0/destinations/redis/transform.js index e9442d8487..ffc4a33c43 100644 --- a/src/v0/destinations/redis/transform.js +++ b/src/v0/destinations/redis/transform.js @@ -51,7 +51,7 @@ const process = (event) => { const messageType = message && message.type && message.type.toLowerCase(); if (messageType !== EventType.IDENTIFY) { - return []; + throw new InstrumentationError('Only Identify calls are supported'); } if (isEmpty(message.userId)) { diff --git a/test/integrations/destinations/redis/processor/data.ts b/test/integrations/destinations/redis/processor/data.ts index b0622fd91d..72c78a1ad4 100644 --- a/test/integrations/destinations/redis/processor/data.ts +++ b/test/integrations/destinations/redis/processor/data.ts @@ -1,660 +1,661 @@ export const data = [ - { - "name": "redis", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": " " - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": [ - { - "x": 1, - "y": 2 - } - ], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "key": "user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "redis", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": [ - { - "x": 1, - "y": 2 - } - ], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "redis", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "arrayProp": [ - { - "x": 1, - "y": 2 - } - ], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "traits": { - "country": "USA", - "firstname": "Mickey" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "USA", - "lastname": "Mouse", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2", - "firstname": "Mickey" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "redis", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestEmptyKey" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "arrayProp": [ - { - "x": 1, - "y": 2 - } - ], - "emptyKey": "", - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "traits": { - "country": "USA", - "firstname": "Mickey" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "key": "TestEmptyKey:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "USA", - "lastname": "Mouse", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "emptyKey": "", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2", - "firstname": "Mickey" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "redis", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "context or context.traits or traits is empty", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "REDIS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "redis", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "metadata": { - "workspaceId": "some-workspace-id" - }, - "message": { - "userId": "some-user-id", - "channel": "sources", - "context": { - "sources": { - "job_id": "some-job-id", - "version": "some-version", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg", - "profiles_model": "some-model", - "profiles_entity": "some-entity", - "profiles_id_type": "some-id-type" - } - }, - "traits": { - "MODEL_ID": "1691755780", - "VALID_AT": "2023-08-11T11:32:44.963062Z", - "USER_MAIN_ID": "rid5530313526204a95efe71d98cd17d5a1", - "CHURN_SCORE_7_DAYS": 0.027986, - "PERCENTILE_CHURN_SCORE_7_DAYS": 0 - }, - "messageId": "some-message-id", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify" - }, - "request": {} - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "hash": "some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id", - "key": "some-model", - "value": "{\"MODEL_ID\":\"1691755780\",\"VALID_AT\":\"2023-08-11T11:32:44.963062Z\",\"USER_MAIN_ID\":\"rid5530313526204a95efe71d98cd17d5a1\",\"CHURN_SCORE_7_DAYS\":0.027986,\"PERCENTILE_CHURN_SCORE_7_DAYS\":0}" - }, - "userId": "some-user-id" - }, - "metadata": { - "workspaceId": "some-workspace-id" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'redis', + description: + 'Test 0: Covering flattened json, removing empty values, stringify array, prefix key from the config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: ' ', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: '[{"x":1,"y":2}]', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: '[{"x":1,"y":2}]', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + traits: { + country: 'USA', + firstname: 'Mickey', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'USA', + lastname: 'Mouse', + arrayProp: '[{"x":1,"y":2}]', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + firstname: 'Mickey', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestEmptyKey', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + emptyKey: '', + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + traits: { + country: 'USA', + firstname: 'Mickey', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'TestEmptyKey:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'USA', + lastname: 'Mouse', + arrayProp: '[{"x":1,"y":2}]', + emptyKey: '', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + firstname: 'Mickey', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'context or context.traits or traits is empty', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'REDIS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + metadata: { + workspaceId: 'some-workspace-id', + }, + message: { + userId: 'some-user-id', + channel: 'sources', + context: { + sources: { + job_id: 'some-job-id', + version: 'some-version', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + profiles_model: 'some-model', + profiles_entity: 'some-entity', + profiles_id_type: 'some-id-type', + }, + }, + traits: { + MODEL_ID: '1691755780', + VALID_AT: '2023-08-11T11:32:44.963062Z', + USER_MAIN_ID: 'rid5530313526204a95efe71d98cd17d5a1', + CHURN_SCORE_7_DAYS: 0.027986, + PERCENTILE_CHURN_SCORE_7_DAYS: 0, + }, + messageId: 'some-message-id', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + hash: 'some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id', + key: 'some-model', + value: + '{"MODEL_ID":"1691755780","VALID_AT":"2023-08-11T11:32:44.963062Z","USER_MAIN_ID":"rid5530313526204a95efe71d98cd17d5a1","CHURN_SCORE_7_DAYS":0.027986,"PERCENTILE_CHURN_SCORE_7_DAYS":0}', + }, + userId: 'some-user-id', + }, + metadata: { + workspaceId: 'some-workspace-id', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/shynet/processor/data.ts b/test/integrations/destinations/shynet/processor/data.ts index a4e10128cc..b3485bc8d5 100644 --- a/test/integrations/destinations/shynet/processor/data.ts +++ b/test/integrations/destinations/shynet/processor/data.ts @@ -1,212 +1,218 @@ export const data = [ - { - "name": "shynet", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js", - "heartBeat": 5000 - } - }, - "message": { - "type": "page", - "sentAt": "2022-08-22T13:39:21.034Z", - "channel": "web", - "context": { - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "12312@!fma", - "city": "Pune", - "revenue": 93889 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "messageId": "bf412108-0357-4330-b119-7305e767823r", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-22T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "idempotency": "bf412108-0357-4330-b119-7305e767823r" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "userId": "", - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "shynet", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - } - }, - "message": { - "type": "page", - "sentAt": "2022-08-22T13:39:21.034Z", - "channel": "web", - "context": { - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "", - "loadTime": 45 - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "12312@!fma", - "city": "Pune", - "revenue": 93889 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "properties": { - "loadTime": 45 - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "675467tfhjgjhfcghjc", - "messageId": "bf412108-0357-4330-b119-7305e767823r", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-22T13:39:21.032Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "loadTime": 45, - "referrer": "http://127.0.0.1:7307/Testing/test/", - "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "idempotency": "bf412108-0357-4330-b119-7305e767823r" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'shynet', + description: 'Test 0: Page Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + shynetServiceUrl: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + heartBeat: 5000, + }, + }, + message: { + type: 'page', + sentAt: '2022-08-22T13:39:21.034Z', + channel: 'web', + context: { + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.2.20', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + path: '/Testing/test/ourSdk.html', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + initial_referrer: '$direct', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '', + }, + locale: 'en-US', + screen: { + width: 1440, + height: 900, + density: 2, + innerWidth: 536, + innerHeight: 689, + }, + traits: { + email: '12312@!fma', + city: 'Pune', + revenue: 93889, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.2.20', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36', + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + messageId: 'bf412108-0357-4330-b119-7305e767823r', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-22T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + location: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + idempotency: 'bf412108-0357-4330-b119-7305e767823r', + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + userId: '', + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'shynet', + description: 'Test 1: Page Call without heartBeat Mentioned', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + shynetServiceUrl: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + }, + }, + message: { + type: 'page', + sentAt: '2022-08-22T13:39:21.034Z', + channel: 'web', + context: { + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.2.20', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + path: '/Testing/test/ourSdk.html', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + initial_referrer: '$direct', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '', + loadTime: 45, + }, + locale: 'en-US', + screen: { + width: 1440, + height: 900, + density: 2, + innerWidth: 536, + innerHeight: 689, + }, + traits: { + email: '12312@!fma', + city: 'Pune', + revenue: 93889, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.2.20', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36', + }, + properties: { + loadTime: 45, + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: '675467tfhjgjhfcghjc', + messageId: 'bf412108-0357-4330-b119-7305e767823r', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-22T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + loadTime: 45, + referrer: 'http://127.0.0.1:7307/Testing/test/', + location: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + idempotency: 'bf412108-0357-4330-b119-7305e767823r', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +];