diff --git a/src/v0/destinations/gainsight_px/data/GainsightPX_Identify.json b/src/v0/destinations/gainsight_px/data/GainsightPX_Identify.json index 5d07b290dc..6641ed749d 100644 --- a/src/v0/destinations/gainsight_px/data/GainsightPX_Identify.json +++ b/src/v0/destinations/gainsight_px/data/GainsightPX_Identify.json @@ -55,12 +55,7 @@ }, { "destKey": "signUpDate", - "sourceKeys": [ - "traits.signUpDate", - "context.traits.signUpDate", - "timestamp", - "originalTimestamp" - ], + "sourceKeys": ["traits.signUpDate", "context.traits.signUpDate"], "required": false, "metadata": { "type": "timestamp" diff --git a/src/v0/destinations/gainsight_px/transform.js b/src/v0/destinations/gainsight_px/transform.js index 4d91980f11..4bb40df240 100644 --- a/src/v0/destinations/gainsight_px/transform.js +++ b/src/v0/destinations/gainsight_px/transform.js @@ -1,5 +1,9 @@ /* eslint-disable no-nested-ternary */ -const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); +const { + InstrumentationError, + ConfigurationError, + formatTimeStamp, +} = require('@rudderstack/integrations-lib'); const { EventType } = require('../../../constants'); const { isEmptyObject, @@ -56,6 +60,10 @@ const identifyResponseBuilder = async (message, { Config }) => { payload.firstName = fName; payload.lastName = lName; } + // Only for the case of new user creation, if signUpDate is not provided in traits, timestamp / originalTimestamp is mapped + if (!isPresent && !payload.signUpDate) { + payload.signUpDate = formatTimeStamp(message.timestamp || message.originalTimestamp); + } let customAttributes = {}; customAttributes = extractCustomFields( message, diff --git a/src/v0/destinations/salesforce/transform.js b/src/v0/destinations/salesforce/transform.js index 5ada9dfaa0..db28e471d6 100644 --- a/src/v0/destinations/salesforce/transform.js +++ b/src/v0/destinations/salesforce/transform.js @@ -221,6 +221,7 @@ async function getSalesforceIdFromPayload( if (!email) { throw new InstrumentationError('Invalid Email address for Lead Objet'); } + // we need to make this url dynamic this is defaulting to lead. const leadQueryUrl = `${authorizationData.instanceUrl}/services/data/v${SF_API_VERSION}/parameterizedSearch/?q=${email}&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted`; // request configuration will be conditional diff --git a/test/integrations/destinations/gainsight_px/processor/data.ts b/test/integrations/destinations/gainsight_px/processor/data.ts index 192c6969c4..3a71992d4a 100644 --- a/test/integrations/destinations/gainsight_px/processor/data.ts +++ b/test/integrations/destinations/gainsight_px/processor/data.ts @@ -1,1857 +1,2168 @@ export const data = [ - { - "name": "gainsight_px", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "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 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Product Added", - "properties": { - "product_id": "123", - "sku": "F16", - "category": "Games", - "name": "Game", - "brand": "Gamepro", - "variant": "111", - "price": 13.49, - "quantity": 11, - "coupon": "DISC21", - "position": 1, - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.png" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "product_id": "123", - "sku": "F16", - "category": "Games", - "name": "Game", - "brand": "Gamepro", - "variant": "111", - "price": 13.49, - "quantity": 11, - "coupon": "DISC21", - "position": 1, - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.png" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Product Added", - "globalContext": { - "projectId": "p-123", - "tag": "sample-category-tag" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "message": { - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "version": "1.27.0", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:8887/", - "path": "/", - "title": "RudderStack in 5", - "search": "", - "tab_url": "http://127.0.0.1:8887/", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1512, - "height": 982, - "density": 2, - "innerWidth": 774, - "innerHeight": 774 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.27.0" - }, - "campaign": {}, - "sessionId": 1679967592314, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36", - "properties": { - "email": "84@84.com", - "price": "56.0", - "quantity": "5" - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Marketing - Plan Change Events", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": {}, - "url": "http://127.0.0.1:8887/", - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "referrer": "$direct", - "date": 1571043797562, - "sessionId": 1679967592314, - "eventName": "Marketing - Plan Change Events", - "globalContext": { - "projectId": "p-123", - "tag": "sample-category-tag" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "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 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Track Me", - "properties": { - "description": "Sample Track call", - "globalContext": { - "testOverride": "some-value" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "description": "Sample Track call" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Track Me", - "globalContext": { - "testOverride": "some-value" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "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", - "userId": "sample-user-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": [ - "AP-XABC-123" - ], - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": { - "hobby": "Sample Hobby" - } - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "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 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "medium": null - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "sample-user-id", - "groupId": "ecorp-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "accountId": "ecorp-id" - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "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": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "userId or anonymousId is required for identify", - "statTags": { - "destType": "GAINSIGHT_PX", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "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", - "event": "Product Added", - "properties": { - "product_id": "123", - "sku": "F16", - "category": "Games", - "name": "Game", - "brand": "Gamepro", - "variant": "111", - "price": 13.49, - "quantity": 11, - "coupon": "DISC21", - "position": 1, - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.png" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Missing required value from \"userId\"", - "statTags": { - "destType": "GAINSIGHT_PX", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "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 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "sample-user-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "groupId is required for group", - "statTags": { - "destType": "GAINSIGHT_PX", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "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 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Stringify Test", - "properties": { - "description": "Stringify test for object values", - "nested": { - "a": [ - 1, - 2, - 3 - ], - "b": { - "c": 1 - } - }, - "arr": [ - 1, - 2, - 3 - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "description": "Stringify test for object values", - "nested": "{\"a\":[1,2,3],\"b\":{\"c\":1}}", - "arr": "[1,2,3]" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Stringify Test", - "globalContext": { - "projectId": "p-123", - "tag": "sample-category-tag" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [ - { - "from": "projectId", - "to": "p-123" - }, - { - "from": "tag", - "to": "sample-category-tag" - } - ] - } - }, - "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 - } - }, - "userId": "sample-user-id", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "type": "track", - "event": "Stringify Test", - "properties": { - "description": "Stringify test for object values", - "nested": { - "a": [ - 1, - 2, - 3 - ], - "b": { - "c": 1 - } - }, - "arr": [ - 1, - 2, - 3 - ], - "globalContext": { - "someKey": "someVal" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "attributes": { - "description": "Stringify test for object values", - "nested": "{\"a\":[1,2,3],\"b\":{\"c\":1}}", - "arr": "[1,2,3]" - }, - "propertyKey": "AP-XABC-123", - "userType": "USER", - "identifyId": "sample-user-id", - "date": 1571043797562, - "eventName": "Stringify Test", - "globalContext": { - "someKey": "someVal" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/events/custom", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "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 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "absent-id", - "groupId": "ecorp-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "aborting group call: {\"status\":\"NOT_FOUND\",\"message\":\"User was not found for parameters {id=absent-id}\",\"debugMessage\":null,\"subErrors\":null}", - "statTags": { - "destType": "GAINSIGHT_PX", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 11", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "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", - "userId": "absent-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "identifyId": "absent-id", - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": [ - "AP-XABC-123" - ], - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": { - "hobby": "Sample Hobby" - } - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 12", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "globalContextMap": [] - } - }, - "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", - "userId": "absent-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby", - "accountId": 1234 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "identifyId": "absent-id", - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": [ - "AP-XABC-123" - ], - "accountId": "1234", - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": {} - } - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 13", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [], - "globalContextMap": [] - } - }, - "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 - }, - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User" - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "sample-anon-id", - "userId": "absent-id", - "groupId": "ecorp-id", - "type": "group", - "traits": { - "name": "ECorp", - "industry": "software", - "numberOfEmployees": 400, - "website": "www.ecorp.com", - "plan": "premium", - "term": null - }, - "integrations": { - "All": true, - "GAINSIGHT_PX": { - "limitAPIForGroup": true - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.aptrinsic.com/v1/users/absent-id", - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "accountId": "ecorp-id" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "gainsight_px", - "description": "Test 14", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "sample-api-key", - "productTagKey": "AP-XABC-123", - "accountAttributeMap": [ - { - "from": "", - "to": "" - } - ], - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ], - "globalContextMap": [] - } - }, - "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", - "userId": "sample-user-id", - "anonymousId": "sample-anon-id", - "type": "identify", - "traits": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "title": "engineer", - "countryName": "USA", - "countryCode": "US", - "city": "New York", - "hobbyCustomField": "Sample Hobby", - "term": null, - "campaign": "" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {}, - "JSON": { - "type": "USER", - "gender": "MALE", - "email": "user@email.com", - "firstName": "Sample", - "lastName": "User", - "signUpDate": 1624431528295, - "createDate": 1571043797562, - "title": "engineer", - "propertyKeys": [ - "AP-XABC-123" - ], - "location": { - "countryName": "USA", - "countryCode": "US", - "city": "New York" - }, - "customAttributes": { - "hobby": "Sample Hobby" - } - } - }, - "type": "REST", - "files": {}, - "method": "PUT", - "params": {}, - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://api.aptrinsic.com/v1/users/sample-user-id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'gainsight_px', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: '', + to: '', + }, + ], + globalContextMap: [ + { + from: 'projectId', + to: 'p-123', + }, + { + from: 'tag', + to: 'sample-category-tag', + }, + ], + }, + }, + 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, + }, + }, + userId: 'sample-user-id', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + type: 'track', + event: 'Product Added', + properties: { + product_id: '123', + sku: 'F16', + category: 'Games', + name: 'Game', + brand: 'Gamepro', + variant: '111', + price: 13.49, + quantity: 11, + coupon: 'DISC21', + position: 1, + url: 'https://www.website.com/product/path', + image_url: 'https://www.website.com/product/path.png', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + attributes: { + product_id: '123', + sku: 'F16', + category: 'Games', + name: 'Game', + brand: 'Gamepro', + variant: '111', + price: 13.49, + quantity: 11, + coupon: 'DISC21', + position: 1, + url: 'https://www.website.com/product/path', + image_url: 'https://www.website.com/product/path.png', + }, + propertyKey: 'AP-XABC-123', + userType: 'USER', + identifyId: 'sample-user-id', + date: 1571043797562, + eventName: 'Product Added', + globalContext: { + projectId: 'p-123', + tag: 'sample-category-tag', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/events/custom', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: '', + to: '', + }, + ], + globalContextMap: [ + { + from: 'projectId', + to: 'p-123', + }, + { + from: 'tag', + to: 'sample-category-tag', + }, + ], + }, + }, + message: { + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + version: '1.27.0', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:8887/', + path: '/', + title: 'RudderStack in 5', + search: '', + tab_url: 'http://127.0.0.1:8887/', + referrer: '$direct', + initial_referrer: '$direct', + referring_domain: '', + initial_referring_domain: '', + }, + locale: 'en-US', + screen: { + width: 1512, + height: 982, + density: 2, + innerWidth: 774, + innerHeight: 774, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.27.0', + }, + campaign: {}, + sessionId: 1679967592314, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36', + properties: { + email: '84@84.com', + price: '56.0', + quantity: '5', + }, + }, + userId: 'sample-user-id', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + type: 'track', + event: 'Marketing - Plan Change Events', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + attributes: {}, + url: 'http://127.0.0.1:8887/', + propertyKey: 'AP-XABC-123', + userType: 'USER', + identifyId: 'sample-user-id', + referrer: '$direct', + date: 1571043797562, + sessionId: 1679967592314, + eventName: 'Marketing - Plan Change Events', + globalContext: { + projectId: 'p-123', + tag: 'sample-category-tag', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/events/custom', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: '', + to: '', + }, + ], + globalContextMap: [ + { + from: 'projectId', + to: 'p-123', + }, + { + from: 'tag', + to: 'sample-category-tag', + }, + ], + }, + }, + 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, + }, + }, + userId: 'sample-user-id', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + type: 'track', + event: 'Track Me', + properties: { + description: 'Sample Track call', + globalContext: { + testOverride: 'some-value', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + attributes: { + description: 'Sample Track call', + }, + propertyKey: 'AP-XABC-123', + userType: 'USER', + identifyId: 'sample-user-id', + date: 1571043797562, + eventName: 'Track Me', + globalContext: { + testOverride: 'some-value', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/events/custom', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + globalContextMap: [], + }, + }, + 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', + userId: 'sample-user-id', + anonymousId: 'sample-anon-id', + type: 'identify', + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + title: 'engineer', + countryName: 'USA', + countryCode: 'US', + city: 'New York', + hobbyCustomField: 'Sample Hobby', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + createDate: 1571043797562, + title: 'engineer', + propertyKeys: ['AP-XABC-123'], + location: { + countryName: 'USA', + countryCode: 'US', + city: 'New York', + }, + customAttributes: { + hobby: 'Sample Hobby', + }, + }, + }, + type: 'REST', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/users/sample-user-id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [], + globalContextMap: [], + }, + }, + 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, + }, + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + medium: null, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + userId: 'sample-user-id', + groupId: 'ecorp-id', + type: 'group', + traits: { + name: 'ECorp', + industry: 'software', + numberOfEmployees: 400, + website: 'www.ecorp.com', + plan: 'premium', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + accountId: 'ecorp-id', + }, + }, + type: 'REST', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/users/sample-user-id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + globalContextMap: [], + }, + }, + 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: 'identify', + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + title: 'engineer', + countryName: 'USA', + countryCode: 'US', + city: 'New York', + hobbyCustomField: 'Sample Hobby', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'userId or anonymousId is required for identify', + statTags: { + destType: 'GAINSIGHT_PX', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: '', + to: '', + }, + ], + globalContextMap: [ + { + from: 'projectId', + to: 'p-123', + }, + { + from: 'tag', + to: 'sample-category-tag', + }, + ], + }, + }, + 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', + event: 'Product Added', + properties: { + product_id: '123', + sku: 'F16', + category: 'Games', + name: 'Game', + brand: 'Gamepro', + variant: '111', + price: 13.49, + quantity: 11, + coupon: 'DISC21', + position: 1, + url: 'https://www.website.com/product/path', + image_url: 'https://www.website.com/product/path.png', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Missing required value from "userId"', + statTags: { + destType: 'GAINSIGHT_PX', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [], + globalContextMap: [], + }, + }, + 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, + }, + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + userId: 'sample-user-id', + type: 'group', + traits: { + name: 'ECorp', + industry: 'software', + numberOfEmployees: 400, + website: 'www.ecorp.com', + plan: 'premium', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'groupId is required for group', + statTags: { + destType: 'GAINSIGHT_PX', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: '', + to: '', + }, + ], + globalContextMap: [ + { + from: 'projectId', + to: 'p-123', + }, + { + from: 'tag', + to: 'sample-category-tag', + }, + ], + }, + }, + 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, + }, + }, + userId: 'sample-user-id', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + type: 'track', + event: 'Stringify Test', + properties: { + description: 'Stringify test for object values', + nested: { + a: [1, 2, 3], + b: { + c: 1, + }, + }, + arr: [1, 2, 3], + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + attributes: { + description: 'Stringify test for object values', + nested: '{"a":[1,2,3],"b":{"c":1}}', + arr: '[1,2,3]', + }, + propertyKey: 'AP-XABC-123', + userType: 'USER', + identifyId: 'sample-user-id', + date: 1571043797562, + eventName: 'Stringify Test', + globalContext: { + projectId: 'p-123', + tag: 'sample-category-tag', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/events/custom', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: '', + to: '', + }, + ], + globalContextMap: [ + { + from: 'projectId', + to: 'p-123', + }, + { + from: 'tag', + to: 'sample-category-tag', + }, + ], + }, + }, + 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, + }, + }, + userId: 'sample-user-id', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + type: 'track', + event: 'Stringify Test', + properties: { + description: 'Stringify test for object values', + nested: { + a: [1, 2, 3], + b: { + c: 1, + }, + }, + arr: [1, 2, 3], + globalContext: { + someKey: 'someVal', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + attributes: { + description: 'Stringify test for object values', + nested: '{"a":[1,2,3],"b":{"c":1}}', + arr: '[1,2,3]', + }, + propertyKey: 'AP-XABC-123', + userType: 'USER', + identifyId: 'sample-user-id', + date: 1571043797562, + eventName: 'Stringify Test', + globalContext: { + someKey: 'someVal', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/events/custom', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [], + globalContextMap: [], + }, + }, + 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, + }, + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + userId: 'absent-id', + groupId: 'ecorp-id', + type: 'group', + traits: { + name: 'ECorp', + industry: 'software', + numberOfEmployees: 400, + website: 'www.ecorp.com', + plan: 'premium', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'aborting group call: {"status":"NOT_FOUND","message":"User was not found for parameters {id=absent-id}","debugMessage":null,"subErrors":null}', + statTags: { + destType: 'GAINSIGHT_PX', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + globalContextMap: [], + }, + }, + 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', + userId: 'absent-id', + anonymousId: 'sample-anon-id', + type: 'identify', + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + title: 'engineer', + countryName: 'USA', + countryCode: 'US', + city: 'New York', + hobbyCustomField: 'Sample Hobby', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + identifyId: 'absent-id', + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + createDate: 1571043797562, + title: 'engineer', + propertyKeys: ['AP-XABC-123'], + location: { + countryName: 'USA', + countryCode: 'US', + city: 'New York', + }, + customAttributes: { + hobby: 'Sample Hobby', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/users', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: '', + to: '', + }, + ], + globalContextMap: [], + }, + }, + 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', + userId: 'absent-id', + anonymousId: 'sample-anon-id', + type: 'identify', + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + title: 'engineer', + countryName: 'USA', + countryCode: 'US', + city: 'New York', + hobbyCustomField: 'Sample Hobby', + accountId: 1234, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + identifyId: 'absent-id', + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + createDate: 1571043797562, + title: 'engineer', + propertyKeys: ['AP-XABC-123'], + accountId: '1234', + location: { + countryName: 'USA', + countryCode: 'US', + city: 'New York', + }, + customAttributes: {}, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/users', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [], + globalContextMap: [], + }, + }, + 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, + }, + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'sample-anon-id', + userId: 'absent-id', + groupId: 'ecorp-id', + type: 'group', + traits: { + name: 'ECorp', + industry: 'software', + numberOfEmployees: 400, + website: 'www.ecorp.com', + plan: 'premium', + term: null, + }, + integrations: { + All: true, + GAINSIGHT_PX: { + limitAPIForGroup: true, + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.aptrinsic.com/v1/users/absent-id', + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + accountId: 'ecorp-id', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 14', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + globalContextMap: [], + }, + }, + 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', + userId: 'sample-user-id', + anonymousId: 'sample-anon-id', + type: 'identify', + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + title: 'engineer', + countryName: 'USA', + countryCode: 'US', + city: 'New York', + hobbyCustomField: 'Sample Hobby', + term: null, + campaign: '', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1624431528295, + createDate: 1571043797562, + title: 'engineer', + propertyKeys: ['AP-XABC-123'], + location: { + countryName: 'USA', + countryCode: 'US', + city: 'New York', + }, + customAttributes: { + hobby: 'Sample Hobby', + }, + }, + }, + type: 'REST', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/users/sample-user-id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 15 : new user with no signUpDate in traits', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'sample-api-key', + productTagKey: 'AP-XABC-123', + accountAttributeMap: [ + { + from: '', + to: '', + }, + ], + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + globalContextMap: [], + }, + }, + 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', + userId: 'absent-id', + anonymousId: 'sample-anon-id', + type: 'identify', + traits: { + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + title: 'engineer', + countryName: 'USA', + countryCode: 'US', + city: 'New York', + hobbyCustomField: 'Sample Hobby', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + identifyId: 'absent-id', + type: 'USER', + gender: 'MALE', + email: 'user@email.com', + firstName: 'Sample', + lastName: 'User', + signUpDate: 1571043797562, + createDate: 1571043797562, + title: 'engineer', + propertyKeys: ['AP-XABC-123'], + location: { + countryName: 'USA', + countryCode: 'US', + city: 'New York', + }, + customAttributes: { + hobby: 'Sample Hobby', + }, + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: 'https://api.aptrinsic.com/v1/users', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'gainsight_px', + description: 'Test 16 : existing user with no signUpDate in traits', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + Name: 'gainsight-px-dest', + DestinationDefinition: { + ID: '1uLuOdwPCqtei55ZKXewwPhjQPf', + Name: 'GAINSIGHT_PX', + DisplayName: 'Gainsight PX', + Config: { + destConfig: { + defaultConfig: [ + 'apiKey', + 'productTagKey', + 'userAttributeMap', + 'accountAttributeMap', + 'globalContextMap', + ], + }, + excludeKeys: [], + includeKeys: [], + saveDestinationResponse: true, + secretKeys: ['apiKey', 'productTagKey'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + 'flutter', + ], + transformAt: 'router', + transformAtV1: 'router', + }, + ResponseRules: {}, + }, + Config: { + accountAttributeMap: [ + { + from: 'cultureCustomField', + to: 'culture', + }, + ], + apiKey: 'sample-api-key', + eventDelivery: false, + eventDeliveryTS: 1624472902670, + globalContextMap: [ + { + from: 'kubrickTest', + to: 'value', + }, + ], + productTagKey: 'AP-SAMPLE-2', + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + type: 'identify', + sentAt: '2021-06-25T08:59:52.891Z', + userId: 'stanley-kubrick', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + title: 'Test', + search: '', + path: 'index.html', + url: 'http://127.0.0.1:3003/index.html', + tab_url: 'http://127.0.0.1:3003/index.html', + referrer: '$direct', + initial_referrer: '$direct', + referring_domain: '', + initial_referring_domain: '', + }, + locale: 'en-GB', + screen: { + width: 1920, + height: 1080, + density: 1, + innerWidth: 1920, + innerHeight: 436, + }, + traits: { + name: 'Stanley Kubrick', + email: 'stanley@kubrick.com', + score: 100, + title: 'Director/Film Maker', + gender: 'Male', + countryCode: 'US', + countryName: 'USA', + hobbyCustomField: 'Making films. Being a genius', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.18', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36', + }, + rudderId: '9a7820d0-0ff2-4451-b655-682cec15cbd2', + messageId: 'ff90d62e-a6e3-4e23-af20-03b4a249ef48', + timestamp: '2021-06-25T14:29:52.911+05:30', + receivedAt: '2021-06-25T14:29:52.911+05:30', + request_ip: '[::1]', + anonymousId: '1585ea2f-dddc-4d23-935f-c1196405d61e', + integrations: { + All: true, + }, + originalTimestamp: '2021-06-25T08:59:52.891Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.aptrinsic.com/v1/users/stanley-kubrick', + userId: '', + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'stanley@kubrick.com', + gender: 'MALE', + title: 'Director/Film Maker', + score: 100, + createDate: 1624611592911, + location: { + countryName: 'USA', + countryCode: 'US', + }, + firstName: 'Stanley', + lastName: 'Kubrick', + customAttributes: { + hobby: 'Making films. Being a genius', + }, + propertyKeys: ['AP-SAMPLE-2'], + type: 'USER', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/gainsight_px/router/data.ts b/test/integrations/destinations/gainsight_px/router/data.ts index 4017a3ddb7..0268266d6a 100644 --- a/test/integrations/destinations/gainsight_px/router/data.ts +++ b/test/integrations/destinations/gainsight_px/router/data.ts @@ -1,558 +1,558 @@ export const data = [ - { - name: 'gainsight_px', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "message": { - "type": "identify", - "sentAt": "2021-06-25T08:59:52.891Z", - "userId": "stanley-kubrick", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "title": "Test", - "search": "", - "path": "index.html", - "url": "http://127.0.0.1:3003/index.html", - "tab_url": "http://127.0.0.1:3003/index.html", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-GB", - "screen": { - "width": 1920, - "height": 1080, - "density": 1, - "innerWidth": 1920, - "innerHeight": 436 - }, - "traits": { - "name": "Stanley Kubrick", - "email": "stanley@kubrick.com", - "score": 100, - "title": "Director/Film Maker", - "gender": "Male", - "countryCode": "US", - "countryName": "USA", - "hobbyCustomField": "Making films. Being a genius" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" - }, - "rudderId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", - "messageId": "ff90d62e-a6e3-4e23-af20-03b4a249ef48", - "timestamp": "2021-06-25T14:29:52.911+05:30", - "receivedAt": "2021-06-25T14:29:52.911+05:30", - "request_ip": "[::1]", - "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-06-25T08:59:52.891Z" - }, - "metadata": { - "userId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", - "jobId": 1, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-25T14:29:52.911+05:30", - "createdAt": "2021-06-25T08:59:56.329Z", - "firstAttemptedAt": "", - "transformAt": "router" - }, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - }, - { - "message": { - "type": "track", - "event": "nested test2", - "sentAt": "2021-06-26T10:41:22.316Z", - "userId": "adifhas9734", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.18", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "path": "/Users/anurajguha/workspace/simple-html-test/index.html", - "title": "Test", - "search": "", - "tab_url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "referrer": "$direct", - "initial_referrer": "$direct", - "referring_domain": "", - "initial_referring_domain": "" - }, - "locale": "en-GB", - "screen": { - "width": 1920, - "height": 1080, - "density": 1, - "innerWidth": 1920, - "innerHeight": 585 - }, - "traits": { - "name": "Update test unique", - "phone": "9900990899", - "lastname": "user6", - "firstname": "test", - "previousCompany": "testprevCompany2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.18" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36" - }, - "rudderId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", - "messageId": "595dae36-5e4f-4feb-a2e4-8a7849615d38", - "timestamp": "2021-06-26T16:11:22.335+05:30", - "properties": { - "array": [1, 2, 3], - "nested": { - "json": "test" - }, - "status": "testing", - "description": "Example track call", - "fullyNested": [ - { - "a": 1, - "b": 2 - }, - { - "a": 1, - "b": [1, 2, 3] - } - ] - }, - "receivedAt": "2021-06-26T16:11:22.335+05:30", - "request_ip": "[::1]", - "anonymousId": "1585ea2f-dddc-4d23-935f-c1196405d61e", - "integrations": { - "All": true - }, - "originalTimestamp": "2021-06-26T10:41:22.316Z" - }, - "metadata": { - "userId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", - "jobId": 2, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-26T16:11:22.335+05:30", - "createdAt": "2021-06-26T10:41:24.126Z", - "firstAttemptedAt": "", - "transformAt": "router" - }, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - , - destType: 'gainsight_px', + { + name: 'gainsight_px', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'identify', + sentAt: '2021-06-25T08:59:52.891Z', + userId: 'stanley-kubrick', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + title: 'Test', + search: '', + path: 'index.html', + url: 'http://127.0.0.1:3003/index.html', + tab_url: 'http://127.0.0.1:3003/index.html', + referrer: '$direct', + initial_referrer: '$direct', + referring_domain: '', + initial_referring_domain: '', + }, + locale: 'en-GB', + screen: { + width: 1920, + height: 1080, + density: 1, + innerWidth: 1920, + innerHeight: 436, + }, + traits: { + name: 'Stanley Kubrick', + email: 'stanley@kubrick.com', + score: 100, + title: 'Director/Film Maker', + gender: 'Male', + countryCode: 'US', + countryName: 'USA', + hobbyCustomField: 'Making films. Being a genius', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.18', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36', + }, + rudderId: '9a7820d0-0ff2-4451-b655-682cec15cbd2', + messageId: 'ff90d62e-a6e3-4e23-af20-03b4a249ef48', + timestamp: '2021-06-25T14:29:52.911+05:30', + receivedAt: '2021-06-25T14:29:52.911+05:30', + request_ip: '[::1]', + anonymousId: '1585ea2f-dddc-4d23-935f-c1196405d61e', + integrations: { + All: true, + }, + originalTimestamp: '2021-06-25T08:59:52.891Z', + }, + metadata: { + userId: '9a7820d0-0ff2-4451-b655-682cec15cbd2', + jobId: 1, + sourceId: '1s9eG8UCer6YSKsD8ZlQCyLa3pj', + destinationId: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + attemptNum: 0, + receivedAt: '2021-06-25T14:29:52.911+05:30', + createdAt: '2021-06-25T08:59:56.329Z', + firstAttemptedAt: '', + transformAt: 'router', + }, + destination: { + ID: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + Name: 'gainsight-px-dest', + DestinationDefinition: { + ID: '1uLuOdwPCqtei55ZKXewwPhjQPf', + Name: 'GAINSIGHT_PX', + DisplayName: 'Gainsight PX', + Config: { + destConfig: { + defaultConfig: [ + 'apiKey', + 'productTagKey', + 'userAttributeMap', + 'accountAttributeMap', + 'globalContextMap', + ], + }, + excludeKeys: [], + includeKeys: [], + saveDestinationResponse: true, + secretKeys: ['apiKey', 'productTagKey'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + 'flutter', + ], + transformAt: 'router', + transformAtV1: 'router', + }, + ResponseRules: {}, }, + Config: { + accountAttributeMap: [ + { + from: 'cultureCustomField', + to: 'culture', + }, + ], + apiKey: 'sample-api-key', + eventDelivery: false, + eventDeliveryTS: 1624472902670, + globalContextMap: [ + { + from: 'kubrickTest', + to: 'value', + }, + ], + productTagKey: 'AP-SAMPLE-2', + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, }, + { + message: { + type: 'track', + event: 'nested test2', + sentAt: '2021-06-26T10:41:22.316Z', + userId: 'adifhas9734', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'file:///Users/anurajguha/workspace/simple-html-test/index.html', + path: '/Users/anurajguha/workspace/simple-html-test/index.html', + title: 'Test', + search: '', + tab_url: 'file:///Users/anurajguha/workspace/simple-html-test/index.html', + referrer: '$direct', + initial_referrer: '$direct', + referring_domain: '', + initial_referring_domain: '', + }, + locale: 'en-GB', + screen: { + width: 1920, + height: 1080, + density: 1, + innerWidth: 1920, + innerHeight: 585, + }, + traits: { + name: 'Update test unique', + phone: '9900990899', + lastname: 'user6', + firstname: 'test', + previousCompany: 'testprevCompany2', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.18', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36', + }, + rudderId: 'a27a8a8a-9e81-4898-beeb-e6041fc1552d', + messageId: '595dae36-5e4f-4feb-a2e4-8a7849615d38', + timestamp: '2021-06-26T16:11:22.335+05:30', + properties: { + array: [1, 2, 3], + nested: { + json: 'test', + }, + status: 'testing', + description: 'Example track call', + fullyNested: [ + { + a: 1, + b: 2, + }, + { + a: 1, + b: [1, 2, 3], + }, + ], + }, + receivedAt: '2021-06-26T16:11:22.335+05:30', + request_ip: '[::1]', + anonymousId: '1585ea2f-dddc-4d23-935f-c1196405d61e', + integrations: { + All: true, + }, + originalTimestamp: '2021-06-26T10:41:22.316Z', + }, + metadata: { + userId: 'a27a8a8a-9e81-4898-beeb-e6041fc1552d', + jobId: 2, + sourceId: '1s9eG8UCer6YSKsD8ZlQCyLa3pj', + destinationId: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + attemptNum: 0, + receivedAt: '2021-06-26T16:11:22.335+05:30', + createdAt: '2021-06-26T10:41:24.126Z', + firstAttemptedAt: '', + transformAt: 'router', + }, + destination: { + ID: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + Name: 'gainsight-px-dest', + DestinationDefinition: { + ID: '1uLuOdwPCqtei55ZKXewwPhjQPf', + Name: 'GAINSIGHT_PX', + DisplayName: 'Gainsight PX', + Config: { + destConfig: { + defaultConfig: [ + 'apiKey', + 'productTagKey', + 'userAttributeMap', + 'accountAttributeMap', + 'globalContextMap', + ], + }, + excludeKeys: [], + includeKeys: [], + saveDestinationResponse: true, + secretKeys: ['apiKey', 'productTagKey'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + 'flutter', + ], + transformAt: 'router', + transformAtV1: 'router', + }, + ResponseRules: {}, + }, + Config: { + accountAttributeMap: [ + { + from: 'cultureCustomField', + to: 'culture', + }, + ], + apiKey: 'sample-api-key', + eventDelivery: false, + eventDeliveryTS: 1624472902670, + globalContextMap: [ + { + from: 'kubrickTest', + to: 'value', + }, + ], + productTagKey: 'AP-SAMPLE-2', + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + destType: 'gainsight_px', }, - output: { - response: { - status: 200, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.aptrinsic.com/v1/users/stanley-kubrick', + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'stanley@kubrick.com', + gender: 'MALE', + title: 'Director/Film Maker', + score: 100, + createDate: 1624611592911, + location: { + countryName: 'USA', + countryCode: 'US', + }, + firstName: 'Stanley', + lastName: 'Kubrick', + customAttributes: { + hobby: 'Making films. Being a genius', + }, + propertyKeys: ['AP-SAMPLE-2'], + type: 'USER', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + userId: '9a7820d0-0ff2-4451-b655-682cec15cbd2', + jobId: 1, + sourceId: '1s9eG8UCer6YSKsD8ZlQCyLa3pj', + destinationId: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + attemptNum: 0, + receivedAt: '2021-06-25T14:29:52.911+05:30', + createdAt: '2021-06-25T08:59:56.329Z', + firstAttemptedAt: '', + transformAt: 'router', + }, + ], + batched: false, + statusCode: 200, + destination: { + ID: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + Name: 'gainsight-px-dest', + DestinationDefinition: { + ID: '1uLuOdwPCqtei55ZKXewwPhjQPf', + Name: 'GAINSIGHT_PX', + DisplayName: 'Gainsight PX', + Config: { + destConfig: { + defaultConfig: [ + 'apiKey', + 'productTagKey', + 'userAttributeMap', + 'accountAttributeMap', + 'globalContextMap', + ], + }, + excludeKeys: [], + includeKeys: [], + saveDestinationResponse: true, + secretKeys: ['apiKey', 'productTagKey'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + 'flutter', + ], + transformAt: 'router', + transformAtV1: 'router', + }, + ResponseRules: {}, + }, + Config: { + accountAttributeMap: [ + { + from: 'cultureCustomField', + to: 'culture', + }, + ], + apiKey: 'sample-api-key', + eventDelivery: false, + eventDeliveryTS: 1624472902670, + globalContextMap: [ + { + from: 'kubrickTest', + to: 'value', + }, + ], + productTagKey: 'AP-SAMPLE-2', + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.aptrinsic.com/v1/events/custom', + headers: { + 'X-APTRINSIC-API-KEY': 'sample-api-key', + 'Content-Type': 'application/json', + }, + params: {}, body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.aptrinsic.com/v1/users/stanley-kubrick", - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "email": "stanley@kubrick.com", - "gender": "MALE", - "signUpDate": 1624611592911, - "title": "Director/Film Maker", - "score": 100, - "createDate": 1624611592911, - "location": { - "countryName": "USA", - "countryCode": "US" - }, - "firstName": "Stanley", - "lastName": "Kubrick", - "customAttributes": { - "hobby": "Making films. Being a genius" - }, - "propertyKeys": ["AP-SAMPLE-2"], - "type": "USER" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "userId": "9a7820d0-0ff2-4451-b655-682cec15cbd2", - "jobId": 1, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-25T14:29:52.911+05:30", - "createdAt": "2021-06-25T08:59:56.329Z", - "firstAttemptedAt": "", - "transformAt": "router" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.aptrinsic.com/v1/events/custom", - "headers": { - "X-APTRINSIC-API-KEY": "sample-api-key", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "identifyId": "adifhas9734", - "eventName": "nested test2", - "date": 1624704082335, - "attributes": { - "array": "[1,2,3]", - "nested": "{\"json\":\"test\"}", - "status": "testing", - "description": "Example track call", - "fullyNested": "[{\"a\":1,\"b\":2},{\"a\":1,\"b\":[1,2,3]}]" - }, - "url": "file:///Users/anurajguha/workspace/simple-html-test/index.html", - "referrer": "$direct", - "propertyKey": "AP-SAMPLE-2", - "userType": "USER", - "globalContext": { - "kubrickTest": "value" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "userId": "a27a8a8a-9e81-4898-beeb-e6041fc1552d", - "jobId": 2, - "sourceId": "1s9eG8UCer6YSKsD8ZlQCyLa3pj", - "destinationId": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "attemptNum": 0, - "receivedAt": "2021-06-26T16:11:22.335+05:30", - "createdAt": "2021-06-26T10:41:24.126Z", - "firstAttemptedAt": "", - "transformAt": "router" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1uLy1tqsoo9RhL1zLiqLQTKBIKL", - "Name": "gainsight-px-dest", - "DestinationDefinition": { - "ID": "1uLuOdwPCqtei55ZKXewwPhjQPf", - "Name": "GAINSIGHT_PX", - "DisplayName": "Gainsight PX", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "productTagKey", - "userAttributeMap", - "accountAttributeMap", - "globalContextMap" - ] - }, - "excludeKeys": [], - "includeKeys": [], - "saveDestinationResponse": true, - "secretKeys": ["apiKey", "productTagKey"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter" - ], - "transformAt": "router", - "transformAtV1": "router" - }, - "ResponseRules": {} - }, - "Config": { - "accountAttributeMap": [ - { - "from": "cultureCustomField", - "to": "culture" - } - ], - "apiKey": "sample-api-key", - "eventDelivery": false, - "eventDeliveryTS": 1624472902670, - "globalContextMap": [ - { - "from": "kubrickTest", - "to": "value" - } - ], - "productTagKey": "AP-SAMPLE-2", - "userAttributeMap": [ - { - "from": "hobbyCustomField", - "to": "hobby" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } + JSON: { + identifyId: 'adifhas9734', + eventName: 'nested test2', + date: 1624704082335, + attributes: { + array: '[1,2,3]', + nested: '{"json":"test"}', + status: 'testing', + description: 'Example track call', + fullyNested: '[{"a":1,"b":2},{"a":1,"b":[1,2,3]}]', + }, + url: 'file:///Users/anurajguha/workspace/simple-html-test/index.html', + referrer: '$direct', + propertyKey: 'AP-SAMPLE-2', + userType: 'USER', + globalContext: { + kubrickTest: 'value', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + userId: 'a27a8a8a-9e81-4898-beeb-e6041fc1552d', + jobId: 2, + sourceId: '1s9eG8UCer6YSKsD8ZlQCyLa3pj', + destinationId: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + attemptNum: 0, + receivedAt: '2021-06-26T16:11:22.335+05:30', + createdAt: '2021-06-26T10:41:24.126Z', + firstAttemptedAt: '', + transformAt: 'router', + }, + ], + batched: false, + statusCode: 200, + destination: { + ID: '1uLy1tqsoo9RhL1zLiqLQTKBIKL', + Name: 'gainsight-px-dest', + DestinationDefinition: { + ID: '1uLuOdwPCqtei55ZKXewwPhjQPf', + Name: 'GAINSIGHT_PX', + DisplayName: 'Gainsight PX', + Config: { + destConfig: { + defaultConfig: [ + 'apiKey', + 'productTagKey', + 'userAttributeMap', + 'accountAttributeMap', + 'globalContextMap', + ], + }, + excludeKeys: [], + includeKeys: [], + saveDestinationResponse: true, + secretKeys: ['apiKey', 'productTagKey'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + 'flutter', ], + transformAt: 'router', + transformAtV1: 'router', + }, + ResponseRules: {}, + }, + Config: { + accountAttributeMap: [ + { + from: 'cultureCustomField', + to: 'culture', + }, + ], + apiKey: 'sample-api-key', + eventDelivery: false, + eventDeliveryTS: 1624472902670, + globalContextMap: [ + { + from: 'kubrickTest', + to: 'value', + }, + ], + productTagKey: 'AP-SAMPLE-2', + userAttributeMap: [ + { + from: 'hobbyCustomField', + to: 'hobby', + }, + ], }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, }, + ], }, + }, }, + }, ];