diff --git a/test/integrations/destinations/algolia/processor/data.ts b/test/integrations/destinations/algolia/processor/data.ts new file mode 100644 index 0000000000..fa76b6376e --- /dev/null +++ b/test/integrations/destinations/algolia/processor/data.ts @@ -0,0 +1,1243 @@ +export const data = [ + { + "name": "algolia", + "description": "Test 0", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product clicked", + "userId": "testuserId1", + "properties": { + "index": "products", + "filters": [ + "field1:hello", + "val1:val2" + ] + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product clicked", + "to": "cLick " + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "FORM": {}, + "JSON_ARRAY": {}, + "JSON": { + "events": [ + { + "eventName": "product clicked", + "eventType": "click", + "filters": [ + "field1:hello", + "val1:val2" + ], + "index": "products", + "userToken": "testuserId1" + } + ] + }, + "XML": {} + }, + "endpoint": "https://insights.algolia.io/1/events", + "files": {}, + "headers": { + "X-Algolia-API-Key": "dummyApiKey", + "X-Algolia-Application-Id": "O2YARRI15I" + }, + "method": "POST", + "params": {}, + "type": "REST", + "userId": "", + "version": "1" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "algolia", + "description": "Test 1", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product list viewed", + "userId": "testuserId1", + "properties": { + "index": "products", + "products": [ + { + "objectId": "ecommerce-sample-data-919", + "position": 7 + }, + { + "objectId": "9780439784542", + "position": 8 + } + ], + "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product list viewed", + "to": "click" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "FORM": {}, + "JSON_ARRAY": {}, + "JSON": { + "events": [ + { + "eventName": "product list viewed", + "eventType": "click", + "objectIDs": [ + "ecommerce-sample-data-919", + "9780439784542" + ], + "positions": [ + 7, + 8 + ], + "index": "products", + "userToken": "testuserId1", + "queryID": "43b15df305339e827f0ac0bdc5ebcaa7" + } + ] + }, + "XML": {} + }, + "endpoint": "https://insights.algolia.io/1/events", + "files": {}, + "headers": { + "X-Algolia-API-Key": "dummyApiKey", + "X-Algolia-Application-Id": "O2YARRI15I" + }, + "method": "POST", + "params": {}, + "type": "REST", + "userId": "", + "version": "1" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "algolia", + "description": "Test 2", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product clicked", + "userId": "testuserId1", + "properties": { + "eventType": "click", + "index": "products", + "queryId": "43b15df305339e827f0ac0bdc5ebcaa8" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Either filters or objectIds is required.", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "algolia", + "description": "Test 3", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "userId": "testuserId1", + "event": "product clicked", + "properties": { + "index": "products", + "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "eventType is mandatory for track call", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "algolia", + "description": "Test 4", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product list viewed", + "userId": "testuserId1", + "properties": { + "index": "products", + "products": [ + { + "objectId": "ecommerce-sample-data-919", + "position": 7 + }, + { + "objectId": "9780439784542", + "position": 8 + } + ], + "queryId": "" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product list viewed", + "to": "click" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "for click eventType either both positions and queryId should be present or none", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "algolia", + "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.0.0" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product list viewed", + "userId": "testuserId1", + "properties": { + "index": "products", + "products": [ + { + "objectId": "ecommerce-sample-data-919", + "position": 7 + }, + { + "objectId": "9780439784542", + "position": 8 + } + ], + "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product list viewed", + "to": "view" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "body": { + "FORM": {}, + "JSON_ARRAY": {}, + "JSON": { + "events": [ + { + "eventName": "product list viewed", + "eventType": "view", + "index": "products", + "objectIDs": [ + "ecommerce-sample-data-919", + "9780439784542" + ], + "userToken": "testuserId1", + "queryID": "43b15df305339e827f0ac0bdc5ebcaa7" + } + ] + }, + "XML": {} + }, + "endpoint": "https://insights.algolia.io/1/events", + "files": {}, + "headers": { + "X-Algolia-API-Key": "dummyApiKey", + "X-Algolia-Application-Id": "O2YARRI15I" + }, + "method": "POST", + "params": {}, + "type": "REST", + "userId": "", + "version": "1" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "algolia", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product list viewed", + "userId": "testuserId1", + "properties": { + "index": "products", + "products": [ + { + "objectId": "ecommerce-sample-data-919", + "position": "7" + }, + { + "objectId": "9780439784542", + "position": "a" + } + ], + "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product list viewed", + "to": "click" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "for click eventType either both positions and queryId should be present or none", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "algolia", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product list viewed", + "userId": "testuserId1", + "properties": { + "index": "products", + "products": [ + { + "objectId": "ecommerce-sample-data-919", + "position": "7" + }, + { + "objectId": "9780439784542", + "position": "a" + } + ], + "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product list viewed", + "to": "check" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "eventType can be either click, view or conversion", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "algolia", + "description": "Test 8", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product list viewed", + "userId": "testuserId1", + "properties": { + "index": "products", + "products": [ + { + "objectId": "ecommerce-sample-data-919", + "position": "7" + }, + { + "objectId": "9780439784542", + "position": "a" + } + ], + "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "eventType is mandatory for track call", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "algolia", + "description": "Test 9", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": "product clicked", + "userId": "testuserId1", + "properties": { + "filters": [ + "field1:hello", + "val1:val2" + ] + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product clicked", + "to": "cLick " + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Missing required value from \"properties.index\"", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "algolia", + "description": "Test 10", + "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" + }, + "traits": { + "email": "testone@gmail.com", + "firstName": "test", + "lastName": "one" + }, + "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 + }, + "page": { + "path": "/destinations/ometria", + "referrer": "", + "search": "", + "title": "", + "url": "https://docs.rudderstack.com/destinations/ometria", + "category": "destination", + "initial_referrer": "https://docs.rudderstack.com", + "initial_referring_domain": "docs.rudderstack.com" + } + }, + "type": "track", + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "123456", + "event": [ + "abc", + "def" + ], + "userId": "testuserId1", + "properties": { + "filters": [ + "field1:hello", + "val1:val2" + ] + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "applicationId": "O2YARRI15I", + "eventTypeSettings": [ + { + "from": "product clicked", + "to": "cLick " + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "event name should be a string", + "statTags": { + "destType": "ALGOLIA", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/appcues/processor/data.ts b/test/integrations/destinations/appcues/processor/data.ts new file mode 100644 index 0000000000..c01abc241e --- /dev/null +++ b/test/integrations/destinations/appcues/processor/data.ts @@ -0,0 +1,1387 @@ +export const data = [ + { + name: 'appcues', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '33787665-4168-4acc-8df7-17ba79325332', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/rudder-sdk-js/tests/html/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + originalTimestamp: '2021-01-04T08:25:04.780Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: '79881a62-980a-4d76-89ca-7099440f8c13', + sentAt: '2021-01-04T08:25:04.781Z', + timestamp: '2021-01-04T13:55:04.798+05:30', + type: 'identify', + userId: 'onlyUserId', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + request_id: '6a5f38c0-4e75-4268-a066-2b73fbcad01f', + profile_update: {}, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/onlyUserId/activity', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '33787665-4168-4acc-8df7-17ba79325332', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/rudder-sdk-js/tests/html/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + }, + screen: { + density: 2, + }, + traits: { + 'first name': 'John', + 'last name': 'Abraham', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '57494c6a-3c62-4b30-83aa-6e821d37ac75', + originalTimestamp: '2021-01-04T08:25:04.786Z', + receivedAt: '2021-01-04T13:55:04.799+05:30', + request_ip: '[::1]', + rudderId: 'ed2ed08a-3cd9-4b2c-9b04-7e3d3501fab7', + sentAt: '2021-01-04T08:25:04.787Z', + timestamp: '2021-01-04T13:55:04.798+05:30', + type: 'identify', + userId: 'userIdWithProperties', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + request_id: '57494c6a-3c62-4b30-83aa-6e821d37ac75', + profile_update: { + 'last name': 'Abraham', + 'first name': 'John', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: + 'https://api.appcues.com/v1/accounts/86086/users/userIdWithProperties/activity', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '59f2911c-f050-497d-9f80-e1696a3c56aa', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/rudder-sdk-js/tests/html/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + event: 'eventWithoutProperties', + integrations: { + All: true, + }, + messageId: '045f5107-6036-4557-ae17-6ddf5ee57eb6', + originalTimestamp: '2021-01-04T08:33:07.004Z', + properties: {}, + receivedAt: '2021-01-04T14:03:07.009+05:30', + request_ip: '[::1]', + rudderId: '9b6b8204-292c-493b-9c08-2c3ec0ade688', + sentAt: '2021-01-04T08:33:07.005Z', + timestamp: '2021-01-04T14:03:07.008+05:30', + type: 'track', + userId: 'sampleId', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'eventWithoutProperties', + timestamp: 1609749187, + attributes: {}, + }, + ], + request_id: '045f5107-6036-4557-ae17-6ddf5ee57eb6', + }, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/sampleId/activity', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '59f2911c-f050-497d-9f80-e1696a3c56aa', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/rudder-sdk-js/tests/html/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + event: 'eventWithProperties', + integrations: { + All: true, + }, + messageId: '4b99c45d-8591-473c-b79d-abd466f6f4d5', + originalTimestamp: '2021-01-04T08:33:07.006Z', + properties: { + category: 'blah', + }, + receivedAt: '2021-01-04T14:03:07.026+05:30', + request_ip: '[::1]', + rudderId: '9b6b8204-292c-493b-9c08-2c3ec0ade688', + sentAt: '2021-01-04T08:33:07.006Z', + timestamp: '2021-01-04T14:03:07.026+05:30', + type: 'track', + userId: 'sampleId', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'eventWithProperties', + timestamp: 1609749187, + attributes: { + category: 'blah', + }, + }, + ], + request_id: '4b99c45d-8591-473c-b79d-abd466f6f4d5', + }, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/sampleId/activity', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'a4a6304a-df41-4ca9-b2b7-4b0009dfddaa', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/rudder-sdk-js/tests/html/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '75a9e08b-955a-4dc7-8a39-3f6fba9d7497', + originalTimestamp: '2021-01-04T08:43:05.783Z', + properties: { + path: '/rudder-sdk-js/tests/html/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + }, + receivedAt: '2021-01-04T14:13:05.800+05:30', + request_ip: '[::1]', + rudderId: '2d03081c-8053-4cce-9abf-bb024f747900', + sentAt: '2021-01-04T08:43:05.783Z', + timestamp: '2021-01-04T14:13:05.799+05:30', + type: 'page', + userId: 'sampleId', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'Visited a Page', + context: { + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + }, + timestamp: 1609749785, + attributes: { + url: 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + path: '/rudder-sdk-js/tests/html/script-test.html', + _identity: { + userId: 'sampleId', + }, + }, + }, + ], + request_id: '75a9e08b-955a-4dc7-8a39-3f6fba9d7497', + profile_update: { + _appcuesId: '86086', + _updatedAt: '2021-01-04T14:13:05.799+05:30', + _userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + _currentPageUrl: + 'http://localhost:4321/rudder-sdk-js/tests/html/script-test.html', + _lastBrowserLanguage: 'en-GB', + userId: 'sampleId', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/sampleId/activity', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'a4a6304a-df41-4ca9-b2b7-4b0009dfddaa', + category: 'page category', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/testing', + referrer: '', + search: '', + title: '', + url: 'https://pagecall.com/testing', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '397fdf96-daee-46c8-ac38-5d717cd8cabd', + name: 'page name', + originalTimestamp: '2021-01-04T08:43:05.784Z', + properties: { + category: 'page category', + name: 'page name', + path: '/testing', + referrer: '', + search: '', + title: '', + url: 'https://pagecall.com/testing', + }, + receivedAt: '2021-01-04T14:13:05.801+05:30', + request_ip: '[::1]', + rudderId: '2d03081c-8053-4cce-9abf-bb024f747900', + sentAt: '2021-01-04T08:43:05.784Z', + timestamp: '2021-01-04T14:13:05.801+05:30', + type: 'page', + userId: 'sampleId', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + events: [ + { + name: 'Visited a Page', + context: { + url: 'https://pagecall.com/testing', + }, + timestamp: 1609749785, + attributes: { + url: 'https://pagecall.com/testing', + name: 'page name', + path: '/testing', + category: 'page category', + _identity: { + userId: 'sampleId', + }, + }, + }, + ], + request_id: '397fdf96-daee-46c8-ac38-5d717cd8cabd', + profile_update: { + _appcuesId: '86086', + _updatedAt: '2021-01-04T14:13:05.801+05:30', + _userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + _currentPageUrl: 'https://pagecall.com/testing', + _lastBrowserLanguage: 'en-GB', + userId: 'sampleId', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/sampleId/activity', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'a4a6304a-df41-4ca9-b2b7-4b0009dfddaa', + category: 'page category', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/testing', + referrer: '', + search: '', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '397fdf96-daee-46c8-ac38-5d717cd8cabd', + name: 'page name', + originalTimestamp: '2021-01-04T08:43:05.784Z', + properties: { + category: 'page category', + name: 'page name', + path: '/testing', + referrer: '', + search: '', + title: 'properties title', + url: 'https://pagecall.com/properties_url', + }, + receivedAt: '2021-01-04T14:13:05.801+05:30', + request_ip: '[::1]', + rudderId: '2d03081c-8053-4cce-9abf-bb024f747900', + sentAt: '2021-01-04T08:43:05.784Z', + timestamp: '2021-01-04T14:13:05.801+05:30', + type: 'page', + userId: 'sampleId', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/sampleId/activity', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + request_id: '397fdf96-daee-46c8-ac38-5d717cd8cabd', + profile_update: { + userId: 'sampleId', + _lastBrowserLanguage: 'en-GB', + _updatedAt: '2021-01-04T14:13:05.801+05:30', + _userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + _currentPageTitle: 'properties title', + _currentPageUrl: 'https://pagecall.com/properties_url', + _appcuesId: '86086', + }, + events: [ + { + timestamp: 1609749785, + attributes: { + category: 'page category', + name: 'page name', + path: '/testing', + title: 'properties title', + url: 'https://pagecall.com/properties_url', + _identity: { + userId: 'sampleId', + }, + }, + name: 'Visited a Page', + context: { + url: 'https://pagecall.com/properties_url', + }, + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'a4a6304a-df41-4ca9-b2b7-4b0009dfddaa', + category: 'page category', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.9', + }, + campaign: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.9', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/testing', + referrer: '', + search: '', + title: 'context title', + url: 'https://pagecall.com/context_url', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '397fdf96-daee-46c8-ac38-5d717cd8cabd', + name: 'page name', + originalTimestamp: '2021-01-04T08:43:05.784Z', + properties: { + category: 'page category', + name: 'page name', + path: '/testing', + referrer: '', + search: '', + }, + receivedAt: '2021-01-04T14:13:05.801+05:30', + request_ip: '[::1]', + rudderId: '2d03081c-8053-4cce-9abf-bb024f747900', + sentAt: '2021-01-04T08:43:05.784Z', + timestamp: '2021-01-04T14:13:05.801+05:30', + type: 'page', + userId: 'sampleId', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/sampleId/activity', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + request_id: '397fdf96-daee-46c8-ac38-5d717cd8cabd', + profile_update: { + userId: 'sampleId', + _lastBrowserLanguage: 'en-GB', + _updatedAt: '2021-01-04T14:13:05.801+05:30', + _userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', + _currentPageTitle: 'context title', + _currentPageUrl: 'https://pagecall.com/context_url', + _appcuesId: '86086', + }, + events: [ + { + timestamp: 1609749785, + attributes: { + category: 'page category', + name: 'page name', + path: '/testing', + _identity: { + userId: 'sampleId', + }, + }, + name: 'Visited a Page', + context: { + url: 'https://pagecall.com/context_url', + }, + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5094f5704b9cf2b3', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AppcuesIntegration', + namespace: 'com.Appcues', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.1-beta.1', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '8.1.0', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5094f5704b9cf2b3', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)', + }, + event: 'MainActivity', + integrations: { + All: true, + }, + messageId: 'id1', + properties: { + name: 'MainActivity', + automatic: true, + }, + originalTimestamp: '2020-03-12T09:05:03.421Z', + type: 'screen', + userId: 'sampleId', + sentAt: '2020-03-12T09:05:13.042Z', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + endpoint: 'https://api.appcues.com/v1/accounts/86086/users/sampleId/activity', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + request_id: 'id1', + events: [ + { + name: 'Viewed a Screen', + timestamp: 1584003903, + attributes: { + name: 'MainActivity', + automatic: true, + }, + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5094f5704b9cf2b3', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AppcuesIntegration', + namespace: 'com.Appcues', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.1-beta.1', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '8.1.0', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5094f5704b9cf2b3', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)', + }, + event: 'MainActivity', + integrations: { + All: true, + }, + messageId: 'id1', + properties: { + name: 'MainActivity', + automatic: true, + }, + originalTimestamp: '2020-03-12T09:05:03.421Z', + type: 'screen', + sentAt: '2020-03-12T09:05:13.042Z', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: "User id is absent. Aborting event as userId is mandatory for Appcues", + statTags: { + destType: 'APPCUES', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5094f5704b9cf2b3', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AppcuesIntegration', + namespace: 'com.Appcues', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.1-beta.1', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '8.1.0', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5094f5704b9cf2b3', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)', + }, + event: 'MainActivity', + integrations: { + All: true, + }, + messageId: 'id1', + properties: { + name: 'MainActivity', + automatic: true, + }, + originalTimestamp: '2020-03-12T09:05:03.421Z', + type: '', + userId: 'sampleId', + sentAt: '2020-03-12T09:05:13.042Z', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message Type is not present. Aborting message.', + statTags: { + destType: 'APPCUES', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'appcues', + description: 'Test 11', + 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: '/html/sajal.html', + referrer: '', + search: + '?utm_source=google&utm_medium=medium&utm_term=keyword&utm_content=some%20content&utm_campaign=some%20campaign&utm_test=other%20value', + title: '', + url: 'http://localhost:9116/html/sajal.html?utm_source=google&utm_medium=medium&utm_term=keyword&utm_content=some%20content&utm_campaign=some%20campaign&utm_test=other%20value', + }, + }, + type: 'group', + messageId: 'e5034df0-a404-47b4-a463-76df99934fea', + originalTimestamp: '2020-10-20T07:54:58.983Z', + anonymousId: 'my-anonymous-id-new', + userId: 'sampleusrRudder3', + integrations: { + All: true, + }, + groupId: 'Sample_groupId23', + traits: { + KEY_3: { + CHILD_KEY_92: 'value_95', + CHILD_KEY_102: 'value_103', + }, + KEY_2: { + CHILD_KEY_92: 'value_95', + CHILD_KEY_102: 'value_103', + }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + sentAt: '2020-10-20T07:54:58.983Z', + }, + destination: { + Config: { + accountId: '86086', + useNativeSDK: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message type is not supported', + statTags: { + destType: 'APPCUES', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/attentive_tag/processor/data.ts b/test/integrations/destinations/attentive_tag/processor/data.ts new file mode 100644 index 0000000000..df5292ac42 --- /dev/null +++ b/test/integrations/destinations/attentive_tag/processor/data.ts @@ -0,0 +1,1659 @@ +export const data = [ + { + "name": "attentive_tag", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "4eb021e9-a2af-4926-ae82-fe996d12f3c5", + "channel": "web", + "context": { + "locale": "en-GB", + "traits": { + "email": "a@gmail.com", + "phone": "+16405273911", + "customIdentifiers": [ + { + "name": "string", + "value": "string" + } + ] + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "e108eb05-f6cd-4624-ba8c-568f2e2b3f92", + "receivedAt": "2019-10-14T09:03:17.562Z", + "type": "identify" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "241654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "userId": "", + "method": "POST", + "endpoint": "https://api.attentivemobile.com/v1/subscriptions", + "headers": { + "Authorization": "Bearer dummyApiKey", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "user": { + "phone": "+16405273911", + "email": "a@gmail.com" + }, + "signUpSourceId": "241654", + "externalIdentifiers": { + "customIdentifiers": [ + { + "name": "string", + "value": "string" + } + ] + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 1", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "224" + }, + { + "type": "klaviyoId", + "id": "132" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product,id": "r494", + "quantity": "34", + "variant": "f" + }, + "event": "Order Shipped", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:17.562Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "[Attentive_Tag]: Events must be sent within 12 hours of their occurrence.", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "4eb021e9-a2af-4926-ae82-fe996d12f3c5", + "channel": "web", + "context": { + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "traits": { + "company": { + "id": "abc123" + }, + "createdAt": "Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)", + "phone": "+16465453911" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36" + }, + "integrations": { + "All": true, + "attentive_tag": { + "signUpSourceId": "241654", + "identifyOperation": "unsubscribe" + } + }, + "messageId": "e108eb05-f6cd-4624-ba8c-568f2e2b3f92", + "receivedAt": "2020-10-16T13:56:14.945+05:30", + "type": "identify" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "241654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "userId": "", + "method": "POST", + "endpoint": "https://api.attentivemobile.com/v1/subscriptions/unsubscribe", + "headers": { + "Authorization": "Bearer dummyApiKey", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "user": { + "phone": "+16465453911" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 3", + "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" + }, + "traits": { + "email": "test@rudderstack.com" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "143" + }, + { + "type": "klaviyoId", + "id": "142" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Order Completed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "[Attentive_Tag]: Events must be sent within 12 hours of their occurrence.", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 4", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": 1 + }, + { + "type": "shopifyId", + "id": 1 + }, + { + "type": "klaviyoId", + "id": 1 + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "[Attentive Tag] :: Event name is not present", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "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.0.0" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "143" + }, + { + "type": "klaviyoId", + "id": "142" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Product List Viewed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "[Attentive Tag]: Events must be sent within 12 hours of their occurrence.", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "143" + }, + { + "type": "klaviyoId", + "id": "142" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Product Viewed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "[Attentive Tag]: Events must be sent within 12 hours of their occurrence.", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "224" + }, + { + "type": "klaviyoId", + "id": "132" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34" + }, + "event": "Order Shipped", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "[Attentive Tag]: Events must be sent within 12 hours of their occurrence.", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 8", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": 1 + }, + { + "type": "shopifyId", + "id": 1 + }, + { + "type": "klaviyoId", + "id": 1 + } + ] + }, + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Order Completed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Message Type is not present. Aborting message.", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "4eb021e9-a2af-4926-ae82-fe996d12f3c5", + "channel": "web", + "context": { + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "traits": { + "company": { + "id": "abc123" + }, + "createdAt": "Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)", + "email": "test0@gmail.com", + "phone": "+16465453911" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36" + }, + "integrations": { + "All": true, + "attentive_tag": { + "signUpSourceId": "241654", + "identifyOperation": "subscribe" + } + }, + "messageId": "e108eb05-f6cd-4624-ba8c-568f2e2b3f92", + "receivedAt": "2020-10-16T13:56:14.945+05:30", + "type": "identify" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "241654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "userId": "", + "method": "POST", + "endpoint": "https://api.attentivemobile.com/v1/subscriptions", + "headers": { + "Authorization": "Bearer dummyApiKey", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "user": { + "phone": "+16465453911", + "email": "test0@gmail.com" + }, + "signUpSourceId": "241654" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 10", + "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" + }, + "traits": {}, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "143" + }, + { + "type": "klaviyoId", + "id": "142" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Product Viewed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "[Attentive_Tag]: Events must be sent within 12 hours of their occurrence.", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 11", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "143" + }, + { + "type": "klaviyoId", + "id": "142" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Product Viewed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Missing required value from \"product_id\"", + "statTags": { + "destType": "ATTENTIVE_TAG", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 12", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "143" + }, + { + "type": "klaviyoId", + "id": "142" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Product Viewed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "statusCode": 400, + "error": "Missing required value from \"variant\"" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 13", + "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" + }, + "traits": { + "email": "test@rudderstack.com", + "phone": "+16465053911" + }, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "clientUserId", + "id": "144" + }, + { + "type": "shopifyId", + "id": "143" + }, + { + "type": "klaviyoId", + "id": "142" + } + ] + }, + "type": "track", + "properties": { + "price": "12", + "curre,ncy": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Order Shipped", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "statusCode": 400, + "error": "[Attentive Tag]:The event name contains characters which is not allowed" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 14", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "4eb021e9-a2af-4926-ae82-fe996d12f3c5", + "channel": "web", + "context": { + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "traits": { + "company": { + "id": "abc123" + }, + "createdAt": "Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)", + "email": "test0@gmail.com", + "phone": "+16465453911" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36" + }, + "integrations": { + "All": true, + "attentive_tag": { + "signUpSourceId": "241654" + } + }, + "messageId": "e108eb05-f6cd-4624-ba8c-568f2e2b3f92", + "receivedAt": "2020-10-16T13:56:14.945+05:30", + "type": "identify" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "241654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.attentivemobile.com/v1/subscriptions", + "headers": { + "Authorization": "Bearer dummyApiKey", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "user": { + "phone": "+16465453911", + "email": "test0@gmail.com" + }, + "signUpSourceId": "241654" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "attentive_tag", + "description": "Test 15", + "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" + }, + "traits": {}, + "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": { + "id": "72e528f869711c3d", + "manufacturer": "Google", + "model": "sdk_gphone_x86", + "name": "generic_x86_arm", + "token": "some_device_token", + "type": "android" + }, + "screen": { + "density": 2 + } + }, + "type": "track", + "properties": { + "price": "12", + "currency": "USD", + "product_id": "r494", + "quantity": "34", + "products": [ + { + "product_id": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "variant": "green", + "price": "19", + "quantity": "2", + "currency": "USD" + } + ] + }, + "event": "Product Viewed", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "00000000000000000000000000", + "userId": "123456", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "signUpSourceId": "240654" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.attentivemobile.com/v1/events/ecommerce/product-view", + "headers": { + "Authorization": "Bearer dummyApiKey", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "user": {}, + "occuredAt": "2019-10-14T09:03:17.562Z", + "items": [ + { + "productId": "507f1f77bcf86cd799439011", + "name": "MOBILE", + "productVariantId": "green", + "quantity": "2", + "price": [ + { + "value": 19, + "currency": "USD" + } + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {} + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file