diff --git a/jest.config.js b/jest.config.js index 875c8f8893..412d8d2733 100644 --- a/jest.config.js +++ b/jest.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 80, - lines: 80, - statements: 80, + functions: 75, + lines: 75, + statements: 75, }, }, diff --git a/jest.default.config.js b/jest.default.config.js index 895b8aa075..fed1dcef31 100644 --- a/jest.default.config.js +++ b/jest.default.config.js @@ -36,9 +36,9 @@ module.exports = { coverageThreshold: { global: { branches: 60, - functions: 80, - lines: 80, - statements: 80, + functions: 75, + lines: 75, + statements: 75, }, }, diff --git a/src/v0/destinations/clevertap/transform.js b/src/v0/destinations/clevertap/transform.js index 7bbc4dc59c..5c1e28c086 100644 --- a/src/v0/destinations/clevertap/transform.js +++ b/src/v0/destinations/clevertap/transform.js @@ -419,7 +419,7 @@ const processRouterDest = (inputs, reqMetadata) => { batchedEvents.forEach((batch) => { const batchedRequest = generateClevertapBatchedPayload(batch.events, batch.destination); batchResponseList.push( - getSuccessRespEvents(batchedRequest, batch.metadata, batch.destination) + getSuccessRespEvents(batchedRequest, batch.metadata, batch.destination), ); }); } diff --git a/src/v0/destinations/hs/HSTransform-v1.js b/src/v0/destinations/hs/HSTransform-v1.js index 5cb80f10f5..30546ad8f6 100644 --- a/src/v0/destinations/hs/HSTransform-v1.js +++ b/src/v0/destinations/hs/HSTransform-v1.js @@ -81,7 +81,7 @@ const processLegacyIdentify = async (message, destination, propertyMap) => { )}/${hsSearchId}`; response.method = defaultPatchRequestConfig.requestMethod; } - + traits = await populateTraits(propertyMap, traits, destination); response.body.JSON = removeUndefinedAndNullValues({ properties: traits }); response.source = 'rETL'; diff --git a/src/v0/destinations/hs/util.js b/src/v0/destinations/hs/util.js index 31c4252a4b..eb062b0c39 100644 --- a/src/v0/destinations/hs/util.js +++ b/src/v0/destinations/hs/util.js @@ -158,14 +158,16 @@ const validatePayloadDataTypes = (propertyMap, hsSupportedKey, value, traitsKey) if (propertyMap[hsSupportedKey] === 'bool' && typeof propValue === 'object') { throw new InstrumentationError( - `Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${propertyMap[hsSupportedKey] + `Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${ + propertyMap[hsSupportedKey] }`, ); } if (propertyMap[hsSupportedKey] === 'number' && typeof propValue !== 'number') { throw new InstrumentationError( - `Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${propertyMap[hsSupportedKey] + `Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${ + propertyMap[hsSupportedKey] }`, ); } @@ -175,15 +177,15 @@ const validatePayloadDataTypes = (propertyMap, hsSupportedKey, value, traitsKey) /** * Converts date to UTC Midnight TimeStamp - * @param {*} propValue - * @returns + * @param {*} propValue + * @returns */ const getUTCMidnightTimeStampValue = (propValue) => { const time = propValue; const date = new Date(time); date.setUTCHours(0, 0, 0, 0); return date.getTime(); -} +}; /** * add addtional properties in the payload that is provided in traits @@ -532,15 +534,15 @@ const getExistingData = async (inputs, destination) => { searchResponse = Config.authorizationType === 'newPrivateAppApi' ? await httpPOST(url, requestData, requestOptions, { - destType: 'hs', - feature: 'transformation', - endpointPath, - }) + destType: 'hs', + feature: 'transformation', + endpointPath, + }) : await httpPOST(url, requestData, { - destType: 'hs', - feature: 'transformation', - endpointPath, - }); + destType: 'hs', + feature: 'transformation', + endpointPath, + }); searchResponse = processAxiosResponse(searchResponse); if (searchResponse.status !== 200) { @@ -637,9 +639,9 @@ const getHsSearchId = (message) => { /** * returns updated traits - * @param {*} propertyMap - * @param {*} traits - * @param {*} destination + * @param {*} propertyMap + * @param {*} traits + * @param {*} destination */ const populateTraits = async (propertyMap, traits, destination) => { const populatedTraits = traits; @@ -655,10 +657,10 @@ const populateTraits = async (propertyMap, traits, destination) => { if (propertyToTypeMap[key] === 'date') { populatedTraits[key] = getUTCMidnightTimeStampValue(value); } - }) + }); return populatedTraits; -} +}; module.exports = { validateDestinationConfig, diff --git a/src/v0/destinations/redis/transform.js b/src/v0/destinations/redis/transform.js index e9442d8487..ffc4a33c43 100644 --- a/src/v0/destinations/redis/transform.js +++ b/src/v0/destinations/redis/transform.js @@ -51,7 +51,7 @@ const process = (event) => { const messageType = message && message.type && message.type.toLowerCase(); if (messageType !== EventType.IDENTIFY) { - return []; + throw new InstrumentationError('Only Identify calls are supported'); } if (isEmpty(message.userId)) { diff --git a/src/v0/destinations/snapchat_conversion/data/TrackEventCommonConfig.json b/src/v0/destinations/snapchat_conversion/data/TrackEventCommonConfig.json index 39187f47b0..42b61fd605 100644 --- a/src/v0/destinations/snapchat_conversion/data/TrackEventCommonConfig.json +++ b/src/v0/destinations/snapchat_conversion/data/TrackEventCommonConfig.json @@ -1,90 +1,90 @@ [ - { - "destKey": "description", - "sourceKeys": "properties.description", - "required": false - }, - { - "destKey": "brands", - "sourceKeys": "properties.brands", - "required": false, - "metadata": { - "type": "IsArray" - } - }, - { - "destKey": "event_tag", - "sourceKeys": "properties.event_tag", - "required": false - }, - { - "destKey": "click_id", - "sourceKeys": "properties.click_id", - "required": false - }, - { - "destKey": "level", - "sourceKeys": "properties.level", - "required": false - }, - { - "destKey": "uuid_c1", - "sourceKeys": "properties.uuid_c1", - "required": false - }, - { - "destKey": "customer_status", - "sourceKeys": "properties.customer_status", - "required": false - }, - { - "destKey": "data", - "sourceKeys": "properties.data", - "required": false - }, - { - "destKey": "att_status", - "sourceKeys": "properties.att_status", - "required": false - }, - { - "destKey": "sign_up_method", - "sourceKeys": "properties.sign_up_method", - "required": false - }, - { - "destKey": "advertiser_cookie_1", - "sourceKeys": "properties.advertiser_cookie_1", - "required": false - }, - { - "destKey": "delivery_method", - "sourceKeys": "properties.delivery_method", - "required": false - }, - { - "sourceKeys": "context.device.model", - "destKey": "device_model", - "required": false - }, - { - "sourceKeys": "country", - "destKey": "country", - "sourceFromGenericMap": true, - "required": false - }, - { - "sourceKeys": "region", - "destKey": "region", - "sourceFromGenericMap": true, - "required": false - }, - { - "sourceKeys": "context.userAgent", - "destKey": "user_agent", - "metadata": { - "type": "toLower" - }, - "required": false + { + "destKey": "description", + "sourceKeys": "properties.description", + "required": false + }, + { + "destKey": "brands", + "sourceKeys": "properties.brands", + "required": false, + "metadata": { + "type": "IsArray" } -] \ No newline at end of file + }, + { + "destKey": "event_tag", + "sourceKeys": "properties.event_tag", + "required": false + }, + { + "destKey": "click_id", + "sourceKeys": "properties.click_id", + "required": false + }, + { + "destKey": "level", + "sourceKeys": "properties.level", + "required": false + }, + { + "destKey": "uuid_c1", + "sourceKeys": "properties.uuid_c1", + "required": false + }, + { + "destKey": "customer_status", + "sourceKeys": "properties.customer_status", + "required": false + }, + { + "destKey": "data", + "sourceKeys": "properties.data", + "required": false + }, + { + "destKey": "att_status", + "sourceKeys": "properties.att_status", + "required": false + }, + { + "destKey": "sign_up_method", + "sourceKeys": "properties.sign_up_method", + "required": false + }, + { + "destKey": "advertiser_cookie_1", + "sourceKeys": "properties.advertiser_cookie_1", + "required": false + }, + { + "destKey": "delivery_method", + "sourceKeys": "properties.delivery_method", + "required": false + }, + { + "sourceKeys": "context.device.model", + "destKey": "device_model", + "required": false + }, + { + "sourceKeys": "country", + "destKey": "country", + "sourceFromGenericMap": true, + "required": false + }, + { + "sourceKeys": "region", + "destKey": "region", + "sourceFromGenericMap": true, + "required": false + }, + { + "sourceKeys": "context.userAgent", + "destKey": "user_agent", + "metadata": { + "type": "toLower" + }, + "required": false + } +] diff --git a/src/v0/destinations/snapchat_conversion/transform.js b/src/v0/destinations/snapchat_conversion/transform.js index 8af5b2dadc..49776935de 100644 --- a/src/v0/destinations/snapchat_conversion/transform.js +++ b/src/v0/destinations/snapchat_conversion/transform.js @@ -397,4 +397,4 @@ const processRouterDest = async (inputs, reqMetadata) => { return [...batchResponseList, ...errorRespList]; }; -module.exports = { process, processRouterDest }; \ No newline at end of file +module.exports = { process, processRouterDest }; diff --git a/test/__mocks__/data/marketo/proxy_response.json b/test/__mocks__/data/marketo/proxy_response.json deleted file mode 100644 index 4f5bfea7a6..0000000000 --- a/test/__mocks__/data/marketo/proxy_response.json +++ /dev/null @@ -1,282 +0,0 @@ -{ - "https://testMunchkin3.mktorest.com/bulk/v1/leads/batch/12345/warnings.json": { - "status": 200 - }, - "https://testMunchkin3.mktorest.com/bulk/v1/leads/batch/12345/failures.json": { - "status": 200 - }, - "https://a.mktorest.com/bulk/v1/leads/batch/12345/warnings.json": { - "status": 200, - "data": "data" - }, - "https://a.mktorest.com/bulk/v1/leads/batch/12345/failures.json": { - "status": 200, - "data": "data" - }, - "https://testMunchkin3.mktorest.com/bulk/v1/leads/batch/1234.json": { - "status": 200, - "data": { - "errors": [ - { - "message": "Any 400 error", - "code": 500 - } - ] - }, - "response": { - "statusText": "Any 500 error", - "status": 502 - } - }, - "https://testMunchkin4.mktorest.com/bulk/v1/leads/batch/1234.json": { - "status": 200, - "data": { - "errors": [ - { - "message": "Any 400 error", - "code": 1000 - } - ] - } - }, - "https://a.mktorest.com/bulk/v1/leads/batch/1234.json": { - "status": 200, - "data": { - "requestId": "13402#17e7238a1b9", - "result": [ - { - "batchId": 1234, - "importId": "1234", - "status": "Complete", - "numOfLeadsProcessed": 1, - "numOfRowsFailed": 0, - "numOfRowsWithWarning": 0, - "message": "Import succeeded, 1 records imported (1 members)" - } - ], - "success": true - } - }, - "https://testMunchkin4.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "message": "Any other error" - } - ] - } - }, - "https://testMunchkin4.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin3.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "message": "Empty file" - } - ] - } - }, - "https://testMunchkin3.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin2.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "message": "There are 10 imports currently being processed. Please try again later" - } - ] - } - }, - "https://testMunchkin2.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin1.mktorest.com/bulk/v1/leads.json": { - "status": 400 - }, - "https://testMunchkin1.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://testMunchkin.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "requestId": "125f1#17e710ba1fd", - "success": false, - "errors": [ - { - "code": "1006", - "message": "Header field 'a' not found" - } - ] - } - }, - "https://testMunchkin.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://a.mktorest.com/identity/oauth/token?client_id=b&client_secret=forThrottle&grant_type=client_credentials": { - "status": 500, - "response": { - "status": 502, - "statusText": "throttled" - } - }, - "https://a.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=c&grant_type=client_credentials": { - "status": 400, - "code": 401, - "statusText": "Unauthorized" - }, - "https://wrongMunchkin.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 400, - "code": "ENOTFOUND" - }, - "https://a.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials": { - "status": 200, - "data": { - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://a.mktorest.com/bulk/v1/leads.json": { - "status": 200, - "data": { - "success": true, - "result": [ - { - "importId": "TestImportId" - } - ], - "access_token": "abc", - "token_type": "bearer", - "expires_in": 2340, - "scope": "integrations@rudderstack.com" - } - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test1": { - "data": { - "requestId": "664#17dae8c3d48", - "result": [ - { - "id": 1328328, - "status": "updated" - } - ], - "success": true - }, - "status": 200, - "statusText": "OK" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test2": { - "data": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "601", - "message": "Access token invalid" - } - ] - }, - "status": 200, - "statusText": "OK" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test3": { - "data": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "610", - "message": "Requested resource not found" - } - ] - }, - "status": 200, - "statusText": "OK" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test4": { - "response": { - "data": { - "code": 413, - "payload_size_bytes": 86321233, - "message": "Payload exceeded 1MB limit." - }, - "status": 413, - "statusText": "Request Entity Too Large", - "headers": { - "date": "Sat, 11 Dec 2021 15:08:22 GMT", - "content-type": "application/json", - "content-length": "93", - "connection": "keep-alive", - "access-control-allow-origin": "*", - "access-control-allow-methods": "GET, POST", - "strict-transport-security": "max-age=15768000" - } - } - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test5": { - "response": {} - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test6": { - "response": "" - }, - "https://mktId.mktorest.com/rest/v1/leads.json/test7": { - "code": "[ENOTFOUND] :: DNS lookup failed" - }, - "https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json": { - "data": { - "requestId": "142e4#1835b117b76", - "success": false, - "errors": [ - { - "code": "random_marketo_code", - "message": "problem" - } - ] - }, - "status": 200, - "statusText": "OK" - } -} diff --git a/test/__tests__/data/hs_router_rETL_output.json b/test/__tests__/data/hs_router_rETL_output.json index dc7507220c..c20694cdf4 100644 --- a/test/__tests__/data/hs_router_rETL_output.json +++ b/test/__tests__/data/hs_router_rETL_output.json @@ -228,4 +228,4 @@ "isProcessorEnabled": true } } -] \ No newline at end of file +] diff --git a/test/__tests__/data/marketo_proxy_input.json b/test/__tests__/data/marketo_proxy_input.json deleted file mode 100644 index b846f02419..0000000000 --- a/test/__tests__/data/marketo_proxy_input.json +++ /dev/null @@ -1,272 +0,0 @@ -[ - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test1", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test2", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test3", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test4", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test5", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test6", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "type": "REST", - "endpoint": "https://mktId.mktorest.com/rest/v1/leads.json/test7", - "method": "POST", - "userId": "", - "headers": { - "Authorization": "Bearer token", - "Content-Type": "application/json" - }, - "body": { - "FORM": {}, - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "City": "Tokyo", - "Country": "JP", - "Email": "gabi29@gmail.com", - "PostalCode": "100-0001", - "Title": "Owner", - "id": 1328328, - "userId": "gabi_userId_45" - } - ], - "lookupField": "id" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer access_token_success" - }, - "body": { - "JSON": { - "action": "createOrUpdate", - "input": [ - { - "Email": "0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail", - "FirstName": "A", - "LastName": "M", - "id": 4, - "userId": "e17c5a5e-5e2f-430b-b497-fe3f1ea3a704" - } - ], - "lookupField": "id" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "params": { - "destination": "marketo" - } - } -] \ No newline at end of file diff --git a/test/__tests__/data/marketo_proxy_output.json b/test/__tests__/data/marketo_proxy_output.json deleted file mode 100644 index a17eb1d47d..0000000000 --- a/test/__tests__/data/marketo_proxy_output.json +++ /dev/null @@ -1,193 +0,0 @@ -[ - { - "output": { - "status": 200, - "message": "Request Processed Successfully", - "destinationResponse": { - "response": { - "requestId": "664#17dae8c3d48", - "result": [ - { - "id": 1328328, - "status": "updated" - } - ], - "success": true - }, - "status": 200 - } - } - }, - { - "output": { - "status": 500, - "message": "Request Failed for marketo, Access token invalid (Retryable).during Marketo Response Handling", - "destinationResponse": { - "response": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "601", - "message": "Access token invalid" - } - ] - }, - "status": 200 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Request Failed for marketo, Requested resource not found (Aborted).during Marketo Response Handling", - "destinationResponse": { - "response": { - "requestId": "a61c#17daea5968a", - "success": false, - "errors": [ - { - "code": "610", - "message": "Requested resource not found" - } - ] - }, - "status": 200 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 413, - "message": "Request failed with status: 413", - "destinationResponse": { - "response": { - "code": 413, - "payload_size_bytes": 86321233, - "message": "Payload exceeded 1MB limit." - }, - "status": 413 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Request failed with status: 500", - "destinationResponse": { - "response": "", - "status": 500 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Request failed with status: 500", - "destinationResponse": { - "response": "", - "status": 500 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Request failed with status: 400", - "destinationResponse": { - "response": "[[ENOTFOUND] :: DNS lookup failed]", - "status": 400 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Error occurred during Marketo Response Handling -> problem", - "destinationResponse": { - "response": { - "requestId": "142e4#1835b117b76", - "success": false, - "errors": [ - { - "code": "random_marketo_code", - "message": "problem" - } - ] - }, - "status": 200 - }, - "statTags": { - "destType": "MARKETO", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "meta": "unhandledStatusCode", - "module": "destination" - } - } - } -] \ No newline at end of file diff --git a/test/__tests__/data/redis_input.json b/test/__tests__/data/redis_input.json deleted file mode 100644 index e3407c837a..0000000000 --- a/test/__tests__/data/redis_input.json +++ /dev/null @@ -1,405 +0,0 @@ -[ - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": " " - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": [{ "x": 1, "y": 2 }], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": [{ "x": 1, "y": 2 }], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "arrayProp": [{ "x": 1, "y": 2 }], - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "traits": { - "country": "USA", - "firstname": "Mickey" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestEmptyKey" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "country": "UK", - "lastname": "Mouse", - "arrayProp": [{ "x": 1, "y": 2 }], - "emptyKey": "", - "nestedProp": { - "innerProp1": "innerPropVal1", - "innerProp2": "innerPropVal2", - "innerProp3": {} - } - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "traits": { - "country": "USA", - "firstname": "Mickey" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - "request": {} - }, - { - "destination": { - "Config": { - "address": "localhost:6379", - "database": "test", - "prefix": "TestPrefix" - }, - "DestinationDefinition": { - "DisplayName": "Redis", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "REDIS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Redis", - "Transformations": [] - }, - "metadata": { - "workspaceId": "some-workspace-id" - }, - "message": { - "userId": "some-user-id", - "channel": "sources", - "context": { - "sources": { - "job_id": "some-job-id", - "version": "some-version", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg", - "profiles_model": "some-model", - "profiles_entity": "some-entity", - "profiles_id_type": "some-id-type" - } - }, - "traits": { - "MODEL_ID": "1691755780", - "VALID_AT": "2023-08-11T11:32:44.963062Z", - "USER_MAIN_ID": "rid5530313526204a95efe71d98cd17d5a1", - "CHURN_SCORE_7_DAYS": 0.027986, - "PERCENTILE_CHURN_SCORE_7_DAYS": 0 - }, - "messageId": "some-message-id", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify" - }, - "request": {} - } -] diff --git a/test/__tests__/data/redis_output.json b/test/__tests__/data/redis_output.json deleted file mode 100644 index 69d2aa20c2..0000000000 --- a/test/__tests__/data/redis_output.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "message": { - "key": "user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "message": { - "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "UK", - "lastname": "Mouse", - "omega": "test", - "omega v2": "test", - "9mega": "test", - "mega&": "test", - "ome$ga": "test", - "alpha$": "test", - "ome_ ga": "test", - "9mega________-________90": "test", - "Cízǔ": "test", - "CamelCase123Key": "test", - "1CComega": "test", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "message": { - "key": "TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "USA", - "firstname": "Mickey", - "lastname": "Mouse", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "message": { - "key": "TestEmptyKey:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33", - "fields": { - "country": "USA", - "firstname": "Mickey", - "lastname": "Mouse", - "arrayProp": "[{\"x\":1,\"y\":2}]", - "emptyKey": "", - "nestedProp.innerProp1": "innerPropVal1", - "nestedProp.innerProp2": "innerPropVal2" - } - }, - "userId": "9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33" - }, - { - "error": "context or context.traits or traits is empty" - }, - { - "message": { - "hash": "some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id", - "key": "some-model", - "value": "{\"MODEL_ID\":\"1691755780\",\"VALID_AT\":\"2023-08-11T11:32:44.963062Z\",\"USER_MAIN_ID\":\"rid5530313526204a95efe71d98cd17d5a1\",\"CHURN_SCORE_7_DAYS\":0.027986,\"PERCENTILE_CHURN_SCORE_7_DAYS\":0}" - }, - "userId": "some-user-id" - } -] diff --git a/test/__tests__/data/revenue_cat_input.json b/test/__tests__/data/revenue_cat_input.json deleted file mode 100644 index 0e56415545..0000000000 --- a/test/__tests__/data/revenue_cat_input.json +++ /dev/null @@ -1,449 +0,0 @@ -[ - { - "destination": { - "Config": { - "apiKey": "as9d920a5e75a18acb4a29abd9ec1e2e", - "xPlatform": "stripe" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "lastname": "Doe", - "density": "420", - "height": "1794", - "width": "1080", - "iterableCampaignId": "1234", - "iterableTemplateId": "1234" - } - } - }, - { - "destination": { - "Config": { - "apiKey": "a5e75dfda29abd920ec1ec8a18acb42e", - "xPlatform": "stripe" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "firstname": "James", - "density": 420, - "height": 1794, - "width": 1080, - "iterableCampaignId": "1234", - "iterableTemplateId": "1234" - } - } - }, - { - "destination": { - "Config": { - "xPlatform": "stripe" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "name": "John Doe" - } - } - }, - { - "destination": { - "Config": { - "apiKey": "a5e75d99c8a18acb4a29abd920ec1e2e" - } - }, - "message": { - "userId": "rudder1235678", - "channel": "web", - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "phone": "92374162212", - "name": "John Doe" - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123", - "products": [ - { - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games", - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - } - ] - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "xPlatform": "stripe" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123", - "products": [ - { - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games", - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - } - ] - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "xPlatform": "stripe" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "products": [ - { - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games", - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - }, - { - "sku": "G-33", - "name": "SunGlass", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - { - "sku": "G-35", - "product_id": "1234sb", - "name": "Real-me", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - } - ] - } - } - }, - { - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "xPlatform": "stripe" - } - }, - "message": { - "type": "track", - "userId": "rudder123", - "properties": { - "checkout_id": "12345", - "order_id": "1234", - "affiliation": "Apple Store", - "total": 20, - "revenue": 15.0, - "shipping": 22, - "tax": 1, - "discount": 1.5, - "coupon": "ImagePro", - "currency": "USD", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - } - } - } -] diff --git a/test/__tests__/data/revenue_cat_output.json b/test/__tests__/data/revenue_cat_output.json deleted file mode 100644 index a4e49c25d0..0000000000 --- a/test/__tests__/data/revenue_cat_output.json +++ /dev/null @@ -1,424 +0,0 @@ -[ - [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", - "headers": { - "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", - "headers": { - "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "attributes": { - "app_user_id": { - "value": "rudder1235678" - }, - "$email": { - "value": "chandan@companyname.com" - }, - "$phoneNumber": { - "value": "92374162212" - }, - "$ip": { - "value": "14.5.67.21" - }, - "$iterableCampaignId": { - "value": "1234" - }, - "$iterableTemplateId": { - "value": "1234" - }, - "$displayName": { - "value": "Doe" - }, - "lastname": { - "value": "Doe" - }, - "density": { - "value": "420" - }, - "height": { - "value": "1794" - }, - "width": { - "value": "1080" - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", - "headers": { - "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", - "headers": { - "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "attributes": { - "app_user_id": { - "value": "rudder1235678" - }, - "$email": { - "value": "chandan@companyname.com" - }, - "$phoneNumber": { - "value": "92374162212" - }, - "$ip": { - "value": "14.5.67.21" - }, - "$iterableCampaignId": { - "value": "1234" - }, - "$iterableTemplateId": { - "value": "1234" - }, - "$displayName": { - "value": "James" - }, - "firstname": { - "value": "James" - }, - "density": { - "value": "420" - }, - "height": { - "value": "1794" - }, - "width": { - "value": "1080" - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Public API Key required for Authentication", - "statTags": { - "destination": "revenue_cat", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", - "headers": { - "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", - "headers": { - "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "attributes": { - "app_user_id": { - "value": "rudder1235678" - }, - "$displayName": { - "value": "John Doe" - }, - "$email": { - "value": "chandan@companyname.com" - }, - "$phoneNumber": { - "value": "92374162212" - }, - "$ip": { - "value": "14.5.67.21" - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "X-Platform is required field", - "statTags": { - "destination": "revenue_cat", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "123", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "345", - "currency": "USD", - "price": 3.45, - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "345", - "currency": "USD", - "price": 3.45, - "introductory_price": "250", - "is_restore": false, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "123-sa", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.revenuecat.com/v1/receipts", - "headers": { - "Authorization": "Basic dummyApiKey", - "Content-Type": "application/json", - "X-Platform": "stripe" - }, - "params": {}, - "body": { - "JSON": { - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "product_id": "1234sb", - "currency": "USD", - "price": 14, - "introductory_price": "350", - "is_restore": true, - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "price": 14, - "currency": "USD", - "is_restore": true, - "product_id": "123-sa", - "app_user_id": "rudder123", - "fetch_token": "dummyFetchToken", - "introductory_price": "350", - "presented_offering_identifier": "123erd" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "X-Platform": "stripe", - "Content-Type": "application/json", - "Authorization": "Basic dummyApiKey" - }, - "version": "1", - "endpoint": "https://api.revenuecat.com/v1/receipts" - } -] diff --git a/test/__tests__/data/salesforce_input.json b/test/__tests__/data/salesforce_input.json deleted file mode 100644 index 32115abf15..0000000000 --- a/test/__tests__/data/salesforce_input.json +++ /dev/null @@ -1,793 +0,0 @@ -[ - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "track", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs", - "customKey": "customValue", - "customNullValue": null - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp", - "LeadSource": "RudderLabs", - "customKey": "customValue", - "customNullValue": null - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "City": "east greenwich", - "Company": "Initech", - "Country": "USA", - "Email": "peter.gibbons@initech.com", - "FirstName": "Peter", - "LastName": "Gibbons", - "Phone": "570-690-4150", - "PostalCode": "94115", - "Rating": "Hot", - "State": "California", - "Street": "19123 forest lane", - "Title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", - "externalId": [ - { - "type": "Salesforce-Contact", - "id": "sf-contact-id" - } - ] - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com", - "mapProperty": false - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36", - "externalId": [ - { - "type": "Salesforce-Lead", - "id": "sf-contact-id" - } - ] - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", - "password": "dummyPassword2", - "userName": "test.c97-qvpd@force.com.test", - "sandbox": true - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", - "Name": "Test SF", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", - "password": "dummyPassword2", - "userName": "test.c97-qvpd@force.com.test", - "sandbox": true - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", - "Name": "Test SF", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "id": "a005g0000383kmUAAQ", - "type": "SALESFORCE-custom_object__c", - "identifierType": "Id" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "john@rs.com", - "firstname": "john doe" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - }, - { - "destination": { - "Config": { - "initialAccessToken": "7fiy1FKcO9sohsxq1v6J88sg", - "password": "dummyPassword2", - "userName": "test.c97-qvpd@force.com.test", - "sandbox": true - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1ut7LcVW1QC56y2EoTNo7ZwBWSY", - "Name": "Test SF", - "Transformations": [] - }, - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "id": "a005g0000383kmUAAQ", - "type": "SALESFORCE-custom_object__c", - "identifierType": "Id" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "john@rs.com", - "firstname": "john doe", - "Id": "some-id" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - } - } -] diff --git a/test/__tests__/data/salesforce_output.json b/test/__tests__/data/salesforce_output.json deleted file mode 100644 index 69b383d23a..0000000000 --- a/test/__tests__/data/salesforce_output.json +++ /dev/null @@ -1,320 +0,0 @@ -[ - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech", - "LeadSource": "RudderLabs" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "message type track is not supported" - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech", - "LeadSource": "RudderLabs", - "customKey__c": "customValue" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "PostalCode": "94115", - "LastName": "n/a", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "n/a", - "LeadSource": "RudderLabs", - "customKey__c": "customValue" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Contact/sf-contact-id?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email__c": "peter.gibbons@initech.com", - "Phone__c": "570-690-4150", - "Rating__c": "Hot", - "Title__c": "VP of Derp", - "FirstName__c": "Peter", - "LastName": "n/a", - "LastName__c": "Gibbons", - "PostalCode__c": "94115", - "City__c": "east greenwich", - "Country__c": "USA", - "State__c": "California", - "Street__c": "19123 forest lane", - "Company__c": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/sf-contact-id?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "email": "john@rs.com", - "firstname": "john doe" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "email": "john@rs.com", - "firstname": "john doe" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ] -] diff --git a/test/__tests__/data/salesforce_proxy_input.json b/test/__tests__/data/salesforce_proxy_input.json deleted file mode 100644 index f1aeef71ab..0000000000 --- a/test/__tests__/data/salesforce_proxy_input.json +++ /dev/null @@ -1,326 +0,0 @@ -[ - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/102", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer Incorrect_token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "files": {}, - "method": "POST", - "userId": "", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "version": "1", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7", - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "Email": "denis.kornilov@sbermarket.ru", - "Company": "sbermarket.ru", - "LastName": "Корнилов", - "FirstName": "Денис", - "LeadSource": "App Signup", - "account_type__c": "free_trial" - }, - "JSON_ARRAY": {} - }, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - }, - { - "type": "REST", - "method": "POST", - "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token" - }, - "body": { - "JSON": { - "Planning_Categories__c": "pc", - "External_ID__c": 123 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "metadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "params": { - "destination": "salesforce" - } - } -] diff --git a/test/__tests__/data/salesforce_proxy_output.json b/test/__tests__/data/salesforce_proxy_output.json deleted file mode 100644 index c900661b75..0000000000 --- a/test/__tests__/data/salesforce_proxy_output.json +++ /dev/null @@ -1,260 +0,0 @@ -[ - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"\"[ECONNABORTED] :: Connection aborted\"\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": "[ECONNABORTED] :: Connection aborted", - "status": 500, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"\"[EAI_AGAIN] :: Temporary failure in name resolution\"\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": "[EAI_AGAIN] :: Temporary failure in name resolution", - "status": 500, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 200, - "message": "Request for destination: salesforce Processed Successfully", - "destinationResponse": { - "response": { - "statusText": "No Content" - }, - "status": 204, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - } - } - }, - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"INVALID_SESSION_ID\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "Session expired or invalid", - "errorCode": "INVALID_SESSION_ID" - } - ], - "status": 401, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Salesforce Request Failed: \"401\" due to \"INVALID_HEADER_TYPE\", (Aborted) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "INVALID_HEADER_TYPE", - "errorCode": "INVALID_AUTH_HEADER" - } - ], - "status": 401, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 429, - "message": "Salesforce Request Failed - due to \"REQUEST_LIMIT_EXCEEDED\", (Throttled) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "Request limit exceeded", - "errorCode": "REQUEST_LIMIT_EXCEEDED" - } - ], - "status": 403, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "throttled", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 500, - "message": "Salesforce Request Failed - due to \"Server Unavailable\", (Retryable) during Salesforce Response Handling", - "destinationResponse": { - "response": [ - { - "message": "Server Unavailable", - "errorCode": "SERVER_UNAVAILABLE" - } - ], - "status": 503, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "status": 400, - "message": "Salesforce Request Failed: \"400\" due to \"{\"error\":\"invalid_grant\",\"error_description\":\"authentication failure\"}\", (Aborted) during Salesforce Response Handling", - "destinationResponse": { - "response": { - "error": "invalid_grant", - "error_description": "authentication failure" - }, - "status": 400, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - }, - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - } - } - }, - { - "output": { - "destinationResponse": { - "response": { - "errorCode": "SERVER_UNAVAILABLE", - "message": "Server Unavailable" - }, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - }, - "status": 503 - }, - "message": "Salesforce Request Failed - due to \"{\"message\":\"Server Unavailable\",\"errorCode\":\"SERVER_UNAVAILABLE\"}\", (Retryable) during Salesforce Response Handling", - "statTags": { - "destType": "SALESFORCE", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "retryable", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - }, - "status": 500 - } - }, - { - "output": { - "status": 200, - "message": "Request for destination: salesforce Processed Successfully", - "destinationResponse": { - "response": "", - "status": 200, - "rudderJobMetadata": { - "destInfo": { - "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" - } - } - } - } - } -] \ No newline at end of file diff --git a/test/__tests__/data/salesforce_router_input.json b/test/__tests__/data/salesforce_router_input.json deleted file mode 100644 index 39451af0f1..0000000000 --- a/test/__tests__/data/salesforce_router_input.json +++ /dev/null @@ -1,277 +0,0 @@ -[ - { - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "ddv_ua+{{1234*245}}@bugFix.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "message": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "1e7673da-9473-49c6-97f7-da848ecafa76", - "company": "Initech", - "address": { - "city": "east greenwich", - "country": "USA", - "state": "California", - "street": "19123 forest lane", - "postalCode": "94115" - }, - "email": "peter.gibbons@initech.com", - "name": "Peter Gibbons", - "phone": "570-690-4150", - "rating": "Hot", - "title": "VP of Derp" - }, - "messageId": "f19c35da-e9de-4c6e-b6e5-9e60cccc12c8", - "originalTimestamp": "2020-01-27T12:20:55.301Z", - "receivedAt": "2020-01-27T17:50:58.657+05:30", - "request_ip": "14.98.244.60", - "sentAt": "2020-01-27T12:20:56.849Z", - "timestamp": "2020-01-27T17:50:57.109+05:30", - "type": "identify", - "userId": "1e7673da-9473-49c6-97f7-da848ecafa76" - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "message": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - } -] diff --git a/test/__tests__/data/salesforce_router_output.json b/test/__tests__/data/salesforce_router_output.json deleted file mode 100644 index 698b4fa821..0000000000 --- a/test/__tests__/data/salesforce_router_output.json +++ /dev/null @@ -1,233 +0,0 @@ -[ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/leadId?_HttpMethod=PATCH", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "ddv_ua+{{1234*245}}@bugFix.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "jobId": 3 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY" - }, - "params": {}, - "body": { - "JSON": { - "Email": "peter.gibbons@initech.com", - "Phone": "570-690-4150", - "Rating": "Hot", - "Title": "VP of Derp", - "FirstName": "Peter", - "LastName": "Gibbons", - "PostalCode": "94115", - "City": "east greenwich", - "Country": "USA", - "State": "California", - "Street": "19123 forest lane", - "Company": "Initech" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "initialAccessToken": "dummyInitialAccessToken", - "password": "dummyPassword1", - "userName": "testsalesforce1453@gmail.com" - }, - "DestinationDefinition": { - "DisplayName": "Salesforce", - "ID": "1T96GHZ0YZ1qQSLULHCoJkow9KC", - "Name": "SALESFORCE" - }, - "Enabled": true, - "ID": "1WqFFH5esuVPnUgHkvEoYxDcX3y", - "Name": "tst", - "Transformations": [] - } - } -] diff --git a/test/__tests__/data/segment_input.json b/test/__tests__/data/segment_input.json deleted file mode 100644 index c21cb93f6e..0000000000 --- a/test/__tests__/data/segment_input.json +++ /dev/null @@ -1,368 +0,0 @@ -[ - { - "destination": { - "ID": "1afmecIpsJm7D72aRTksxyODrwR", - "Name": "Segment", - "DestinationDefinition": { - "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", - "Name": "SEGMENT", - "DisplayName": "Segment", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "writeKey": "abcdefghijklmnopqrstuvwxyz" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "testmp@rudderstack.com", - "firstname": "Test Kafka" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "258b77c6-442d-4bdc-8729-f0e4cef41353", - "name": "home", - "originalTimestamp": "2020-04-17T14:55:31.367Z", - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "receivedAt": "2020-04-17T20:25:31.381+05:30", - "request_ip": "[::1]:57363", - "sentAt": "2020-04-17T14:55:31.367Z", - "timestamp": "2020-04-17T20:25:31.381+05:30", - "type": "page", - "userId": "user12345" - } - }, - { - "destination": { - "ID": "1afmecIpsJm7D72aRTksxyODrwR", - "Name": "Segment", - "DestinationDefinition": { - "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", - "Name": "SEGMENT", - "DisplayName": "Segment", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "writeKey": "abcdefghijklmnopqrstuvwxyz" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "testmp@email.com", - "firstname": "Test Transformer" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "023a3a48-190a-4968-9394-a8e99b81a3c0", - "originalTimestamp": "2020-04-17T14:55:31.37Z", - "receivedAt": "2020-04-17T20:25:31.401+05:30", - "request_ip": "[::1]:57364", - "sentAt": "2020-04-17T14:55:31.37Z", - "timestamp": "2020-04-17T20:25:31.401+05:30", - "type": "identify", - "userId": "user12345" - } - }, - { - "destination": { - "ID": "1afmecIpsJm7D72aRTksxyODrwR", - "Name": "Segment", - "DestinationDefinition": { - "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", - "Name": "SEGMENT", - "DisplayName": "Segment", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "writeKey": "abcdefghijklmnopqrstuvwxyz" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "testmp@email.com", - "firstname": "Test Transformer" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "event": "test track with property", - "integrations": { - "All": true - }, - "messageId": "584fde02-901a-4964-a4a0-4078b999d5b2", - "originalTimestamp": "2020-04-17T14:55:31.372Z", - "properties": { - "test_prop_1": "test prop", - "test_prop_2": 1232 - }, - "receivedAt": "2020-04-17T20:25:31.401+05:30", - "request_ip": "[::1]:57365", - "sentAt": "2020-04-17T14:55:31.372Z", - "timestamp": "2020-04-17T20:25:31.401+05:30", - "type": "track", - "userId": "user12345" - } - }, - { - "destination": { - "ID": "1afmecIpsJm7D72aRTksxyODrwR", - "Name": "Segment", - "DestinationDefinition": { - "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", - "Name": "SEGMENT", - "DisplayName": "Segment", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "writeKey": "abcdefghijklmnopqrstuvwxyz" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "testmp@rudderstack.com", - "firstname": "Test Kafka" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "258b77c6-442d-4bdc-8729-f0e4cef41353", - "name": "home", - "originalTimestamp": "2020-04-17T14:55:31.367Z", - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "receivedAt": "2020-04-17T20:25:31.381+05:30", - "request_ip": "[::1]:57363", - "sentAt": "2020-04-17T14:55:31.367Z", - "timestamp": "2020-04-17T20:25:31.381+05:30", - "type": "page", - "userId": "user12345" - } - }, - { - "destination": { - "ID": "1afmecIpsJm7D72aRTksxyODrwR", - "Name": "Segment", - "DestinationDefinition": { - "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", - "Name": "SEGMENT", - "DisplayName": "Segment", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "writeKey": "abcdefghijklmnopqrstuvwxyz" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "screen": { - "density": 2 - }, - - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "event": "test track with property", - "integrations": { - "All": true - }, - "messageId": "584fde02-901a-4964-a4a0-4078b999d5b2", - "originalTimestamp": "2020-04-17T14:55:31.372Z", - "properties": { - "test_prop_1": "test prop", - "test_prop_2": 1232 - }, - "receivedAt": "2020-04-17T20:25:31.401+05:30", - "request_ip": "[::1]:57365", - "sentAt": "2020-04-17T14:55:31.372Z", - "timestamp": "2020-04-17T20:25:31.401+05:30", - "type": "track", - "userId": "user12345" - } - } -] diff --git a/test/__tests__/data/segment_output.json b/test/__tests__/data/segment_output.json deleted file mode 100644 index 0d8ca2c784..0000000000 --- a/test/__tests__/data/segment_output.json +++ /dev/null @@ -1,187 +0,0 @@ -[ - { - "version": "1", - "type": "REST", - "method": "POST", - "userId": "user12345", - "endpoint": "https://api.segment.io/v1/batch", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" - }, - "params": {}, - "body": { - "JSON": { - "batch": [ - { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "type": "page", - "userId": "user12345", - "traits": { - "age": 23, - "email": "testmp@rudderstack.com", - "firstname": "Test Kafka" - }, - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "timeStamp": "2020-04-17T20:25:31.381+05:30" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "userId": "user12345", - "method": "POST", - "endpoint": "https://api.segment.io/v1/batch", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" - }, - "params": {}, - "body": { - "JSON": { - "batch": [ - { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "type": "identify", - "userId": "user12345", - "traits": { - "age": 23, - "email": "testmp@email.com", - "firstname": "Test Transformer" - }, - "timeStamp": "2020-04-17T20:25:31.401+05:30" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "userId": "user12345", - "method": "POST", - "endpoint": "https://api.segment.io/v1/batch", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" - }, - "params": {}, - "body": { - "JSON": { - "batch": [ - { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "type": "track", - "userId": "user12345", - "event": "test track with property", - "traits": { - "age": 23, - "email": "testmp@email.com", - "firstname": "Test Transformer" - }, - "properties": { "test_prop_1": "test prop", "test_prop_2": 1232 }, - "timeStamp": "2020-04-17T20:25:31.401+05:30" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.segment.io/v1/batch", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" - }, - "params": {}, - "body": { - "JSON": { - "batch": [ - { - "type": "page", - "userId": "user12345", - "traits": { - "age": 23, - "email": "testmp@rudderstack.com", - "firstname": "Test Kafka" - }, - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "timeStamp": "2020-04-17T20:25:31.381+05:30" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "user12345", - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.segment.io/v1/batch", - "headers": { - "Content-Type": "application/json", - "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" - }, - "params": {}, - "body": { - "JSON": { - "batch": [ - { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "type": "track", - "userId": "user12345", - "event": "test track with property", - "properties": { - "test_prop_1": "test prop", - "test_prop_2": 1232 - }, - "timeStamp": "2020-04-17T20:25:31.401+05:30" - } - ] - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "user12345", - "statusCode": 200 - } -] diff --git a/test/__tests__/data/shynet.json b/test/__tests__/data/shynet.json deleted file mode 100644 index 16673e09cf..0000000000 --- a/test/__tests__/data/shynet.json +++ /dev/null @@ -1,166 +0,0 @@ -[ - { - "description": "Page Call", - "input": { - "destination": { - "Config": { - "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js", - "heartBeat": 5000 - } - }, - "message": { - "type": "page", - "sentAt": "2022-08-22T13:39:21.034Z", - "channel": "web", - "context": { - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "12312@!fma", - "city": "Pune", - "revenue": 93889 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-22T13:39:21.032Z" - } - }, - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - } - }, - { - "description": "Page Call without heartBeat Mentioned", - "input": { - "destination": { - "Config": { - "shynetServiceUrl": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - } - }, - "message": { - "type": "page", - "sentAt": "2022-08-22T13:39:21.034Z", - "channel": "web", - "context": { - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "path": "/Testing/test/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "", - "loadTime": 45 - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "12312@!fma", - "city": "Pune", - "revenue": 93889 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "properties": { - "loadTime": 45 - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "anonymousId": "675467tfhjgjhfcghjc", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-22T13:39:21.032Z" - } - }, - "output": { - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "loadTime": 45, - "location": "http://127.0.0.1:7307/Testing/test/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/test/" - }, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/json" - }, - "version": "1", - "endpoint": "https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js" - } - } -] diff --git a/test/__tests__/data/slack_input.json b/test/__tests__/data/slack_input.json deleted file mode 100644 index e29624490c..0000000000 --- a/test/__tests__/data/slack_input.json +++ /dev/null @@ -1,1415 +0,0 @@ -[ - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", - "originalTimestamp": "2020-03-23T03:46:30.916Z", - "properties": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "receivedAt": "2020-03-23T09:16:31.041+05:30", - "request_ip": "[::1]:52056", - "sentAt": "2020-03-23T03:46:30.916Z", - "timestamp": "2020-03-23T09:16:31.041+05:30", - "type": "identify", - "userId": "12345" - }, - "metadata": { - "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 126, - "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ], - "denyListOfEvents": [ - { - "eventName": "black_event" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", - "originalTimestamp": "2020-03-23T03:46:30.916Z", - "properties": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "receivedAt": "2020-03-23T09:16:31.041+05:30", - "request_ip": "[::1]:52056", - "sentAt": "2020-03-23T03:46:30.916Z", - "timestamp": "2020-03-23T09:16:31.041+05:30", - "type": "page", - "userId": "12345" - }, - "metadata": { - "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 126, - "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "traits": { - "country": "USA", - "email": "test@domain.com", - "hiji": "hulala-1", - "name": "my-name-1" - }, - "integrations": { - "All": true - }, - "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", - "originalTimestamp": "2020-03-23T03:41:46.122Z", - "receivedAt": "2020-03-23T09:11:46.244+05:30", - "request_ip": "[::1]:52055", - "sentAt": "2020-03-23T03:41:46.123Z", - "timestamp": "2020-03-23T09:11:46.243+05:30", - "type": "identify", - "userId": "12345" - }, - "metadata": { - "anonymousId": "12345", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 123, - "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "incomingWebhooksType": "modern", - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ], - "denyListOfEvents": [ - { - "eventName": "black_event" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "event": "test_isent1", - "integrations": { - "All": true - }, - "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", - "originalTimestamp": "2020-03-23T03:46:30.921Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52057", - "sentAt": "2020-03-23T03:46:30.921Z", - "timestamp": "2020-03-23T09:16:31.064+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 128, - "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "incomingWebhooksType": "modern", - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", - "eventName": "is", - "eventChannel": "example_channel", - "eventRegex": true - }, - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", - "eventName": "is", - "eventChannel": "example_channel", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ], - "denyListOfEvents": [ - { - "eventName": "black_event" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "event": "test_eventing_testis", - "integrations": { - "All": true - }, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "originalTimestamp": "2020-03-23T03:46:30.922Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52054", - "sentAt": "2020-03-23T03:46:30.923Z", - "timestamp": "2020-03-23T09:16:31.063+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 129, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "incomingWebhooksType": "modern", - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", - "eventName": "test_eventing_test", - "eventChannel": "example_channel", - "eventRegex": false - }, - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", - "eventName": "", - "eventChannel": "example_channel", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ], - "denyListOfEvents": [ - { - "eventName": "black_event" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "event": "test_eventing_test", - "integrations": { - "All": true - }, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "originalTimestamp": "2020-03-23T03:46:30.922Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52054", - "sentAt": "2020-03-23T03:46:30.923Z", - "timestamp": "2020-03-23T09:16:31.063+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 129, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "incomingWebhooksType": "legacy", - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ], - "denyListOfEvents": [ - { - "eventName": "black_event" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "event": "test_isent1", - "integrations": { - "All": true - }, - "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", - "originalTimestamp": "2020-03-23T03:46:30.921Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52057", - "sentAt": "2020-03-23T03:46:30.921Z", - "timestamp": "2020-03-23T09:16:31.064+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 128, - "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "incomingWebhooksType": "legacy", - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", - "eventChannel": "example-of-legacy", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ], - "denyListOfEvents": [ - { - "eventName": "black_event" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "event": "test_eventing_testis", - "integrations": { - "All": true - }, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "originalTimestamp": "2020-03-23T03:46:30.922Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52054", - "sentAt": "2020-03-23T03:46:30.923Z", - "timestamp": "2020-03-23T09:16:31.063+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 129, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "event": "test_eventing_testis", - "integrations": { - "All": true - }, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "originalTimestamp": "2020-03-23T03:46:30.922Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52054", - "sentAt": "2020-03-23T03:46:30.923Z", - "timestamp": "2020-03-23T09:16:31.063+05:30", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 129, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "originalTimestamp": "2020-03-23T03:46:30.922Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52054", - "sentAt": "2020-03-23T03:46:30.923Z", - "timestamp": "2020-03-23T09:16:31.063+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 129, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "event": "test_isent1", - "integrations": { - "All": true - }, - "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", - "originalTimestamp": "2020-03-23T03:46:30.921Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52057", - "sentAt": "2020-03-23T03:46:30.921Z", - "timestamp": "2020-03-23T09:16:31.064+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 128, - "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "incomingWebhooksType": "legacy", - "eventChannelSettings": [ - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", - "eventChannel": "example-of-legacy", - "eventName": "is", - "eventRegex": true - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ], - "denyListOfEvents": [ - { - "eventName": "black_event" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "00000000000000000000000000", - "channel": "web", - "context": {}, - "event": "black_event", - "integrations": { - "All": true - }, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "originalTimestamp": "2020-03-23T03:46:30.922Z", - "properties": { - "currency": "USD", - "key1": "test_val1", - "key2": "test_val2", - "revenue": 30, - "user_actual_id": 12345 - }, - "receivedAt": "2020-03-23T09:16:31.064+05:30", - "request_ip": "[::1]:52054", - "sentAt": "2020-03-23T03:46:30.923Z", - "timestamp": "2020-03-23T09:16:31.063+05:30", - "type": "track", - "userId": "12345" - }, - "metadata": { - "anonymousId": "00000000000000000000000000", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 129, - "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - } -] diff --git a/test/__tests__/data/slack_output.json b/test/__tests__/data/slack_output.json deleted file mode 100644 index c772aa3b19..0000000000 --- a/test/__tests__/data/slack_output.json +++ /dev/null @@ -1,164 +0,0 @@ -[ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"text\":\"Identified my-namehiji: hulala \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - }, - { - "error": "Event type page is not supported" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"text\":\"identified my-name-1 with hiji: hulala-1 \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/id1/id2/demo", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/id1/id2/example", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/id1/id2/example", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"text\":\"my-name did test_eventing_test\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"channel\":\"example-of-legacy\",\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - }, - { - "error": "Event type is required" - }, - { - "error": "Event name is required" - }, - { - "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'" - }, - { - "error": "Event is denied. Please check configuration." - } -] diff --git a/test/__tests__/data/slack_router_input.json b/test/__tests__/data/slack_router_input.json deleted file mode 100644 index f2bf20466d..0000000000 --- a/test/__tests__/data/slack_router_input.json +++ /dev/null @@ -1,247 +0,0 @@ -[ - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannel": "#slack_integration", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", - "originalTimestamp": "2020-03-23T03:46:30.916Z", - "properties": { - "path": "/tests/html/script-test.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/script-test.html" - }, - "receivedAt": "2020-03-23T09:16:31.041+05:30", - "request_ip": "[::1]:52056", - "sentAt": "2020-03-23T03:46:30.916Z", - "timestamp": "2020-03-23T09:16:31.041+05:30", - "type": "page", - "userId": "12345" - }, - "metadata": { - "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 126, - "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - }, - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannel": "#slack_integration", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "12345", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.1" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - }, - "screen": { - "density": 1.7999999523162842 - }, - "traits": { - "country": "India", - "email": "name@domain.com", - "hiji": "hulala", - "name": "my-name" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "traits": { - "country": "USA", - "email": "test@domain.com", - "hiji": "hulala-1", - "name": "my-name-1" - }, - "integrations": { - "All": true - }, - "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", - "originalTimestamp": "2020-03-23T03:41:46.122Z", - "receivedAt": "2020-03-23T09:11:46.244+05:30", - "request_ip": "[::1]:52055", - "sentAt": "2020-03-23T03:41:46.123Z", - "timestamp": "2020-03-23T09:11:46.243+05:30", - "type": "identify", - "userId": "12345" - }, - "metadata": { - "anonymousId": "12345", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 123, - "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - } -] diff --git a/test/__tests__/data/slack_router_output.json b/test/__tests__/data/slack_router_output.json deleted file mode 100644 index 6b1658b5e0..0000000000 --- a/test/__tests__/data/slack_router_output.json +++ /dev/null @@ -1,172 +0,0 @@ -[ - { - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannel": "#slack_integration", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "metadata": [ - { - "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 126, - "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - ], - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - }, - "batched": false, - "statusCode": 400, - "error": "Event type page is not supported" - }, - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "headers": { - "Content-Type": "application/x-www-form-urlencoded" - }, - "params": {}, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": { - "payload": "{\"text\":\"identified my-name-1 with hiji: hulala-1 \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" - } - }, - "files": {}, - "userId": "12345", - "statusCode": 200 - } - ], - "metadata": [ - { - "anonymousId": "12345", - "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "destinationType": "SLACK", - "jobId": 123, - "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", - "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", - "Name": "test-slack", - "DestinationDefinition": { - "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", - "Name": "SLACK", - "DisplayName": "Slack", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "eventChannelSettings": [ - { - "eventChannel": "#slack_integration", - "eventName": "is", - "eventRegex": true - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - }, - { - "eventChannel": "", - "eventName": "", - "eventRegex": false - } - ], - "eventTemplateSettings": [ - { - "eventName": "is", - "eventRegex": true, - "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" - }, - { - "eventName": "", - "eventRegex": false, - "eventTemplate": "" - } - ], - "identifyTemplate": "identified {{name}} with {{traits}}", - "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", - "whitelistedTraitsSettings": [ - { - "trait": "hiji" - }, - { - "trait": "" - } - ] - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/snapchat_conversion.json b/test/__tests__/data/snapchat_conversion.json deleted file mode 100644 index f4b896d73c..0000000000 --- a/test/__tests__/data/snapchat_conversion.json +++ /dev/null @@ -1,3028 +0,0 @@ -[ - { - "description": "Test case for Page event-> PAGE_VIEW ", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "page", - "name": "Home Page Viewed", - "properties": { - "title": "Home | RudderStack", - "url": "http://www.rudderstack.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "PAGE_VIEW", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "WEB", - "page_url": "http://www.rudderstack.com", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Test case for Prodcuts Searched event for conversion type offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 ", - "firstName": "john", - "middleName": "victor", - "lastName": "doe", - "city": "some_city", - "state": "some_state" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "brands": "abc", - "query": "t-shirts", - "event_conversion_type": "web", - "number_items": 4, - "click_id": "some_click_id", - "description": "Products Searched event for conversion type offline" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId", - "number_items": 4, - "click_id": "some_click_id", - "description": "Products Searched event for conversion type offline", - "hashed_first_name_sha": "96d9632f363564cc3032521409cf22a852f2032eec099ed5967c0d000cec607a", - "hashed_last_name_sha": "799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f", - "hashed_state_sha": "6db488fc98e30afdf67a05a6da916805b02891ce58f03970c6deff79129c5f1c", - "hashed_middle_name_sha": "99bde068af2d49ed7fc8b8fa79abe13a6059e0db320bb73459fd96624bb4b33f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Track event without event Key", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 ", - "country": "IN", - "zicode": "Sxp-12345", - "region": "some_region" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "statusCode": 400, - "error": "Event name is required" - } - }, - { - "description": "Test case for Identify event which is not supported in this destination", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "identify", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "statusCode": 400, - "error": "Event type identify is not supported" - } - }, - { - "description": "Pixel id is not set as a destination config field", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "statusCode": 400, - "error": "Pixel Id is required for web and offline events" - } - }, - { - "description": "Test case for Prodcuts Searched event for conversion type web", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "WEB", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case where appId is not present in destination config", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId" - } - } - }, - "output": { - "statusCode": 400, - "error": "Snap App Id is required for app events" - } - }, - { - "description": "Test case where snap app id is not present in destination config", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f" - } - } - }, - "output": { - "statusCode": 400, - "error": "Snap App Id is required for app events" - } - }, - { - "description": "Product Searched event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "delivery_method": "in_store", - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "delivery_method": "in_store", - "device_model": "AOSP on IA Emulator", - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Product List Viewed event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 ", - "country": "IN", - "zipcode": "Sxp-12345", - "region": "some_region" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product List Viewed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "VIEW_CONTENT", - "item_ids": [ - "123", - "123" - ], - "price": "56", - "country": "IN", - "hashed_zip": "cbb2704f5b334a0cec32e5463d1fd9355f6ef73987bfe0ebb8389b7617452152", - "region": "some_region", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for checkout_started event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "checkout_started", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": "2" - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "START_CHECKOUT", - "item_ids": [ - "123", - "123" - ], - "price": "42", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Order Completed event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Order Completed", - "properties": { - "brands": [ - "brand01", - "brand02" - ], - "products": [ - { - "product_id": "123", - "price": "14", - "quantity": 1 - }, - { - "product_id": "124", - "price": 14, - "quantity": 3 - } - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "PURCHASE", - "item_ids": [ - "123", - "124" - ], - "brands": [ - "brand01", - "brand02" - ], - "price": "56", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Product Added event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Added", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_ids": "123", - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "ADD_CART", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is web", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "web", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Viewed", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "number_items": 14, - "quantity": 1 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_ids": "123", - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "WEB", - "pixel_id": "dummyPixelId", - "number_items": 14 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Viewed", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "quantity": 1 - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_ids": "123", - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId", - "number_items": 1 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Payment Info Entered event where conversion type is offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Payment Info Entered", - "properties": { - "checkout_id": "12dfdfdf3" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "transaction_id": "12dfdfdf3", - "event_type": "ADD_BILLING", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Subscribe event where conversion type is web", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "subscribe", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "SUBSCRIBE", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Promotion Viewed event for conversion type offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Promotion Viewed", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "AD_VIEW", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Promotion Clicked event for conversion type offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Promotion clicked", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "AD_CLICK", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for save event for conversion type offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "save", - "properties": { - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "SAVE", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is web", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Viewed", - "properties": { - "eventConversionType": "web", - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "url": "hjhb.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "page_url": "hjhb.com", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "WEB", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Viewed event where conversion type is offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Viewed", - "properties": { - "eventConversionType": "offline", - "checkout_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD", - "url": "hjhb.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "price": "14", - "currency": "USD", - "event_type": "VIEW_CONTENT", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Product Searched event where conversion type is offline", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web", - "event_tag": "offline" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "event_tag": "offline", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test Case for Product Added To Whishlist event where conversion type is mobile app", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "product_id": "123", - "price": "14", - "category": "shoes", - "currency": "USD" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "item_category": "shoes", - "item_ids": "123", - "price": "14", - "currency": "USD", - "event_type": "ADD_TO_WISHLIST", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Test case for Products Searched event using event mapping", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "ProdSearched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "ProdSearched", - "to": "products_searched" - } - ] - } - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Test case event doesn't match with snapchat events", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "ProdSearched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [] - } - } - }, - "output": { - "statusCode": 400, - "error": "Event ProdSearched doesn't match with Snapchat Events!" - } - }, - { - "description": "test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product Added to Cart", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "Product_Added_To_Cart", - "to": "products_searched" - } - ] - } - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground - here destination config need to be modified", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product_Added_to_Cart", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "rudderEventsToSnapEvents": [ - { - "from": "Product Added To Cart", - "to": "products_searched" - } - ] - } - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "search_string": "t-shirts", - "event_type": "SEARCH", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "OFFLINE", - "pixel_id": "dummyPixelId" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Enable deduplication with duplication key as email", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "request_ip": "127.0.0.1", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Order Completed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14", - "quantity": 1 - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ], - "revenue": "100", - "custom_dedup_id": "1234" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "deduplicationKey": "properties.custom_dedup_id", - "enableDeduplication": true, - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "PURCHASE", - "item_ids": [ - "123", - "123" - ], - "client_dedup_id": "1234", - "hashed_ip_address": "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0", - "price": "100", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Mapping revenue to price for product list viewed event", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product List Viewed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ], - "revenue": "100" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "VIEW_CONTENT", - "item_ids": [ - "123", - "123" - ], - "price": "100", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Mapping revenue to price for product list viewed event", - "input": { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "channel": "mobile", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Product List Viewed", - "properties": { - "products": [ - { - "product_id": "123", - "price": "14" - }, - { - "product_id": "123", - "price": 14, - "quantity": 3 - } - ], - "revenue": "100" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "pixelId": "dummyPixelId", - "appId": "dhfeih44f", - "snapAppId": "hfhdhfd" - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Authorization": "Bearer dummyApiKey", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_type": "VIEW_CONTENT", - "item_ids": [ - "123", - "123" - ], - "price": "100", - "hashed_email": "73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2", - "hashed_phone_number": "bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492", - "hashed_mobile_ad_id": "f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2", - "hashed_idfv": "54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f", - "user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36", - "timestamp": "1650625078", - "event_conversion_type": "MOBILE_APP", - "snap_app_id": "hfhdhfd", - "app_id": "dhfeih44f" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - } -] \ No newline at end of file diff --git a/test/__tests__/data/snapchat_conversion_router_input.json b/test/__tests__/data/snapchat_conversion_router_input.json deleted file mode 100644 index 0509cef312..0000000000 --- a/test/__tests__/data/snapchat_conversion_router_input.json +++ /dev/null @@ -1,315 +0,0 @@ -[ - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "message": { - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2022-04-22T10:57:58Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "context": { - "traits": { - "email": "test@email.com", - "phone": "+91 2111111 " - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "name": "generic_x86_arm", - "type": "ios", - "attTrackingStatus": 3 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "iOS", - "version": "14.4.1" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "ga4AppInstanceId", - "id": "f0dd99v4f979fb997ce453373900f891" - } - ], - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "type": "track", - "event": "Products Searched", - "properties": { - "query": "t-shirts", - "event_conversion_type": "web" - }, - "integrations": { - "All": true - }, - "sentAt": "2022-04-22T10:57:58Z" - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "message": { - "type": "track", - "event": "Product List Viewed", - "sentAt": "2022-08-01T15:04:58.764Z", - "userId": "d131b5f1fc@nana.sa", - "channel": "mobile", - "context": { - "os": { - "name": "iOS", - "version": "15.5" - }, - "app": { - "name": "CFBundleDisplayName", - "build": "12.43.0.16", - "version": "12.43.0", - "namespace": "iShopCloud.com" - }, - "device": { - "id": "f244e389-d899-40a0-9673-1db87a8db7d3", - "name": "iPhone Monerah", - "type": "iOS", - "model": "iPhone", - "manufacturer": "Apple" - }, - "locale": "ar-SA", - "screen": { - "width": 896, - "height": 414, - "density": 2 - }, - "traits": { - "email": "m@gmail.com", - "phone": "00966556747779", - "userId": "d131b5f1fc@nana.sa", - "address": { - "city": "الرياض", - "country": "sa" - }, - "country": "sa", - "lastName": "", - "firstName": "منيرة ام عمر", - "anonymousId": "f244e389-d899-40a0-9673-1db87a8db7d3", - "Mobile Number": "00966556747779", - "Last App Close": "2022-07-29T21:43:30.342Z", - "Activation code": "9997", - "Activation date": "2022-03-24 19:37:42", - "First App Close": "2022-05-18 07:53:03", - "Mobile Number Status": "Active", - "Last Activated Device": { - "UUID": "F244E389-D899-40A0-9673-1DB87A8DB7D3", - "Platform": "IOS", - "App Version": "12.38.0", - "App Language": "AR", - "Platform Version": "15.4" - }, - "ml_availability_segment": -1 - }, - "library": { - "name": "rudder-ios-library", - "version": "1.0.7" - }, - "network": { - "wifi": true, - "carrier": "unavailable", - "cellular": false, - "bluetooth": false - }, - "timezone": "Asia/Riyadh", - "userAgent": "unknown", - "externalId": [ - { - "id": "CBEDC847-F22C-447C-85DE-2BB693240F8E", - "type": "brazeExternalId" - } - ] - }, - "rudderId": "8fd7a036-fcbd-4ec3-b498-ea2cbf1df629", - "messageId": "1659366289-4126c107-c1e1-4ee1-b534-fb49afca197b", - "timestamp": "2022-08-01T15:04:49.593Z", - "properties": { - "Parent": "Testing", - "List ID": "CAT00002903", - "store_id": "STR00001959", - "List Name": "User", - "session_id": "", - "Viewed From": "home", - "Category Position": 2, - "Banner Position Segment": "B", - "category_personalise_segment": "B" - }, - "receivedAt": "2022-08-01T15:04:59.091Z", - "request_ip": "78.95.64.84", - "anonymousId": "f244e389-d899-40a0-9673-1db87a8db7d3", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-08-01T15:04:49.266Z" - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "appId": "jahsdfjk-5487-asdfa-9957-7c74eb8d3e80", - "snapAppId": "", - "enableDeduplication": false, - "rudderEventsToSnapEvents": [ - { - "from": "Product List Viewed", - "to": "product_list_viewed" - } - ] - } - } - } -] \ No newline at end of file diff --git a/test/__tests__/data/snapchat_conversion_router_output.json b/test/__tests__/data/snapchat_conversion_router_output.json deleted file mode 100644 index bc68d01086..0000000000 --- a/test/__tests__/data/snapchat_conversion_router_output.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://tr.snapchat.com/v2/conversion", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": { - "batch": "[{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"},{\"search_string\":\"t-shirts\",\"event_type\":\"SEARCH\",\"user_agent\":\"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36\",\"hashed_email\":\"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2\",\"hashed_phone_number\":\"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492\",\"hashed_idfv\":\"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f\",\"hashed_mobile_ad_id\":\"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2\",\"timestamp\":\"1650625078\",\"event_conversion_type\":\"OFFLINE\",\"pixel_id\":\"dummyPixelId\"}]" - }, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - }, - { - "jobId": 3 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey" - } - } - }, - { - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statusCode": 400, - "error": "Snap App Id is required for app events", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration" - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "apiKey": "dummyApiKey", - "appId": "jahsdfjk-5487-asdfa-9957-7c74eb8d3e80", - "snapAppId": "", - "enableDeduplication": false, - "rudderEventsToSnapEvents": [ - { - "from": "Product List Viewed", - "to": "product_list_viewed" - } - ] - } - } - } -] diff --git a/test/__tests__/data/snapchat_custom_audience.json b/test/__tests__/data/snapchat_custom_audience.json deleted file mode 100644 index 5c06632200..0000000000 --- a/test/__tests__/data/snapchat_custom_audience.json +++ /dev/null @@ -1,939 +0,0 @@ -[ - { - "description": "adding user", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "removing user", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": true, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "remove": [ - { - "email": "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "adding and removing users", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ], - "remove": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "adding multiple users", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - }, - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["EMAIL_SHA256"], - "data": [ - ["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"], - ["1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd"] - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "removing multiple users", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "remove": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - }, - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [ - ["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"], - ["1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd"] - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "message type is not audiencelist", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audience", - "properties": { - "listData": { - "add": [ - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "Event type audience is not supported" - } - }, - { - "description": "without message type", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "properties": { - "listData": { - "add": [ - { - "email": "test@rudderstack.com", - "phone": "@09876543210", - "firstName": "rudderlabs", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "Event type is required" - } - }, - { - "description": "without sending properties", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "Message properties is not present. Aborting message" - } - }, - { - "description": "without listData inside properties", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "listData is not present inside properties. Aborting message" - } - }, - { - "description": "without add or remove lists inside listData", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "abc": "123" - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "Neither 'add' nor 'remove' property is present inside 'listData'. Aborting message" - } - }, - { - "description": "not providing required field for chosen schema in all the cases", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "remove": [ - { - "email": "", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - }, - { - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": { - "statusCode": 400, - "error": "Required schema parameter email is not found from payload" - } - }, - { - "description": "not providing required field for chosen schema in some cases", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "remove": [ - { - "email": "abcd@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - }, - { - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "DELETE", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "id": "123", - "schema": ["EMAIL_SHA256"], - "data": [["8c37cbc5d9abb3082303c6548571cfc7655a4546ddc1e943f041fc9126e7274a"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "schema= phone", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "phone" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["PHONE_SHA256"], - "data": [["7619ee8cea49187f309616e30ecf54be072259b43760f1f550a644945d5572f2"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "schema= mobileAdId", - "input": { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "mobileAdId" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "09876543210", - "mobileId": "1334", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Authorization": "Bearer dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "schema": ["MOBILE_AD_ID_SHA256"], - "data": [["eb43272640b269219a01caf99c5a4122d6edc0916d45ac13c0ce80ca3ad2def0"]] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - } -] diff --git a/test/__tests__/data/snapchat_custom_audience_router_input.json b/test/__tests__/data/snapchat_custom_audience_router_input.json deleted file mode 100644 index a36eb21365..0000000000 --- a/test/__tests__/data/snapchat_custom_audience_router_input.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "metadata": { - "secret": { - "access_token": "dummyAccessToken", - "refresh_token": "dummyRefreshToken", - "developer_token": "dummyDeveloperToken" - } - }, - "destination": { - "Config": { - "segmentId": "123", - "disableHashing": false, - "schema": "email" - } - }, - "message": { - "userId": "user 1", - "anonymousId": "anon-id-new", - "event": "event1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "email": "test@abc.com", - "phone": "@09876543210", - "firstName": "test", - "lastName": "rudderlabs", - "country": "US", - "postalCode": "1245" - } - ] - }, - "enablePartialFailure": true - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } -] diff --git a/test/__tests__/data/snapchat_custom_audience_router_output.json b/test/__tests__/data/snapchat_custom_audience_router_output.json deleted file mode 100644 index 2d0eac36a1..0000000000 --- a/test/__tests__/data/snapchat_custom_audience_router_output.json +++ /dev/null @@ -1,49 +0,0 @@ -[ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyAccessToken" - }, - "params": {}, - "body": { - "JSON": { - "users": [ - { - "data": [["d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419"]], - "schema": ["EMAIL_SHA256"] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "metadata": [ - { - "secret": { - "access_token": "dummyAccessToken", - "developer_token": "dummyDeveloperToken", - "refresh_token": "dummyRefreshToken" - } - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "disableHashing": false, - "schema": "email", - "segmentId": "123" - } - } - } -] diff --git a/test/__tests__/data/splitio_input.json b/test/__tests__/data/splitio_input.json deleted file mode 100644 index a8b8f5480d..0000000000 --- a/test/__tests__/data/splitio_input.json +++ /dev/null @@ -1,367 +0,0 @@ -[ - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "vertical": "restaurant", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000, - "GMV": false - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "value": "0.93" - }, - "library": { - "name": "http" - } - }, - "type": "group", - "groupId": "group1", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000, - "address": { - "city": "San Francisco", - "state": "CA", - "country": "USA" - }, - "key1": { - "a": "a" - }, - "key2": [1, 2, 3], - "key3": { - "key4": {} - }, - "key5": null - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0" - }, - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "event": "splitio_test_1", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val", - "property1": { - "property2": 1, - "property3": "test", - "property4": { - "subProp1": { - "a": "a", - "b": "b" - }, - "subProp2": ["a", "b"], - "subProp3": { - "prop": {} - } - } - }, - "properties5": null - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "track", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "splitio_test_1", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "page", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "splitio_test_1", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "screen", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "newProperty": "1", - "martin": 21.565000000000001, - "vertical": "restaurant", - "GMV": false - }, - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "newProperty": "1" - }, - "library": { - "name": "http" - } - }, - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "newProperty": "1" - }, - "library": { - "name": "http" - } - }, - "type": "abc", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "@$%%^&", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "0.93", - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "page", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "name": "1pplication accepted", - "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", - "category": "food", - "properties": { - "eventTypeId": "page_load", - "trafficTypeName": "user", - "key": "key_user_0", - "timestamp": 1513357833000, - "value": "bc2", - "martin": 21.565, - "vertical": ["restaurant", "mall"], - "GMV": true, - "abc": "new-val" - }, - "receivedAt": "2021-03-01T22:55:54.806Z", - "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", - "timestamp": "2021-03-01T22:55:54.771Z", - "type": "page", - "userId": "user 1" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "production", - "trafficType": "user" - } - } - }, - { - "message": { - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - } -] diff --git a/test/__tests__/data/splitio_output.json b/test/__tests__/data/splitio_output.json deleted file mode 100644 index bb51be1d17..0000000000 --- a/test/__tests__/data/splitio_output.json +++ /dev/null @@ -1,261 +0,0 @@ -[ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "group", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": false - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "address.city": "San Francisco", - "address.state": "CA", - "address.country": "USA", - "key1.a": "a", - "key2[0]": 1, - "key2[1]": 2, - "key2[2]": 3 - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "splitio_test_1", - "key": "user 1", - "timestamp": 1614639354771, - "value": 0.93, - "environmentName": "production", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val", - "property1.property2": 1, - "property1.property3": "test", - "property1.property4.subProp1.a": "a", - "property1.property4.subProp1.b": "b", - "property1.property4.subProp2[0]": "a", - "property1.property4.subProp2[1]": "b" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "Viewed_splitio_test_1_page", - "key": "user 1", - "timestamp": 1614639354771, - "value": 0.93, - "environmentName": "production", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "Viewed_splitio_test_1_screen", - "key": "user 1", - "timestamp": 1614639354771, - "value": 0.93, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": true, - "abc": "new-val" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "abc": "new-val", - "newProperty": "1", - "martin": 21.565000000000001, - "vertical": "restaurant", - "GMV": false - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "error": "Event type is required" - }, - { - "error": "Event type abc is not supported" - }, - { - "error": "eventTypeId does not match with ideal format /^[\\dA-Za-z][\\w.-]{0,79}$/" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "Viewed_1pplication_accepted_page", - "key": "user 1", - "timestamp": 1614639354771, - "environmentName": "production", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "GMV": true, - "abc": "new-val", - "category": "food", - "vertical[0]": "restaurant", - "vertical[1]": "mall" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": {} - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - } -] diff --git a/test/__tests__/data/splitio_router_input.json b/test/__tests__/data/splitio_router_input.json deleted file mode 100644 index b84fccb474..0000000000 --- a/test/__tests__/data/splitio_router_input.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "vertical": "restaurant", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000, - "GMV": false - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0", - "value": "0.93" - }, - "library": { - "name": "http" - } - }, - "type": "group", - "groupId": "group1", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "message": { - "traits": { - "martin": 21.565000000000001, - "trafficTypeName": "user", - "eventTypeId": "page_load end to end", - "timestamp": 1513357833000 - }, - "userId": "user123", - "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", - "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", - "context": { - "ip": "14.5.67.21", - "traits": { - "abc": "new-val", - "key": "key_user_0" - }, - "library": { - "name": "http" - } - }, - "type": "identify", - "timestamp": "2020-01-21T00:21:34.208Z", - "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", - "receivedAt": "2021-04-19T14:53:18.215+05:30", - "requestIP": "[::1]" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - } -] diff --git a/test/__tests__/data/splitio_router_output.json b/test/__tests__/data/splitio_router_output.json deleted file mode 100644 index 9f07c02d08..0000000000 --- a/test/__tests__/data/splitio_router_output.json +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "group", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565, - "vertical": "restaurant", - "GMV": false - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://events.split.io/api/events", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer abcde" - }, - "params": {}, - "body": { - "JSON": { - "eventTypeId": "identify", - "key": "user123", - "timestamp": 1579566094208, - "environmentName": "staging", - "trafficTypeName": "user", - "properties": { - "martin": 21.565 - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde", - "environment": "staging", - "trafficType": "user" - } - } - } -] diff --git a/test/__tests__/data/statsig_cdk_output.json b/test/__tests__/data/statsig_cdk_output.json deleted file mode 100644 index d0601e8df9..0000000000 --- a/test/__tests__/data/statsig_cdk_output.json +++ /dev/null @@ -1,607 +0,0 @@ -[ - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSPonIAEmulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9112340345", - "username": "john_sparrow" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", - "properties": { - "revenue": "30", - "currency": "USD", - "quantity": "5", - "test_key_2": { - "test_child_key_1": "test_child_value_1" - }, - "price": "58.0" - }, - "originalTimestamp": "2020-05-25T18:37:10.917Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "track", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "identify", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "identify", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "page@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "page", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "page", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "screen", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "screen", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-4n07h3rsecr3t" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.5" - }, - "traits": { - "name": "Shehan Study", - "category": "SampleIdentify", - "email": "test@rudderstack.com", - "plan": "Open source", - "logins": 5, - "createdAt": 1599264000 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.5" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 0.8999999761581421 - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign", - "test": "other value" - }, - "page": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "alias", - "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", - "originalTimestamp": "2020-10-20T08:14:28.778Z", - "anonymousId": "my-anonymous-id-new", - "userId": "newUserIdAlias", - "integrations": { - "All": true - }, - "previousId": "sampleusrRudder3", - "sentAt": "2020-10-20T08:14:28.778Z" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "group", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "error": "message type NOT_A_TYPE is not supported" - } -] diff --git a/test/__tests__/data/statsig_input.json b/test/__tests__/data/statsig_input.json deleted file mode 100644 index dbcf0666e9..0000000000 --- a/test/__tests__/data/statsig_input.json +++ /dev/null @@ -1,627 +0,0 @@ -[ - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSPonIAEmulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9112340345", - "username": "john_sparrow" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", - "properties": { - "revenue": "30", - "currency": "USD", - "quantity": "5", - "test_key_2": { - "test_child_key_1": "test_child_value_1" - }, - "price": "58.0" - }, - "originalTimestamp": "2020-05-25T18:37:10.917Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "track", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "identify", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "identify", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "page@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "page", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "page", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "screen", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - }, - { - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "screen", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-4n07h3rsecr3t" - } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.5" - }, - "traits": { - "name": "Shehan Study", - "category": "SampleIdentify", - "email": "test@rudderstack.com", - "plan": "Open source", - "logins": 5, - "createdAt": 1599264000 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.5" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 0.8999999761581421 - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign", - "test": "other value" - }, - "page": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "alias", - "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", - "originalTimestamp": "2020-10-20T08:14:28.778Z", - "anonymousId": "my-anonymous-id-new", - "userId": "newUserIdAlias", - "integrations": { - "All": true - }, - "previousId": "sampleusrRudder3", - "sentAt": "2020-10-20T08:14:28.778Z" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "group", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "NOT_A_TYPE", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "secretKey": "secret-tHe5ecr37" - } - } - } -] diff --git a/test/__tests__/data/statsig_output.json b/test/__tests__/data/statsig_output.json deleted file mode 100644 index 11b3553f4c..0000000000 --- a/test/__tests__/data/statsig_output.json +++ /dev/null @@ -1,607 +0,0 @@ -[ - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSPonIAEmulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9112340345", - "username": "john_sparrow" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", - "properties": { - "revenue": "30", - "currency": "USD", - "quantity": "5", - "test_key_2": { - "test_child_key_1": "test_child_value_1" - }, - "price": "58.0" - }, - "originalTimestamp": "2020-05-25T18:37:10.917Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "track", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "identify@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "identify", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "identify", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "page@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "page", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "page", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "screen", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "Kolkata", - "country": "India", - "postalcode": "700096", - "state": "West bengal", - "street": "Park Street" - }, - "age": "30", - "anonymousId": "8d872292709c6fbe", - "birthday": "2020-05-26", - "createdat": "18th March 2020", - "description": "Premium User for 3 years", - "email": "screen@test.com", - "firstname": "John", - "userId": "sample_user_id", - "lastname": "Sparrow", - "name": "John Sparrow", - "id": "sample_user_id", - "phone": "9876543210", - "username": "john_sparrow", - "quantity": "5", - "price": "56.0" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "screen", - "integrations": { - "All": true - }, - "messageId": "1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9", - "originalTimestamp": "2020-05-25T18:37:10.865Z", - "sentAt": "2020-05-25T18:37:10.917Z", - "type": "screen", - "userId": "sample_user_id" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-4n07h3rsecr3t" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.5" - }, - "traits": { - "name": "Shehan Study", - "category": "SampleIdentify", - "email": "test@rudderstack.com", - "plan": "Open source", - "logins": 5, - "createdAt": 1599264000 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.5" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 0.8999999761581421 - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign", - "test": "other value" - }, - "page": { - "path": "/destinations/amplitude", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/amplitude", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "alias", - "messageId": "dd46338d-5f83-493b-bd28-3b48f55d0be8", - "originalTimestamp": "2020-10-20T08:14:28.778Z", - "anonymousId": "my-anonymous-id-new", - "userId": "newUserIdAlias", - "integrations": { - "All": true - }, - "previousId": "sampleusrRudder3", - "sentAt": "2020-10-20T08:14:28.778Z" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "group", - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.statsig.com/v1/webhooks/rudderstack", - "headers": { - "content-type": "application/json", - "STATSIG-API-KEY": "secret-tHe5ecr37" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "error": "message type \"NOT_A_TYPE\" not supported for \"statsig\"" - } -] diff --git a/test/__tests__/data/tiktok_ads_input.json b/test/__tests__/data/tiktok_ads_input.json deleted file mode 100644 index 89919e866f..0000000000 --- a/test/__tests__/data/tiktok_ads_input.json +++ /dev/null @@ -1,2500 +0,0 @@ -[ - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout started", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist1", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "1234" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "SubscriBe", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+868987675687", - "email": "sample@sample.com" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "payment info entered", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "type": "track", - "event": "payment info entered", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "submitform", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "submitform", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "contact", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "identify", - "event": "contact", - "properties": { - "eventId": "16163186328257", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "order completed", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "user@sample.com", - "phone": "+919912345678" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "SubscriBe", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "TEST0000000011", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+918987674657", - "email": "sample@rudder.com" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "user@sample.com", - "phone": "+919912345678" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "SubscriBe", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "TEST0000000011", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "", - "email": "" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "ad": { - "callback": "999ATXSfe" - }, - "page": { - "url": "http://rudder.mywebsite.com/purchase", - "referrer": "http://rudder.mywebsite.com" - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "abc", - "to": "search" - }, - { - "from": "def", - "to": "search" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false, - "eventsToStandard": [ - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+371234567890123", - "email": "sample@sample.com" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "abc", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+3712345678", - "email": "sample@sample.com" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "abc", - "to": "download" - }, - { - "from": "def", - "to": "download" - } - ] - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "products": [ - { - "product_id": 123, - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "products": [ - { - "product_id": 123, - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "contentType": "product_group", - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "product_id": 345, - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "contentType": "product_group", - "quantity": 2 - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "products": [ - { - "contentType": "product_group", - "product_id": "123", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "contentType": "product_group", - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "category": "Urban", - "status": "processed", - "name": "games", - "contentType": "product_group", - "productId": "qqw21221341234", - "eventId": "1616318632825_357", - "products": [ - { - "product_id": "123", - "sku": "G-32", - "name": "Monopoly", - "price": 14, - "quantity": 1, - "category": "Games", - "url": "https://www.website.com/product/path", - "image_url": "https://www.website.com/product/path.jpg" - }, - { - "product_id": "345", - "sku": "F-32", - "name": "UNO", - "price": 3.45, - "quantity": 2, - "category": "Games" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - } -] diff --git a/test/__tests__/data/tiktok_ads_offline_events.json b/test/__tests__/data/tiktok_ads_offline_events.json deleted file mode 100644 index 24bdb2ed4e..0000000000 --- a/test/__tests__/data/tiktok_ads_offline_events.json +++ /dev/null @@ -1,469 +0,0 @@ -[ - { - "description": "Identify call not supported error message", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "type": "Identify", - "userId": "yash001", - "originalTimestamp": "2019-10-14T09:03:17.562Z" - } - }, - "output": { - "error": "Event type identify is not supported" - } - }, - { - "description": "Regular track call", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": false - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7181537436256731137", - "eventId": "1616318632825_352", - "order_id": "abc_xyz", - "shop_id": "123abc", - "currency": "USD", - "value": 46.0, - "price": 8, - "quantity": 2, - "content_type": "product1234", - "product_id": "1077218", - "name": "socks", - "category": "Men's cloth" - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_set_id": "7181537436256731137", - "event": "Subscribe", - "event_id": "1616318632825_352", - "timestamp": "2023-01-03", - "partner_name": "RudderStack", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ] - } - }, - "properties": { - "order_id": "abc_xyz", - "shop_id": "123abc", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "product1234", - "content_id": "1077218", - "content_name": "socks", - "content_category": "Men's cloth" - } - ], - "event_channel": "web", - "currency": "USD", - "value": 46.0 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "event_set_id": "7181537436256731137" - } - ] - }, - { - "description": "Track call with hashUserProperties set to true", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "1234567890" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7181537436256731137", - "eventId": "1616318632825_352", - "prop1": "val1" - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_set_id": "7181537436256731137", - "event": "Subscribe", - "event_id": "1616318632825_352", - "timestamp": "2023-01-03", - "partner_name": "RudderStack", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ] - } - }, - "properties": { - "event_channel": "web" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "event_set_id": "7181537436256731137" - } - ] - }, - { - "description": "Track call with event mapping", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "RandomEvent", - "to": "SubmitForm" - } - ] - } - }, - "message": { - "event": "RandomEvent", - "context": { - "traits": { - "phone": "1234567890" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7185009018564395009", - "eventId": "1616318632003_004", - "prop1": "val1" - }, - "userId": "eventIdn01", - "timestamp": "2023-01-03", - "type": "track" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event": "SubmitForm", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ] - } - }, - "event_id": "1616318632003_004", - "timestamp": "2023-01-03", - "properties": { - "event_channel": "web" - }, - "event_set_id": "7185009018564395009", - "partner_name": "RudderStack" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "event_set_id": "7185009018564395009" - } - ] - }, - { - "description": "Track call with no Access-Token", - "input": { - "destination": { - "Config": { - "hashUserProperties": true - } - }, - "message": { - "type": "track", - "userId": "yash001", - "originalTimestamp": "2019-10-14T09:03:17.562Z" - } - }, - "output": { - "error": "Access Token not found" - } - }, - { - "description": "Track call with product details in properties", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true - } - }, - "message": { - "event": "subscribe", - "context": { - "traits": { - "phone": "1234567890", - "email": "random@mail.com" - }, - "channel": "web" - }, - "properties": { - "eventSetId": "7181537436256731137", - "eventId": "1616318632825_352", - "products": [ - { - "price": 8, - "quantity": 2, - "content_type": "product1", - "product_id": "1077218", - "name": "socks", - "category": "Men's cloth" - }, - { - "price": 18, - "quantity": 12, - "content_type": "product2", - "product_id": "1077219", - "name": "socks1", - "category": "Men's cloth1" - } - ] - }, - "type": "track", - "userId": "eventIdn01", - "timestamp": "2023-01-03" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event_set_id": "7181537436256731137", - "event": "Subscribe", - "event_id": "1616318632825_352", - "timestamp": "2023-01-03", - "partner_name": "RudderStack", - "context": { - "user": { - "phone_numbers": [ - "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" - ], - "emails": ["d9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16"] - } - }, - "properties": { - "event_channel": "web", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "product1", - "content_id": "1077218", - "content_name": "socks", - "content_category": "Men's cloth" - }, - { - "price": 18, - "quantity": 12, - "content_type": "product2", - "content_id": "1077219", - "content_name": "socks1", - "content_category": "Men's cloth1" - } - ] - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "event_set_id": "7181537436256731137" - } - ] - }, - { - "description": "Track call with email and phone number parameter as an array", - "input": { - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "hashUserProperties": true, - "eventsToStandard": [ - { - "from": "CompletePayment", - "to": "Purchase" - } - ] - } - }, - "message": { - "type": "track", - "event": "CompletePayment", - "sentAt": "2023-03-22T00:02:33.802Z", - "traits": { - "email": [ - "efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900", - "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" - ], - "phone": [ - "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", - "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" - ] - }, - "userId": "60241286212", - "channel": "sources", - "context": { - "sources": { - "job_id": "2N4WuoNQpGYmCPASUvnV86QyhY4/Syncher", - "version": "v1.20.0", - "job_run_id": "cgd4a063b2fn2e1j0q90", - "task_run_id": "cgd4a063b2fn2e1j0qa0" - } - }, - "recordId": "16322", - "rudderId": "5b4ed73f-69aa-4198-88d1-3d4d509acbf1", - "messageId": "cgd4b663b2fn2e1j8th0", - "timestamp": "2023-03-22T00:02:33.170Z", - "properties": { - "phone": "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", - "value": 32.839999999999996, - "emails": "[\"efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900\",\"078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]", - "eventId": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", - "currency": "USD", - "order_id": 60241286212, - "eventSetId": "7211223771099742210", - "event_name": "CompletePayment" - }, - "receivedAt": "2023-03-22T00:02:33.171Z", - "request_ip": "10.7.78.187", - "anonymousId": "60241286212", - "originalTimestamp": "2023-03-22T00:02:33.802Z" - } - }, - "output": [ - { - "body": { - "FORM": {}, - "JSON": { - "context": { - "user": { - "emails": [ - "4dc75b075057df6f6b729e74a9feed1244dcf8ceb7903eaba13203f3268ae4b9", - "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" - ], - "phone_numbers": [ - "28b7b205c2936d2ded022d2587fb2677a76e560e921b3ad615b739b0238baa5d", - "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" - ] - } - }, - "event": "Purchase", - "event_id": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", - "event_set_id": "7211223771099742210", - "partner_name": "RudderStack", - "properties": { - "currency": "USD", - "order_id": 60241286212, - "value": 32.839999999999996 - }, - "timestamp": "2023-03-22T00:02:33.170Z" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", - "event_set_id": "7211223771099742210", - "files": {}, - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - ] - } -] diff --git a/test/__tests__/data/tiktok_ads_output.json b/test/__tests__/data/tiktok_ads_output.json deleted file mode 100644 index a5ca42e5cb..0000000000 --- a/test/__tests__/data/tiktok_ads_output.json +++ /dev/null @@ -1,1545 +0,0 @@ -[ - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "InitiateCheckout", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - } - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event name (product added to wishlist1) is not valid, must be mapped to one of standard events", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "body": { - "FORM": {}, - "JSON": { - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "referrer": "http://demo.mywebsite.com", - "url": "http://demo.mywebsite.com/purchase" - }, - "user": { - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", - "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4", - "phone_number": "1d96e70d2bf54087e33586457cde2790825bee7b1a3b05d26481cb12ec8e63fd" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "event": "Subscribe", - "event_id": "1616318632825_357", - "partner_name": "RudderStack", - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "properties": { - "contents": [ - { - "content_id": "1077218", - "content_type": "socks", - "price": 8, - "quantity": 2 - }, - { - "content_id": "1197218", - "content_type": "dress", - "price": 30, - "quantity": 1 - } - ], - "currency": "USD", - "value": 46 - }, - "timestamp": "2020-09-17T19:49:27Z" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "files": {}, - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddPaymentInfo", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event name is required", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - { - "statusCode": 400, - "error": "Event type is required", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "AddPaymentInfo", - "event_id": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "SubmitForm", - "event_id": "16163186328257", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "SubmitForm", - "event_id": "16163186328257", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "Contact", - "event_id": "16163186328257", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event type identify is not supported", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "PlaceAnOrder", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "Subscribe", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "TEST0000000011", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "1b6abcebb79b2208929967160ba291656f3fcd4f00e93b6a846c1e56c0e177c6", - "email": "02e47a94635c1ffd6f6a69fe2c7a92dbfbb9d5e2ebddb54810520b34989b66a7", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "Subscribe", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "test_event_code": "TEST0000000011", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "241102c24fa8a642e3d1346a31fbce3dd312563c015ae577a2253cb8652581eb", - "email": "a344da1fac6201ed1c1f20a07e1b55bb896a5ac0abd269c1e9daf1afbbffca3b", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "999ATXSfe" - }, - "page": { - "url": "http://rudder.mywebsite.com/purchase", - "referrer": "http://rudder.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "search", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Event name (abc) is not valid, must be mapped to one of standard events", - "statTags": { - "destination": "tiktok_ads", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "6080191ec608e10062e9257702cbca694cfe1bfa53944ba5701119d8f8b99ad6", - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "download", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "6e6c1bb39126b3ecf537e62847909b1372a1a22de9b28d85960e12c78f322035", - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", - "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "content_id": "123", - "content_type": "product_group", - "content_name": "Monopoly", - "price": 14, - "quantity": 1, - "content_category": "Games" - }, - { - "content_id": "345", - "content_type": "product_group", - "content_name": "UNO", - "price": 3.45, - "quantity": 2 - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "currency": "USD", - "value": 46, - "contents": [ - { - "content_type": "product_group", - "content_id": "123", - "content_category": "Games", - "content_name": "Monopoly", - "price": 14, - "quantity": 1 - }, - { - "content_type": "product_group", - "content_id": "345", - "content_category": "Games", - "content_name": "UNO", - "price": 3.45, - "quantity": 2 - } - ] - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "partner_name": "RudderStack" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "event": "CompletePayment", - "event_id": "1616318632825_357", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "content_category": "Urban", - "status": "processed", - "content_name": "games", - "content_id": "qqw21221341234", - "content_type": "product_group", - "currency": "USD", - "value": 46, - "contents": [ - { - "content_type": "product_group", - "content_id": "123", - "content_category": "Games", - "content_name": "Monopoly", - "price": 14, - "quantity": 1 - }, - { - "content_type": "product_group", - "content_id": "345", - "content_category": "Games", - "content_name": "UNO", - "price": 3.45, - "quantity": 2 - } - ] - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "partner_name": "RudderStack" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] -] diff --git a/test/__tests__/data/tiktok_ads_router_input.json b/test/__tests__/data/tiktok_ads_router_input.json deleted file mode 100644 index 7ed27e8fcf..0000000000 --- a/test/__tests__/data/tiktok_ads_router_input.json +++ /dev/null @@ -1,439 +0,0 @@ -[ - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131", - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout step completed", - "properties": { - "eventId": "1616318632825_357", - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 5 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "checkout started", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "download", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "search", - "properties": { - "eventId": "1616318632825_357", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "message": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "locale": "en-US", - "ip": "13.57.97.131", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "tiktokExternalId", - "id": "1234" - } - ] - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "timestamp": "2020-09-17T19:49:27Z", - "type": "track", - "event": "Product Added to Wishlist", - "properties": { - "eventId": "1616318632825_357", - "testEventCode": "sample rudder test_event_code", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "phone_number": "+858987675687", - "email": "sample@sample.com" - }, - "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", - "ip": "13.57.97.131" - }, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46.0 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - } - } -] diff --git a/test/__tests__/data/tiktok_ads_router_output.json b/test/__tests__/data/tiktok_ads_router_output.json deleted file mode 100644 index c13c2b9c13..0000000000 --- a/test/__tests__/data/tiktok_ads_router_output.json +++ /dev/null @@ -1,287 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/batch/", - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "batch": [ - { - "event": "CompletePayment", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "properties": { - "contents": [ - { - "price": 8, - "quantity": 2, - "content_type": "socks", - "content_id": "1077218" - }, - { - "price": 30, - "quantity": 1, - "content_type": "dress", - "content_id": "1197218" - } - ], - "currency": "USD", - "value": 46 - }, - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "ip": "13.57.97.131", - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - } - }, - { - "event": "InitiateCheckout", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "properties": { - "value": 46, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_id": "1077218", - "content_type": "socks" - }, - { - "price": 30, - "quantity": 1, - "content_id": "1197218", - "content_type": "dress" - } - ], - "currency": "USD" - } - }, - { - "event": "Download", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "properties": { - "value": 46, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_id": "1077218", - "content_type": "socks" - }, - { - "price": 30, - "quantity": 1, - "content_id": "1197218", - "content_type": "dress" - } - ], - "currency": "USD" - } - }, - { - "event": "Search", - "event_id": "1616318632825_357", - "type": "track", - "timestamp": "2020-09-17T19:49:27Z", - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "url": "http://demo.mywebsite.com/purchase", - "referrer": "http://demo.mywebsite.com" - }, - "user": { - "email": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc", - "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "properties": { - "value": 46, - "contents": [ - { - "price": 8, - "quantity": 2, - "content_id": "1077218", - "content_type": "socks" - }, - { - "price": 30, - "quantity": 1, - "content_id": "1197218", - "content_type": "dress" - } - ], - "currency": "USD" - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 5 - }, - { - "jobId": 1 - }, - { - "jobId": 2 - }, - { - "jobId": 4 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": false - } - } - }, - { - "batched": false, - "batchedRequest": [ - { - "body": { - "FORM": {}, - "JSON": { - "context": { - "ad": { - "callback": "123ATXSfe" - }, - "ip": "13.57.97.131", - "page": { - "referrer": "http://demo.mywebsite.com", - "url": "http://demo.mywebsite.com/purchase" - }, - "user": { - "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4", - "phone_number": "4443dd476f2be18201447ef046731c1a715accee4edc5192641a3b4c3ba921c7", - "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa" - }, - "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" - }, - "event": "AddToWishlist", - "event_id": "1616318632825_357", - "pixel_code": "A1T8T4UYGVIQA8ORZMX9", - "partner_name": "RudderStack", - "properties": { - "contents": [ - { - "content_id": "1077218", - "content_type": "socks", - "price": 8, - "quantity": 2 - }, - { - "content_id": "1197218", - "content_type": "dress", - "price": 30, - "quantity": 1 - } - ], - "currency": "USD", - "value": 46 - }, - "test_event_code": "sample rudder test_event_code", - "timestamp": "2020-09-17T19:49:27Z" - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", - "files": {}, - "headers": { - "Access-Token": "dummyAccessToken", - "Content-Type": "application/json" - }, - "method": "POST", - "params": {}, - "type": "REST", - "version": "1" - } - ], - "destination": { - "Config": { - "accessToken": "dummyAccessToken", - "pixelCode": "A1T8T4UYGVIQA8ORZMX9", - "hashUserProperties": true - } - }, - "metadata": [ - { - "jobId": 3 - } - ], - "statusCode": 200 - } -] diff --git a/test/__tests__/data/twitter_ads.json b/test/__tests__/data/twitter_ads.json deleted file mode 100644 index 53c7c19929..0000000000 --- a/test/__tests__/data/twitter_ads.json +++ /dev/null @@ -1,708 +0,0 @@ -[ - { - "description": "Track - success call", - "input": { - "message": { - "type": "track", - "event": "ABC Searched", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com", - "contents": [ - { - "price": "123.3345", - "quantity": "12", - "id": "12" - }, - { - "price": 200, - "quantity": 11, - "id": "4" - } - ] - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-odt2o-odt2q" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - "headers": { - "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "conversions": [ - { - "number_items": 2, - "price_currency": "USD", - "value": "25", - "conversion_id": "213123", - "contents": [ - { - "content_price": 123.3345, - "num_items": 12, - "content_id": "12" - }, - { - "content_price": 200.0, - "num_items": 11, - "content_id": "4" - } - ], - "event_id": "tw-234234324234", - "conversion_time": "2023-06-01T06:03:08.739Z", - "identifiers": [ - { - "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - }, - { - "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - }, - { - "twclid": "543" - } - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track - validation fail call", - "input": { - "message": { - "type": "track", - "event": "Home Page Viewed", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "conversionTime": "2023-06-01T06:03:08.739Z", - "eventId": "429047995", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-2dfsdf" - } - ] - } - } - }, - "output": { - "statusCode": 400, - "error": "[TWITTER ADS]: one of twclid, phone or email must be present in properties.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "TWITTER_ADS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - }, - { - "description": "Track - pixelId from payload call", - "input": { - "message": { - "type": "track", - "event": "Home Page Viewed", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "eventId": "429047995", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25.55, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - "headers": { - "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "conversions": [ - { - "number_items": 2, - "price_currency": "USD", - "value": "25.55", - "conversion_id": "213123", - "event_id": "429047995", - "conversion_time": "2023-06-01T06:03:08.739Z", - "identifiers": [ - { - "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - }, - { - "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - }, - { - "twclid": "543" - } - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Track - event name with no corresponding eventId", - "input": { - "message": { - "type": "track", - "event": "Home Page", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - }, - "output": { - "statusCode": 400, - "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting" - } - }, - { - "description": "Track - event name with no corresponding eventId", - "input": { - "message": { - "type": "track", - "event": "Home Page", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "pixelId": "dummyPixelId", - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com" - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": " ", - "twitterEventId": "tw-324fdsf" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-324fdsf" - } - ] - } - } - }, - "output": { - "statusCode": 400, - "error": "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting" - } - }, - { - "description": "Track - success call", - "input": { - "message": { - "type": "track", - "event": "Home Page Viewed", - "channel": "web", - "context": { - "source": "test", - "userAgent": "chrome", - "traits": { - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "email": "abc@gmail.com", - "phone": "+1234589947", - "ge": "male", - "db": "19950715", - "lastname": "Rudderlabs", - "firstName": "Test", - "address": { - "city": "Kolkata", - "state": "WB", - "zip": "700114", - "country": "IN" - } - }, - "device": { - "advertisingId": "abc123" - }, - "library": { - "name": "rudder-sdk-ruby-sync", - "version": "1.0.6" - } - }, - "messageId": "7208bbb6-2c4e-45bb-bf5b-ad426f3593e9", - "timestamp": "2020-08-14T05:30:30.118Z", - "properties": { - "conversionTime": "2023-06-01T06:03:08.739Z", - "tax": 2, - "total": 27.5, - "coupon": "hasbros", - "revenue": 48, - "price": 25, - "quantity": 2, - "currency": "USD", - "priceCurrency": "USD", - "conversionId": "213123", - "numberItems": "2323", - "phone": "+919927455678", - "twclid": "543", - "shipping": 3, - "subtotal": 22.5, - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "email": "abc@ax.com", - "contents": [ - { - "price": "123.3345", - "quantity": "12", - "id": "12" - }, - { - "price": 200, - "quantity": 11, - "id": "4" - } - ] - }, - "anonymousId": "50be5c78-6c3f-4b60-be84-97805a316fb1", - "integrations": { - "All": true - } - }, - "metadata": { - "secret": { - "consumerKey": "qwe", - "consumerSecret": "fdghv", - "accessToken": "dummyAccessToken", - "accessTokenSecret": "testAccessTokenSecret" - } - }, - "destination": { - "Config": { - "pixelId": "dummyPixelId", - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK", - "twitterAdsEventNames": [ - { - "rudderEventName": "ABC Searched", - "twitterEventId": "tw-234234324234" - }, - { - "rudderEventName": "Home Page Viewed", - "twitterEventId": "tw-odt2o-odt2q" - } - ] - } - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId", - "headers": { - "Authorization": "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\"", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "conversions": [ - { - "number_items": 2, - "price_currency": "USD", - "value": "25", - "conversion_id": "213123", - "contents": [ - { - "content_price": 123.3345, - "num_items": 12, - "content_id": "12" - }, - { - "content_price": 200.0, - "num_items": 11, - "content_id": "4" - } - ], - "event_id": "tw-odt2o-odt2q", - "conversion_time": "2023-06-01T06:03:08.739Z", - "identifiers": [ - { - "hashed_email": "4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb" - }, - { - "hashed_phone_number": "b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56" - }, - { - "twclid": "543" - } - ] - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - } -] diff --git a/test/__tests__/data/variance_input.json b/test/__tests__/data/variance_input.json deleted file mode 100644 index bb95160e9c..0000000000 --- a/test/__tests__/data/variance_input.json +++ /dev/null @@ -1,410 +0,0 @@ -[ - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "user_properties": { - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "fb_profile": "0", - "game_fps": 30, - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": false, - "level": 6, - "lifetime_gem_balance": 0, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2 - } - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "http://6b0e6a60.ngrok.io", - "authHeader": "Basic MVA4dUtGOF=" - } - } - }, - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "user_properties": { - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "fb_profile": "0", - "game_fps": 30, - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": false, - "level": 6, - "lifetime_gem_balance": 0, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2 - } - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "https://6b0e6a60.ngrok.io/n" - } - } - }, - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "user_properties": { - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "fb_profile": "0", - "game_fps": 30, - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": false, - "level": 6, - "lifetime_gem_balance": 0, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2 - } - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "https://6b0e6a60." - } - } - }, - { - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "request_ip": "127.0.0.1" - }, - "destination": { - "DestinationDefinition": { - "Config": { - "cdkEnabled": true - } - }, - "Config": { - "webhookUrl": "http://6b0e6a60.ngrok.io", - "header": [ - { - "from": "test1", - "to": "value1" - }, - { - "from": "test2", - "to": "value2" - } - ] - } - } - } -] diff --git a/test/__tests__/data/variance_output.json b/test/__tests__/data/variance_output.json deleted file mode 100644 index 2295fdbe7b..0000000000 --- a/test/__tests__/data/variance_output.json +++ /dev/null @@ -1,421 +0,0 @@ -[ - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "user_properties": { - "total_payments": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "level": 6, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "coin_balance": 9466052, - "player_total_shields": 0, - "isLowEndDevice": false, - "game_fps": 30, - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "graphicsQuality": "HD", - "current_module_name": "CasinoGameModule", - "player_total_battles": 0, - "lifetime_gem_balance": 0, - "gem_balance": 0, - "fb_profile": "0", - "start_date": "2019-08-01", - "versionSessionCount": 2, - "game_name": "FireEagleSlots" - }, - "integrations": { - "All": true - }, - "event": "spin_result", - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "model": "Redmi 6", - "manufacturer": "Xiaomi", - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "name": "xiaomi" - }, - "traits": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "address": { - "city": "Dhaka", - "country": "Bangladesh" - } - }, - "os": { - "version": "8.1.0", - "name": "android" - }, - "network": { - "carrier": "Banglalink" - } - }, - "type": "track", - "properties": { - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "jackpot_win_type": "Silver", - "coin_balance": 9466052, - "bet_level": 1, - "ishighroller": "False", - "tournament_id": "T1561970819", - "battle_id": "N/A", - "bet_amount": 9, - "fb_profile": "0", - "player_total_shields": 0, - "is_turbo": "False", - "player_total_battles": 0, - "bet_multiplier": 1, - "start_date": "2019-08-01", - "versionSessionCount": 2, - "graphicsQuality": "HD", - "is_auto_spin": "False", - "days_in_game": 0, - "additional_bet_index": 0, - "isLowEndDevice": "False", - "game_fps": 30, - "extra_param": "N/A", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "current_module_name": "CasinoGameModule", - "game_id": "fireEagleBase", - "featureGameType": "N/A", - "gem_balance": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "total_payments": 0, - "level": 6, - "win_amount": 0, - "no_of_spin": 1, - "game_name": "FireEagleSlots", - "jackpot_win_amount": 90, - "lifetime_gem_balance": 0, - "isf": "False" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "http://6b0e6a60.ngrok.io", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "content-type": "application/json", - "authorization": "Basic MVA4dUtGOF=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "user_properties": { - "total_payments": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "level": 6, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "coin_balance": 9466052, - "player_total_shields": 0, - "isLowEndDevice": false, - "game_fps": 30, - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "graphicsQuality": "HD", - "current_module_name": "CasinoGameModule", - "player_total_battles": 0, - "lifetime_gem_balance": 0, - "gem_balance": 0, - "fb_profile": "0", - "start_date": "2019-08-01", - "versionSessionCount": 2, - "game_name": "FireEagleSlots" - }, - "integrations": { - "All": true - }, - "event": "spin_result", - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "model": "Redmi 6", - "manufacturer": "Xiaomi", - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "name": "xiaomi" - }, - "traits": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "address": { - "city": "Dhaka", - "country": "Bangladesh" - } - }, - "os": { - "version": "8.1.0", - "name": "android" - }, - "network": { - "carrier": "Banglalink" - } - }, - "type": "track", - "properties": { - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "jackpot_win_type": "Silver", - "coin_balance": 9466052, - "bet_level": 1, - "ishighroller": "False", - "tournament_id": "T1561970819", - "battle_id": "N/A", - "bet_amount": 9, - "fb_profile": "0", - "player_total_shields": 0, - "is_turbo": "False", - "player_total_battles": 0, - "bet_multiplier": 1, - "start_date": "2019-08-01", - "versionSessionCount": 2, - "graphicsQuality": "HD", - "is_auto_spin": "False", - "days_in_game": 0, - "additional_bet_index": 0, - "isLowEndDevice": "False", - "game_fps": 30, - "extra_param": "N/A", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "current_module_name": "CasinoGameModule", - "game_id": "fireEagleBase", - "featureGameType": "N/A", - "gem_balance": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "total_payments": 0, - "level": 6, - "win_amount": 0, - "no_of_spin": 1, - "game_name": "FireEagleSlots", - "jackpot_win_amount": 90, - "lifetime_gem_balance": 0, - "isf": "False" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://6b0e6a60.ngrok.io/n", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "content-type": "application/json" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "user_properties": { - "total_payments": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "level": 6, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "coin_balance": 9466052, - "player_total_shields": 0, - "isLowEndDevice": false, - "game_fps": 30, - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "graphicsQuality": "HD", - "current_module_name": "CasinoGameModule", - "player_total_battles": 0, - "lifetime_gem_balance": 0, - "gem_balance": 0, - "fb_profile": "0", - "start_date": "2019-08-01", - "versionSessionCount": 2, - "game_name": "FireEagleSlots" - }, - "integrations": { - "All": true - }, - "event": "spin_result", - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "model": "Redmi 6", - "manufacturer": "Xiaomi", - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "name": "xiaomi" - }, - "traits": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "address": { - "city": "Dhaka", - "country": "Bangladesh" - } - }, - "os": { - "version": "8.1.0", - "name": "android" - }, - "network": { - "carrier": "Banglalink" - } - }, - "type": "track", - "properties": { - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "jackpot_win_type": "Silver", - "coin_balance": 9466052, - "bet_level": 1, - "ishighroller": "False", - "tournament_id": "T1561970819", - "battle_id": "N/A", - "bet_amount": 9, - "fb_profile": "0", - "player_total_shields": 0, - "is_turbo": "False", - "player_total_battles": 0, - "bet_multiplier": 1, - "start_date": "2019-08-01", - "versionSessionCount": 2, - "graphicsQuality": "HD", - "is_auto_spin": "False", - "days_in_game": 0, - "additional_bet_index": 0, - "isLowEndDevice": "False", - "game_fps": 30, - "extra_param": "N/A", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "current_module_name": "CasinoGameModule", - "game_id": "fireEagleBase", - "featureGameType": "N/A", - "gem_balance": 0, - "internetReachability": "ReachableViaLocalAreaNetwork", - "total_payments": 0, - "level": 6, - "win_amount": 0, - "no_of_spin": 1, - "game_name": "FireEagleSlots", - "jackpot_win_amount": 90, - "lifetime_gem_balance": 0, - "isf": "False" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://6b0e6a60.", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "content-type": "application/json" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "http://6b0e6a60.ngrok.io", - "headers": { - "content-type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - }, - "ip": "127.0.0.1" - }, - "event": "spin_result", - "integrations": { - "All": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "versionSessionCount": 2, - "win_amount": 0 - }, - "timestamp": "2019-09-01T15:46:51.693229+05:30", - "originalTimestamp": "2019-09-01T15:46:51.693229+05:30", - "sentAt": "2019-09-01T15:46:51.693229+05:30", - "type": "track", - "request_ip": "127.0.0.1" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } -] diff --git a/test/__tests__/data/vero.json b/test/__tests__/data/vero.json deleted file mode 100644 index 7a524a7da0..0000000000 --- a/test/__tests__/data/vero.json +++ /dev/null @@ -1,559 +0,0 @@ -[ - { - "description": "Identify Call with userId only", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "homwTown": "kanpur", - "age": "24" - } - }, - "type": "Identify", - "userId": "yash001", - "originalTimestamp": "2019-10-14T09:03:17.562Z" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "yash001", - "data": { - "homwTown": "kanpur", - "age": "24" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify Call with both userId and email", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1001@tech.com" - } - }, - "type": "Identify", - "userId": "user1001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user1001", - "email": "user1001@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify Call with anonymousId and email only", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1002@tech.com" - } - }, - "type": "Identify", - "anonymousId": "b4ffheww8eisndbdjgdewifewfgerwibderv" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "b4ffheww8eisndbdjgdewifewfgerwibderv", - "email": "user1002@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Add tags in identify call", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "address": "Caravela Beach Goa", - "homwTown": "Mawsynram", - "email": "user1005@tech.com" - } - }, - "integrations": { - "vero": { - "tags": { - "add": ["a", "b"] - } - } - }, - "type": "Identify", - "userId": "fprediruser001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "fprediruser001", - "email": "user1005@tech.com", - "data": { - "address": "Caravela Beach Goa", - "homwTown": "Mawsynram" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "auth_token": "testAuthToken", - "id": "fprediruser001", - "add": ["a", "b"] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Track Call with nonexistent userId- Creates new user with event", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "event": "Random event with nonexisting userId and email", - "properties": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "type": "track", - "userId": "eventIdn01" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "eventIdn01", - "email": "eventIdn01@sample.com" - }, - "event_name": "Random event with nonexisting userId and email", - "data": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Track Call with already existing userId and removing tags", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "event": "Random event with existing userId and some tags removed", - "properties": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "integrations": { - "Vero": { - "tags": { - "remove": ["a"] - } - } - }, - "type": "track", - "userId": "fprediruser001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "fprediruser001", - "email": "eventIdn01@sample.com" - }, - "event_name": "Random event with existing userId and some tags removed", - "data": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn01@sample.com" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "auth_token": "testAuthToken", - "id": "fprediruser001", - "remove": ["a"] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Alias Call - Merge two user profiles", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "type": "alias", - "userId": "sample101", - "previousId": "newsamplel01" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.getvero.com/api/v2/users/reidentify", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "new_id": "sample101", - "id": "newsamplel01", - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Identify Call with valid channels", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1001@tech.com" - }, - "os": { - "name": "android" - }, - "device": { - "token": "qwertyuioiuytrewwertyu", - "name": "Mi" - } - }, - "type": "Identify", - "userId": "user1001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user1001", - "email": "user1001@tech.com", - "channels": { - "platform": "android", - "address": "qwertyuioiuytrewwertyu", - "device": "Mi", - "type": "push" - }, - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Identify Call with invalid channels", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "context": { - "traits": { - "email": "user1001@tech.com" - }, - "device": { - "token": "qwertyuioiuytrewwertyu", - "name": "Mi" - } - }, - "type": "Identify", - "userId": "user1001" - } - }, - "output": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user1001", - "email": "user1001@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ] - }, - { - "description": "Track Call to unsubscribe a userId", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "event": "unsubscribe", - "type": "track", - "userId": "eventIdn01" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/unsubscribe", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "eventIdn01", - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Page Call with an existing userID", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "name": "Rudderstack", - "properties": { - "title": "rudderstack", - "path": "/" - }, - "type": "page", - "userId": "eventIdn01" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "eventIdn01" - }, - "event_name": "Viewed Rudderstack Page", - "data": { - "title": "rudderstack", - "path": "/" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - }, - { - "description": "Error flow - message type not supported", - "input": { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "message": { - "groupId": "1234", - "traits": { - "name": "MyGroup", - "industry": "IT", - "employees": 450, - "plan": "basic" - }, - "type": "group", - "userId": "eventIdn01" - } - }, - "output": { - "error": "Event type group is not supported" - } - } -] diff --git a/test/__tests__/data/vero_router_input.json b/test/__tests__/data/vero_router_input.json deleted file mode 100644 index 749ea11dfd..0000000000 --- a/test/__tests__/data/vero_router_input.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 1 - }, - "message": { - "context": { - "traits": { - "email": "user001@tech.com" - } - }, - "type": "Identify", - "userId": "user001" - } - }, - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "context": { - "traits": { - "email": "user002@tech.com" - } - }, - "type": "Identify", - "anonymousId": "b4ffheww8eisndbdjgdewifewfgerwibderv" - } - }, - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 3 - }, - "message": { - "context": { - "traits": { - "address": "Caravela Beach Goa", - "homwTown": "Mawsynram", - "email": "user005@tech.com" - } - }, - "integrations": { - "vero": { - "tags": { - "add": ["a", "b"] - } - } - }, - "type": "Identify", - "userId": "fprediruser001" - } - }, - { - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": { - "jobId": 4 - }, - "message": { - "event": "Random event with nonexisting userId and email", - "properties": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn02@sample.com" - }, - "type": "track", - "userId": "eventIdn01" - } - } -] diff --git a/test/__tests__/data/vero_router_output.json b/test/__tests__/data/vero_router_output.json deleted file mode 100644 index 293b351251..0000000000 --- a/test/__tests__/data/vero_router_output.json +++ /dev/null @@ -1,175 +0,0 @@ -[ - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "user001", - "email": "user001@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 1 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "b4ffheww8eisndbdjgdewifewfgerwibderv", - "email": "user002@tech.com", - "data": {}, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 2 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/users/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "id": "fprediruser001", - "email": "user005@tech.com", - "data": { - "address": "Caravela Beach Goa", - "homwTown": "Mawsynram" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "auth_token": "testAuthToken", - "id": "fprediruser001", - "add": ["a", "b"] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 3 - } - ], - "statusCode": 200 - }, - { - "batched": false, - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getvero.com/api/v2/events/track", - "headers": {}, - "params": {}, - "body": { - "JSON": { - "identity": { - "id": "eventIdn01", - "email": "eventIdn02@sample.com" - }, - "event_name": "Random event with nonexisting userId and email", - "data": { - "movieWatched": 3, - "gamesPlayed": 4, - "email": "eventIdn02@sample.com" - }, - "auth_token": "testAuthToken" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - "destination": { - "Config": { - "authToken": "testAuthToken" - } - }, - "metadata": [ - { - "jobId": 4 - } - ], - "statusCode": 200 - } -] diff --git a/test/__tests__/proxy.test.ts b/test/__tests__/proxy.test.ts deleted file mode 100644 index abccf8dbb4..0000000000 --- a/test/__tests__/proxy.test.ts +++ /dev/null @@ -1,106 +0,0 @@ -const name = 'Proxy'; -import fs, { appendFileSync } from 'fs'; -import path, { join } from 'path'; -import request from 'supertest'; -import { createHttpTerminator } from 'http-terminator'; -import { mockedAxiosClient } from '../__mocks__/network'; -import Koa from 'koa'; -import bodyParser from 'koa-bodyparser'; -import { applicationRoutes } from '../../src/routes'; -import { responses } from '../testHelper'; - -let server: any; -const OLD_ENV = process.env; - -beforeAll(async () => { - process.env = { ...OLD_ENV }; // Make a copy - const app = new Koa(); - app.use( - bodyParser({ - jsonLimit: '200mb', - }), - ); - applicationRoutes(app); - server = app.listen(9090); -}); - -afterAll(async () => { - process.env = OLD_ENV; // Restore old environment - const httpTerminator = createHttpTerminator({ - server, - }); - await httpTerminator.terminate(); -}); - -jest.mock('axios', () => jest.fn(mockedAxiosClient)); - -const version = '1'; -const destinations = [ - 'marketo', - 'braze', - 'facebook_pixel', - 'fb', - 'snapchat_custom_audience', - 'clevertap', - 'salesforce', - 'marketo_static_list', - 'criteo_audience', - 'tiktok_ads', - 'intercom', -]; - -// start of generic tests -const inputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/proxy_input.json`)); -const outputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/proxy_output.json`)); -const inputData = JSON.parse(inputDataFile.toString()); -const expectedData = JSON.parse(outputDataFile.toString()); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload - ${index}`, async () => { - const response = await request(server) - .post(`/${version}/destinations/any/proxy`) - .set('Accept', 'application/json') - .send(input); - expect(response.body).toEqual(expectedData[index]); - }); -}); -// end of generic tests - -// destination tests start -destinations.forEach((destination) => { - const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${destination}_proxy_input.json`), - ); - const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${destination}_proxy_output.json`), - ); - const inputData = JSON.parse(inputDataFile.toString()); - const expectedData = JSON.parse(outputDataFile.toString()); - - describe(`Proxy Test for ${destination}`, () => { - inputData.forEach((input, index) => { - it(`${name} Tests: ${destination} - Payload ${index}`, async () => { - const response = await request(server) - .post(`/${version}/destinations/${destination}/proxy`) - .set('Accept', 'application/json') - .send(input); - expect(response.body).toEqual(expectedData[index]); - }); - }); - afterAll(() => { - if (process.env.GEN_AXIOS_FOR_TESTS === 'true') { - const callsDataStr = responses.join('\n'); - const calls = ` - export const networkCallsData = [ - ${callsDataStr} - ] - `; - appendFileSync( - join(__dirname, '..', 'integrations', 'destinations', destination, 'network.ts'), - calls, - ); - } - }); - }); -}); -// destination tests end diff --git a/test/__tests__/redis.test.js b/test/__tests__/redis.test.js deleted file mode 100644 index be3a1a497f..0000000000 --- a/test/__tests__/redis.test.js +++ /dev/null @@ -1,28 +0,0 @@ -const integration = "redis"; -const name = "Redis"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload - ${index}`, () => { - try { - const output = transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); -}); diff --git a/test/__tests__/revenue_cat.test.js b/test/__tests__/revenue_cat.test.js deleted file mode 100644 index 8b4487e764..0000000000 --- a/test/__tests__/revenue_cat.test.js +++ /dev/null @@ -1,33 +0,0 @@ -const integration = "revenue_cat"; -const name = "revenue_cat"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -describe(`${name} Tests`, () => { - describe("Processor Tests", () => { - inputData.forEach((input, index) => { - it(`${name} - payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); -}); diff --git a/test/__tests__/salesforce.test.js b/test/__tests__/salesforce.test.js deleted file mode 100644 index 7315017376..0000000000 --- a/test/__tests__/salesforce.test.js +++ /dev/null @@ -1,70 +0,0 @@ -jest.mock("axios"); -const integration = "salesforce"; -const name = "Salesforce"; -const version = "v0"; - -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -// Router Metadata Test files -const inputRouterMetadataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_metadata_input.json`) -); -const outputRouterMetadataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_metadata_output.json`) -); -const inputRouterMetadata = JSON.parse(inputRouterMetadataFile); -const expectedRouterMetadata = JSON.parse(outputRouterMetadataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); - - describe("Router Metadata Tests", () => { - it("Payload", async () => { - const routerMetadataOutput = await transformer.processMetadataForRouter( - inputRouterMetadata - ); - expect(routerMetadataOutput).toEqual(expectedRouterMetadata); - }); - }); -}); diff --git a/test/__tests__/segment.test.js b/test/__tests__/segment.test.js deleted file mode 100644 index a1f9812f22..0000000000 --- a/test/__tests__/segment.test.js +++ /dev/null @@ -1,33 +0,0 @@ -const integration = "segment"; -const name = "Segment"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -// const { compareJSON } = require("./util"); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - test(`${name} Tests: payload - ${index}`, () => { - let output, expected; - try { - output = transformer.process(input); - expected = expectedData[index]; - } catch (error) { - output = error.message; - expected = expectedData[index].message; - } - expect(output).toEqual(expected); - }); -}); diff --git a/test/__tests__/shynet.test.js b/test/__tests__/shynet.test.js deleted file mode 100644 index b7027d14c3..0000000000 --- a/test/__tests__/shynet.test.js +++ /dev/null @@ -1,29 +0,0 @@ -const integration = "shynet"; -const name = "shynet"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - let output = await transformer.process(dataPoint.input); - delete output.body.JSON.idempotency; - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); -}); diff --git a/test/__tests__/slack.test.js b/test/__tests__/slack.test.js deleted file mode 100644 index eec0f4054f..0000000000 --- a/test/__tests__/slack.test.js +++ /dev/null @@ -1,48 +0,0 @@ -const integration = "slack"; -const name = "Slack"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); -// const { compareJSON } = require("./util"); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -inputData.forEach((input, index) => { - test(`${name} Tests - payload: ${index}`, () => { - try { - const output = transformer.process(input); - expect(output).toEqual([expectedData[index]]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); -}); -describe(`${name} Tests`, () => { - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/snapchat_conversion.test.js b/test/__tests__/snapchat_conversion.test.js deleted file mode 100644 index 17fd363cc7..0000000000 --- a/test/__tests__/snapchat_conversion.test.js +++ /dev/null @@ -1,48 +0,0 @@ -const integration = "snapchat_conversion"; -const name = "Snapchat Conversion"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -Date.now = jest.fn(() => new Date("2022-04-22T10:57:58Z")); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, () => { - try { - const output = transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/snapchat_custom_audience.test.js b/test/__tests__/snapchat_custom_audience.test.js deleted file mode 100644 index 41c4217562..0000000000 --- a/test/__tests__/snapchat_custom_audience.test.js +++ /dev/null @@ -1,51 +0,0 @@ -const integration = "snapchat_custom_audience"; -const name = "Snapchat Custom Audience"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - const output = await transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - describe("Router", () => { - it("Payload", async () => { - try { - const routerOutput = await transformer.processRouterDest( - inputRouterData - ); - expect(routerOutput).toEqual(expectedRouterData); - } catch (error) { - expect(error.message).toEqual(expectedRouterData.error); - } - }); - }); -}); diff --git a/test/__tests__/splitio.test.js b/test/__tests__/splitio.test.js deleted file mode 100644 index d2b226aea3..0000000000 --- a/test/__tests__/splitio.test.js +++ /dev/null @@ -1,7 +0,0 @@ -const { - getDestFromTestFile, - executeTransformationTest -} = require("./utilities/test-utils"); - -executeTransformationTest(getDestFromTestFile(__filename), "processor"); -executeTransformationTest(getDestFromTestFile(__filename), "router"); diff --git a/test/__tests__/statsig-cdk.test.ts b/test/__tests__/statsig-cdk.test.ts deleted file mode 100644 index 79bb3e9fae..0000000000 --- a/test/__tests__/statsig-cdk.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { processCdkV2Workflow } from '../../src/cdk/v2/handler'; -import tags from '../../src/v0/util/tags'; - -const integration = 'statsig'; -const destName = 'Statsig'; - -const inputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/${integration}_input.json`), { - encoding: 'utf8', -}); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_cdk_output.json`), - { encoding: 'utf8' }, -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -describe(`${destName} Tests`, () => { - describe('Processor Tests', () => { - inputData.forEach((input, index) => { - it(`${destName} - payload: ${index}`, async () => { - const expected = expectedData[index]; - try { - const output = await processCdkV2Workflow(integration, input, tags.FEATURES.PROCESSOR); - expect(output).toEqual(expected); - } catch (error: any) { - expect(error.message).toEqual(expected.error); - } - }); - }); - }); -}); diff --git a/test/__tests__/statsig.test.js b/test/__tests__/statsig.test.js deleted file mode 100644 index b0b36ba187..0000000000 --- a/test/__tests__/statsig.test.js +++ /dev/null @@ -1,3 +0,0 @@ -const { executeTransformationTest } = require("./utilities/test-utils"); - -executeTransformationTest("statsig", "processor"); diff --git a/test/__tests__/tiktok_ads.test.js b/test/__tests__/tiktok_ads.test.js deleted file mode 100644 index 8b61fabf3d..0000000000 --- a/test/__tests__/tiktok_ads.test.js +++ /dev/null @@ -1,50 +0,0 @@ -const integration = "tiktok_ads"; -const name = "TikTok"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/tiktok_ads_offline_events.test.js b/test/__tests__/tiktok_ads_offline_events.test.js deleted file mode 100644 index 849f73befc..0000000000 --- a/test/__tests__/tiktok_ads_offline_events.test.js +++ /dev/null @@ -1,46 +0,0 @@ -const integration = "tiktok_ads_offline_events"; -const name = "TikTok Ads Offline Events"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - const output = await transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/__tests__/twitter_ads.test.js b/test/__tests__/twitter_ads.test.js deleted file mode 100644 index 08811aad52..0000000000 --- a/test/__tests__/twitter_ads.test.js +++ /dev/null @@ -1,44 +0,0 @@ -const integration = "twitter_ads"; -const name = "twitter_ads"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -const authHeaderConstant = "OAuth oauth_consumer_key=\"qwe\", oauth_nonce=\"V1kMh028kZLLhfeYozuL0B45Pcx6LvuW\", oauth_signature=\"Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1685603652\", oauth_token=\"dummyAccessToken\", oauth_version=\"1.0\""; - -jest.mock("../../src/v0/destinations/twitter_ads/util", () => { - const originalModule = jest.requireActual("../../src/v0/destinations/twitter_ads/util"); - return { - ...originalModule, - getAuthHeaderForRequest: jest.fn(() => { - return { - Authorization: authHeaderConstant - } - }) - } -}) - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - let output = await transformer.process(dataPoint.input); - delete output.body.JSON.idempotency; - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); -}); diff --git a/test/__tests__/variance-cdk.test.ts b/test/__tests__/variance-cdk.test.ts deleted file mode 100644 index 648ddaddbb..0000000000 --- a/test/__tests__/variance-cdk.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { processCdkV2Workflow } from '../../src/cdk/v2/handler'; -import tags from '../../src/v0/util/tags'; - -const integration = 'variance'; -const destName = 'Variance'; - -const inputDataFile = fs.readFileSync(path.resolve(__dirname, `./data/${integration}_input.json`), { - encoding: 'utf8', -}); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`), - { encoding: 'utf8' }, -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -describe(`${destName} Tests`, () => { - describe('Processor Tests', () => { - inputData.forEach((input, index) => { - it(`${destName} - payload: ${index}`, async () => { - const expected = expectedData[index]; - try { - const output = await processCdkV2Workflow(integration, input, tags.FEATURES.PROCESSOR); - expect(output).toEqual(expected); - } catch (error: any) { - expect(error.message).toEqual(expected.error); - } - }); - }); - }); -}); diff --git a/test/__tests__/variance.test.js b/test/__tests__/variance.test.js deleted file mode 100644 index ac6e247191..0000000000 --- a/test/__tests__/variance.test.js +++ /dev/null @@ -1,3 +0,0 @@ -const { executeTransformationTest } = require("./utilities/test-utils"); - -executeTransformationTest("variance", "processor"); diff --git a/test/__tests__/vero.test.js b/test/__tests__/vero.test.js deleted file mode 100644 index b0b1d130ff..0000000000 --- a/test/__tests__/vero.test.js +++ /dev/null @@ -1,46 +0,0 @@ -const integration = "vero"; -const name = "vero"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test Data -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach((dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - const output = await transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 8b2a2ec7bd..847dd4c91f 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -73,18 +73,17 @@ afterAll(async () => { } await createHttpTerminator({ server }).terminate(); }); -let mock; +let mockAdapter; if (!opts.generate || opts.generate === 'false') { // unmock already existing axios-mocking - mock = new MockAxiosAdapter(axios, { onNoMatch: 'passthrough' }); + mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); const registerAxiosMocks = (axiosMocks: MockHttpCallsData[]) => { - axiosMocks.forEach((axiosMock) => addMock(mock, axiosMock)); + axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); }; // // all the axios requests will be stored in this map const allTestMockDataFilePaths = getAllTestMockDataFilePaths(__dirname, opts.destination); const allAxiosRequests = allTestMockDataFilePaths - .filter((d) => !d.includes('/af/')) .map((currPath) => { const mockNetworkCallsData: MockHttpCallsData[] = getMockHttpCallsData(currPath); return mockNetworkCallsData; @@ -184,7 +183,7 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { } describe(`${testData[0].name} ${testData[0].module}`, () => { test.each(testData)('$feature -> $description', async (tcData) => { - tcData?.mockFns?.(mock); + tcData?.mockFns?.(mockAdapter); switch (tcData.module) { case tags.MODULES.DESTINATION: diff --git a/test/integrations/destinations/algolia/processor/data.ts b/test/integrations/destinations/algolia/processor/data.ts index fa76b6376e..f5c01e47e5 100644 --- a/test/integrations/destinations/algolia/processor/data.ts +++ b/test/integrations/destinations/algolia/processor/data.ts @@ -1,1243 +1,1232 @@ export const data = [ - { - "name": "algolia", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product clicked", - "userId": "testuserId1", - "properties": { - "index": "products", - "filters": [ - "field1:hello", - "val1:val2" - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product clicked", - "to": "cLick " - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "FORM": {}, - "JSON_ARRAY": {}, - "JSON": { - "events": [ - { - "eventName": "product clicked", - "eventType": "click", - "filters": [ - "field1:hello", - "val1:val2" - ], - "index": "products", - "userToken": "testuserId1" - } - ] - }, - "XML": {} - }, - "endpoint": "https://insights.algolia.io/1/events", - "files": {}, - "headers": { - "X-Algolia-API-Key": "dummyApiKey", - "X-Algolia-Application-Id": "O2YARRI15I" - }, - "method": "POST", - "params": {}, - "type": "REST", - "userId": "", - "version": "1" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product list viewed", - "userId": "testuserId1", - "properties": { - "index": "products", - "products": [ - { - "objectId": "ecommerce-sample-data-919", - "position": 7 - }, - { - "objectId": "9780439784542", - "position": 8 - } - ], - "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product list viewed", - "to": "click" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "FORM": {}, - "JSON_ARRAY": {}, - "JSON": { - "events": [ - { - "eventName": "product list viewed", - "eventType": "click", - "objectIDs": [ - "ecommerce-sample-data-919", - "9780439784542" - ], - "positions": [ - 7, - 8 - ], - "index": "products", - "userToken": "testuserId1", - "queryID": "43b15df305339e827f0ac0bdc5ebcaa7" - } - ] - }, - "XML": {} - }, - "endpoint": "https://insights.algolia.io/1/events", - "files": {}, - "headers": { - "X-Algolia-API-Key": "dummyApiKey", - "X-Algolia-Application-Id": "O2YARRI15I" - }, - "method": "POST", - "params": {}, - "type": "REST", - "userId": "", - "version": "1" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product clicked", - "userId": "testuserId1", - "properties": { - "eventType": "click", - "index": "products", - "queryId": "43b15df305339e827f0ac0bdc5ebcaa8" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Either filters or objectIds is required.", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "testuserId1", - "event": "product clicked", - "properties": { - "index": "products", - "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "eventType is mandatory for track call", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product list viewed", - "userId": "testuserId1", - "properties": { - "index": "products", - "products": [ - { - "objectId": "ecommerce-sample-data-919", - "position": 7 - }, - { - "objectId": "9780439784542", - "position": 8 - } - ], - "queryId": "" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product list viewed", - "to": "click" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "for click eventType either both positions and queryId should be present or none", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product list viewed", - "userId": "testuserId1", - "properties": { - "index": "products", - "products": [ - { - "objectId": "ecommerce-sample-data-919", - "position": 7 - }, - { - "objectId": "9780439784542", - "position": 8 - } - ], - "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product list viewed", - "to": "view" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "FORM": {}, - "JSON_ARRAY": {}, - "JSON": { - "events": [ - { - "eventName": "product list viewed", - "eventType": "view", - "index": "products", - "objectIDs": [ - "ecommerce-sample-data-919", - "9780439784542" - ], - "userToken": "testuserId1", - "queryID": "43b15df305339e827f0ac0bdc5ebcaa7" - } - ] - }, - "XML": {} - }, - "endpoint": "https://insights.algolia.io/1/events", - "files": {}, - "headers": { - "X-Algolia-API-Key": "dummyApiKey", - "X-Algolia-Application-Id": "O2YARRI15I" - }, - "method": "POST", - "params": {}, - "type": "REST", - "userId": "", - "version": "1" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product list viewed", - "userId": "testuserId1", - "properties": { - "index": "products", - "products": [ - { - "objectId": "ecommerce-sample-data-919", - "position": "7" - }, - { - "objectId": "9780439784542", - "position": "a" - } - ], - "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product list viewed", - "to": "click" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "for click eventType either both positions and queryId should be present or none", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product list viewed", - "userId": "testuserId1", - "properties": { - "index": "products", - "products": [ - { - "objectId": "ecommerce-sample-data-919", - "position": "7" - }, - { - "objectId": "9780439784542", - "position": "a" - } - ], - "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product list viewed", - "to": "check" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "eventType can be either click, view or conversion", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product list viewed", - "userId": "testuserId1", - "properties": { - "index": "products", - "products": [ - { - "objectId": "ecommerce-sample-data-919", - "position": "7" - }, - { - "objectId": "9780439784542", - "position": "a" - } - ], - "queryId": "43b15df305339e827f0ac0bdc5ebcaa7" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "eventType is mandatory for track call", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": "product clicked", - "userId": "testuserId1", - "properties": { - "filters": [ - "field1:hello", - "val1:val2" - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product clicked", - "to": "cLick " - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Missing required value from \"properties.index\"", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "algolia", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testone@gmail.com", - "firstName": "test", - "lastName": "one" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/destinations/ometria", - "referrer": "", - "search": "", - "title": "", - "url": "https://docs.rudderstack.com/destinations/ometria", - "category": "destination", - "initial_referrer": "https://docs.rudderstack.com", - "initial_referring_domain": "docs.rudderstack.com" - } - }, - "type": "track", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "event": [ - "abc", - "def" - ], - "userId": "testuserId1", - "properties": { - "filters": [ - "field1:hello", - "val1:val2" - ] - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey", - "applicationId": "O2YARRI15I", - "eventTypeSettings": [ - { - "from": "product clicked", - "to": "cLick " - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "event name should be a string", - "statTags": { - "destType": "ALGOLIA", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'algolia', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product clicked', + userId: 'testuserId1', + properties: { + index: 'products', + filters: ['field1:hello', 'val1:val2'], + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product clicked', + to: 'cLick ', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON_ARRAY: {}, + JSON: { + events: [ + { + eventName: 'product clicked', + eventType: 'click', + filters: ['field1:hello', 'val1:val2'], + index: 'products', + userToken: 'testuserId1', + }, + ], + }, + XML: {}, + }, + endpoint: 'https://insights.algolia.io/1/events', + files: {}, + headers: { + 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-Application-Id': 'O2YARRI15I', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product list viewed', + userId: 'testuserId1', + properties: { + index: 'products', + products: [ + { + objectId: 'ecommerce-sample-data-919', + position: 7, + }, + { + objectId: '9780439784542', + position: 8, + }, + ], + queryId: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product list viewed', + to: 'click', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON_ARRAY: {}, + JSON: { + events: [ + { + eventName: 'product list viewed', + eventType: 'click', + objectIDs: ['ecommerce-sample-data-919', '9780439784542'], + positions: [7, 8], + index: 'products', + userToken: 'testuserId1', + queryID: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + ], + }, + XML: {}, + }, + endpoint: 'https://insights.algolia.io/1/events', + files: {}, + headers: { + 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-Application-Id': 'O2YARRI15I', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product clicked', + userId: 'testuserId1', + properties: { + eventType: 'click', + index: 'products', + queryId: '43b15df305339e827f0ac0bdc5ebcaa8', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Either filters or objectIds is required.', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: 'testuserId1', + event: 'product clicked', + properties: { + index: 'products', + queryId: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventType is mandatory for track call', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product list viewed', + userId: 'testuserId1', + properties: { + index: 'products', + products: [ + { + objectId: 'ecommerce-sample-data-919', + position: 7, + }, + { + objectId: '9780439784542', + position: 8, + }, + ], + queryId: '', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product list viewed', + to: 'click', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'for click eventType either both positions and queryId should be present or none', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product list viewed', + userId: 'testuserId1', + properties: { + index: 'products', + products: [ + { + objectId: 'ecommerce-sample-data-919', + position: 7, + }, + { + objectId: '9780439784542', + position: 8, + }, + ], + queryId: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product list viewed', + to: 'view', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON_ARRAY: {}, + JSON: { + events: [ + { + eventName: 'product list viewed', + eventType: 'view', + index: 'products', + objectIDs: ['ecommerce-sample-data-919', '9780439784542'], + userToken: 'testuserId1', + queryID: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + ], + }, + XML: {}, + }, + endpoint: 'https://insights.algolia.io/1/events', + files: {}, + headers: { + 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-Application-Id': 'O2YARRI15I', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product list viewed', + userId: 'testuserId1', + properties: { + index: 'products', + products: [ + { + objectId: 'ecommerce-sample-data-919', + position: '7', + }, + { + objectId: '9780439784542', + position: 'a', + }, + ], + queryId: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product list viewed', + to: 'click', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'for click eventType either both positions and queryId should be present or none', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product list viewed', + userId: 'testuserId1', + properties: { + index: 'products', + products: [ + { + objectId: 'ecommerce-sample-data-919', + position: '7', + }, + { + objectId: '9780439784542', + position: 'a', + }, + ], + queryId: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product list viewed', + to: 'check', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventType can be either click, view or conversion', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product list viewed', + userId: 'testuserId1', + properties: { + index: 'products', + products: [ + { + objectId: 'ecommerce-sample-data-919', + position: '7', + }, + { + objectId: '9780439784542', + position: 'a', + }, + ], + queryId: '43b15df305339e827f0ac0bdc5ebcaa7', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventType is mandatory for track call', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'product clicked', + userId: 'testuserId1', + properties: { + filters: ['field1:hello', 'val1:val2'], + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product clicked', + to: 'cLick ', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Missing required value from "properties.index"', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'algolia', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/destinations/ometria', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/ometria', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: ['abc', 'def'], + userId: 'testuserId1', + properties: { + filters: ['field1:hello', 'val1:val2'], + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + applicationId: 'O2YARRI15I', + eventTypeSettings: [ + { + from: 'product clicked', + to: 'cLick ', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'event name should be a string', + statTags: { + destType: 'ALGOLIA', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/am/dataDelivery/data.ts b/test/integrations/destinations/am/dataDelivery/data.ts new file mode 100644 index 0000000000..a4faa7e60c --- /dev/null +++ b/test/integrations/destinations/am/dataDelivery/data.ts @@ -0,0 +1,547 @@ +import { AxiosError } from 'axios'; +import MockAdapter from 'axios-mock-adapter'; +import { isMatch } from 'lodash'; + +// Note: This destination makes use of generic network handler +export const data = [ + { + name: 'am', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test1', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: + '[Generic Response Handler] Request for destination: am Processed Successfully', + destinationResponse: { + response: { + code: 200, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 1, + }, + status: 200, + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test2', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + '[Generic Response Handler] Request failed for destination am with status: 400', + destinationResponse: { + response: { + code: 400, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 0, + }, + status: 400, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test3', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + '[Generic Response Handler] Request failed for destination am with status: 400', + destinationResponse: { + response: '[ENOTFOUND] :: DNS lookup failed', + status: 400, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + mockAdapter + .onPost( + 'https://api.amplitude.com/2/httpapi/test3', + { + asymmetricMatch: (actual) => { + const expected = { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }; + const isMatched = isMatch(actual, expected); + return isMatched; + }, + }, + { + asymmetricMatch: (actual) => { + const expected = { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }; + const isMatched = isMatch(actual, expected); + return isMatched; + }, + }, + ) + .replyOnce((config) => { + // @ts-ignore + const err = AxiosError.from('DNS not found', 'ENOTFOUND', config); + return Promise.reject(err); + }); + }, + }, + { + name: 'am', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test4', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + '[Generic Response Handler] Request failed for destination am with status: 400', + destinationResponse: { + response: '', + status: 400, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test5', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + '[Generic Response Handler] Request failed for destination am with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'am', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/test6', + method: 'POST', + userId: 'gabi_anonId_45', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + '[Generic Response Handler] Request failed for destination am with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/am/network.ts b/test/integrations/destinations/am/network.ts index 81daa29621..5cd016069c 100644 --- a/test/integrations/destinations/am/network.ts +++ b/test/integrations/destinations/am/network.ts @@ -206,4 +206,211 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; + +const deliveryNwData = [ + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test1', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + code: 200, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 1, + }, + status: 200, + statusText: 'OK', + headers: { + date: 'Sat, 11 Dec 2021 15:08:22 GMT', + 'content-type': 'application/json', + 'content-length': '93', + connection: 'keep-alive', + 'access-control-allow-origin': '*', + 'access-control-allow-methods': 'GET, POST', + 'strict-transport-security': 'max-age=15768000', + }, + }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test2', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + code: 400, + server_upload_time: 1639235302252, + payload_size_bytes: 863, + events_ingested: 0, + }, + status: 400, + statusText: 'Bad Request', + headers: { + date: 'Sat, 11 Dec 2021 15:08:22 GMT', + 'content-type': 'application/json', + 'content-length': '93', + connection: 'keep-alive', + 'access-control-allow-origin': '*', + 'access-control-allow-methods': 'GET, POST', + 'strict-transport-security': 'max-age=15768000', + }, + }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test4', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { status: 400, statusText: 'Bad Request' }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test5', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: {}, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test6', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'am' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: {}, + }, +]; + +export const networkCallsData = [...deleteNwData, ...deliveryNwData]; diff --git a/test/integrations/destinations/appcues/processor/data.ts b/test/integrations/destinations/appcues/processor/data.ts index c01abc241e..ab47e5c857 100644 --- a/test/integrations/destinations/appcues/processor/data.ts +++ b/test/integrations/destinations/appcues/processor/data.ts @@ -1160,7 +1160,7 @@ export const data = [ status: 200, body: [ { - error: "User id is absent. Aborting event as userId is mandatory for Appcues", + error: 'User id is absent. Aborting event as userId is mandatory for Appcues', statTags: { destType: 'APPCUES', errorCategory: 'dataValidation', @@ -1169,7 +1169,7 @@ export const data = [ implementation: 'native', module: 'destination', }, - statusCode: 400, + statusCode: 400, }, ], }, @@ -1258,7 +1258,7 @@ export const data = [ status: 200, body: [ { - error: 'Message Type is not present. Aborting message.', + error: 'Message Type is not present. Aborting message.', statTags: { destType: 'APPCUES', errorCategory: 'dataValidation', @@ -1267,7 +1267,7 @@ export const data = [ implementation: 'native', module: 'destination', }, - statusCode: 400, + statusCode: 400, }, ], }, @@ -1369,7 +1369,7 @@ export const data = [ status: 200, body: [ { - error: 'Message type is not supported', + error: 'Message type is not supported', statTags: { destType: 'APPCUES', errorCategory: 'dataValidation', @@ -1378,7 +1378,7 @@ export const data = [ implementation: 'native', module: 'destination', }, - statusCode: 400, + statusCode: 400, }, ], }, diff --git a/test/integrations/destinations/appcues/router/data.ts b/test/integrations/destinations/appcues/router/data.ts index 28a52c8bdc..ddc8dddf57 100644 --- a/test/integrations/destinations/appcues/router/data.ts +++ b/test/integrations/destinations/appcues/router/data.ts @@ -217,5 +217,5 @@ export const data = [ }, }, }, - } + }, ]; diff --git a/test/integrations/destinations/attentive_tag/processor/data.ts b/test/integrations/destinations/attentive_tag/processor/data.ts index 42e6492d10..f585fb58d8 100644 --- a/test/integrations/destinations/attentive_tag/processor/data.ts +++ b/test/integrations/destinations/attentive_tag/processor/data.ts @@ -1,5 +1,4 @@ export const mockFns = (_) => { - // @ts-ignore jest.useFakeTimers().setSystemTime(new Date('2023-10-14')); }; diff --git a/test/integrations/destinations/azure_event_hub/processor/data.ts b/test/integrations/destinations/azure_event_hub/processor/data.ts index 8784bf4d60..2f7acf742e 100644 --- a/test/integrations/destinations/azure_event_hub/processor/data.ts +++ b/test/integrations/destinations/azure_event_hub/processor/data.ts @@ -1,825 +1,835 @@ export const data = [ - { - "name": "azure_event_hub", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "Purchase", - "integrations": { - "All": true - }, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "originalTimestamp": "2020-05-21T10:23:15.984Z", - "properties": { - "currency": "USD", - "revenue": 100 - }, - "receivedAt": "2020-05-21T15:53:16.013+05:30", - "request_ip": "[::1]:59371", - "sentAt": "2020-05-21T10:23:15.985Z", - "timestamp": "2020-05-21T15:53:16.012+05:30", - "type": "track", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 46, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "Purchase", - "integrations": { - "All": true - }, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "originalTimestamp": "2020-05-21T10:23:15.984Z", - "properties": { - "currency": "USD", - "revenue": 100 - }, - "receivedAt": "2020-05-21T15:53:16.013+05:30", - "request_ip": "[::1]:59371", - "sentAt": "2020-05-21T10:23:15.985Z", - "timestamp": "2020-05-21T15:53:16.012+05:30", - "type": "track", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 46, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "azure_event_hub", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "originalTimestamp": "2020-05-21T10:23:15.975Z", - "properties": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:58616", - "sentAt": "2020-05-21T10:23:15.975Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "page", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 47, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "originalTimestamp": "2020-05-21T10:23:15.975Z", - "properties": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:58616", - "sentAt": "2020-05-21T10:23:15.975Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "page", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 47, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "azure_event_hub", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "originalTimestamp": "2020-05-21T10:23:15.979Z", - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59372", - "sentAt": "2020-05-21T10:23:15.979Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "identify", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 48, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "originalTimestamp": "2020-05-21T10:23:15.979Z", - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59372", - "sentAt": "2020-05-21T10:23:15.979Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "identify", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 48, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "azure_event_hub", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track without property", - "integrations": { - "All": true - }, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "originalTimestamp": "2020-05-21T10:23:15.981Z", - "properties": {}, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59374", - "sentAt": "2020-05-21T10:23:15.981Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "track", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 49, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track without property", - "integrations": { - "All": true - }, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "originalTimestamp": "2020-05-21T10:23:15.981Z", - "properties": {}, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59374", - "sentAt": "2020-05-21T10:23:15.981Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "track", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 49, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "azure_event_hub", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track with property", - "integrations": { - "All": true - }, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "originalTimestamp": "2020-05-21T10:23:15.982Z", - "properties": { - "test_prop_1": "test prop", - "test_prop_2": 1232 - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59373", - "sentAt": "2020-05-21T10:23:15.983Z", - "timestamp": "2020-05-21T15:53:16.013+05:30", - "type": "track", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 50, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track with property", - "integrations": { - "All": true - }, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "originalTimestamp": "2020-05-21T10:23:15.982Z", - "properties": { - "test_prop_1": "test prop", - "test_prop_2": 1232 - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59373", - "sentAt": "2020-05-21T10:23:15.983Z", - "timestamp": "2020-05-21T15:53:16.013+05:30", - "type": "track", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 50, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'azure_event_hub', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'Purchase', + integrations: { + All: true, + }, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + originalTimestamp: '2020-05-21T10:23:15.984Z', + properties: { + currency: 'USD', + revenue: 100, + }, + receivedAt: '2020-05-21T15:53:16.013+05:30', + request_ip: '[::1]:59371', + sentAt: '2020-05-21T10:23:15.985Z', + timestamp: '2020-05-21T15:53:16.012+05:30', + type: 'track', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 46, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'Purchase', + integrations: { + All: true, + }, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + originalTimestamp: '2020-05-21T10:23:15.984Z', + properties: { + currency: 'USD', + revenue: 100, + }, + receivedAt: '2020-05-21T15:53:16.013+05:30', + request_ip: '[::1]:59371', + sentAt: '2020-05-21T10:23:15.985Z', + timestamp: '2020-05-21T15:53:16.012+05:30', + type: 'track', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 46, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'azure_event_hub', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + originalTimestamp: '2020-05-21T10:23:15.975Z', + properties: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:58616', + sentAt: '2020-05-21T10:23:15.975Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'page', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 47, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + originalTimestamp: '2020-05-21T10:23:15.975Z', + properties: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:58616', + sentAt: '2020-05-21T10:23:15.975Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'page', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 47, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'azure_event_hub', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + originalTimestamp: '2020-05-21T10:23:15.979Z', + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59372', + sentAt: '2020-05-21T10:23:15.979Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'identify', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 48, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + originalTimestamp: '2020-05-21T10:23:15.979Z', + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59372', + sentAt: '2020-05-21T10:23:15.979Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'identify', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 48, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'azure_event_hub', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track without property', + integrations: { + All: true, + }, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + originalTimestamp: '2020-05-21T10:23:15.981Z', + properties: {}, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59374', + sentAt: '2020-05-21T10:23:15.981Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'track', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 49, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track without property', + integrations: { + All: true, + }, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + originalTimestamp: '2020-05-21T10:23:15.981Z', + properties: {}, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59374', + sentAt: '2020-05-21T10:23:15.981Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'track', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 49, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'azure_event_hub', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track with property', + integrations: { + All: true, + }, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + originalTimestamp: '2020-05-21T10:23:15.982Z', + properties: { + test_prop_1: 'test prop', + test_prop_2: 1232, + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59373', + sentAt: '2020-05-21T10:23:15.983Z', + timestamp: '2020-05-21T15:53:16.013+05:30', + type: 'track', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 50, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track with property', + integrations: { + All: true, + }, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + originalTimestamp: '2020-05-21T10:23:15.982Z', + properties: { + test_prop_1: 'test prop', + test_prop_2: 1232, + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59373', + sentAt: '2020-05-21T10:23:15.983Z', + timestamp: '2020-05-21T15:53:16.013+05:30', + type: 'track', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 50, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/blueshift/processor/data.ts b/test/integrations/destinations/blueshift/processor/data.ts index 990515f40a..d489a38bd6 100644 --- a/test/integrations/destinations/blueshift/processor/data.ts +++ b/test/integrations/destinations/blueshift/processor/data.ts @@ -1,1997 +1,1991 @@ export const data = [ - { - "name": "blueshift", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "dataCenter": "standard" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.5" - }, - "traits": { - "name": "hardik", - "email": "hardik@rudderstack.com", - "cookie": "1234abcd-efghklkj-1234kfjadslk-34iu123", - "industry": "Education", - "employees": 399, - "plan": "enterprise", - "total billed": 830 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.5" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36", - "locale": "en-US", - "os": { - "name": "", - "version": "" - } - }, - "type": "group", - "messageId": "e5034df0-a404-47b4-a463-76df99934fea", - "anonymousId": "my-anonymous-id-new", - "userId": "sampleusrRudder7", - "traits": { - "groupType": "company", - "name_trait": "Company", - "value_trait": "Comapny-ABC" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Missing required value from \"groupId\"", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "standard" - } - }, - "message": { - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.5" - }, - "traits": { - "name": "hardik", - "email": "hardik@rudderstack.com", - "cookie": "1234abcd-efghklkj-1234kfjadslk-34iu123", - "industry": "Education", - "employees": 399, - "plan": "enterprise", - "total billed": 830 - } - }, - "type": "group", - "userId": "rudderstack8", - "groupId": "35838" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getblueshift.com/api/v1/event", - "headers": { - "Authorization": "Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "group_id": "35838", - "customer_id": "rudderstack8", - "email": "hardik@rudderstack.com", - "event": "identify" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "standard" - } - }, - "message": { - "context": { - "ip": "14.5.67.21", - "device": { - "adTrackingEnabled": true, - "advertisingId": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "Android", - "attTrackingStatus": 3 - }, - "os": { - "name": "Android", - "version": "9" - }, - "network": { - "bluetooth": false, - "carrier": "Android", - "cellular": true, - "wifi": true - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "latitude": "37.7672319", - "longitude": "-122.4021353", - "state": "WB", - "street": "rajnagar" - } - }, - "properties": { - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123" - }, - "messageId": "34abcd-efghijkj-1234kf", - "type": "track", - "event": "identify", - "userId": "sampleusrRudder7" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getblueshift.com/api/v1/event", - "headers": { - "Authorization": "Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "customer_id": "sampleusrRudder7", - "event": "identify", - "device_type": "Android", - "device_id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "device_idfa": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "device_idfv": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "device_manufacturer": "Google", - "os_name": "Android", - "network_carrier": "Android", - "ip": "14.5.67.21", - "latitude": "37.7672319", - "longitude": "-122.4021353", - "event_uuid": "34abcd-efghijkj-1234kf", - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "standard" - } - }, - "message": { - "type": "track", - "event": "Product Viewed", - "properties": { - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123", - "checkout_id": "C324532", - "order_id": "T1230", - "value": 15.98, - "revenue": 16.98, - "shipping": 3, - "coupon": "FY21", - "currency": "INR", - "products": [ - { - "product_id": "product-mixedfruit-jam", - "sku": "sku-1", - "category": "Food", - "name": "Food/Drink", - "brand": "Sample", - "variant": "None", - "price": 10, - "quantity": 2, - "currency": "INR", - "position": 1, - "value": 6, - "typeOfProduct": "Food", - "url": "https://www.example.com/product/bacon-jam", - "image_url": "https://www.example.com/product/bacon-jam.jpg" - } - ] - }, - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - } - }, - "messageId": "34abcd-efghijkj-1234kf", - "userId": "sampleRudderstack9" - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getblueshift.com/api/v1/event", - "headers": { - "Authorization": "Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event": "view", - "device_type": "android", - "device_id": "7e32188a4dab669f", - "device_idfv": "7e32188a4dab669f", - "device_manufacturer": "Google", - "os_name": "Android", - "network_carrier": "Android", - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123", - "checkout_id": "C324532", - "order_id": "T1230", - "value": 15.98, - "revenue": 16.98, - "shipping": 3, - "coupon": "FY21", - "currency": "INR", - "products": [ - { - "product_id": "product-mixedfruit-jam", - "sku": "sku-1", - "category": "Food", - "name": "Food/Drink", - "brand": "Sample", - "variant": "None", - "price": 10, - "quantity": 2, - "currency": "INR", - "position": 1, - "value": 6, - "typeOfProduct": "Food", - "url": "https://www.example.com/product/bacon-jam", - "image_url": "https://www.example.com/product/bacon-jam.jpg" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "message": { - "type": "track", - "event": "Products Searched", - "properties": { - "description": "Sneaker purchase", - "brand": "Victory Sneakers", - "colors": [ - "red", - "blue" - ], - "items": [ - { - "text": "New Line Sneakers", - "price": "$ 79.95" - }, - { - "text": "Old Line Sneakers", - "price": "$ 79.95" - }, - { - "text": "Blue Line Sneakers", - "price": "$ 79.95" - } - ], - "name": "Hugh Manbeing", - "userLocation": { - "state": "CO", - "zip": "80202" - } - }, - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - } - }, - "messageId": "34abcd-efghijkj-1234kf", - "userId": "sampleRudderstack9" - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.eu.getblueshift.com/api/v1/event", - "headers": { - "Authorization": "Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "event": "search", - "device_type": "android", - "device_id": "7e32188a4dab669f", - "device_idfv": "7e32188a4dab669f", - "device_manufacturer": "Google", - "os_name": "Android", - "network_carrier": "Android", - "description": "Sneaker purchase", - "brand": "Victory Sneakers", - "colors": [ - "red", - "blue" - ], - "items": [ - { - "text": "New Line Sneakers", - "price": "$ 79.95" - }, - { - "text": "Old Line Sneakers", - "price": "$ 79.95" - }, - { - "text": "Blue Line Sneakers", - "price": "$ 79.95" - } - ], - "name": "Hugh Manbeing", - "userLocation": { - "state": "CO", - "zip": "80202" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "standard" - } - }, - "message": { - "type": "track", - "event": "Product_purchased", - "properties": { - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123" - }, - "messageId": "34abcd-efghijkj-1234kf", - "context": { - "ip": "14.5.67.21", - "device": { - "adTrackingEnabled": true, - "advertisingId": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "Android", - "attTrackingStatus": 3 - }, - "os": { - "name": "Android", - "version": "9" - }, - "network": { - "bluetooth": false, - "carrier": "Android", - "cellular": true, - "wifi": true - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "latitude": "37.7672319", - "longitude": "-122.4021353", - "state": "WB", - "street": "rajnagar" - } - }, - "userId": "sampleRudderstack9" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "[BLUESHIFT] event Api Keys required for Authentication.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "a5e75d99c8a18acb4a29abd920ec1e2e", - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "standard" - } - }, - "message": { - "type": "identify", - "event": "Product_purchased", - "properties": { - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123" - }, - "messageId": "34abcd-efghijkj-1234kf", - "context": { - "ip": "14.5.67.21", - "device": { - "adTrackingEnabled": true, - "advertisingId": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "Android", - "attTrackingStatus": 3 - }, - "os": { - "name": "Android", - "version": "9" - }, - "network": { - "bluetooth": false, - "carrier": "Android", - "cellular": true, - "wifi": true - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "latitude": "37.7672319", - "longitude": "-122.4021353", - "state": "WB", - "street": "rajnagar" - } - }, - "userId": "sampleRudderstack9" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Missing required value from \"email\"", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "a5e75d99c8a18acb4a29abd920ec1e2e", - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "standard" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "userId": "rudder123", - "anonymousId": "anon_id", - "name": "James Doe", - "phone": "92374162212", - "gender": "M", - "firstname": "James", - "lastname": "Doe", - "employed": true, - "birthday": "1614775793", - "education": "Science", - "graduate": true, - "married": true, - "customerType": "Prime", - "msg_push": true, - "msgSms": true, - "msgemail": true, - "msgwhatsapp": false, - "custom_tags": [ - "Test_User", - "Interested_User", - "DIY_Hobby" - ], - "custom_mappings": { - "Office": "Trastkiv", - "Country": "Russia" - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getblueshift.com/api/v1/customers", - "headers": { - "Authorization": "Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "email": "chandan@companyname.com", - "customer_id": "rudder123", - "phone_number": "92374162212", - "firstname": "James", - "lastname": "Doe", - "gender": "M", - "userId": "rudder123", - "anonymousId": "anon_id", - "name": "James Doe", - "employed": true, - "birthday": "1614775793", - "education": "Science", - "graduate": true, - "married": true, - "customerType": "Prime", - "msg_push": true, - "msgSms": true, - "msgemail": true, - "msgwhatsapp": false, - "custom_tags": [ - "Test_User", - "Interested_User", - "DIY_Hobby" - ], - "custom_mappings": { - "Office": "Trastkiv", - "Country": "Russia" - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "state": "WB", - "street": "" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "a5e75d99c8a18acb4a29abd920ec1e2e", - "dataCenter": "eu" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "userId": "rudder123", - "anonymousId": "anon_id", - "name": "James Doe", - "phone": "92374162212", - "gender": "M", - "firstname": "James", - "lastname": "Doe", - "employed": true, - "birthday": "1614775793", - "education": "Science", - "graduate": true, - "married": true, - "customerType": "Prime", - "msg_push": true, - "msgSms": true, - "msgemail": true, - "msgwhatsapp": false, - "custom_tags": [ - "Test_User", - "Interested_User", - "DIY_Hobby" - ], - "custom_mappings": { - "Office": "Trastkiv", - "Country": "Russia" - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "[BLUESHIFT] User API Key required for Authentication.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "a5e75d99c8a18acb4a29abd920ec1e2e", - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "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" - }, - "locale": "en-US", - "ip": "0.0.0.0" - }, - "type": "identify", - "traits": { - "email": "chandan@companyname.com", - "userId": "rudder123", - "anonymousId": "anon_id", - "name": "James Doe", - "phone": "92374162212", - "gender": "M", - "firstname": "James", - "lastname": "Doe" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.eu.getblueshift.com/api/v1/customers", - "headers": { - "Authorization": "Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "email": "chandan@companyname.com", - "customer_id": "rudder123", - "phone_number": "92374162212", - "firstname": "James", - "lastname": "Doe", - "gender": "M", - "userId": "rudder123", - "anonymousId": "anon_id", - "name": "James Doe" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "a5e75d99c8a18acb4a29abd920ec1e2e", - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "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" - }, - "locale": "en-US", - "ip": "0.0.0.0" - }, - "traits": { - "email": "chandan@companyname.com", - "userId": "rudder123", - "anonymousId": "anon_id", - "name": "James Doe", - "phone": "92374162212", - "gender": "M", - "firstname": "James", - "lastname": "Doe" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Message Type is not present. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 11", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "a5e75d99c8a18acb4a29abd920ec1e2e", - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "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" - }, - "locale": "en-US", - "ip": "0.0.0.0" - }, - "type": "page", - "traits": { - "email": "chandan@companyname.com", - "userId": "rudder123", - "anonymousId": "anon_id", - "name": "James Doe", - "phone": "92374162212", - "gender": "M", - "firstname": "James", - "lastname": "Doe" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Message type page not supported", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 12", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "message": { - "type": "track", - "event": "Order Completed", - "properties": { - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - }, - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "quantity": "2", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - } - ] - }, - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "userId": "sampleRudderstack11" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.eu.getblueshift.com/api/v1/event", - "headers": { - "Authorization": "Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "customer_id": "sampleRudderstack11", - "event": "purchase", - "device_type": "android", - "device_id": "7e32188a4dab669f", - "device_idfv": "7e32188a4dab669f", - "device_manufacturer": "Google", - "os_name": "Android", - "network_carrier": "Android", - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - }, - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "quantity": "2", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 13", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75d99c8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "message": { - "context": { - "ip": "14.5.67.21", - "device": { - "adTrackingEnabled": true, - "advertisingId": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "manufacturer": "Google", - "model": "AOSP on IA Emulator", - "name": "generic_x86_arm", - "type": "Android", - "attTrackingStatus": 3 - }, - "os": { - "name": "Android", - "version": "9" - }, - "network": { - "bluetooth": false, - "carrier": "Android", - "cellular": true, - "wifi": true - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "latitude": "37.7672319", - "longitude": "-122.4021353", - "state": "WB", - "street": "rajnagar" - } - }, - "properties": { - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123" - }, - "messageId": "34abcd-efghijkj-1234kf", - "type": "track", - "event": "Custom Events", - "userId": "sampleusrRudder7" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.eu.getblueshift.com/api/v1/event", - "headers": { - "Authorization": "Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "customer_id": "sampleusrRudder7", - "event": "Custom_Events", - "device_type": "Android", - "device_id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "device_idfa": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "device_idfv": "3f034872-5e28-45a1-9eda-ce22a3e36d1a", - "device_manufacturer": "Google", - "os_name": "Android", - "network_carrier": "Android", - "ip": "14.5.67.21", - "latitude": "37.7672319", - "longitude": "-122.4021353", - "event_uuid": "34abcd-efghijkj-1234kf", - "cookie": "1234abcd-efghijkj-1234kfjadslk-34iu123" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 14", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "message": { - "type": "track", - "event": "Order 9Completed", - "properties": { - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - }, - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "quantity": "2", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - } - ] - }, - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "userId": "sampleRudderstack11" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "[Blueshift] Event shouldn't contain period(.), numeric value and contains not more than 64 characters", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 15", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "message": { - "type": "track", - "event": "Order.Completed", - "properties": { - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - }, - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "quantity": "2", - "position": "1", - "category": "Games,Gifts,Entertainment,Toys", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg" - } - ] - }, - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "userId": "sampleRudderstack11" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "[Blueshift] Event shouldn't contain period(.), numeric value and contains not more than 64 characters", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 16", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "eventApiKey": "efeb4a29aba5e75d99c8a18acd620ec1", - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "standard" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "group", - "messageId": "e5034jh0-a404-47b4-a463-76df99934kl2", - "userId": "sampleusrRudder1", - "groupId": "group22222", - "traits": { - "name": "hardik", - "email": "hardik@rudderstack.com", - "cookie": "1234abcd-efghklkj-1234kfjadslk-34iu123", - "industry": "Education", - "employees": 399, - "plan": "enterprise", - "total billed": 830, - "gender": "male" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.getblueshift.com/api/v1/event", - "headers": { - "Authorization": "Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "group_id": "group22222", - "customer_id": "sampleusrRudder1", - "email": "hardik@rudderstack.com", - "device_type": "android", - "device_id": "7e32188a4dab669f", - "device_idfv": "7e32188a4dab669f", - "device_manufacturer": "Google", - "os_name": "Android", - "network_carrier": "Android", - "event_uuid": "e5034jh0-a404-47b4-a463-76df99934kl2", - "event": "identify", - "name": "hardik", - "cookie": "1234abcd-efghklkj-1234kfjadslk-34iu123", - "industry": "Education", - "employees": 399, - "plan": "enterprise", - "total billed": 830, - "gender": "male" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "blueshift", - "description": "Test 17", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "usersApiKey": "b4a29aba5e75duic8a18acd920ec1e2e", - "dataCenter": "eu" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "campaign": { - "source": "google", - "medium": "medium", - "term": "keyword", - "content": "some content", - "name": "some campaign" - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Mumbai", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "type": "group", - "messageId": "e5034jh0-a404-47b4-a463-76df99934kl2", - "userId": "sampleusrRudder1", - "groupId": "group22222", - "traits": { - "name": "hardik", - "email": "hardik@rudderstack.com", - "cookie": "1234abcd-efghklkj-1234kfjadslk-34iu123", - "industry": "Education", - "employees": 399, - "plan": "enterprise", - "total billed": 830, - "gender": "male" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "[BLUESHIFT] event API Key required for Authentication.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "BLUESHIFT", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - } -] \ No newline at end of file + { + name: 'blueshift', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + dataCenter: 'standard', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.5', + }, + traits: { + name: 'hardik', + email: 'hardik@rudderstack.com', + cookie: '1234abcd-efghklkj-1234kfjadslk-34iu123', + industry: 'Education', + employees: 399, + plan: 'enterprise', + 'total billed': 830, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.5', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36', + locale: 'en-US', + os: { + name: '', + version: '', + }, + }, + type: 'group', + messageId: 'e5034df0-a404-47b4-a463-76df99934fea', + anonymousId: 'my-anonymous-id-new', + userId: 'sampleusrRudder7', + traits: { + groupType: 'company', + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Missing required value from "groupId"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'standard', + }, + }, + message: { + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.5', + }, + traits: { + name: 'hardik', + email: 'hardik@rudderstack.com', + cookie: '1234abcd-efghklkj-1234kfjadslk-34iu123', + industry: 'Education', + employees: 399, + plan: 'enterprise', + 'total billed': 830, + }, + }, + type: 'group', + userId: 'rudderstack8', + groupId: '35838', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getblueshift.com/api/v1/event', + headers: { + Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + group_id: '35838', + customer_id: 'rudderstack8', + email: 'hardik@rudderstack.com', + event: 'identify', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'standard', + }, + }, + message: { + context: { + ip: '14.5.67.21', + device: { + adTrackingEnabled: true, + advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'Android', + attTrackingStatus: 3, + }, + os: { + name: 'Android', + version: '9', + }, + network: { + bluetooth: false, + carrier: 'Android', + cellular: true, + wifi: true, + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + latitude: '37.7672319', + longitude: '-122.4021353', + state: 'WB', + street: 'rajnagar', + }, + }, + properties: { + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + }, + messageId: '34abcd-efghijkj-1234kf', + type: 'track', + event: 'identify', + userId: 'sampleusrRudder7', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getblueshift.com/api/v1/event', + headers: { + Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + customer_id: 'sampleusrRudder7', + event: 'identify', + device_type: 'Android', + device_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + device_idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + device_idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + device_manufacturer: 'Google', + os_name: 'Android', + network_carrier: 'Android', + ip: '14.5.67.21', + latitude: '37.7672319', + longitude: '-122.4021353', + event_uuid: '34abcd-efghijkj-1234kf', + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'standard', + }, + }, + message: { + type: 'track', + event: 'Product Viewed', + properties: { + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + checkout_id: 'C324532', + order_id: 'T1230', + value: 15.98, + revenue: 16.98, + shipping: 3, + coupon: 'FY21', + currency: 'INR', + products: [ + { + product_id: 'product-mixedfruit-jam', + sku: 'sku-1', + category: 'Food', + name: 'Food/Drink', + brand: 'Sample', + variant: 'None', + price: 10, + quantity: 2, + currency: 'INR', + position: 1, + value: 6, + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + }, + ], + }, + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Mumbai', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + }, + messageId: '34abcd-efghijkj-1234kf', + userId: 'sampleRudderstack9', + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getblueshift.com/api/v1/event', + headers: { + Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event: 'view', + device_type: 'android', + device_id: '7e32188a4dab669f', + device_idfv: '7e32188a4dab669f', + device_manufacturer: 'Google', + os_name: 'Android', + network_carrier: 'Android', + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + checkout_id: 'C324532', + order_id: 'T1230', + value: 15.98, + revenue: 16.98, + shipping: 3, + coupon: 'FY21', + currency: 'INR', + products: [ + { + product_id: 'product-mixedfruit-jam', + sku: 'sku-1', + category: 'Food', + name: 'Food/Drink', + brand: 'Sample', + variant: 'None', + price: 10, + quantity: 2, + currency: 'INR', + position: 1, + value: 6, + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + message: { + type: 'track', + event: 'Products Searched', + properties: { + description: 'Sneaker purchase', + brand: 'Victory Sneakers', + colors: ['red', 'blue'], + items: [ + { + text: 'New Line Sneakers', + price: '$ 79.95', + }, + { + text: 'Old Line Sneakers', + price: '$ 79.95', + }, + { + text: 'Blue Line Sneakers', + price: '$ 79.95', + }, + ], + name: 'Hugh Manbeing', + userLocation: { + state: 'CO', + zip: '80202', + }, + }, + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Mumbai', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + }, + messageId: '34abcd-efghijkj-1234kf', + userId: 'sampleRudderstack9', + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.eu.getblueshift.com/api/v1/event', + headers: { + Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event: 'search', + device_type: 'android', + device_id: '7e32188a4dab669f', + device_idfv: '7e32188a4dab669f', + device_manufacturer: 'Google', + os_name: 'Android', + network_carrier: 'Android', + description: 'Sneaker purchase', + brand: 'Victory Sneakers', + colors: ['red', 'blue'], + items: [ + { + text: 'New Line Sneakers', + price: '$ 79.95', + }, + { + text: 'Old Line Sneakers', + price: '$ 79.95', + }, + { + text: 'Blue Line Sneakers', + price: '$ 79.95', + }, + ], + name: 'Hugh Manbeing', + userLocation: { + state: 'CO', + zip: '80202', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'standard', + }, + }, + message: { + type: 'track', + event: 'Product_purchased', + properties: { + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + }, + messageId: '34abcd-efghijkj-1234kf', + context: { + ip: '14.5.67.21', + device: { + adTrackingEnabled: true, + advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'Android', + attTrackingStatus: 3, + }, + os: { + name: 'Android', + version: '9', + }, + network: { + bluetooth: false, + carrier: 'Android', + cellular: true, + wifi: true, + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + latitude: '37.7672319', + longitude: '-122.4021353', + state: 'WB', + street: 'rajnagar', + }, + }, + userId: 'sampleRudderstack9', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: '[BLUESHIFT] event Api Keys required for Authentication.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'standard', + }, + }, + message: { + type: 'identify', + event: 'Product_purchased', + properties: { + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + }, + messageId: '34abcd-efghijkj-1234kf', + context: { + ip: '14.5.67.21', + device: { + adTrackingEnabled: true, + advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'Android', + attTrackingStatus: 3, + }, + os: { + name: 'Android', + version: '9', + }, + network: { + bluetooth: false, + carrier: 'Android', + cellular: true, + wifi: true, + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + latitude: '37.7672319', + longitude: '-122.4021353', + state: 'WB', + street: 'rajnagar', + }, + }, + userId: 'sampleRudderstack9', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Missing required value from "email"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'standard', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + type: 'identify', + traits: { + email: 'chandan@companyname.com', + userId: 'rudder123', + anonymousId: 'anon_id', + name: 'James Doe', + phone: '92374162212', + gender: 'M', + firstname: 'James', + lastname: 'Doe', + employed: true, + birthday: '1614775793', + education: 'Science', + graduate: true, + married: true, + customerType: 'Prime', + msg_push: true, + msgSms: true, + msgemail: true, + msgwhatsapp: false, + custom_tags: ['Test_User', 'Interested_User', 'DIY_Hobby'], + custom_mappings: { + Office: 'Trastkiv', + Country: 'Russia', + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getblueshift.com/api/v1/customers', + headers: { + Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'chandan@companyname.com', + customer_id: 'rudder123', + phone_number: '92374162212', + firstname: 'James', + lastname: 'Doe', + gender: 'M', + userId: 'rudder123', + anonymousId: 'anon_id', + name: 'James Doe', + employed: true, + birthday: '1614775793', + education: 'Science', + graduate: true, + married: true, + customerType: 'Prime', + msg_push: true, + msgSms: true, + msgemail: true, + msgwhatsapp: false, + custom_tags: ['Test_User', 'Interested_User', 'DIY_Hobby'], + custom_mappings: { + Office: 'Trastkiv', + Country: 'Russia', + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + dataCenter: 'eu', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + type: 'identify', + traits: { + email: 'chandan@companyname.com', + userId: 'rudder123', + anonymousId: 'anon_id', + name: 'James Doe', + phone: '92374162212', + gender: 'M', + firstname: 'James', + lastname: 'Doe', + employed: true, + birthday: '1614775793', + education: 'Science', + graduate: true, + married: true, + customerType: 'Prime', + msg_push: true, + msgSms: true, + msgemail: true, + msgwhatsapp: false, + custom_tags: ['Test_User', 'Interested_User', 'DIY_Hobby'], + custom_mappings: { + Office: 'Trastkiv', + Country: 'Russia', + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: '[BLUESHIFT] User API Key required for Authentication.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + 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', + }, + locale: 'en-US', + ip: '0.0.0.0', + }, + type: 'identify', + traits: { + email: 'chandan@companyname.com', + userId: 'rudder123', + anonymousId: 'anon_id', + name: 'James Doe', + phone: '92374162212', + gender: 'M', + firstname: 'James', + lastname: 'Doe', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.eu.getblueshift.com/api/v1/customers', + headers: { + Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'chandan@companyname.com', + customer_id: 'rudder123', + phone_number: '92374162212', + firstname: 'James', + lastname: 'Doe', + gender: 'M', + userId: 'rudder123', + anonymousId: 'anon_id', + name: 'James Doe', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + 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', + }, + locale: 'en-US', + ip: '0.0.0.0', + }, + traits: { + email: 'chandan@companyname.com', + userId: 'rudder123', + anonymousId: 'anon_id', + name: 'James Doe', + phone: '92374162212', + gender: 'M', + firstname: 'James', + lastname: 'Doe', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Message Type is not present. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + 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', + }, + locale: 'en-US', + ip: '0.0.0.0', + }, + type: 'page', + traits: { + email: 'chandan@companyname.com', + userId: 'rudder123', + anonymousId: 'anon_id', + name: 'James Doe', + phone: '92374162212', + gender: 'M', + firstname: 'James', + lastname: 'Doe', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Message type page not supported', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + message: { + type: 'track', + event: 'Order Completed', + properties: { + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + quantity: '2', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + ], + }, + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Mumbai', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + userId: 'sampleRudderstack11', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.eu.getblueshift.com/api/v1/event', + headers: { + Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + customer_id: 'sampleRudderstack11', + event: 'purchase', + device_type: 'android', + device_id: '7e32188a4dab669f', + device_idfv: '7e32188a4dab669f', + device_manufacturer: 'Google', + os_name: 'Android', + network_carrier: 'Android', + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + quantity: '2', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + message: { + context: { + ip: '14.5.67.21', + device: { + adTrackingEnabled: true, + advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'Android', + attTrackingStatus: 3, + }, + os: { + name: 'Android', + version: '9', + }, + network: { + bluetooth: false, + carrier: 'Android', + cellular: true, + wifi: true, + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + latitude: '37.7672319', + longitude: '-122.4021353', + state: 'WB', + street: 'rajnagar', + }, + }, + properties: { + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + }, + messageId: '34abcd-efghijkj-1234kf', + type: 'track', + event: 'Custom Events', + userId: 'sampleusrRudder7', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.eu.getblueshift.com/api/v1/event', + headers: { + Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + customer_id: 'sampleusrRudder7', + event: 'Custom_Events', + device_type: 'Android', + device_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + device_idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + device_idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + device_manufacturer: 'Google', + os_name: 'Android', + network_carrier: 'Android', + ip: '14.5.67.21', + latitude: '37.7672319', + longitude: '-122.4021353', + event_uuid: '34abcd-efghijkj-1234kf', + cookie: '1234abcd-efghijkj-1234kfjadslk-34iu123', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 14', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + message: { + type: 'track', + event: 'Order 9Completed', + properties: { + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + quantity: '2', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + ], + }, + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Mumbai', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + userId: 'sampleRudderstack11', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + "[Blueshift] Event shouldn't contain period(.), numeric value and contains not more than 64 characters", + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 15', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + message: { + type: 'track', + event: 'Order.Completed', + properties: { + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + quantity: '2', + position: '1', + category: 'Games,Gifts,Entertainment,Toys', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + }, + ], + }, + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Mumbai', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + userId: 'sampleRudderstack11', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + "[Blueshift] Event shouldn't contain period(.), numeric value and contains not more than 64 characters", + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'standard', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Mumbai', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + type: 'group', + messageId: 'e5034jh0-a404-47b4-a463-76df99934kl2', + userId: 'sampleusrRudder1', + groupId: 'group22222', + traits: { + name: 'hardik', + email: 'hardik@rudderstack.com', + cookie: '1234abcd-efghklkj-1234kfjadslk-34iu123', + industry: 'Education', + employees: 399, + plan: 'enterprise', + 'total billed': 830, + gender: 'male', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getblueshift.com/api/v1/event', + headers: { + Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + group_id: 'group22222', + customer_id: 'sampleusrRudder1', + email: 'hardik@rudderstack.com', + device_type: 'android', + device_id: '7e32188a4dab669f', + device_idfv: '7e32188a4dab669f', + device_manufacturer: 'Google', + os_name: 'Android', + network_carrier: 'Android', + event_uuid: 'e5034jh0-a404-47b4-a463-76df99934kl2', + event: 'identify', + name: 'hardik', + cookie: '1234abcd-efghklkj-1234kfjadslk-34iu123', + industry: 'Education', + employees: 399, + plan: 'enterprise', + 'total billed': 830, + gender: 'male', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'blueshift', + description: 'Test 17', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', + dataCenter: 'eu', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Mumbai', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + type: 'group', + messageId: 'e5034jh0-a404-47b4-a463-76df99934kl2', + userId: 'sampleusrRudder1', + groupId: 'group22222', + traits: { + name: 'hardik', + email: 'hardik@rudderstack.com', + cookie: '1234abcd-efghklkj-1234kfjadslk-34iu123', + industry: 'Education', + employees: 399, + plan: 'enterprise', + 'total billed': 830, + gender: 'male', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: '[BLUESHIFT] event API Key required for Authentication.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'BLUESHIFT', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/braze/dataDelivery/data.ts b/test/integrations/destinations/braze/dataDelivery/data.ts new file mode 100644 index 0000000000..3e1805c01d --- /dev/null +++ b/test/integrations/destinations/braze/dataDelivery/data.ts @@ -0,0 +1,488 @@ +import MockAdapter from "axios-mock-adapter"; + +export const data = [ + { + "name": "braze", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test1", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request for braze Processed Successfully", + "destinationResponse": { + "response": { + "aliases_processed": 1, + "message": "success" + }, + "status": 201 + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test2", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request for braze Processed Successfully", + "destinationResponse": { + "response": { + "message": "success", + "errors": [ + "minor error message" + ] + }, + "status": 201 + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test3", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request failed for braze with status: 201", + "destinationResponse": { + "response": { + "message": "fatal error message", + "errors": [ + "minor error message" + ] + }, + "status": 201 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test4", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 201, + "message": "Request for braze Processed Successfully", + "destinationResponse": { + "response": "", + "status": 201 + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test5", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request failed for braze with status: 500", + "destinationResponse": { + "response": "", + "status": 500 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "braze", + "description": "Test 5", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test6", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request failed for braze with status: 500", + "destinationResponse": { + "response": "", + "status": 500 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + }, + mockFns: (mockAdapter: MockAdapter) => { + // params has `{ destination: salesforce }` + mockAdapter + .onPost( + 'https://rest.iad-03.braze.com/users/identify/test6', + { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + ).replyOnce((config) => { + // @ts-ignore + const err = AxiosError.from('DNS not found', 'ENOTFOUND', config) + return Promise.reject(err); + }); + } + }, + { + "name": "braze", + "description": "Test 6", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://rest.iad-03.braze.com/users/identify/test7", + "method": "POST", + "userId": "gabi_userId_45", + "headers": { + "Accept": "application/json", + "Authorization": "Bearer api_key", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "aliases_to_identify": [ + { + "external_id": "gabi_userId_45", + "user_alias": { + "alias_label": "rudder_id", + "alias_name": "gabi_anonId_45" + } + } + ] + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "braze" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request failed for braze with status: 500", + "destinationResponse": { + "response": "", + "status": 500 + }, + "statTags": { + "destType": "BRAZE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/braze/network.ts b/test/integrations/destinations/braze/network.ts index 4dfd5fa2a5..1c39a247e4 100644 --- a/test/integrations/destinations/braze/network.ts +++ b/test/integrations/destinations/braze/network.ts @@ -1,3 +1,207 @@ +const dataDeliveryMocksData = [ + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test5', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'any' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { response: {} }, + }, + { + httpReq: { + url: 'https://api.amplitude.com/2/httpapi/test6', + data: { + api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + events: [ + { + app_name: 'Rudder-CleverTap_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'gabi_userId_45', + user_properties: { + Residence: 'Shibuya', + city: 'Tokyo', + country: 'JP', + email: 'gabi29@gmail.com', + gender: 'M', + name: 'User2 Gabi2', + organization: 'Company', + region: 'ABC', + title: 'Owner', + zip: '100-0001', + }, + }, + ], + options: { min_id_length: 1 }, + }, + params: { destination: 'any' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: {}, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test1', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { aliases_processed: 1, message: 'success' }, status: 201 }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test2', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { message: 'success', errors: ['minor error message'] }, status: 201 }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test3', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { message: 'fatal error message', errors: ['minor error message'] }, + status: 201, + }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test4', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: '', status: 201 }, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test5', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: {}, + }, + { + httpReq: { + url: 'https://rest.iad-03.braze.com/users/identify/test7', + data: { + aliases_to_identify: [ + { + external_id: 'gabi_userId_45', + user_alias: { alias_label: 'rudder_id', alias_name: 'gabi_anonId_45' }, + }, + ], + }, + params: { destination: 'braze' }, + headers: { + Accept: 'application/json', + Authorization: 'Bearer api_key', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { response: {} }, + }, +]; + const deleteNwData = [ { httpReq: { @@ -188,4 +392,4 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; +export const networkCallsData = [...deleteNwData, ...dataDeliveryMocksData]; diff --git a/test/integrations/destinations/campaign_manager/processor/data.ts b/test/integrations/destinations/campaign_manager/processor/data.ts index 6721cf2631..beff44c928 100644 --- a/test/integrations/destinations/campaign_manager/processor/data.ts +++ b/test/integrations/destinations/campaign_manager/processor/data.ts @@ -1,825 +1,830 @@ export const data = [ - { - "name": "campaign_manager", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "id": "0572f78fa49c648e", - "name": "generic_x86_arm", - "type": "Android", - "model": "AOSP on IA Emulator", - "manufacturer": "Google", - "adTrackingEnabled": true, - "advertisingId": "44c97318-9040-4361-8bc7-4eb30f665ca8" - }, - "traits": { - "email": "alex@example.com", - "phone": "+1-202-555-0146", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "England", - "countryCode": "GB", - "postalCode": "EC3M", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "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 - } - }, - "originalTimestamp": "2022-11-17T00:22:02.903+05:30", - "properties": { - "profileId": "34245", - "floodlightConfigurationId": "213123123", - "ordinal": "string", - "floodlightActivityId": "456543345245", - "value": "756", - "encryptedUserIdCandidates": [ - "dfghjbnm" - ], - "quantity": "455678", - "encryptionSource": "AD_SERVING", - "encryptionEntityId": "3564523", - "encryptionEntityType": "DCM_ACCOUNT", - "requestType": "batchinsert" - }, - "type": "track", - "event": "event test", - "anonymousId": "randomId", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "profileId": "5343234", - "treatmentForUnderage": false, - "limitAdTracking": false, - "childDirectedTreatment": false, - "nonPersonalizedAd": false, - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert", - "headers": { - "Authorization": "Bearer dummyApiToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "kind": "dfareporting#conversionsBatchInsertRequest", - "encryptionInfo": { - "encryptionEntityType": "DCM_ACCOUNT", - "encryptionSource": "AD_SERVING", - "encryptionEntityId": "3564523", - "kind": "dfareporting#encryptionInfo" - }, - "conversions": [ - { - "floodlightConfigurationId": "213123123", - "ordinal": "string", - "timestampMicros": "1668624722903000", - "floodlightActivityId": "456543345245", - "quantity": "455678", - "value": 756, - "encryptedUserIdCandidates": [ - "dfghjbnm" - ], - "nonPersonalizedAd": false, - "treatmentForUnderage": false, - "childDirectedTreatment": false, - "limitAdTracking": false - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "campaign_manager", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "id": "0572f78fa49c648e", - "name": "generic_x86_arm", - "type": "Android", - "model": "AOSP on IA Emulator", - "manufacturer": "Google", - "adTrackingEnabled": true, - "advertisingId": "44c97318-9040-4361-8bc7-4eb30f665ca8" - }, - "traits": { - "email": "alex@example.com", - "phone": "+1-202-555-0146", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "England", - "countryCode": "GB", - "postalCode": "EC3M", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "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 - } - }, - "originalTimestamp": "2021-01-04T08:25:04.780Z", - "properties": { - "profileId": "34245", - "floodlightConfigurationId": "213123123", - "ordinal": "string", - "floodlightActivityId": "456543345245", - "value": "756", - "quantity": "455678", - "gclid": "string", - "encryptionSource": "AD_SERVING", - "encryptionEntityId": "3564523", - "encryptionEntityType": "DCM_ACCOUNT", - "requestType": "batchupdate" - }, - "type": "track", - "event": "event test", - "anonymousId": "randomId", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "profileId": "5343234", - "treatmentForUnderage": false, - "limitAdTracking": false, - "childDirectedTreatment": false, - "nonPersonalizedAd": false, - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate", - "headers": { - "Authorization": "Bearer dummyApiToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "kind": "dfareporting#conversionsBatchUpdateRequest", - "conversions": [ - { - "floodlightConfigurationId": "213123123", - "ordinal": "string", - "timestampMicros": "1609748704780000", - "floodlightActivityId": "456543345245", - "quantity": "455678", - "value": 756, - "gclid": "string", - "nonPersonalizedAd": false, - "treatmentForUnderage": false - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "campaign_manager", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "id": "0572f78fa49c648e", - "name": "generic_x86_arm", - "type": "Android", - "model": "AOSP on IA Emulator", - "manufacturer": "Google", - "adTrackingEnabled": true, - "advertisingId": "44c97318-9040-4361-8bc7-4eb30f665ca8" - }, - "traits": { - "email": "alex@example.com", - "phone": "+1-202-555-0146", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "England", - "countryCode": "GB", - "postalCode": "EC3M", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "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 - } - }, - "originalTimestamp": "2022-11-17T00:22:02.903+05:30", - "properties": { - "profileId": "34245", - "floodlightConfigurationId": "213123123", - "ordinal": "string", - "floodlightActivityId": "456543345245", - "mobileDeviceId": "string", - "value": "756", - "encryptedUserIdCandidates": [ - "dfghjbnm" - ], - "quantity": "455678", - "gclid": "string", - "matchId": "string", - "dclid": "string", - "impressionId": "string", - "requestType": "batchinsert" - }, - "type": "track", - "event": "event test", - "anonymousId": "randomId", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "profileId": "5343234", - "treatmentForUnderage": false, - "limitAdTracking": false, - "childDirectedTreatment": false, - "nonPersonalizedAd": false, - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 400, - "error": "[CAMPAIGN MANAGER (DCM)]: If encryptedUserId or encryptedUserIdCandidates is used, provide proper values for properties.encryptionEntityType , properties.encryptionSource and properties.encryptionEntityId", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CAMPAIGN_MANAGER", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "campaign_manager", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "sources", - "originalTimestamp": "2022-11-17T00:22:02.903+05:30", - "properties": { - "floodlightConfigurationId": "213123123", - "ordinal": "string", - "floodlightActivityId": "456543345245", - "value": "756", - "quantity": "455678", - "requestType": "batchinsert" - }, - "type": "track", - "event": "event test", - "anonymousId": "randomId", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "profileId": "5343234", - "treatmentForUnderage": false, - "limitAdTracking": false, - "childDirectedTreatment": false, - "nonPersonalizedAd": false, - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 400, - "error": "[CAMPAIGN MANAGER (DCM)]: Atleast one of encryptedUserId,encryptedUserIdCandidates, matchId, mobileDeviceId, gclid, dclid, impressionId.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CAMPAIGN_MANAGER", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "campaign_manager", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "id": "0572f78fa49c648e", - "name": "generic_x86_arm", - "type": "Android", - "model": "AOSP on IA Emulator", - "manufacturer": "Google", - "adTrackingEnabled": true, - "advertisingId": "44c97318-9040-4361-8bc7-4eb30f665ca8" - }, - "traits": { - "email": "alex@example.com", - "phone": "+1-202-555-0146", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "England", - "countryCode": "GB", - "postalCode": "EC3M", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "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 - } - }, - "originalTimestamp": "2022-11-17T00:22:02.903+05:30", - "properties": { - "profileId": "34245", - "floodlightConfigurationId": "213123123", - "ordinal": "1", - "floodlightActivityId": "456543345245", - "value": "756", - "quantity": "455678", - "encryptionSource": "AD_SERVING", - "encryptionEntityId": "3564523", - "encryptionEntityType": "DCM_ACCOUNT", - "requestType": "batchinsert", - "matchId": "123" - }, - "type": "track", - "event": "event test", - "anonymousId": "randomId", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "profileId": "5343234", - "treatmentForUnderage": false, - "limitAdTracking": false, - "childDirectedTreatment": false, - "nonPersonalizedAd": false, - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert", - "headers": { - "Authorization": "Bearer dummyApiToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "kind": "dfareporting#conversionsBatchInsertRequest", - "conversions": [ - { - "floodlightConfigurationId": "213123123", - "ordinal": "1", - "timestampMicros": "1668624722903000", - "floodlightActivityId": "456543345245", - "quantity": "455678", - "value": 756, - "matchId": "123", - "nonPersonalizedAd": false, - "treatmentForUnderage": false, - "childDirectedTreatment": false, - "limitAdTracking": false - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "campaign_manager", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "device": { - "id": "0572f78fa49c648e", - "name": "generic_x86_arm", - "type": "Android", - "model": "AOSP on IA Emulator", - "manufacturer": "Google", - "adTrackingEnabled": true, - "advertisingId": "44c97318-9040-4361-8bc7-4eb30f665ca8" - }, - "traits": { - "email": "alex@example.com", - "phone": "+1-202-555-0146", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "England", - "countryCode": "GB", - "postalCode": "EC3M", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "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 - } - }, - "originalTimestamp": "1668624722903333", - "properties": { - "profileId": "34245", - "floodlightConfigurationId": "213123123", - "ordinal": "1", - "floodlightActivityId": "456543345245", - "value": "756", - "quantity": "455678", - "encryptionSource": "AD_SERVING", - "encryptionEntityId": "3564523", - "encryptionEntityType": "DCM_ACCOUNT", - "requestType": "batchinsert", - "matchId": "123" - }, - "type": "track", - "event": "event test", - "anonymousId": "randomId", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "profileId": "5343234", - "treatmentForUnderage": false, - "limitAdTracking": false, - "childDirectedTreatment": false, - "nonPersonalizedAd": false, - "rudderAccountId": "2EOknn1JNH7WK1MfNku4fGYKkRK" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert", - "headers": { - "Authorization": "Bearer dummyApiToken", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "kind": "dfareporting#conversionsBatchInsertRequest", - "conversions": [ - { - "floodlightConfigurationId": "213123123", - "ordinal": "1", - "timestampMicros": "1668624722903333", - "floodlightActivityId": "456543345245", - "quantity": "455678", - "value": 756, - "matchId": "123", - "nonPersonalizedAd": false, - "treatmentForUnderage": false, - "childDirectedTreatment": false, - "limitAdTracking": false - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "access_token": "dummyApiToken", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'campaign_manager', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + id: '0572f78fa49c648e', + name: 'generic_x86_arm', + type: 'Android', + model: 'AOSP on IA Emulator', + manufacturer: 'Google', + adTrackingEnabled: true, + advertisingId: '44c97318-9040-4361-8bc7-4eb30f665ca8', + }, + traits: { + email: 'alex@example.com', + phone: '+1-202-555-0146', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'England', + countryCode: 'GB', + postalCode: 'EC3M', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + 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, + }, + }, + originalTimestamp: '2022-11-17T00:22:02.903+05:30', + properties: { + profileId: '34245', + floodlightConfigurationId: '213123123', + ordinal: 'string', + floodlightActivityId: '456543345245', + value: '756', + encryptedUserIdCandidates: ['dfghjbnm'], + quantity: '455678', + encryptionSource: 'AD_SERVING', + encryptionEntityId: '3564523', + encryptionEntityType: 'DCM_ACCOUNT', + requestType: 'batchinsert', + }, + type: 'track', + event: 'event test', + anonymousId: 'randomId', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + profileId: '5343234', + treatmentForUnderage: false, + limitAdTracking: false, + childDirectedTreatment: false, + nonPersonalizedAd: false, + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', + headers: { + Authorization: 'Bearer dummyApiToken', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + kind: 'dfareporting#conversionsBatchInsertRequest', + encryptionInfo: { + encryptionEntityType: 'DCM_ACCOUNT', + encryptionSource: 'AD_SERVING', + encryptionEntityId: '3564523', + kind: 'dfareporting#encryptionInfo', + }, + conversions: [ + { + floodlightConfigurationId: '213123123', + ordinal: 'string', + timestampMicros: '1668624722903000', + floodlightActivityId: '456543345245', + quantity: '455678', + value: 756, + encryptedUserIdCandidates: ['dfghjbnm'], + nonPersonalizedAd: false, + treatmentForUnderage: false, + childDirectedTreatment: false, + limitAdTracking: false, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'campaign_manager', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + id: '0572f78fa49c648e', + name: 'generic_x86_arm', + type: 'Android', + model: 'AOSP on IA Emulator', + manufacturer: 'Google', + adTrackingEnabled: true, + advertisingId: '44c97318-9040-4361-8bc7-4eb30f665ca8', + }, + traits: { + email: 'alex@example.com', + phone: '+1-202-555-0146', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'England', + countryCode: 'GB', + postalCode: 'EC3M', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + 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, + }, + }, + originalTimestamp: '2021-01-04T08:25:04.780Z', + properties: { + profileId: '34245', + floodlightConfigurationId: '213123123', + ordinal: 'string', + floodlightActivityId: '456543345245', + value: '756', + quantity: '455678', + gclid: 'string', + encryptionSource: 'AD_SERVING', + encryptionEntityId: '3564523', + encryptionEntityType: 'DCM_ACCOUNT', + requestType: 'batchupdate', + }, + type: 'track', + event: 'event test', + anonymousId: 'randomId', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + profileId: '5343234', + treatmentForUnderage: false, + limitAdTracking: false, + childDirectedTreatment: false, + nonPersonalizedAd: false, + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', + headers: { + Authorization: 'Bearer dummyApiToken', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + kind: 'dfareporting#conversionsBatchUpdateRequest', + conversions: [ + { + floodlightConfigurationId: '213123123', + ordinal: 'string', + timestampMicros: '1609748704780000', + floodlightActivityId: '456543345245', + quantity: '455678', + value: 756, + gclid: 'string', + nonPersonalizedAd: false, + treatmentForUnderage: false, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'campaign_manager', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + id: '0572f78fa49c648e', + name: 'generic_x86_arm', + type: 'Android', + model: 'AOSP on IA Emulator', + manufacturer: 'Google', + adTrackingEnabled: true, + advertisingId: '44c97318-9040-4361-8bc7-4eb30f665ca8', + }, + traits: { + email: 'alex@example.com', + phone: '+1-202-555-0146', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'England', + countryCode: 'GB', + postalCode: 'EC3M', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + 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, + }, + }, + originalTimestamp: '2022-11-17T00:22:02.903+05:30', + properties: { + profileId: '34245', + floodlightConfigurationId: '213123123', + ordinal: 'string', + floodlightActivityId: '456543345245', + mobileDeviceId: 'string', + value: '756', + encryptedUserIdCandidates: ['dfghjbnm'], + quantity: '455678', + gclid: 'string', + matchId: 'string', + dclid: 'string', + impressionId: 'string', + requestType: 'batchinsert', + }, + type: 'track', + event: 'event test', + anonymousId: 'randomId', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + profileId: '5343234', + treatmentForUnderage: false, + limitAdTracking: false, + childDirectedTreatment: false, + nonPersonalizedAd: false, + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: + '[CAMPAIGN MANAGER (DCM)]: If encryptedUserId or encryptedUserIdCandidates is used, provide proper values for properties.encryptionEntityType , properties.encryptionSource and properties.encryptionEntityId', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CAMPAIGN_MANAGER', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'campaign_manager', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'sources', + originalTimestamp: '2022-11-17T00:22:02.903+05:30', + properties: { + floodlightConfigurationId: '213123123', + ordinal: 'string', + floodlightActivityId: '456543345245', + value: '756', + quantity: '455678', + requestType: 'batchinsert', + }, + type: 'track', + event: 'event test', + anonymousId: 'randomId', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + profileId: '5343234', + treatmentForUnderage: false, + limitAdTracking: false, + childDirectedTreatment: false, + nonPersonalizedAd: false, + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: + '[CAMPAIGN MANAGER (DCM)]: Atleast one of encryptedUserId,encryptedUserIdCandidates, matchId, mobileDeviceId, gclid, dclid, impressionId.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CAMPAIGN_MANAGER', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'campaign_manager', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + id: '0572f78fa49c648e', + name: 'generic_x86_arm', + type: 'Android', + model: 'AOSP on IA Emulator', + manufacturer: 'Google', + adTrackingEnabled: true, + advertisingId: '44c97318-9040-4361-8bc7-4eb30f665ca8', + }, + traits: { + email: 'alex@example.com', + phone: '+1-202-555-0146', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'England', + countryCode: 'GB', + postalCode: 'EC3M', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + 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, + }, + }, + originalTimestamp: '2022-11-17T00:22:02.903+05:30', + properties: { + profileId: '34245', + floodlightConfigurationId: '213123123', + ordinal: '1', + floodlightActivityId: '456543345245', + value: '756', + quantity: '455678', + encryptionSource: 'AD_SERVING', + encryptionEntityId: '3564523', + encryptionEntityType: 'DCM_ACCOUNT', + requestType: 'batchinsert', + matchId: '123', + }, + type: 'track', + event: 'event test', + anonymousId: 'randomId', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + profileId: '5343234', + treatmentForUnderage: false, + limitAdTracking: false, + childDirectedTreatment: false, + nonPersonalizedAd: false, + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', + headers: { + Authorization: 'Bearer dummyApiToken', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + kind: 'dfareporting#conversionsBatchInsertRequest', + conversions: [ + { + floodlightConfigurationId: '213123123', + ordinal: '1', + timestampMicros: '1668624722903000', + floodlightActivityId: '456543345245', + quantity: '455678', + value: 756, + matchId: '123', + nonPersonalizedAd: false, + treatmentForUnderage: false, + childDirectedTreatment: false, + limitAdTracking: false, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'campaign_manager', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + id: '0572f78fa49c648e', + name: 'generic_x86_arm', + type: 'Android', + model: 'AOSP on IA Emulator', + manufacturer: 'Google', + adTrackingEnabled: true, + advertisingId: '44c97318-9040-4361-8bc7-4eb30f665ca8', + }, + traits: { + email: 'alex@example.com', + phone: '+1-202-555-0146', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'England', + countryCode: 'GB', + postalCode: 'EC3M', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + 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, + }, + }, + originalTimestamp: '1668624722903333', + properties: { + profileId: '34245', + floodlightConfigurationId: '213123123', + ordinal: '1', + floodlightActivityId: '456543345245', + value: '756', + quantity: '455678', + encryptionSource: 'AD_SERVING', + encryptionEntityId: '3564523', + encryptionEntityType: 'DCM_ACCOUNT', + requestType: 'batchinsert', + matchId: '123', + }, + type: 'track', + event: 'event test', + anonymousId: 'randomId', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + profileId: '5343234', + treatmentForUnderage: false, + limitAdTracking: false, + childDirectedTreatment: false, + nonPersonalizedAd: false, + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', + headers: { + Authorization: 'Bearer dummyApiToken', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + kind: 'dfareporting#conversionsBatchInsertRequest', + conversions: [ + { + floodlightConfigurationId: '213123123', + ordinal: '1', + timestampMicros: '1668624722903333', + floodlightActivityId: '456543345245', + quantity: '455678', + value: 756, + matchId: '123', + nonPersonalizedAd: false, + treatmentForUnderage: false, + childDirectedTreatment: false, + limitAdTracking: false, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'dummyApiToken', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/candu/processor/data.ts b/test/integrations/destinations/candu/processor/data.ts index 83f0462538..6e5ae636bd 100644 --- a/test/integrations/destinations/candu/processor/data.ts +++ b/test/integrations/destinations/candu/processor/data.ts @@ -857,15 +857,15 @@ export const data = [ status: 200, body: [ { - statusCode: 400, - error: '[CANDU]:: Message Type is not present. Aborting message.', - statTags: { - destType: 'CANDU', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', + statusCode: 400, + error: '[CANDU]:: Message Type is not present. Aborting message.', + statTags: { + destType: 'CANDU', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', }, }, ], @@ -996,7 +996,7 @@ export const data = [ output: { version: '1', type: 'REST', - userId: "", + userId: '', method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { @@ -1160,7 +1160,7 @@ export const data = [ output: { version: '1', type: 'REST', - userId: "", + userId: '', method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { @@ -1325,7 +1325,7 @@ export const data = [ output: { version: '1', type: 'REST', - userId: "", + userId: '', method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { diff --git a/test/integrations/destinations/clevertap/dataDelivery/data.ts b/test/integrations/destinations/clevertap/dataDelivery/data.ts new file mode 100644 index 0000000000..bc8866823e --- /dev/null +++ b/test/integrations/destinations/clevertap/dataDelivery/data.ts @@ -0,0 +1,227 @@ +export const data = [ + { + "name": "clevertap", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.clevertap.com/1/upload/test1", + "headers": { + "X-CleverTap-Account-Id": "476550467", + "X-CleverTap-Passcode": "fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "d": [ + { + "type": "profile", + "profileData": { + "Email": "jamesDoe@gmail.com", + "Name": "James Doe", + "Phone": "92374162212", + "Gender": "M", + "Employed": true, + "DOB": "1614775793", + "Education": "Science", + "Married": "Y", + "Customer Type": "Prime", + "graduate": true, + "msg_push": true, + "msgSms": true, + "msgemail": true, + "msgwhatsapp": false, + "custom_tags": "[\"Test_User\",\"Interested_User\",\"DIY_Hobby\"]", + "custom_mappings": "{\"Office\":\"Trastkiv\",\"Country\":\"Russia\"}", + "address": "{\"city\":\"kolkata\",\"country\":\"India\",\"postalCode\":789223,\"state\":\"WB\",\"street\":\"\"}" + }, + "identity": "anon_id" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "clevertap" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "status": "success", + "processed": 1, + "unprocessed": [] + }, + "status": 200 + } + } + } + } + } + }, + { + "name": "clevertap", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "d": [ + { + "identity": "anon-id-new", + "type": "event", + "evtName": "Web Page Viewed: Rudder", + "evtData": { + "title": "Home", + "path": "/" + } + } + ] + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "headers": { + "X-CleverTap-Account-Id": "fakeId123", + "X-CleverTap-Passcode": "fakePasscode123", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.clevertap.com/1/upload/test2", + "params": { + "destination": "clevertap" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 401, + "body": { + "output": { + "status": 401, + "message": "Request failed with status: 401", + "destinationResponse": { + "response": { + "status": "fail", + "error": "Invalid Credentials", + "code": 401 + }, + "status": 401 + }, + "statTags": { + "destType": "CLEVERTAP", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "clevertap", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {}, + "JSON": { + "d": [ + { + "identity": "anon-id-new", + "type": "event", + "evtData": { + "title": "Home", + "path": "/" + } + } + ] + } + }, + "type": "REST", + "files": {}, + "method": "POST", + "headers": { + "X-CleverTap-Account-Id": "476550467", + "X-CleverTap-Passcode": "fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1", + "Content-Type": "application/json" + }, + "version": "1", + "endpoint": "https://api.clevertap.com/1/upload/test3", + "params": { + "destination": "clevertap" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Request failed with status: 200", + "destinationResponse": { + "response": { + "status": "fail", + "processed": 0, + "unprocessed": [] + }, + "status": 200 + }, + "statTags": { + "destType": "CLEVERTAP", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/clevertap/network.ts b/test/integrations/destinations/clevertap/network.ts index 458d6faba0..c4eb23ee39 100644 --- a/test/integrations/destinations/clevertap/network.ts +++ b/test/integrations/destinations/clevertap/network.ts @@ -1,3 +1,92 @@ +const dataDeliveryMocksData = [ + { + httpReq: { + url: 'https://api.clevertap.com/1/upload/test1', + data: { + d: [ + { + type: 'profile', + profileData: { + Email: 'jamesDoe@gmail.com', + Name: 'James Doe', + Phone: '92374162212', + Gender: 'M', + Employed: true, + DOB: '1614775793', + Education: 'Science', + Married: 'Y', + 'Customer Type': 'Prime', + graduate: true, + msg_push: true, + msgSms: true, + msgemail: true, + msgwhatsapp: false, + custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', + custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', + address: + '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + }, + identity: 'anon_id', + }, + ], + }, + params: { destination: 'clevertap' }, + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': + 'fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { status: 'success', processed: 1, unprocessed: [] }, status: 200 }, + }, + { + httpReq: { + url: 'https://api.clevertap.com/1/upload/test2', + data: { + d: [ + { + identity: 'anon-id-new', + type: 'event', + evtName: 'Web Page Viewed: Rudder', + evtData: { title: 'Home', path: '/' }, + }, + ], + }, + params: { destination: 'clevertap' }, + headers: { + 'X-CleverTap-Account-Id': 'fakeId123', + 'X-CleverTap-Passcode': 'fakePasscode123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { status: 'fail', error: 'Invalid Credentials', code: 401 }, status: 401 + }, + }, + { + httpReq: { + url: 'https://api.clevertap.com/1/upload/test3', + data: { + d: [{ identity: 'anon-id-new', type: 'event', evtData: { title: 'Home', path: '/' } }], + }, + params: { destination: 'clevertap' }, + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': + 'fbee74a147828e2932c701d19dc1f2dcfa4ac0048be3aa3a88d427090a59dc1c0fa002f1', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { status: 'fail', processed: 0, unprocessed: [] }, status: 200 }, + }, +]; const deleteNwData = [ { httpReq: { @@ -172,4 +261,4 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; +export const networkCallsData = [...deleteNwData, ...dataDeliveryMocksData]; diff --git a/test/integrations/destinations/confluent_cloud/processor/data.ts b/test/integrations/destinations/confluent_cloud/processor/data.ts index 0453d3dd8f..dd43f1be83 100644 --- a/test/integrations/destinations/confluent_cloud/processor/data.ts +++ b/test/integrations/destinations/confluent_cloud/processor/data.ts @@ -1,825 +1,835 @@ export const data = [ - { - "name": "confluent_cloud", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "Purchase", - "integrations": { - "All": true - }, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "originalTimestamp": "2020-05-21T10:23:15.984Z", - "properties": { - "currency": "USD", - "revenue": 100 - }, - "receivedAt": "2020-05-21T15:53:16.013+05:30", - "request_ip": "[::1]:59371", - "sentAt": "2020-05-21T10:23:15.985Z", - "timestamp": "2020-05-21T15:53:16.012+05:30", - "type": "track", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 46, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "Purchase", - "integrations": { - "All": true - }, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "originalTimestamp": "2020-05-21T10:23:15.984Z", - "properties": { - "currency": "USD", - "revenue": 100 - }, - "receivedAt": "2020-05-21T15:53:16.013+05:30", - "request_ip": "[::1]:59371", - "sentAt": "2020-05-21T10:23:15.985Z", - "timestamp": "2020-05-21T15:53:16.012+05:30", - "type": "track", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 46, - "messageId": "ce46866c-6f19-42f0-86cb-18c51863b817", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "confluent_cloud", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "originalTimestamp": "2020-05-21T10:23:15.975Z", - "properties": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:58616", - "sentAt": "2020-05-21T10:23:15.975Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "page", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 47, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "originalTimestamp": "2020-05-21T10:23:15.975Z", - "properties": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:58616", - "sentAt": "2020-05-21T10:23:15.975Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "page", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 47, - "messageId": "e02dafb0-9df8-4fa2-becd-f4d8617956a4", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "confluent_cloud", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "originalTimestamp": "2020-05-21T10:23:15.979Z", - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59372", - "sentAt": "2020-05-21T10:23:15.979Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "identify", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 48, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "originalTimestamp": "2020-05-21T10:23:15.979Z", - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59372", - "sentAt": "2020-05-21T10:23:15.979Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "identify", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 48, - "messageId": "41b62b30-db5d-450c-98ed-cec14ead27cc", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "confluent_cloud", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track without property", - "integrations": { - "All": true - }, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "originalTimestamp": "2020-05-21T10:23:15.981Z", - "properties": {}, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59374", - "sentAt": "2020-05-21T10:23:15.981Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "track", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 49, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track without property", - "integrations": { - "All": true - }, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "originalTimestamp": "2020-05-21T10:23:15.981Z", - "properties": {}, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59374", - "sentAt": "2020-05-21T10:23:15.981Z", - "timestamp": "2020-05-21T15:53:16.014+05:30", - "type": "track", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 49, - "messageId": "c409577d-5dd4-430a-8965-a20aed7b9c9e", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "confluent_cloud", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "Name": "Azure Event Hub", - "DestinationDefinition": { - "ID": "1cCs4qQ72QY8vovP7BlJ47mkjBh", - "Name": "AZURE_EVENT_HUB", - "DisplayName": "Azure Event Hub", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": null, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track with property", - "integrations": { - "All": true - }, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "originalTimestamp": "2020-05-21T10:23:15.982Z", - "properties": { - "test_prop_1": "test prop", - "test_prop_2": 1232 - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59373", - "sentAt": "2020-05-21T10:23:15.983Z", - "timestamp": "2020-05-21T15:53:16.013+05:30", - "type": "track", - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 50, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index7.html", - "referrer": "http://localhost:1111/tests/html/", - "search": "", - "title": "", - "url": "http://localhost:1111/tests/html/index7.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "test@kinesis.com", - "firstname": "Test Kinesis" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36" - }, - "event": "test track with property", - "integrations": { - "All": true - }, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "originalTimestamp": "2020-05-21T10:23:15.982Z", - "properties": { - "test_prop_1": "test prop", - "test_prop_2": 1232 - }, - "receivedAt": "2020-05-21T15:53:16.014+05:30", - "request_ip": "[::1]:59373", - "sentAt": "2020-05-21T10:23:15.983Z", - "timestamp": "2020-05-21T15:53:16.013+05:30", - "type": "track", - "userId": "user-12345" - }, - "userId": "user-12345" - }, - "metadata": { - "anonymousId": "d36981e7-6413-4862-9bb9-b8595fb3d0d4", - "destinationId": "1cCz8hts5rp3YWglzhU1GPmVdjE", - "destinationType": "AZURE_EVENT_HUB", - "jobId": 50, - "messageId": "f8b6e882-3186-446a-b589-51eba60930d7", - "sourceId": "1bqCEGibwCvR7F0acuLzbEMQYIC" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'confluent_cloud', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'Purchase', + integrations: { + All: true, + }, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + originalTimestamp: '2020-05-21T10:23:15.984Z', + properties: { + currency: 'USD', + revenue: 100, + }, + receivedAt: '2020-05-21T15:53:16.013+05:30', + request_ip: '[::1]:59371', + sentAt: '2020-05-21T10:23:15.985Z', + timestamp: '2020-05-21T15:53:16.012+05:30', + type: 'track', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 46, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'Purchase', + integrations: { + All: true, + }, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + originalTimestamp: '2020-05-21T10:23:15.984Z', + properties: { + currency: 'USD', + revenue: 100, + }, + receivedAt: '2020-05-21T15:53:16.013+05:30', + request_ip: '[::1]:59371', + sentAt: '2020-05-21T10:23:15.985Z', + timestamp: '2020-05-21T15:53:16.012+05:30', + type: 'track', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 46, + messageId: 'ce46866c-6f19-42f0-86cb-18c51863b817', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'confluent_cloud', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + originalTimestamp: '2020-05-21T10:23:15.975Z', + properties: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:58616', + sentAt: '2020-05-21T10:23:15.975Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'page', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 47, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + originalTimestamp: '2020-05-21T10:23:15.975Z', + properties: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:58616', + sentAt: '2020-05-21T10:23:15.975Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'page', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 47, + messageId: 'e02dafb0-9df8-4fa2-becd-f4d8617956a4', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'confluent_cloud', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + originalTimestamp: '2020-05-21T10:23:15.979Z', + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59372', + sentAt: '2020-05-21T10:23:15.979Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'identify', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 48, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + originalTimestamp: '2020-05-21T10:23:15.979Z', + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59372', + sentAt: '2020-05-21T10:23:15.979Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'identify', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 48, + messageId: '41b62b30-db5d-450c-98ed-cec14ead27cc', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'confluent_cloud', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track without property', + integrations: { + All: true, + }, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + originalTimestamp: '2020-05-21T10:23:15.981Z', + properties: {}, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59374', + sentAt: '2020-05-21T10:23:15.981Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'track', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 49, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track without property', + integrations: { + All: true, + }, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + originalTimestamp: '2020-05-21T10:23:15.981Z', + properties: {}, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59374', + sentAt: '2020-05-21T10:23:15.981Z', + timestamp: '2020-05-21T15:53:16.014+05:30', + type: 'track', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 49, + messageId: 'c409577d-5dd4-430a-8965-a20aed7b9c9e', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'confluent_cloud', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1cCz8hts5rp3YWglzhU1GPmVdjE', + Name: 'Azure Event Hub', + DestinationDefinition: { + ID: '1cCs4qQ72QY8vovP7BlJ47mkjBh', + Name: 'AZURE_EVENT_HUB', + DisplayName: 'Azure Event Hub', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: null, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track with property', + integrations: { + All: true, + }, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + originalTimestamp: '2020-05-21T10:23:15.982Z', + properties: { + test_prop_1: 'test prop', + test_prop_2: 1232, + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59373', + sentAt: '2020-05-21T10:23:15.983Z', + timestamp: '2020-05-21T15:53:16.013+05:30', + type: 'track', + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 50, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index7.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/index7.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'test@kinesis.com', + firstname: 'Test Kinesis', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', + }, + event: 'test track with property', + integrations: { + All: true, + }, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + originalTimestamp: '2020-05-21T10:23:15.982Z', + properties: { + test_prop_1: 'test prop', + test_prop_2: 1232, + }, + receivedAt: '2020-05-21T15:53:16.014+05:30', + request_ip: '[::1]:59373', + sentAt: '2020-05-21T10:23:15.983Z', + timestamp: '2020-05-21T15:53:16.013+05:30', + type: 'track', + userId: 'user-12345', + }, + userId: 'user-12345', + }, + metadata: { + anonymousId: 'd36981e7-6413-4862-9bb9-b8595fb3d0d4', + destinationId: '1cCz8hts5rp3YWglzhU1GPmVdjE', + destinationType: 'AZURE_EVENT_HUB', + jobId: 50, + messageId: 'f8b6e882-3186-446a-b589-51eba60930d7', + sourceId: '1bqCEGibwCvR7F0acuLzbEMQYIC', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/courier/processor/data.ts b/test/integrations/destinations/courier/processor/data.ts index a1bcb930d7..9371f9e7b2 100644 --- a/test/integrations/destinations/courier/processor/data.ts +++ b/test/integrations/destinations/courier/processor/data.ts @@ -1,333 +1,333 @@ export const data = [ - { - "name": "courier", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "track", - "channel": "web", - "event": "Product Added", - "properties": {}, - "context": {}, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "destination": { - "Config": {} - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "apiKey is required", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "COURIER", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "courier", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "context": { - "ip": "8.8.8.8" - }, - "traits": { - "name": "Joe Doe", - "email": "joe@example.com", - "plan": "basic", - "age": 27 - }, - "type": "identify", - "userId": "userIdTest", - "originalTimestamp": "2022-10-17T15:53:10.566+05:30", - "messageId": "8d04cc30-fc15-49bd-901f-c5c3f72a7d82" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.courier.com/inbound/rudderstack", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "context": { - "ip": "8.8.8.8" - }, - "traits": { - "name": "Joe Doe", - "email": "joe@example.com", - "plan": "basic", - "age": 27 - }, - "type": "identify", - "userId": "userIdTest", - "originalTimestamp": "2022-10-17T15:53:10.566+05:30", - "messageId": "8d04cc30-fc15-49bd-901f-c5c3f72a7d82" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "courier", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "context": { - "ip": "8.8.8.8", - "traits": { - "name": "Joe Doe", - "email": "joe@example.com", - "plan": "basic", - "age": 27 - } - }, - "type": "identify", - "userId": "userIdTest", - "originalTimestamp": "2022-10-17T15:53:10.566+05:30", - "messageId": "8d04cc30-fc15-49bd-901f-c5c3f72a7d82" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.courier.com/inbound/rudderstack", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "context": { - "ip": "8.8.8.8", - "traits": { - "name": "Joe Doe", - "email": "joe@example.com", - "plan": "basic", - "age": 27 - } - }, - "type": "identify", - "userId": "userIdTest", - "originalTimestamp": "2022-10-17T15:53:10.566+05:30", - "messageId": "8d04cc30-fc15-49bd-901f-c5c3f72a7d82", - "traits": { - "name": "Joe Doe", - "email": "joe@example.com", - "plan": "basic", - "age": 27 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "courier", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "context": { - "ip": "8.8.8.8" - }, - "type": "identify", - "userId": "userIdTest", - "originalTimestamp": "2022-10-17T15:53:10.566+05:30", - "messageId": "8d04cc30-fc15-49bd-901f-c5c3f72a7d82" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "traits is a required field for identify call", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "COURIER", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "courier", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "context": { - "ip": "8.8.8.8" - }, - "event": "trackTest", - "properties": { - "activity": "checkout" - }, - "userId": "userIdTest", - "type": "track", - "messageId": "3c0abc14-96a2-4aed-9dfc-ee463832cc24", - "originalTimestamp": "2022-10-17T15:32:44.202+05:30" - }, - "destination": { - "Config": { - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.courier.com/inbound/rudderstack", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummyApiKey" - }, - "params": {}, - "body": { - "JSON": { - "context": { - "ip": "8.8.8.8" - }, - "event": "trackTest", - "properties": { - "activity": "checkout" - }, - "userId": "userIdTest", - "type": "track", - "messageId": "3c0abc14-96a2-4aed-9dfc-ee463832cc24", - "originalTimestamp": "2022-10-17T15:32:44.202+05:30" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'courier', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + channel: 'web', + event: 'Product Added', + properties: {}, + context: {}, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + destination: { + Config: {}, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'apiKey is required', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'COURIER', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'courier', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + context: { + ip: '8.8.8.8', + }, + traits: { + name: 'Joe Doe', + email: 'joe@example.com', + plan: 'basic', + age: 27, + }, + type: 'identify', + userId: 'userIdTest', + originalTimestamp: '2022-10-17T15:53:10.566+05:30', + messageId: '8d04cc30-fc15-49bd-901f-c5c3f72a7d82', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.courier.com/inbound/rudderstack', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + context: { + ip: '8.8.8.8', + }, + traits: { + name: 'Joe Doe', + email: 'joe@example.com', + plan: 'basic', + age: 27, + }, + type: 'identify', + userId: 'userIdTest', + originalTimestamp: '2022-10-17T15:53:10.566+05:30', + messageId: '8d04cc30-fc15-49bd-901f-c5c3f72a7d82', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'courier', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + context: { + ip: '8.8.8.8', + traits: { + name: 'Joe Doe', + email: 'joe@example.com', + plan: 'basic', + age: 27, + }, + }, + type: 'identify', + userId: 'userIdTest', + originalTimestamp: '2022-10-17T15:53:10.566+05:30', + messageId: '8d04cc30-fc15-49bd-901f-c5c3f72a7d82', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.courier.com/inbound/rudderstack', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + context: { + ip: '8.8.8.8', + traits: { + name: 'Joe Doe', + email: 'joe@example.com', + plan: 'basic', + age: 27, + }, + }, + type: 'identify', + userId: 'userIdTest', + originalTimestamp: '2022-10-17T15:53:10.566+05:30', + messageId: '8d04cc30-fc15-49bd-901f-c5c3f72a7d82', + traits: { + name: 'Joe Doe', + email: 'joe@example.com', + plan: 'basic', + age: 27, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'courier', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + context: { + ip: '8.8.8.8', + }, + type: 'identify', + userId: 'userIdTest', + originalTimestamp: '2022-10-17T15:53:10.566+05:30', + messageId: '8d04cc30-fc15-49bd-901f-c5c3f72a7d82', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'traits is a required field for identify call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'COURIER', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'courier', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + context: { + ip: '8.8.8.8', + }, + event: 'trackTest', + properties: { + activity: 'checkout', + }, + userId: 'userIdTest', + type: 'track', + messageId: '3c0abc14-96a2-4aed-9dfc-ee463832cc24', + originalTimestamp: '2022-10-17T15:32:44.202+05:30', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.courier.com/inbound/rudderstack', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + context: { + ip: '8.8.8.8', + }, + event: 'trackTest', + properties: { + activity: 'checkout', + }, + userId: 'userIdTest', + type: 'track', + messageId: '3c0abc14-96a2-4aed-9dfc-ee463832cc24', + originalTimestamp: '2022-10-17T15:32:44.202+05:30', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/data.ts b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts new file mode 100644 index 0000000000..bc3af8f22d --- /dev/null +++ b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts @@ -0,0 +1,530 @@ +export const data = [ + { + "name": "criteo_audience", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34894/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "remove", + "identifierType": "gum", + "identifiers": [ + "sample_gum3" + ], + "internalIdentifiers": false, + "gumCallerId": "329739" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": "", + "status": 200 + } + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/3485/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 401, + "body": { + "output": { + "status": 401, + "authErrorCategory": "REFRESH_TOKEN", + "destinationResponse": { + "errors": [ + { + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization", + "code": "authorization-token-expired", + "instance": "/2022-10/audiences/123/contactlist", + "title": "The authorization token has expired" + } + ] + }, + "message": "The authorization token has expired during criteo_audience response transformation", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34895/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 401, + "body": { + "output": { + "status": 401, + "authErrorCategory": "REFRESH_TOKEN", + "destinationResponse": { + "errors": [ + { + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization", + "code": "authorization-token-invalid", + "instance": "/2022-10/audiences/123/contactlist", + "title": "The authorization header is invalid" + } + ] + }, + "message": "The authorization header is invalid during criteo_audience response transformation", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34896/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "message": "AudienceId is Invalid. Please Provide Valid AudienceId", + "destinationResponse": { + "response": { + "errors": [ + { + "code": "audience-invalid", + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization" + } + ] + }, + "status": 404 + }, + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "meta": "instrumentation", + "module": "destination" + }, + "status": 400 + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34897/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "destinationResponse": { + "response": { + "errors": [ + { + "code": "audience-invalid", + "traceIdentifier": "80a1a0ba3981b04da847d05700752c77", + "type": "authorization" + } + ] + }, + "status": 503 + }, + "message": "Request Failed: during criteo_audience response transformation (Retryable)", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "feature": "dataDelivery", + "implementation": "native", + "errorType": "retryable", + "module": "destination" + }, + "status": 500 + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 5", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34898/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 429, + "body": { + "output": { + "destinationResponse": { + "response": {}, + "status": 429 + }, + "message": "Request Failed: during criteo_audience response transformation - due to Request Limit exceeded, (Throttled)", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "throttled", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "status": 429 + } + } + } + } + }, + { + "name": "criteo_audience", + "description": "Test 6", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "PATCH", + "endpoint": "https://api.criteo.com/2022-10/audiences/34899/contactlist", + "headers": { + "Authorization": "Bearer success_access_token", + "Content-Type": "application/json", + "Accept": "application/json" + }, + "body": { + "JSON": { + "data": { + "type": "ContactlistAmendment", + "attributes": { + "operation": "add", + "identifierType": "madid", + "identifiers": [ + "sample_madid", + "sample_madid_1", + "sample_madid_2" + ], + "internalIdentifiers": false + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "criteo_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "destinationResponse": { + "response": { + "message": "unknown error" + }, + "status": 410 + }, + "message": "Request Failed: during criteo_audience response transformation with status \"410\" due to \"{\"message\":\"unknown error\"}\", (Aborted) ", + "statTags": { + "destType": "CRITEO_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "status": 400 + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/criteo_audience/network.ts b/test/integrations/destinations/criteo_audience/network.ts new file mode 100644 index 0000000000..959e8a2112 --- /dev/null +++ b/test/integrations/destinations/criteo_audience/network.ts @@ -0,0 +1,230 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'remove', + identifierType: 'gum', + identifiers: ['sample_gum3'], + internalIdentifiers: false, + gumCallerId: '329739', + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { status: 200 }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/3485/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '400', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'authorization-token-expired', + instance: '/2022-10/audiences/123/contactlist', + title: 'The authorization token has expired', + }, + ], + }, + status: 401, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34895/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '400', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'authorization-token-invalid', + instance: '/2022-10/audiences/123/contactlist', + title: 'The authorization header is invalid', + }, + ], + }, + status: 401, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34896/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '400', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'audience-invalid', + }, + ], + }, + status: 404, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34897/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { + code: '500', + data: { + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'audience-invalid', + }, + ], + }, + status: 503, + }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34898/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { code: '429', data: {}, status: 429 }, + }, + { + httpReq: { + url: 'https://api.criteo.com/2022-10/audiences/34899/contactlist', + data: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + internalIdentifiers: false, + }, + }, + }, + params: { destination: 'criteo_audience' }, + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'PATCH', + }, + httpRes: { code: '400', data: { message: 'unknown error' }, status: 410 }, + }, +]; diff --git a/test/integrations/destinations/criteo_audience/processor/data.ts b/test/integrations/destinations/criteo_audience/processor/data.ts index e7fcbcad9c..61573fed9b 100644 --- a/test/integrations/destinations/criteo_audience/processor/data.ts +++ b/test/integrations/destinations/criteo_audience/processor/data.ts @@ -1,1638 +1,1616 @@ export const data = [ - { - "name": "criteo_audience", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com" - }, - { - "madid": "sample_madid", - "email": "alex@email.com" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34894", - "audienceType": "email" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34894/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "add", - "identifierType": "email", - "internalIdentifiers": false, - "identifiers": [ - "alex@email.com", - "amy@email.com", - "van@email.com", - "alex@email.com", - "amy@email.com", - "van@email.com" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid" - }, - { - "madid": "sample_madid_1" - }, - { - "madid": "sample_madid_2" - }, - { - "madid": "sample_madid_10" - }, - { - "madid": "sample_madid_13" - }, - { - "madid": "sample_madid_11" - }, - { - "madid": "sample_madid_12" - } - ], - "remove": [ - { - "madid": "sample_madid_3" - }, - { - "madid": "sample_madid_4" - }, - { - "madid": "sample_madid_5" - }, - { - "madid": "sample_madid_6" - }, - { - "madid": "sample_madid_7" - }, - { - "madid": "sample_madid_8" - }, - { - "madid": "sample_madid_9" - } - ] - } - }, - "context": { - "ip": "14.5.67.21" - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "madid" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "add", - "identifierType": "madid", - "internalIdentifiers": false, - "identifiers": [ - "sample_madid", - "sample_madid_1", - "sample_madid_2", - "sample_madid_10", - "sample_madid_13", - "sample_madid_11", - "sample_madid_12" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "remove", - "identifierType": "madid", - "internalIdentifiers": false, - "identifiers": [ - "sample_madid_3", - "sample_madid_4", - "sample_madid_5", - "sample_madid_6", - "sample_madid_7", - "sample_madid_8", - "sample_madid_9" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com", - "identityLink": "abc.com", - "gum": "sdjfds" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34894", - "audienceType": "email" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34894/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "add", - "identifierType": "email", - "internalIdentifiers": false, - "identifiers": [ - "alex@email.com", - "amy@email.com", - "van@email.com" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com", - "identityLink": "abc.com", - "gum": "sdjfds" - } - ] - } - }, - "context": { - "ip": "14.5.67.21" - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34895", - "audienceType": "madid" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34895/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "add", - "identifierType": "madid", - "internalIdentifiers": false, - "identifiers": [ - "sample_madid", - "sample_madid_1", - "sample_madid_2" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com", - "identityLink": "abc.com", - "gum": "sdjfds" - } - ], - "remove": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - } - ] - } - }, - "context": { - "ip": "14.5.67.21" - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "madid" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "add", - "identifierType": "madid", - "internalIdentifiers": false, - "identifiers": [ - "sample_madid", - "sample_madid_1", - "sample_madid_2" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "remove", - "identifierType": "madid", - "internalIdentifiers": false, - "identifiers": [ - "sample_madid" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com", - "identityLink": "abc.com", - "gum": "sdjfds" - } - ], - "remove": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - } - ] - } - }, - "context": { - "ip": "14.5.67.21" - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "identityLink" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "add", - "identifierType": "identityLink", - "internalIdentifiers": false, - "identifiers": [ - "text.com", - "yahoo.com", - "abc.com" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "remove", - "identifierType": "identityLink", - "internalIdentifiers": false, - "identifiers": [ - "text.com" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sample_gum1" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sample_gum2" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com", - "identityLink": "abc.com", - "gum": "sample_gum3" - } - ], - "remove": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sample_gum3" - } - ] - } - }, - "context": { - "ip": "14.5.67.21" - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "gum", - "gumCallerId": "329739" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "add", - "identifierType": "gum", - "internalIdentifiers": false, - "gumCallerId": "329739", - "identifiers": [ - "sample_gum1", - "sample_gum2", - "sample_gum3" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.criteo.com/2022-10/audiences/34893/contactlist", - "headers": { - "Authorization": "Bearer success_access_token", - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "type": "ContactlistAmendment", - "attributes": { - "operation": "remove", - "identifierType": "gum", - "internalIdentifiers": false, - "gumCallerId": "329739", - "identifiers": [ - "sample_gum3" - ] - } - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "identify", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com", - "identityLink": "abc.com", - "gum": "sdjfds" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "email" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 400, - "error": "Event type identify is not supported", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CRITEO_AUDIENCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "email" - }, - "ID": "sample_destinationId" - }, - "message": { - "type": "audiencelist", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "brand": "John Players", - "price": "15000", - "firstName": "Test", - "email": "test@rudderstack.com", - "userId": "user@27" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 400, - "error": "Message properties is not present. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CRITEO_AUDIENCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "email" - }, - "ID": "sample_destinationId" - }, - "message": { - "event": "add_to_Cart", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "brand": "Zara", - "price": "12000" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 400, - "error": "listData is not present inside properties. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CRITEO_AUDIENCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": {} - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "email" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 400, - "error": "Payload could not be populated", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CRITEO_AUDIENCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 11", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34893", - "audienceType": "email" - }, - "ID": "sample_destinationId" - }, - "message": { - "event": "add_to_Cart", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "channel": "web", - "properties": { - "brand": "Zara", - "price": "12000" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 400, - "error": "Message Type is not present. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CRITEO_AUDIENCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 12", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "destination": { - "Config": { - "audienceId": "34893", - "audienceType": "gum" - }, - "ID": "sample_destinationId" - }, - "message": { - "event": "add_to_Cart", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user@27", - "type": "audiencelist", - "channel": "web", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sample_gum1" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sample_gum2" - }, - { - "madid": "sample_madid_2", - "email": "van@email.com", - "identityLink": "abc.com", - "gum": "sample_gum3" - } - ] - }, - "brand": "Zara", - "price": "12000" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "2021-01-03T17:02:53.193Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 400, - "error": "gumCallerId is required for audience type gum", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "CRITEO_AUDIENCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "criteo_audience", - "description": "Test 13", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "message": { - "userId": "user 1", - "type": "audiencelist", - "properties": { - "listData": { - "add": [ - { - "madid": "sample_madid", - "email": "alex@email.com", - "identityLink": "text.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_1", - "email": "amy@email.com", - "identityLink": "yahoo.com", - "gum": "sdjfds" - }, - { - "madid": "sample_madid_2", - "identityLink": "abc.com", - "gum": "sdjfds" - } - ] - } - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "destination": { - "Config": { - "clientId": "abcdef8-f49-4cd6-b4c5-958b3d66d431", - "clientSecret": "sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg", - "audienceId": "34894", - "audienceType": "email" - }, - "ID": "sample_destinationId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "accessToken": "success_access_token" - } - }, - "statusCode": 400, - "error": "Required property for email type audience is not available in an object", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "CRITEO_AUDIENCE", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - } -] \ No newline at end of file + { + name: 'criteo_audience', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + }, + { + madid: 'sample_madid', + email: 'alex@email.com', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34894', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'email', + internalIdentifiers: false, + identifiers: [ + 'alex@email.com', + 'amy@email.com', + 'van@email.com', + 'alex@email.com', + 'amy@email.com', + 'van@email.com', + ], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + }, + { + madid: 'sample_madid_1', + }, + { + madid: 'sample_madid_2', + }, + { + madid: 'sample_madid_10', + }, + { + madid: 'sample_madid_13', + }, + { + madid: 'sample_madid_11', + }, + { + madid: 'sample_madid_12', + }, + ], + remove: [ + { + madid: 'sample_madid_3', + }, + { + madid: 'sample_madid_4', + }, + { + madid: 'sample_madid_5', + }, + { + madid: 'sample_madid_6', + }, + { + madid: 'sample_madid_7', + }, + { + madid: 'sample_madid_8', + }, + { + madid: 'sample_madid_9', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'madid', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + internalIdentifiers: false, + identifiers: [ + 'sample_madid', + 'sample_madid_1', + 'sample_madid_2', + 'sample_madid_10', + 'sample_madid_13', + 'sample_madid_11', + 'sample_madid_12', + ], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'remove', + identifierType: 'madid', + internalIdentifiers: false, + identifiers: [ + 'sample_madid_3', + 'sample_madid_4', + 'sample_madid_5', + 'sample_madid_6', + 'sample_madid_7', + 'sample_madid_8', + 'sample_madid_9', + ], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + identityLink: 'abc.com', + gum: 'sdjfds', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34894', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'email', + internalIdentifiers: false, + identifiers: ['alex@email.com', 'amy@email.com', 'van@email.com'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + identityLink: 'abc.com', + gum: 'sdjfds', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34895', + audienceType: 'madid', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34895/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + internalIdentifiers: false, + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + identityLink: 'abc.com', + gum: 'sdjfds', + }, + ], + remove: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'madid', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'madid', + internalIdentifiers: false, + identifiers: ['sample_madid', 'sample_madid_1', 'sample_madid_2'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'remove', + identifierType: 'madid', + internalIdentifiers: false, + identifiers: ['sample_madid'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + identityLink: 'abc.com', + gum: 'sdjfds', + }, + ], + remove: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'identityLink', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'identityLink', + internalIdentifiers: false, + identifiers: ['text.com', 'yahoo.com', 'abc.com'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'remove', + identifierType: 'identityLink', + internalIdentifiers: false, + identifiers: ['text.com'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sample_gum1', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sample_gum2', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + identityLink: 'abc.com', + gum: 'sample_gum3', + }, + ], + remove: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sample_gum3', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'gum', + gumCallerId: '329739', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'add', + identifierType: 'gum', + internalIdentifiers: false, + gumCallerId: '329739', + identifiers: ['sample_gum1', 'sample_gum2', 'sample_gum3'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'PATCH', + endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', + headers: { + Authorization: 'Bearer success_access_token', + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + data: { + type: 'ContactlistAmendment', + attributes: { + operation: 'remove', + identifierType: 'gum', + internalIdentifiers: false, + gumCallerId: '329739', + identifiers: ['sample_gum3'], + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'identify', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + identityLink: 'abc.com', + gum: 'sdjfds', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 400, + error: 'Event type identify is not supported', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CRITEO_AUDIENCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + message: { + type: 'audiencelist', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + brand: 'John Players', + price: '15000', + firstName: 'Test', + email: 'test@rudderstack.com', + userId: 'user@27', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 400, + error: 'Message properties is not present. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CRITEO_AUDIENCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + message: { + event: 'add_to_Cart', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + brand: 'Zara', + price: '12000', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 400, + error: 'listData is not present inside properties. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CRITEO_AUDIENCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: {}, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 400, + error: 'Payload could not be populated', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CRITEO_AUDIENCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34893', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + message: { + event: 'add_to_Cart', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + channel: 'web', + properties: { + brand: 'Zara', + price: '12000', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 400, + error: 'Message Type is not present. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CRITEO_AUDIENCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + destination: { + Config: { + audienceId: '34893', + audienceType: 'gum', + }, + ID: 'sample_destinationId', + }, + message: { + event: 'add_to_Cart', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user@27', + type: 'audiencelist', + channel: 'web', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sample_gum1', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sample_gum2', + }, + { + madid: 'sample_madid_2', + email: 'van@email.com', + identityLink: 'abc.com', + gum: 'sample_gum3', + }, + ], + }, + brand: 'Zara', + price: '12000', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 400, + error: 'gumCallerId is required for audience type gum', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'CRITEO_AUDIENCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'criteo_audience', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + message: { + userId: 'user 1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + madid: 'sample_madid', + email: 'alex@email.com', + identityLink: 'text.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_1', + email: 'amy@email.com', + identityLink: 'yahoo.com', + gum: 'sdjfds', + }, + { + madid: 'sample_madid_2', + identityLink: 'abc.com', + gum: 'sdjfds', + }, + ], + }, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + destination: { + Config: { + clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', + clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + audienceId: '34894', + audienceType: 'email', + }, + ID: 'sample_destinationId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + accessToken: 'success_access_token', + }, + }, + statusCode: 400, + error: 'Required property for email type audience is not available in an object', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'CRITEO_AUDIENCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/customerio/processor/data.ts b/test/integrations/destinations/customerio/processor/data.ts index 4fc83099ee..5bbbfe7b10 100644 --- a/test/integrations/destinations/customerio/processor/data.ts +++ b/test/integrations/destinations/customerio/processor/data.ts @@ -1,8483 +1,8278 @@ export const data = [ - { - "name": "customerio", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "type": "identify", - "userId": "cio_1234", - "integrations": { - "All": true - }, - "traits": { - "email": "updated_email@example.com", - "id": "updated-id-value" - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "email": "updated_email@example.com", - "id": "updated-id-value" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/cio_1234", - "userId": "cio_1234", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "user_properties": { - "prop1": "val1", - "prop2": "val2" - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com", - "dot.name": "Arnab Pal", - "address": { - "city": "NY", - "country": "USA", - "postalCode": 712136, - "state": "CA", - "street": "" - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "apiKey not found in Configs", - "statTags": { - "destType": "CUSTOMERIO", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "user_properties": { - "prop1": "val1", - "prop2": "val2" - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com", - "dot.name": "Arnab Pal", - "address": { - "city": "NY", - "country": "USA", - "postalCode": 712136, - "state": "CA", - "street": "" - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "_timestamp": 1571043797, - "anonymous_id": "123456", - "city": "NY", - "state": "CA", - "street": "", - "prop1": "val1", - "prop2": "val2", - "country": "USA", - "postalCode": 712136, - "email": "test@gmail.com", - "dot.name": "Arnab Pal" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/123456", - "userId": "123456", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "user_properties": { - "prop1": "val1", - "prop2": "val2" - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "anon-id", - "dot.name": "Arnab Pal", - "address": { - "city": "NY", - "country": "USA", - "postalCode": 712136, - "state": "CA", - "street": "" - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "userId or email is not present", - "statTags": { - "destType": "CUSTOMERIO", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "user_properties": { - "prop1": "val1", - "prop2": "val2" - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com", - "dot.name": "Arnab Pal", - "address": { - "city": "NY", - "country": "USA", - "postalCode": 712136, - "state": "CA", - "street": "" - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "_timestamp": 1571043797, - "anonymous_id": "123456", - "city": "NY", - "country": "USA", - "dot.name": "Arnab Pal", - "email": "test@gmail.com", - "postalCode": 712136, - "prop1": "val1", - "prop2": "val2", - "state": "CA", - "street": "" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/test@gmail.com", - "userId": "123456", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "page", - "data": { - "url": "www.rudderlabs.com", - "path": "/test", - "search": "abc", - "referrer": "Rudder", - "title": "Test Page" - }, - "timestamp": 1571051718, - "name": "ApplicationLoaded" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "event": "test track event", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "test track event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "", - "event": "test track event", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "test track event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/test@rudderstack.com/events", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "", - "event": "test track event", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "anonymous_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "test track event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/events", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "7e32188a4dab669f", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.torpedolabs.wynn.wscci.dev", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android", - "token": "abcxyz" - }, - "library": { - "name": "com.rudderlabs.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "event": "Application Installed", - "integrations": { - "All": true - }, - "messageId": "1578564113557-af022c68-429e-4af4-b99b-2b9174056383", - "properties": { - "review_id": "some_review_id", - "product_id": "some_product_id_a", - "rating": 2, - "review_body": "Some Review Body" - }, - "userId": "12345", - "originalTimestamp": "2020-01-09T10:01:53.558Z", - "type": "track", - "sentAt": "2020-01-09T10:02:03.257Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "review_body": "Some Review Body", - "rating": 2, - "review_id": "some_review_id", - "last_used": 1578564113, - "platform": "android", - "id": "abcxyz", - "product_id": "some_product_id_a" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/devices", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "7e32188a4dab669f", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.torpedolabs.wynn.wscci.dev", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android", - "token": "abcxyz" - }, - "library": { - "name": "com.rudderlabs.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "event": "Application Uninstalled", - "integrations": { - "All": true - }, - "messageId": "1578564113557-af022c68-429e-4af4-b99b-2b9174056383", - "properties": { - "review_id": "some_review_id", - "product_id": "some_product_id_a", - "rating": 2, - "review_body": "Some Review Body" - }, - "userId": "12345", - "originalTimestamp": "2020-01-09T10:01:53.558Z", - "type": "track", - "sentAt": "2020-01-09T10:02:03.257Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": {}, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/devices/abcxyz", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "DELETE", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 11", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "event": "Application Uninstalled", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": {}, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/devices/somel", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "DELETE", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 12", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Uninstalled", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": {}, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/test@rudderstack.com/devices/somel", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "DELETE", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 13", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Uninstalled", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "userId/email or device_token not present", - "statTags": { - "destType": "CUSTOMERIO", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 14", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "id": "somel", - "last_used": 1571051718, - "platform": "mobile", - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/test@rudderstack.com/devices", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 15", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymous_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "name": "Application Installed", - "timestamp": 1571051718, - "type": "event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/events", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 16", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "last_used": 1571051718, - "user_time_spent": 50000, - "platform": "mobile", - "id": "somel" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/devices", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 17", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "Application Installed" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 18", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Opened", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "Application Opened" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 19", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "sample_device_token" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Opened", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "last_used": 1571051718, - "user_time_spent": 50000, - "platform": "mobile", - "id": "sample_device_token" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/devices", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 20", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "sample_device_token" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Uninstalled", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": {}, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/devices/sample_device_token", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "DELETE", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 21", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "user_properties": { - "prop1": "val1", - "prop2": "val2" - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com", - "address": { - "city": "NY", - "country": "USA", - "postalCode": 712136, - "state": "CA", - "street": "" - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "_timestamp": 1571043797, - "anonymous_id": "123456", - "city": "NY", - "state": "CA", - "street": "", - "prop1": "val1", - "prop2": "val2", - "country": "USA", - "postalCode": 712136, - "email": "test@gmail.com" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/123456", - "userId": "123456", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 22", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "page", - "data": { - "url": "www.rudderlabs.com", - "path": "/test", - "search": "abc", - "referrer": "Rudder", - "title": "Test Page" - }, - "timestamp": 1571051718, - "name": "ApplicationLoaded" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 23", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "event": "test track event", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "test track event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 24", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "", - "event": "test track event", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "test track event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/events", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 25", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "", - "event": "test track event", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "anonymous_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "test track event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/events", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 26", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "7e32188a4dab669f", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.torpedolabs.wynn.wscci.dev", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android", - "token": "abcxyz" - }, - "library": { - "name": "com.rudderlabs.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "event": "Application Installed", - "integrations": { - "All": true - }, - "messageId": "1578564113557-af022c68-429e-4af4-b99b-2b9174056383", - "properties": { - "review_id": "some_review_id", - "product_id": "some_product_id_a", - "rating": 2, - "review_body": "Some Review Body" - }, - "userId": "12345", - "originalTimestamp": "2020-01-09T10:01:53.558Z", - "type": "track", - "sentAt": "2020-01-09T10:02:03.257Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "review_body": "Some Review Body", - "rating": 2, - "review_id": "some_review_id", - "last_used": 1578564113, - "platform": "android", - "id": "abcxyz", - "product_id": "some_product_id_a" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/devices", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 27", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "7e32188a4dab669f", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.torpedolabs.wynn.wscci.dev", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android", - "token": "abcxyz" - }, - "library": { - "name": "com.rudderlabs.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "7e32188a4dab669f" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" - }, - "event": "Application Uninstalled", - "integrations": { - "All": true - }, - "messageId": "1578564113557-af022c68-429e-4af4-b99b-2b9174056383", - "properties": { - "review_id": "some_review_id", - "product_id": "some_product_id_a", - "rating": 2, - "review_body": "Some Review Body" - }, - "userId": "12345", - "originalTimestamp": "2020-01-09T10:01:53.558Z", - "type": "track", - "sentAt": "2020-01-09T10:02:03.257Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": {}, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/devices/abcxyz", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "DELETE", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 28", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "event": "Application Uninstalled", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": {}, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/devices/somel", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "DELETE", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 29", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Uninstalled", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "userId/email or device_token not present", - "statTags": { - "destType": "CUSTOMERIO", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 30", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "id": "somel", - "last_used": 1571051718, - "platform": "mobile", - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/devices", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 31", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "anonymous_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "data": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "name": "Application Installed", - "timestamp": 1571051718, - "type": "event" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/events", - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 32", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "somel" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "last_used": 1571051718, - "user_time_spent": 50000, - "platform": "mobile", - "id": "somel" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/devices", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 33", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Installed", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "Application Installed" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 34", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Opened", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "event", - "data": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "user_time_spent": 50000 - }, - "timestamp": 1571051718, - "name": "Application Opened" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 35", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "sample_device_token" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Opened", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "device": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "last_used": 1571051718, - "user_time_spent": 50000, - "platform": "mobile", - "id": "sample_device_token" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/devices", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "PUT", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 36", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "mobile", - "context": { - "device": { - "name": "test android", - "id": "sample_device_id", - "model": "some_model_device", - "type": "mobile", - "token": "sample_device_token" - }, - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "Application Uninstalled", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": {}, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track-eu.customer.io/api/v1/customers/12345/devices/sample_device_token", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "DELETE", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 37", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v1/events", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50 - }, - "anonymous_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "name": "https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-s", - "type": "event", - "timestamp": 1571051718 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 38", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v1/customers/test@rudderstack.com/events", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50 - }, - "name": "https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/", - "type": "event", - "timestamp": 1571051718 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 39", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "12345" - }, - "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 - } - }, - "type": "screen", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v1/events", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "anonymous_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "name": "Viewed https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-q Screen", - "type": "event", - "timestamp": 1571051718 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 40", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "screen", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "event": "https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v1/customers/test@rudderstack.com/events", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "name": "Viewed https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/ Screen", - "type": "event", - "timestamp": 1571051718 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 41", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "dummy-100-anon", - "channel": "mobile", - "context": { - "app": { - "build": "173", - "name": "MyWallSt Debug", - "namespace": "com.rubicoin.Invest", - "version": "6.2" - }, - "device": { - "attTrackingStatus": 0, - "id": "6fdb629d-4f18-4f3e-943a-3f6f482b331e", - "manufacturer": "Apple", - "model": "iPhone", - "name": "Ales' iPhone", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.0.19" - }, - "locale": "en-DE", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "14.8" - }, - "screen": { - "density": 3, - "height": 375, - "width": 812 - }, - "timezone": "Europe/Prague", - "traits": { - "anonymousId": "6fdb629d-4f18-4f3e-943a-3f6f482b331e", - "userId": "6a540d50-c4dc-4694-beca-d16de113a1c4-1618384106.8700438" - } - }, - "event": "Home: Viewed", - "integrations": { - "All": true - }, - "messageId": "1632314412-e724167f-13bd-455b-943d-dd765a7810fe", - "originalTimestamp": "2021-09-22T12:40:12.220Z", - "properties": {}, - "rudderId": "782cdb50-e2b9-45fc-9d22-07fe792dcfba", - "sentAt": "2021-09-22T12:40:14.453Z", - "type": "track", - "userId": "dummy-user-id-100" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "abc", - "apiKey": "xyz" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v1/customers/dummy-user-id-100/events", - "headers": { - "Authorization": "Basic YWJjOnh5eg==" - }, - "params": {}, - "body": { - "JSON": { - "data": {}, - "name": "Home: Viewed", - "type": "event", - "timestamp": 1632314412 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "dummy-user-id-100", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 42", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "test@rudderstack.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "dummy-100-anon", - "userId": "dummy-user-id-100", - "integrations": { - "All": true - }, - "traits": { - "email": "test@gmail.com", - "address": { - "city": "NY", - "country": "USA", - "postalCode": 712136, - "state": "CA", - "street": "" - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "datacenter": "EU", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track-eu.customer.io/api/v1/customers/dummy-user-id-100", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "params": {}, - "body": { - "JSON": { - "city": "NY", - "country": "USA", - "postalCode": 712136, - "state": "CA", - "street": "", - "email": "test@gmail.com", - "_timestamp": 1571043797, - "anonymous_id": "dummy-100-anon" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "dummy-user-id-100", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 43", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "sources", - "context": { - "externalId": [ - { - "id": "xaviercharles@hotmail.com", - "identifierType": "email", - "type": "CUSTOMERIO-customers" - } - ], - "mappedToDestination": "true", - "sources": { - "batch_id": "3d6f7aa8-9b70-4759-970d-212e6714ad22", - "job_id": "1zDgnw7ZmHWR7gtY4niHYysL3zS/Syncher", - "job_run_id": "c5shebbh9jqg10k8d21g", - "task_id": "tt_10_rows", - "task_run_id": "c5shebbh9jqg10k8d220", - "version": "release.v1.6.8" - } - }, - "messageId": "d82a45e1-5a27-4c1d-af89-83bdbc6139d0", - "originalTimestamp": "2021-10-27T09:09:56.673Z", - "receivedAt": "2021-10-27T09:09:56.187Z", - "recordId": "3", - "request_ip": "10.1.85.177", - "rudderId": "5b19a81b-df60-4ccd-abf0-fcfe2b7db054", - "sentAt": "2021-10-27T09:09:56.673Z", - "timestamp": "2021-10-27T09:09:56.186Z", - "traits": { - "last_name": "xavier", - "first_name": "charles" - }, - "type": "identify", - "userId": "xaviercharles@hotmail.com" - }, - "destination": { - "ID": "1zgXcyv272oZA8HWqe7zInhJjPL", - "Name": "ere", - "DestinationDefinition": { - "ID": "1iVQr671C0E8MVpzvCEegsLM2J5", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU" - ], - "web": [ - "useNativeSDK" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative" - ], - "supportsVisualMapper": true, - "transformAt": "processor" - }, - "ResponseRules": null - }, - "Config": { - "apiKey": "a292d85ac36de15fc219", - "datacenter": "US", - "siteID": "eead090ab9e2e35004dc" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "libraries": [], - "request": { - "query": {} - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/xaviercharles@hotmail.com", - "headers": { - "Authorization": "Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=" - }, - "params": {}, - "body": { - "JSON": { - "last_name": "xavier", - "first_name": "charles", - "email": "xaviercharles@hotmail.com", - "_timestamp": 1635325796 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "xaviercharles@hotmail.com", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 44", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "sources", - "context": { - "externalId": [ - { - "id": "xaviercharles", - "identifierType": "id", - "type": "CUSTOMERIO-customers" - } - ], - "mappedToDestination": "true", - "sources": { - "batch_id": "3d6f7aa8-9b70-4759-970d-212e6714ad22", - "job_id": "1zDgnw7ZmHWR7gtY4niHYysL3zS/Syncher", - "job_run_id": "c5shebbh9jqg10k8d21g", - "task_id": "tt_10_rows", - "task_run_id": "c5shebbh9jqg10k8d220", - "version": "release.v1.6.8" - } - }, - "messageId": "d82a45e1-5a27-4c1d-af89-83bdbc6139d0", - "originalTimestamp": "2021-10-27T09:09:56.673Z", - "receivedAt": "2021-10-27T09:09:56.187Z", - "recordId": "3", - "request_ip": "10.1.85.177", - "rudderId": "5b19a81b-df60-4ccd-abf0-fcfe2b7db054", - "sentAt": "2021-10-27T09:09:56.673Z", - "traits": { - "last_name": "xavier", - "first_name": "charles" - }, - "type": "identify", - "userId": "xaviercharles" - }, - "destination": { - "ID": "1zgXcyv272oZA8HWqe7zInhJjPL", - "Name": "ere", - "DestinationDefinition": { - "ID": "1iVQr671C0E8MVpzvCEegsLM2J5", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU" - ], - "web": [ - "useNativeSDK" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative" - ], - "supportsVisualMapper": true, - "transformAt": "processor" - }, - "ResponseRules": null - }, - "Config": { - "apiKey": "a292d85ac36de15fc219", - "datacenter": "US", - "siteID": "eead090ab9e2e35004dc" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "libraries": [], - "request": { - "query": {} - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/xaviercharles", - "headers": { - "Authorization": "Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=" - }, - "params": {}, - "body": { - "JSON": { - "last_name": "xavier", - "first_name": "charles", - "id": "xaviercharles", - "_timestamp": 1635325796 - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "xaviercharles", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 45", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "Application Opened", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "timestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:35:30.556+05:30", - "request_ip": "[::1]", - "rudderId": "423cdf83-0448-4a99-b14d-36fcc63e6ea0", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track", - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "from_background": false, - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 46", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "Application Opened", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:39:04.424+05:30", - "request_ip": "[::1]", - "rudderId": "423cdf83-0448-4a99-b14d-36fcc63e6ea0", - "sentAt": "2022-01-10T10:00:26.982Z", - "timestamp": "2022-01-10T20:39:03.955+05:30", - "type": "track", - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "from_background": false - }, - "name": "Application Opened", - "type": "event", - "timestamp": 1641827343 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 47", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0 - } - }, - "event": "Application Opened", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:41:30.970+05:30", - "request_ip": "[::1]", - "rudderId": "423cdf83-0448-4a99-b14d-36fcc63e6ea0", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track", - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "from_background": false, - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 48", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "Application Opened", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:44:52.784+05:30", - "request_ip": "[::1]", - "rudderId": "0aef312c-0dc0-4a49-b613-4f33fb4e9b46", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "from_background": false, - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 49", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "Application Opened", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "timestamp": "2022-01-10T10:00:26.513Z", - "receivedAt": "2022-01-10T20:47:36.180+05:30", - "request_ip": "[::1]", - "rudderId": "0aef312c-0dc0-4a49-b613-4f33fb4e9b46", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 50", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "device_token_registered", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:49:05.795+05:30", - "request_ip": "[::1]", - "rudderId": "423cdf83-0448-4a99-b14d-36fcc63e6ea0", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track", - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "from_background": false, - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 51", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "device_token_registered", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:50:17.090+05:30", - "request_ip": "[::1]", - "rudderId": "423cdf83-0448-4a99-b14d-36fcc63e6ea0", - "sentAt": "2022-01-10T10:00:26.982Z", - "timestamp": "2022-01-10T20:50:16.621+05:30", - "type": "track", - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "data": { - "from_background": false - }, - "name": "device_token_registered", - "type": "event", - "timestamp": 1641828016 - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 52", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0 - } - }, - "event": "device_token_registered", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:52:19.147+05:30", - "request_ip": "[::1]", - "rudderId": "423cdf83-0448-4a99-b14d-36fcc63e6ea0", - "sentAt": "2022-01-10T10:00:26.982Z", - "timestamp": "2022-01-10T20:52:18.678+05:30", - "type": "track", - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "from_background": false, - "id": "deviceToken", - "platform": "ios", - "last_used": 1641828138 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 53", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "device_token_registered", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:53:43.680+05:30", - "request_ip": "[::1]", - "rudderId": "0aef312c-0dc0-4a49-b613-4f33fb4e9b46", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "from_background": false, - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 54", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "iOS" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - } - }, - "event": "device_token_registered", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "receivedAt": "2022-01-10T20:55:03.845+05:30", - "request_ip": "[::1]", - "rudderId": "0aef312c-0dc0-4a49-b613-4f33fb4e9b46", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 55", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "check for ipados apple family and default it to ios", - "message": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "zx_userid_missing", - "namespace": "org.reactjs.native.example.zx-userid-missing", - "version": "1.0" - }, - "device": { - "attTrackingStatus": 0, - "id": "5d727a3e-a72b-4d00-8078-669c1494791d", - "manufacturer": "Apple", - "model": "iPhone", - "name": "iPhone 13", - "token": "deviceToken", - "type": "ipados" - }, - "library": { - "name": "rudder-ios-library", - "version": "1.3.1" - }, - "locale": "en-US", - "network": { - "bluetooth": false, - "carrier": "unavailable", - "cellular": false, - "wifi": true - }, - "os": { - "name": "iOS", - "version": "15.2" - }, - "screen": { - "density": 3, - "height": 390, - "width": 844 - }, - "timezone": "Asia/Kolkata", - "traits": { - "anonymousId": "5d727a3e-a72b-4d00-8078-669c1494791d", - "email": "sofia@gmail.com", - "login_status": "Authenticated", - "name": "Sofia", - "phone_verified": 1, - "selected_city": "", - "selected_lat": 0, - "selected_long": 0, - "selected_neighborhood": "", - "selected_number": "", - "selected_postal_code": "", - "selected_state": "", - "selected_street": "", - "signed_up_for_newsletters": 0 - } - }, - "event": "Application Opened", - "integrations": { - "All": true - }, - "messageId": "1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f", - "originalTimestamp": "2022-01-10T10:00:26.513Z", - "properties": { - "from_background": false - }, - "receivedAt": "2022-01-10T20:41:30.970+05:30", - "request_ip": "[::1]", - "rudderId": "423cdf83-0448-4a99-b14d-36fcc63e6ea0", - "sentAt": "2022-01-10T10:00:26.982Z", - "type": "track", - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "DESAU SAI", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "DESU SAI" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices", - "headers": { - "Authorization": "Basic REVTVSBTQUk6REVTQVUgU0FJ" - }, - "params": {}, - "body": { - "JSON": { - "device": { - "from_background": false, - "id": "deviceToken", - "platform": "ios", - "last_used": 1641808826 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e91e0378-63fe-11ec-82ac-0a028ee659c3", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 56", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "successful group call with identify action", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.0-beta.2" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.0-beta.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "groupId": "group@1", - "integrations": { - "All": true - }, - "traits": { - "domainNames": "rudderstack.com", - "email": "help@rudderstack.com", - "name": "rudderstack", - "action": "identify" - }, - "type": "group", - "userId": "user@1" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "ef32c3f60fb98f39ef35", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "c0efdbd20b9fbe24a7e2" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v2/batch", - "headers": { - "Authorization": "Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=" - }, - "params": {}, - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "type": "object", - "action": "identify", - "attributes": { - "name": "rudderstack", - "email": "help@rudderstack.com", - "domainNames": "rudderstack.com" - }, - "identifiers": { - "object_id": "group@1", - "object_type_id": "1" - }, - "cio_relationships": [ - { - "identifiers": { - "id": "user@1" - } - } - ] - }, - "JSON_ARRAY": {} - }, - "files": {}, - "userId": "user@1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 57", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "successful group call with delete action", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.0-beta.2" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.0-beta.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "groupId": "group@1", - "integrations": { - "All": true - }, - "traits": { - "domainNames": "rudderstack.com", - "email": "help@rudderstack.com", - "name": "rudderstack", - "action": "delete" - }, - "type": "group", - "userId": "user@1" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "ef32c3f60fb98f39ef35", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "c0efdbd20b9fbe24a7e2" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v2/batch", - "headers": { - "Authorization": "Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=" - }, - "params": {}, - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "type": "object", - "action": "delete", - "attributes": { - "name": "rudderstack", - "email": "help@rudderstack.com", - "domainNames": "rudderstack.com" - }, - "identifiers": { - "object_id": "group@1", - "object_type_id": "1" - }, - "cio_relationships": [ - { - "identifiers": { - "id": "user@1" - } - } - ] - }, - "JSON_ARRAY": {} - }, - "files": {}, - "userId": "user@1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 58", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "successful group call with add_relationships action", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.0-beta.2" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.0-beta.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "test@rudderstack.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "groupId": "group@1", - "integrations": { - "All": true - }, - "traits": { - "domainNames": "rudderstack.com", - "email": "help@rudderstack.com", - "name": "rudderstack", - "action": "add_relationships" - }, - "type": "group", - "userId": "user@1" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "ef32c3f60fb98f39ef35", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "c0efdbd20b9fbe24a7e2" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v2/batch", - "headers": { - "Authorization": "Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=" - }, - "params": {}, - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "type": "object", - "action": "add_relationships", - "attributes": { - "name": "rudderstack", - "email": "help@rudderstack.com", - "domainNames": "rudderstack.com" - }, - "identifiers": { - "object_id": "group@1", - "object_type_id": "1" - }, - "cio_relationships": [ - { - "identifiers": { - "id": "user@1" - } - } - ] - }, - "JSON_ARRAY": {} - }, - "files": {}, - "userId": "user@1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 59", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "successful group call with delete_relationships action", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.0-beta.2" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.0-beta.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "email": "test@rudderstack.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" - }, - "groupId": "group@1", - "integrations": { - "All": true - }, - "traits": { - "domainNames": "rudderstack.com", - "email": "help@rudderstack.com", - "name": "rudderstack", - "action": "delete_relationships" - }, - "type": "group", - "userId": "user@1" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "ef32c3f60fb98f39ef35", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "c0efdbd20b9fbe24a7e2" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v2/batch", - "headers": { - "Authorization": "Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=" - }, - "params": {}, - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "type": "object", - "action": "delete_relationships", - "attributes": { - "name": "rudderstack", - "email": "help@rudderstack.com", - "domainNames": "rudderstack.com" - }, - "identifiers": { - "object_id": "group@1", - "object_type_id": "1" - }, - "cio_relationships": [ - { - "identifiers": { - "id": "user@1" - } - } - ] - }, - "JSON_ARRAY": {} - }, - "files": {}, - "userId": "user@1", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 60", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "successful group call with userId and groupId as an integer", - "message": { - "type": "group", - "header": { - "content-type": "application/json; charset=utf-8" - }, - "sentAt": "2023-03-28T09:36:49.882Z", - "traits": { - "city": "Frankfurt", - "name": "rudder test", - "state": "Hessen", - "isFake": true, - "address": "Solmsstraße 83", - "country": "DE", - "website": "http://www.rudderstack.com", - "industry": "Waste and recycling", - "postcode": "60486", - "whiteLabel": "rudderlabs", - "maxNbJobBoards": 2, - "organisationId": 306, - "pricingPackage": "packageExpert", - "dateProTrialEnd": "2022-08-31T00:00:00+00:00", - "isProTrialActive": true, - "datetimeRegistration": "2020-07-01T10:23:41+00:00", - "isPersonnelServiceProvider": false - }, - "userId": 432, - "channel": "server", - "context": { - "library": { - "name": "rudder-analytics-php", - "version": "2.0.1", - "consumer": "LibCurl" - } - }, - "groupId": 306, - "rudderId": "f5b46a12-2dab-4e24-a127-7316eed414fc", - "messageId": "7032394c-e813-4737-bf52-622dbcefe849", - "receivedAt": "2023-03-28T09:36:48.296Z", - "request_ip": "18.195.235.225", - "originalTimestamp": "2023-03-28T09:36:49.882Z" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "ef32c3f60fb98f39ef35", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "c0efdbd20b9fbe24a7e2" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v2/batch", - "headers": { - "Authorization": "Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=" - }, - "params": {}, - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "type": "object", - "action": "identify", - "attributes": { - "city": "Frankfurt", - "name": "rudder test", - "state": "Hessen", - "isFake": true, - "address": "Solmsstraße 83", - "country": "DE", - "website": "http://www.rudderstack.com", - "industry": "Waste and recycling", - "postcode": "60486", - "whiteLabel": "rudderlabs", - "maxNbJobBoards": 2, - "organisationId": 306, - "pricingPackage": "packageExpert", - "dateProTrialEnd": "2022-08-31T00:00:00+00:00", - "isProTrialActive": true, - "datetimeRegistration": "2020-07-01T10:23:41+00:00", - "isPersonnelServiceProvider": false - }, - "identifiers": { - "object_id": "306", - "object_type_id": "1" - }, - "cio_relationships": [ - { - "identifiers": { - "id": "432" - } - } - ] - }, - "JSON_ARRAY": {} - }, - "files": {}, - "userId": "432", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 61", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "successful group call with userId in email format ", - "message": { - "type": "group", - "header": { - "content-type": "application/json; charset=utf-8" - }, - "sentAt": "2023-03-28T09:36:49.882Z", - "traits": { - "city": "Frankfurt", - "name": "rudder test", - "state": "Hessen", - "isFake": true, - "address": "Solmsstraße 83", - "country": "DE", - "website": "http://www.rudderstack.com", - "industry": "Waste and recycling", - "postcode": "60486", - "whiteLabel": "rudderlabs", - "maxNbJobBoards": 2, - "organisationId": 306, - "pricingPackage": "packageExpert", - "dateProTrialEnd": "2022-08-31T00:00:00+00:00", - "isProTrialActive": true, - "datetimeRegistration": "2020-07-01T10:23:41+00:00", - "isPersonnelServiceProvider": false - }, - "userId": "abc@xyz.com", - "channel": "server", - "context": { - "library": { - "name": "rudder-analytics-php", - "version": "2.0.1", - "consumer": "LibCurl" - } - }, - "groupId": 306, - "rudderId": "f5b46a12-2dab-4e24-a127-7316eed414fc", - "messageId": "7032394c-e813-4737-bf52-622dbcefe849", - "receivedAt": "2023-03-28T09:36:48.296Z", - "request_ip": "18.195.235.225", - "originalTimestamp": "2023-03-28T09:36:49.882Z" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "ef32c3f60fb98f39ef35", - "datacenter": "US", - "deviceTokenEventName": "device_token_registered", - "siteID": "c0efdbd20b9fbe24a7e2" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track.customer.io/api/v2/batch", - "headers": { - "Authorization": "Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=" - }, - "params": {}, - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "type": "object", - "action": "identify", - "attributes": { - "city": "Frankfurt", - "name": "rudder test", - "state": "Hessen", - "isFake": true, - "address": "Solmsstraße 83", - "country": "DE", - "website": "http://www.rudderstack.com", - "industry": "Waste and recycling", - "postcode": "60486", - "whiteLabel": "rudderlabs", - "maxNbJobBoards": 2, - "organisationId": 306, - "pricingPackage": "packageExpert", - "dateProTrialEnd": "2022-08-31T00:00:00+00:00", - "isProTrialActive": true, - "datetimeRegistration": "2020-07-01T10:23:41+00:00", - "isPersonnelServiceProvider": false - }, - "identifiers": { - "object_id": "306", - "object_type_id": "1" - }, - "cio_relationships": [ - { - "identifiers": { - "email": "abc@xyz.com" - } - } - ] - }, - "JSON_ARRAY": {} - }, - "files": {}, - "userId": "abc@xyz.com", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 62", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "description": "successful group call with eu as data center", - "message": { - "type": "group", - "header": { - "content-type": "application/json; charset=utf-8" - }, - "sentAt": "2023-03-28T09:36:49.882Z", - "traits": { - "city": "Frankfurt", - "name": "rudder test", - "state": "Hessen", - "isFake": true, - "address": "Solmsstraße 83", - "country": "DE", - "website": "http://www.rudderstack.com", - "industry": "Waste and recycling", - "postcode": "60486", - "whiteLabel": "rudderlabs", - "maxNbJobBoards": 2, - "organisationId": 306, - "pricingPackage": "packageExpert", - "dateProTrialEnd": "2022-08-31T00:00:00+00:00", - "isProTrialActive": true, - "datetimeRegistration": "2020-07-01T10:23:41+00:00", - "isPersonnelServiceProvider": false - }, - "userId": 432, - "channel": "server", - "context": { - "library": { - "name": "rudder-analytics-php", - "version": "2.0.1", - "consumer": "LibCurl" - } - }, - "groupId": 306, - "rudderId": "f5b46a12-2dab-4e24-a127-7316eed414fc", - "messageId": "7032394c-e813-4737-bf52-622dbcefe849", - "receivedAt": "2023-03-28T09:36:48.296Z", - "request_ip": "18.195.235.225", - "originalTimestamp": "2023-03-28T09:36:49.882Z" - }, - "destination": { - "ID": "23Mi76khsFhY7bh9ZyRcvR3pHDt", - "Name": "Customer IO Dev", - "DestinationDefinition": { - "ID": "23MgSlHXsPLsiH7SbW7IzCP32fn", - "Name": "CUSTOMERIO", - "DisplayName": "Customer IO", - "Config": { - "destConfig": { - "defaultConfig": [ - "apiKey", - "siteID", - "datacenterEU", - "deviceTokenEventName" - ], - "web": [ - "useNativeSDK", - "blackListedEvents", - "whiteListedEvents" - ] - }, - "excludeKeys": [], - "includeKeys": [ - "apiKey", - "siteID", - "datacenterEU", - "blackListedEvents", - "whiteListedEvents" - ], - "saveDestinationResponse": true, - "secretKeys": [], - "supportedMessageTypes": [ - "identify", - "page", - "screen", - "track" - ], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "warehouse", - "reactnative", - "flutter", - "cordova" - ], - "supportsVisualMapper": true, - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "apiKey": "ef32c3f60fb98f39ef35", - "datacenter": "EU", - "deviceTokenEventName": "device_token_registered", - "siteID": "c0efdbd20b9fbe24a7e2" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://track-eu.customer.io/api/v2/batch", - "headers": { - "Authorization": "Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=" - }, - "params": {}, - "body": { - "XML": {}, - "FORM": {}, - "JSON": { - "type": "object", - "action": "identify", - "attributes": { - "city": "Frankfurt", - "name": "rudder test", - "state": "Hessen", - "isFake": true, - "address": "Solmsstraße 83", - "country": "DE", - "website": "http://www.rudderstack.com", - "industry": "Waste and recycling", - "postcode": "60486", - "whiteLabel": "rudderlabs", - "maxNbJobBoards": 2, - "organisationId": 306, - "pricingPackage": "packageExpert", - "dateProTrialEnd": "2022-08-31T00:00:00+00:00", - "isProTrialActive": true, - "datetimeRegistration": "2020-07-01T10:23:41+00:00", - "isPersonnelServiceProvider": false - }, - "identifiers": { - "object_id": "306", - "object_type_id": "1" - }, - "cio_relationships": [ - { - "identifiers": { - "id": "432" - } - } - ] - }, - "JSON_ARRAY": {} - }, - "files": {}, - "userId": "432", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 63", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "page", - "data": { - "url": "www.rudderlabs.com", - "path": "/test", - "search": "abc", - "referrer": "Rudder", - "title": "Test Page" - }, - "timestamp": 1571051718, - "name": "www.rudderlabs.com" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 64", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "page", - "data": { - "path": "/test", - "search": "abc", - "referrer": "Rudder", - "title": "Test Page" - }, - "timestamp": 1571051718 - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "customerio", - "description": "Test 65", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "test@rudderstack.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "datacenter": "US", - "siteID": "46be54768e7d49ab2628", - "apiKey": "dummyApiKey" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "type": "page", - "timestamp": 1571051718 - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://track.customer.io/api/v1/customers/12345/events", - "userId": "12345", - "headers": { - "Authorization": "Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'customerio', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + type: 'identify', + userId: 'cio_1234', + integrations: { + All: true, + }, + traits: { + email: 'updated_email@example.com', + id: 'updated-id-value', + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + email: 'updated_email@example.com', + id: 'updated-id-value', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/cio_1234', + userId: 'cio_1234', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + user_properties: { + prop1: 'val1', + prop2: 'val2', + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + integrations: { + All: true, + }, + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + 'dot.name': 'Arnab Pal', + address: { + city: 'NY', + country: 'USA', + postalCode: 712136, + state: 'CA', + street: '', + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'apiKey not found in Configs', + statTags: { + destType: 'CUSTOMERIO', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + user_properties: { + prop1: 'val1', + prop2: 'val2', + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + integrations: { + All: true, + }, + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + 'dot.name': 'Arnab Pal', + address: { + city: 'NY', + country: 'USA', + postalCode: 712136, + state: 'CA', + street: '', + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + _timestamp: 1571043797, + anonymous_id: '123456', + city: 'NY', + state: 'CA', + street: '', + prop1: 'val1', + prop2: 'val2', + country: 'USA', + postalCode: 712136, + email: 'test@gmail.com', + 'dot.name': 'Arnab Pal', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/123456', + userId: '123456', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + user_properties: { + prop1: 'val1', + prop2: 'val2', + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + integrations: { + All: true, + }, + traits: { + anonymousId: 'anon-id', + 'dot.name': 'Arnab Pal', + address: { + city: 'NY', + country: 'USA', + postalCode: 712136, + state: 'CA', + street: '', + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'userId or email is not present', + statTags: { + destType: 'CUSTOMERIO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + user_properties: { + prop1: 'val1', + prop2: 'val2', + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + integrations: { + All: true, + }, + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + 'dot.name': 'Arnab Pal', + address: { + city: 'NY', + country: 'USA', + postalCode: 712136, + state: 'CA', + street: '', + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + _timestamp: 1571043797, + anonymous_id: '123456', + city: 'NY', + country: 'USA', + 'dot.name': 'Arnab Pal', + email: 'test@gmail.com', + postalCode: 712136, + prop1: 'val1', + prop2: 'val2', + state: 'CA', + street: '', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/test@gmail.com', + userId: '123456', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'page', + data: { + url: 'www.rudderlabs.com', + path: '/test', + search: 'abc', + referrer: 'Rudder', + title: 'Test Page', + }, + timestamp: 1571051718, + name: 'ApplicationLoaded', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + event: 'test track event', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'test track event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '', + event: 'test track event', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'test track event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '', + event: 'test track event', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + anonymous_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'test track event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/events', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '7e32188a4dab669f', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.torpedolabs.wynn.wscci.dev', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: 'abcxyz', + }, + library: { + name: 'com.rudderlabs.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + event: 'Application Installed', + integrations: { + All: true, + }, + messageId: '1578564113557-af022c68-429e-4af4-b99b-2b9174056383', + properties: { + review_id: 'some_review_id', + product_id: 'some_product_id_a', + rating: 2, + review_body: 'Some Review Body', + }, + userId: '12345', + originalTimestamp: '2020-01-09T10:01:53.558Z', + type: 'track', + sentAt: '2020-01-09T10:02:03.257Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + review_body: 'Some Review Body', + rating: 2, + review_id: 'some_review_id', + last_used: 1578564113, + platform: 'android', + id: 'abcxyz', + product_id: 'some_product_id_a', + }, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '7e32188a4dab669f', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.torpedolabs.wynn.wscci.dev', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: 'abcxyz', + }, + library: { + name: 'com.rudderlabs.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + event: 'Application Uninstalled', + integrations: { + All: true, + }, + messageId: '1578564113557-af022c68-429e-4af4-b99b-2b9174056383', + properties: { + review_id: 'some_review_id', + product_id: 'some_product_id_a', + rating: 2, + review_body: 'Some Review Body', + }, + userId: '12345', + originalTimestamp: '2020-01-09T10:01:53.558Z', + type: 'track', + sentAt: '2020-01-09T10:02:03.257Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: {}, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/devices/abcxyz', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'DELETE', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + event: 'Application Uninstalled', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: {}, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/devices/somel', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'DELETE', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Uninstalled', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: {}, + FORM: {}, + }, + files: {}, + endpoint: + 'https://track.customer.io/api/v1/customers/test@rudderstack.com/devices/somel', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'DELETE', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Uninstalled', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'userId/email or device_token not present', + statTags: { + destType: 'CUSTOMERIO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 14', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + id: 'somel', + last_used: 1571051718, + platform: 'mobile', + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/devices', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 15', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + anonymous_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + name: 'Application Installed', + timestamp: 1571051718, + type: 'event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/events', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + last_used: 1571051718, + user_time_spent: 50000, + platform: 'mobile', + id: 'somel', + }, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 17', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'Application Installed', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 18', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Opened', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'Application Opened', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 19', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'sample_device_token', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Opened', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + last_used: 1571051718, + user_time_spent: 50000, + platform: 'mobile', + id: 'sample_device_token', + }, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 20', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'sample_device_token', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Uninstalled', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: {}, + FORM: {}, + }, + files: {}, + endpoint: + 'https://track.customer.io/api/v1/customers/12345/devices/sample_device_token', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'DELETE', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 21', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + user_properties: { + prop1: 'val1', + prop2: 'val2', + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + integrations: { + All: true, + }, + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + address: { + city: 'NY', + country: 'USA', + postalCode: 712136, + state: 'CA', + street: '', + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + _timestamp: 1571043797, + anonymous_id: '123456', + city: 'NY', + state: 'CA', + street: '', + prop1: 'val1', + prop2: 'val2', + country: 'USA', + postalCode: 712136, + email: 'test@gmail.com', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/123456', + userId: '123456', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 22', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'page', + data: { + url: 'www.rudderlabs.com', + path: '/test', + search: 'abc', + referrer: 'Rudder', + title: 'Test Page', + }, + timestamp: 1571051718, + name: 'ApplicationLoaded', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 23', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + event: 'test track event', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'test track event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 24', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '', + event: 'test track event', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'test track event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/events', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 25', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '', + event: 'test track event', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + anonymous_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'test track event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/events', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 26', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '7e32188a4dab669f', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.torpedolabs.wynn.wscci.dev', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: 'abcxyz', + }, + library: { + name: 'com.rudderlabs.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + event: 'Application Installed', + integrations: { + All: true, + }, + messageId: '1578564113557-af022c68-429e-4af4-b99b-2b9174056383', + properties: { + review_id: 'some_review_id', + product_id: 'some_product_id_a', + rating: 2, + review_body: 'Some Review Body', + }, + userId: '12345', + originalTimestamp: '2020-01-09T10:01:53.558Z', + type: 'track', + sentAt: '2020-01-09T10:02:03.257Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + review_body: 'Some Review Body', + rating: 2, + review_id: 'some_review_id', + last_used: 1578564113, + platform: 'android', + id: 'abcxyz', + product_id: 'some_product_id_a', + }, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 27', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '7e32188a4dab669f', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.torpedolabs.wynn.wscci.dev', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: 'abcxyz', + }, + library: { + name: 'com.rudderlabs.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '7e32188a4dab669f', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', + }, + event: 'Application Uninstalled', + integrations: { + All: true, + }, + messageId: '1578564113557-af022c68-429e-4af4-b99b-2b9174056383', + properties: { + review_id: 'some_review_id', + product_id: 'some_product_id_a', + rating: 2, + review_body: 'Some Review Body', + }, + userId: '12345', + originalTimestamp: '2020-01-09T10:01:53.558Z', + type: 'track', + sentAt: '2020-01-09T10:02:03.257Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: {}, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices/abcxyz', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'DELETE', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 28', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + event: 'Application Uninstalled', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: {}, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices/somel', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'DELETE', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 29', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Uninstalled', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'userId/email or device_token not present', + statTags: { + destType: 'CUSTOMERIO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 30', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + id: 'somel', + last_used: 1571051718, + platform: 'mobile', + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + }, + FORM: {}, + }, + files: {}, + endpoint: + 'https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/devices', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 31', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + anonymous_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + data: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + name: 'Application Installed', + timestamp: 1571051718, + type: 'event', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/events', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 32', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'somel', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + last_used: 1571051718, + user_time_spent: 50000, + platform: 'mobile', + id: 'somel', + }, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 33', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Installed', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'Application Installed', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 34', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Opened', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'event', + data: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + user_time_spent: 50000, + }, + timestamp: 1571051718, + name: 'Application Opened', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 35', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'sample_device_token', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Opened', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + device: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + last_used: 1571051718, + user_time_spent: 50000, + platform: 'mobile', + id: 'sample_device_token', + }, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'PUT', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 36', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'mobile', + context: { + device: { + name: 'test android', + id: 'sample_device_id', + model: 'some_model_device', + type: 'mobile', + token: 'sample_device_token', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: 'Application Uninstalled', + userId: '12345', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: {}, + FORM: {}, + }, + files: {}, + endpoint: + 'https://track-eu.customer.io/api/v1/customers/12345/devices/sample_device_token', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'DELETE', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 37', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: + 'https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v1/events', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + params: {}, + body: { + JSON: { + data: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50, + }, + anonymous_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + name: 'https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-s', + type: 'event', + timestamp: 1571051718, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 38', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: + 'https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + params: {}, + body: { + JSON: { + data: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50, + }, + name: 'https://www.stoodi.com.br/exershgcios/upe/2019/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/', + type: 'event', + timestamp: 1571051718, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 39', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '12345', + }, + 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, + }, + }, + type: 'screen', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: + 'https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v1/events', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + params: {}, + body: { + JSON: { + data: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + anonymous_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + name: 'Viewed https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-q Screen', + type: 'event', + timestamp: 1571051718, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 40', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'screen', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + event: + 'https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + params: {}, + body: { + JSON: { + data: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + name: 'Viewed https://www.stoodi.com.br/exercicios/upe/2016/questao/gregorio-de-matos-poeta-baiano-que-viveu-no-seculo-xvi/ Screen', + type: 'event', + timestamp: 1571051718, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 41', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'dummy-100-anon', + channel: 'mobile', + context: { + app: { + build: '173', + name: 'MyWallSt Debug', + namespace: 'com.rubicoin.Invest', + version: '6.2', + }, + device: { + attTrackingStatus: 0, + id: '6fdb629d-4f18-4f3e-943a-3f6f482b331e', + manufacturer: 'Apple', + model: 'iPhone', + name: "Ales' iPhone", + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.0.19', + }, + locale: 'en-DE', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '14.8', + }, + screen: { + density: 3, + height: 375, + width: 812, + }, + timezone: 'Europe/Prague', + traits: { + anonymousId: '6fdb629d-4f18-4f3e-943a-3f6f482b331e', + userId: '6a540d50-c4dc-4694-beca-d16de113a1c4-1618384106.8700438', + }, + }, + event: 'Home: Viewed', + integrations: { + All: true, + }, + messageId: '1632314412-e724167f-13bd-455b-943d-dd765a7810fe', + originalTimestamp: '2021-09-22T12:40:12.220Z', + properties: {}, + rudderId: '782cdb50-e2b9-45fc-9d22-07fe792dcfba', + sentAt: '2021-09-22T12:40:14.453Z', + type: 'track', + userId: 'dummy-user-id-100', + }, + destination: { + Config: { + datacenter: 'US', + siteID: 'abc', + apiKey: 'xyz', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v1/customers/dummy-user-id-100/events', + headers: { + Authorization: 'Basic YWJjOnh5eg==', + }, + params: {}, + body: { + JSON: { + data: {}, + name: 'Home: Viewed', + type: 'event', + timestamp: 1632314412, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'dummy-user-id-100', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 42', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'dummy-100-anon', + userId: 'dummy-user-id-100', + integrations: { + All: true, + }, + traits: { + email: 'test@gmail.com', + address: { + city: 'NY', + country: 'USA', + postalCode: 712136, + state: 'CA', + street: '', + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + datacenter: 'EU', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://track-eu.customer.io/api/v1/customers/dummy-user-id-100', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + params: {}, + body: { + JSON: { + city: 'NY', + country: 'USA', + postalCode: 712136, + state: 'CA', + street: '', + email: 'test@gmail.com', + _timestamp: 1571043797, + anonymous_id: 'dummy-100-anon', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'dummy-user-id-100', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 43', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'sources', + context: { + externalId: [ + { + id: 'xaviercharles@hotmail.com', + identifierType: 'email', + type: 'CUSTOMERIO-customers', + }, + ], + mappedToDestination: 'true', + sources: { + batch_id: '3d6f7aa8-9b70-4759-970d-212e6714ad22', + job_id: '1zDgnw7ZmHWR7gtY4niHYysL3zS/Syncher', + job_run_id: 'c5shebbh9jqg10k8d21g', + task_id: 'tt_10_rows', + task_run_id: 'c5shebbh9jqg10k8d220', + version: 'release.v1.6.8', + }, + }, + messageId: 'd82a45e1-5a27-4c1d-af89-83bdbc6139d0', + originalTimestamp: '2021-10-27T09:09:56.673Z', + receivedAt: '2021-10-27T09:09:56.187Z', + recordId: '3', + request_ip: '10.1.85.177', + rudderId: '5b19a81b-df60-4ccd-abf0-fcfe2b7db054', + sentAt: '2021-10-27T09:09:56.673Z', + timestamp: '2021-10-27T09:09:56.186Z', + traits: { + last_name: 'xavier', + first_name: 'charles', + }, + type: 'identify', + userId: 'xaviercharles@hotmail.com', + }, + destination: { + ID: '1zgXcyv272oZA8HWqe7zInhJjPL', + Name: 'ere', + DestinationDefinition: { + ID: '1iVQr671C0E8MVpzvCEegsLM2J5', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU'], + web: ['useNativeSDK'], + }, + excludeKeys: [], + includeKeys: ['apiKey', 'siteID', 'datacenterEU'], + saveDestinationResponse: true, + secretKeys: [], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + ], + supportsVisualMapper: true, + transformAt: 'processor', + }, + ResponseRules: null, + }, + Config: { + apiKey: 'a292d85ac36de15fc219', + datacenter: 'US', + siteID: 'eead090ab9e2e35004dc', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + libraries: [], + request: { + query: {}, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://track.customer.io/api/v1/customers/xaviercharles@hotmail.com', + headers: { + Authorization: 'Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=', + }, + params: {}, + body: { + JSON: { + last_name: 'xavier', + first_name: 'charles', + email: 'xaviercharles@hotmail.com', + _timestamp: 1635325796, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'xaviercharles@hotmail.com', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 44', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'sources', + context: { + externalId: [ + { + id: 'xaviercharles', + identifierType: 'id', + type: 'CUSTOMERIO-customers', + }, + ], + mappedToDestination: 'true', + sources: { + batch_id: '3d6f7aa8-9b70-4759-970d-212e6714ad22', + job_id: '1zDgnw7ZmHWR7gtY4niHYysL3zS/Syncher', + job_run_id: 'c5shebbh9jqg10k8d21g', + task_id: 'tt_10_rows', + task_run_id: 'c5shebbh9jqg10k8d220', + version: 'release.v1.6.8', + }, + }, + messageId: 'd82a45e1-5a27-4c1d-af89-83bdbc6139d0', + originalTimestamp: '2021-10-27T09:09:56.673Z', + receivedAt: '2021-10-27T09:09:56.187Z', + recordId: '3', + request_ip: '10.1.85.177', + rudderId: '5b19a81b-df60-4ccd-abf0-fcfe2b7db054', + sentAt: '2021-10-27T09:09:56.673Z', + traits: { + last_name: 'xavier', + first_name: 'charles', + }, + type: 'identify', + userId: 'xaviercharles', + }, + destination: { + ID: '1zgXcyv272oZA8HWqe7zInhJjPL', + Name: 'ere', + DestinationDefinition: { + ID: '1iVQr671C0E8MVpzvCEegsLM2J5', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU'], + web: ['useNativeSDK'], + }, + excludeKeys: [], + includeKeys: ['apiKey', 'siteID', 'datacenterEU'], + saveDestinationResponse: true, + secretKeys: [], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + ], + supportsVisualMapper: true, + transformAt: 'processor', + }, + ResponseRules: null, + }, + Config: { + apiKey: 'a292d85ac36de15fc219', + datacenter: 'US', + siteID: 'eead090ab9e2e35004dc', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + libraries: [], + request: { + query: {}, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://track.customer.io/api/v1/customers/xaviercharles', + headers: { + Authorization: 'Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=', + }, + params: {}, + body: { + JSON: { + last_name: 'xavier', + first_name: 'charles', + id: 'xaviercharles', + _timestamp: 1635325796, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'xaviercharles', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 45', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'Application Opened', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + timestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:35:30.556+05:30', + request_ip: '[::1]', + rudderId: '423cdf83-0448-4a99-b14d-36fcc63e6ea0', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + from_background: false, + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 46', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'Application Opened', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:39:04.424+05:30', + request_ip: '[::1]', + rudderId: '423cdf83-0448-4a99-b14d-36fcc63e6ea0', + sentAt: '2022-01-10T10:00:26.982Z', + timestamp: '2022-01-10T20:39:03.955+05:30', + type: 'track', + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + data: { + from_background: false, + }, + name: 'Application Opened', + type: 'event', + timestamp: 1641827343, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 47', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + }, + }, + event: 'Application Opened', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:41:30.970+05:30', + request_ip: '[::1]', + rudderId: '423cdf83-0448-4a99-b14d-36fcc63e6ea0', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + from_background: false, + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 48', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'Application Opened', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:44:52.784+05:30', + request_ip: '[::1]', + rudderId: '0aef312c-0dc0-4a49-b613-4f33fb4e9b46', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + from_background: false, + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 49', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'Application Opened', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + timestamp: '2022-01-10T10:00:26.513Z', + receivedAt: '2022-01-10T20:47:36.180+05:30', + request_ip: '[::1]', + rudderId: '0aef312c-0dc0-4a49-b613-4f33fb4e9b46', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 50', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'device_token_registered', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:49:05.795+05:30', + request_ip: '[::1]', + rudderId: '423cdf83-0448-4a99-b14d-36fcc63e6ea0', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + from_background: false, + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 51', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'device_token_registered', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:50:17.090+05:30', + request_ip: '[::1]', + rudderId: '423cdf83-0448-4a99-b14d-36fcc63e6ea0', + sentAt: '2022-01-10T10:00:26.982Z', + timestamp: '2022-01-10T20:50:16.621+05:30', + type: 'track', + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + data: { + from_background: false, + }, + name: 'device_token_registered', + type: 'event', + timestamp: 1641828016, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 52', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + }, + }, + event: 'device_token_registered', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:52:19.147+05:30', + request_ip: '[::1]', + rudderId: '423cdf83-0448-4a99-b14d-36fcc63e6ea0', + sentAt: '2022-01-10T10:00:26.982Z', + timestamp: '2022-01-10T20:52:18.678+05:30', + type: 'track', + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + from_background: false, + id: 'deviceToken', + platform: 'ios', + last_used: 1641828138, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 53', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'device_token_registered', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:53:43.680+05:30', + request_ip: '[::1]', + rudderId: '0aef312c-0dc0-4a49-b613-4f33fb4e9b46', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + from_background: false, + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 54', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + }, + event: 'device_token_registered', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + receivedAt: '2022-01-10T20:55:03.845+05:30', + request_ip: '[::1]', + rudderId: '0aef312c-0dc0-4a49-b613-4f33fb4e9b46', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 55', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'check for ipados apple family and default it to ios', + message: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'zx_userid_missing', + namespace: 'org.reactjs.native.example.zx-userid-missing', + version: '1.0', + }, + device: { + attTrackingStatus: 0, + id: '5d727a3e-a72b-4d00-8078-669c1494791d', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPhone 13', + token: 'deviceToken', + type: 'ipados', + }, + library: { + name: 'rudder-ios-library', + version: '1.3.1', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '15.2', + }, + screen: { + density: 3, + height: 390, + width: 844, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '5d727a3e-a72b-4d00-8078-669c1494791d', + email: 'sofia@gmail.com', + login_status: 'Authenticated', + name: 'Sofia', + phone_verified: 1, + selected_city: '', + selected_lat: 0, + selected_long: 0, + selected_neighborhood: '', + selected_number: '', + selected_postal_code: '', + selected_state: '', + selected_street: '', + signed_up_for_newsletters: 0, + }, + }, + event: 'Application Opened', + integrations: { + All: true, + }, + messageId: '1641808826-28d23237-f4f0-4f65-baa2-99141e422a8f', + originalTimestamp: '2022-01-10T10:00:26.513Z', + properties: { + from_background: false, + }, + receivedAt: '2022-01-10T20:41:30.970+05:30', + request_ip: '[::1]', + rudderId: '423cdf83-0448-4a99-b14d-36fcc63e6ea0', + sentAt: '2022-01-10T10:00:26.982Z', + type: 'track', + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'DESAU SAI', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'DESU SAI', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: + 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', + headers: { + Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + }, + params: {}, + body: { + JSON: { + device: { + from_background: false, + id: 'deviceToken', + platform: 'ios', + last_used: 1641808826, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e91e0378-63fe-11ec-82ac-0a028ee659c3', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 56', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'successful group call with identify action', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.0-beta.2', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + groupId: 'group@1', + integrations: { + All: true, + }, + traits: { + domainNames: 'rudderstack.com', + email: 'help@rudderstack.com', + name: 'rudderstack', + action: 'identify', + }, + type: 'group', + userId: 'user@1', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'ef32c3f60fb98f39ef35', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'c0efdbd20b9fbe24a7e2', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v2/batch', + headers: { + Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + }, + params: {}, + body: { + XML: {}, + FORM: {}, + JSON: { + type: 'object', + action: 'identify', + attributes: { + name: 'rudderstack', + email: 'help@rudderstack.com', + domainNames: 'rudderstack.com', + }, + identifiers: { + object_id: 'group@1', + object_type_id: '1', + }, + cio_relationships: [ + { + identifiers: { + id: 'user@1', + }, + }, + ], + }, + JSON_ARRAY: {}, + }, + files: {}, + userId: 'user@1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 57', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'successful group call with delete action', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.0-beta.2', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + groupId: 'group@1', + integrations: { + All: true, + }, + traits: { + domainNames: 'rudderstack.com', + email: 'help@rudderstack.com', + name: 'rudderstack', + action: 'delete', + }, + type: 'group', + userId: 'user@1', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'ef32c3f60fb98f39ef35', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'c0efdbd20b9fbe24a7e2', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v2/batch', + headers: { + Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + }, + params: {}, + body: { + XML: {}, + FORM: {}, + JSON: { + type: 'object', + action: 'delete', + attributes: { + name: 'rudderstack', + email: 'help@rudderstack.com', + domainNames: 'rudderstack.com', + }, + identifiers: { + object_id: 'group@1', + object_type_id: '1', + }, + cio_relationships: [ + { + identifiers: { + id: 'user@1', + }, + }, + ], + }, + JSON_ARRAY: {}, + }, + files: {}, + userId: 'user@1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 58', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'successful group call with add_relationships action', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.0-beta.2', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'test@rudderstack.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + groupId: 'group@1', + integrations: { + All: true, + }, + traits: { + domainNames: 'rudderstack.com', + email: 'help@rudderstack.com', + name: 'rudderstack', + action: 'add_relationships', + }, + type: 'group', + userId: 'user@1', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'ef32c3f60fb98f39ef35', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'c0efdbd20b9fbe24a7e2', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v2/batch', + headers: { + Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + }, + params: {}, + body: { + XML: {}, + FORM: {}, + JSON: { + type: 'object', + action: 'add_relationships', + attributes: { + name: 'rudderstack', + email: 'help@rudderstack.com', + domainNames: 'rudderstack.com', + }, + identifiers: { + object_id: 'group@1', + object_type_id: '1', + }, + cio_relationships: [ + { + identifiers: { + id: 'user@1', + }, + }, + ], + }, + JSON_ARRAY: {}, + }, + files: {}, + userId: 'user@1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 59', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'successful group call with delete_relationships action', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.0-beta.2', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'test@rudderstack.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + groupId: 'group@1', + integrations: { + All: true, + }, + traits: { + domainNames: 'rudderstack.com', + email: 'help@rudderstack.com', + name: 'rudderstack', + action: 'delete_relationships', + }, + type: 'group', + userId: 'user@1', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'ef32c3f60fb98f39ef35', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'c0efdbd20b9fbe24a7e2', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v2/batch', + headers: { + Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + }, + params: {}, + body: { + XML: {}, + FORM: {}, + JSON: { + type: 'object', + action: 'delete_relationships', + attributes: { + name: 'rudderstack', + email: 'help@rudderstack.com', + domainNames: 'rudderstack.com', + }, + identifiers: { + object_id: 'group@1', + object_type_id: '1', + }, + cio_relationships: [ + { + identifiers: { + id: 'user@1', + }, + }, + ], + }, + JSON_ARRAY: {}, + }, + files: {}, + userId: 'user@1', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 60', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'successful group call with userId and groupId as an integer', + message: { + type: 'group', + header: { + 'content-type': 'application/json; charset=utf-8', + }, + sentAt: '2023-03-28T09:36:49.882Z', + traits: { + city: 'Frankfurt', + name: 'rudder test', + state: 'Hessen', + isFake: true, + address: 'Solmsstraße 83', + country: 'DE', + website: 'http://www.rudderstack.com', + industry: 'Waste and recycling', + postcode: '60486', + whiteLabel: 'rudderlabs', + maxNbJobBoards: 2, + organisationId: 306, + pricingPackage: 'packageExpert', + dateProTrialEnd: '2022-08-31T00:00:00+00:00', + isProTrialActive: true, + datetimeRegistration: '2020-07-01T10:23:41+00:00', + isPersonnelServiceProvider: false, + }, + userId: 432, + channel: 'server', + context: { + library: { + name: 'rudder-analytics-php', + version: '2.0.1', + consumer: 'LibCurl', + }, + }, + groupId: 306, + rudderId: 'f5b46a12-2dab-4e24-a127-7316eed414fc', + messageId: '7032394c-e813-4737-bf52-622dbcefe849', + receivedAt: '2023-03-28T09:36:48.296Z', + request_ip: '18.195.235.225', + originalTimestamp: '2023-03-28T09:36:49.882Z', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'ef32c3f60fb98f39ef35', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'c0efdbd20b9fbe24a7e2', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v2/batch', + headers: { + Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + }, + params: {}, + body: { + XML: {}, + FORM: {}, + JSON: { + type: 'object', + action: 'identify', + attributes: { + city: 'Frankfurt', + name: 'rudder test', + state: 'Hessen', + isFake: true, + address: 'Solmsstraße 83', + country: 'DE', + website: 'http://www.rudderstack.com', + industry: 'Waste and recycling', + postcode: '60486', + whiteLabel: 'rudderlabs', + maxNbJobBoards: 2, + organisationId: 306, + pricingPackage: 'packageExpert', + dateProTrialEnd: '2022-08-31T00:00:00+00:00', + isProTrialActive: true, + datetimeRegistration: '2020-07-01T10:23:41+00:00', + isPersonnelServiceProvider: false, + }, + identifiers: { + object_id: '306', + object_type_id: '1', + }, + cio_relationships: [ + { + identifiers: { + id: '432', + }, + }, + ], + }, + JSON_ARRAY: {}, + }, + files: {}, + userId: '432', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 61', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'successful group call with userId in email format ', + message: { + type: 'group', + header: { + 'content-type': 'application/json; charset=utf-8', + }, + sentAt: '2023-03-28T09:36:49.882Z', + traits: { + city: 'Frankfurt', + name: 'rudder test', + state: 'Hessen', + isFake: true, + address: 'Solmsstraße 83', + country: 'DE', + website: 'http://www.rudderstack.com', + industry: 'Waste and recycling', + postcode: '60486', + whiteLabel: 'rudderlabs', + maxNbJobBoards: 2, + organisationId: 306, + pricingPackage: 'packageExpert', + dateProTrialEnd: '2022-08-31T00:00:00+00:00', + isProTrialActive: true, + datetimeRegistration: '2020-07-01T10:23:41+00:00', + isPersonnelServiceProvider: false, + }, + userId: 'abc@xyz.com', + channel: 'server', + context: { + library: { + name: 'rudder-analytics-php', + version: '2.0.1', + consumer: 'LibCurl', + }, + }, + groupId: 306, + rudderId: 'f5b46a12-2dab-4e24-a127-7316eed414fc', + messageId: '7032394c-e813-4737-bf52-622dbcefe849', + receivedAt: '2023-03-28T09:36:48.296Z', + request_ip: '18.195.235.225', + originalTimestamp: '2023-03-28T09:36:49.882Z', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'ef32c3f60fb98f39ef35', + datacenter: 'US', + deviceTokenEventName: 'device_token_registered', + siteID: 'c0efdbd20b9fbe24a7e2', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track.customer.io/api/v2/batch', + headers: { + Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + }, + params: {}, + body: { + XML: {}, + FORM: {}, + JSON: { + type: 'object', + action: 'identify', + attributes: { + city: 'Frankfurt', + name: 'rudder test', + state: 'Hessen', + isFake: true, + address: 'Solmsstraße 83', + country: 'DE', + website: 'http://www.rudderstack.com', + industry: 'Waste and recycling', + postcode: '60486', + whiteLabel: 'rudderlabs', + maxNbJobBoards: 2, + organisationId: 306, + pricingPackage: 'packageExpert', + dateProTrialEnd: '2022-08-31T00:00:00+00:00', + isProTrialActive: true, + datetimeRegistration: '2020-07-01T10:23:41+00:00', + isPersonnelServiceProvider: false, + }, + identifiers: { + object_id: '306', + object_type_id: '1', + }, + cio_relationships: [ + { + identifiers: { + email: 'abc@xyz.com', + }, + }, + ], + }, + JSON_ARRAY: {}, + }, + files: {}, + userId: 'abc@xyz.com', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 62', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: 'successful group call with eu as data center', + message: { + type: 'group', + header: { + 'content-type': 'application/json; charset=utf-8', + }, + sentAt: '2023-03-28T09:36:49.882Z', + traits: { + city: 'Frankfurt', + name: 'rudder test', + state: 'Hessen', + isFake: true, + address: 'Solmsstraße 83', + country: 'DE', + website: 'http://www.rudderstack.com', + industry: 'Waste and recycling', + postcode: '60486', + whiteLabel: 'rudderlabs', + maxNbJobBoards: 2, + organisationId: 306, + pricingPackage: 'packageExpert', + dateProTrialEnd: '2022-08-31T00:00:00+00:00', + isProTrialActive: true, + datetimeRegistration: '2020-07-01T10:23:41+00:00', + isPersonnelServiceProvider: false, + }, + userId: 432, + channel: 'server', + context: { + library: { + name: 'rudder-analytics-php', + version: '2.0.1', + consumer: 'LibCurl', + }, + }, + groupId: 306, + rudderId: 'f5b46a12-2dab-4e24-a127-7316eed414fc', + messageId: '7032394c-e813-4737-bf52-622dbcefe849', + receivedAt: '2023-03-28T09:36:48.296Z', + request_ip: '18.195.235.225', + originalTimestamp: '2023-03-28T09:36:49.882Z', + }, + destination: { + ID: '23Mi76khsFhY7bh9ZyRcvR3pHDt', + Name: 'Customer IO Dev', + DestinationDefinition: { + ID: '23MgSlHXsPLsiH7SbW7IzCP32fn', + Name: 'CUSTOMERIO', + DisplayName: 'Customer IO', + Config: { + destConfig: { + defaultConfig: ['apiKey', 'siteID', 'datacenterEU', 'deviceTokenEventName'], + web: ['useNativeSDK', 'blackListedEvents', 'whiteListedEvents'], + }, + excludeKeys: [], + includeKeys: [ + 'apiKey', + 'siteID', + 'datacenterEU', + 'blackListedEvents', + 'whiteListedEvents', + ], + saveDestinationResponse: true, + secretKeys: [], + supportedMessageTypes: ['identify', 'page', 'screen', 'track'], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'warehouse', + 'reactnative', + 'flutter', + 'cordova', + ], + supportsVisualMapper: true, + transformAt: 'processor', + transformAtV1: 'processor', + }, + ResponseRules: {}, + }, + Config: { + apiKey: 'ef32c3f60fb98f39ef35', + datacenter: 'EU', + deviceTokenEventName: 'device_token_registered', + siteID: 'c0efdbd20b9fbe24a7e2', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://track-eu.customer.io/api/v2/batch', + headers: { + Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + }, + params: {}, + body: { + XML: {}, + FORM: {}, + JSON: { + type: 'object', + action: 'identify', + attributes: { + city: 'Frankfurt', + name: 'rudder test', + state: 'Hessen', + isFake: true, + address: 'Solmsstraße 83', + country: 'DE', + website: 'http://www.rudderstack.com', + industry: 'Waste and recycling', + postcode: '60486', + whiteLabel: 'rudderlabs', + maxNbJobBoards: 2, + organisationId: 306, + pricingPackage: 'packageExpert', + dateProTrialEnd: '2022-08-31T00:00:00+00:00', + isProTrialActive: true, + datetimeRegistration: '2020-07-01T10:23:41+00:00', + isPersonnelServiceProvider: false, + }, + identifiers: { + object_id: '306', + object_type_id: '1', + }, + cio_relationships: [ + { + identifiers: { + id: '432', + }, + }, + ], + }, + JSON_ARRAY: {}, + }, + files: {}, + userId: '432', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 63', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'page', + data: { + url: 'www.rudderlabs.com', + path: '/test', + search: 'abc', + referrer: 'Rudder', + title: 'Test Page', + }, + timestamp: 1571051718, + name: 'www.rudderlabs.com', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 64', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'page', + data: { + path: '/test', + search: 'abc', + referrer: 'Rudder', + title: 'Test Page', + }, + timestamp: 1571051718, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'Test 65', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'test@rudderstack.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + type: 'page', + timestamp: 1571051718, + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://track.customer.io/api/v1/customers/12345/events', + userId: '12345', + headers: { + Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/facebook_offline_conversions/processor/data.ts b/test/integrations/destinations/facebook_offline_conversions/processor/data.ts index 2728d52193..26d9a5e2f9 100644 --- a/test/integrations/destinations/facebook_offline_conversions/processor/data.ts +++ b/test/integrations/destinations/facebook_offline_conversions/processor/data.ts @@ -1,1775 +1,1798 @@ export const data = [ - { - "name": "facebook_offline_conversions", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "traits": { - "age": 23, - "email": "adc@test.com", - "firstname": "Test", - "birthday": "2022-05-13T12:51:01.470Z" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "event": "Product Searched", - "originalTimestamp": "2020-09-22T14:42:44.724Z", - "timestamp": "2022-09-22T20:12:44.757+05:30", - "userId": "user@1" - }, - "destination": { - "Config": { - "accessToken": "ABC..." - } - }, - "metadata": { - "secret": { - "access_token": "ABC" - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "ABC" - } - }, - "statusCode": 400, - "error": "Message Type is not present. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "FACEBOOK_OFFLINE_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "traits": { - "age": 23, - "email": "adc@test.com", - "firstname": "Test", - "birthday": "2022-05-13T12:51:01.470Z" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "event": "Product Searched", - "type": "identify", - "originalTimestamp": "2020-09-22T14:42:44.724Z", - "timestamp": "2022-09-22T20:12:44.757+05:30", - "userId": "user@1" - }, - "destination": { - "Config": { - "accessToken": "ABC..." - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Message type identify not supported.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "FACEBOOK_OFFLINE_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "abc": "1234" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "product searched", - "properties": { - "order_id": "5241735", - "value": 31.98, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "GBP", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Viewed" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - }, - { - "from": "AddToWishlist", - "to": "506289934669334" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Please Map Your Standard Events With Event Set Ids", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "FACEBOOK_OFFLINE_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "abc": "1234" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Button Clicked", - "properties": { - "order_id": "5241735", - "value": 31.98, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "GBP", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Viewed" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "statusCode": 400, - "error": "Please Map Your Standard Events With Event Set Ids", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "FACEBOOK_OFFLINE_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Product Viewed", - "properties": { - "order_id": "5241735", - "value": 31.98, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "GBP", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Viewed" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ], - "isHashRequired": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/1166826033904512/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Viewed%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Product Searched", - "properties": { - "order_id": "5241735", - "value": 31.98, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "GBP", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Viewed" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ], - "isHashRequired": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/582603376981640/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22Search%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/506289934669334/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22Search%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Product Searched", - "properties": { - "order_id": "5241735", - "value": 31.98, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "GBP", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Searched" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ], - "isHashRequired": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/582603376981640/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/506289934669334/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/1166826033904512/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Product Searched", - "properties": { - "upload_tag": "test campaign", - "order_id": "5241735", - "value": 31.98, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "GBP", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Searched" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ], - "isHashRequired": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/582603376981640/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/506289934669334/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/1166826033904512/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "email": "test@rudderstack.com", - "birthday": "2005-01-01T23:28:56.782Z", - "firstName": "test", - "name": "test rudderlabs", - "address": { - "city": "kalkata", - "state": "west bangal", - "country": "india", - "zip": "123456" - }, - "phone": "9886775586", - "gender": "male" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - }, - "device": { - "advertisingId": "apple@123" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Cart Checkout", - "properties": { - "upload_tag": "test campaign", - "order_id": "485893487985894998", - "value": 100, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "IND", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Searched" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ], - "isHashRequired": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/1148872185708962/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22doby%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobm%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobd%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22phone%22%3A%5B%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%5D%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%5B%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%5D%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22order_id%22%3A%22485893487985894998%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Cart%20Checkout%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22phone%22%3A%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%22485893487985894998%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22AddToCart%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "email": "test@rudderstack.com", - "birthday": "2005-01-01T23:28:56.782Z", - "firstName": "test", - "name": "test rudderlabs", - "address": { - "city": "kalkata", - "state": "west bangal", - "country": "india", - "zip": "123456" - }, - "phone": "9886775586", - "gender": "male" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - }, - "device": { - "advertisingId": "apple@123" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Cart Checkout", - "properties": { - "upload_tag": "test campaign", - "order_id": "485893487985894998", - "value": 100, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "IND", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Searched" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ], - "isHashRequired": false - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/1148872185708962/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22doby%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobm%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobd%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%22test%40rudderstack.com%22%5D%2C%22phone%22%3A%5B%229886775586%22%5D%2C%22gen%22%3A%22male%22%2C%22fn%22%3A%22test%22%2C%22ct%22%3A%22kalkata%22%2C%22zip%22%3A%5B%22123456%22%5D%2C%22madid%22%3A%22apple%40123%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22ln%22%3A%22rudderlabs%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22order_id%22%3A%22485893487985894998%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Cart%20Checkout%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22email%22%3A%22test%40rudderstack.com%22%2C%22phone%22%3A%229886775586%22%2C%22gen%22%3A%22male%22%2C%22fn%22%3A%22test%22%2C%22ct%22%3A%22kalkata%22%2C%22zip%22%3A%22123456%22%2C%22madid%22%3A%22apple%40123%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%22485893487985894998%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22ln%22%3A%22rudderlabs%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22AddToCart%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "facebook_offline_conversions", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.2" - }, - "traits": { - "email": "test@rudderstack.com", - "birthday": "2005-01-01T23:28:56.782Z", - "firstName": "test", - "name": "test rudderlabs", - "address": { - "city": "kalkata", - "state": "west bangal", - "country": "india", - "zip": "123456" - }, - "phone": "9886775586", - "gender": "male" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.2" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36", - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/ecomm_test.html", - "referrer": "http://0.0.0.0:1112/tests/html/", - "search": "", - "title": "Fb Offline Conversion Ecommerce Test", - "url": "http://0.0.0.0:1112/tests/html/ecomm_test.html" - }, - "device": { - "advertisingId": "apple@123" - } - }, - "integrations": { - "FacebookOfflineConversions": { - "contentType": "e-commerce" - } - }, - "type": "track", - "messageId": "9116b734-7e6b-4497-ab51-c16744d4487e", - "originalTimestamp": "2022-09-21T12:05:19.394Z", - "userId": "user@1", - "event": "Cart Checkout", - "properties": { - "upload_tag": "test campaign", - "order_id": "485893487985894998", - "value": 100, - "revenue": 31.98, - "shipping": 4, - "coupon": "APPARELSALE", - "currency": "IND", - "products": [ - { - "id": "product-bacon-jam", - "category": "Merch", - "brand": "" - }, - { - "id": "product-t-shirt", - "category": "Merch", - "brand": "Levis" - }, - { - "id": "offer-t-shirt", - "category": "Merch", - "brand": "Levis" - } - ] - } - }, - "destination": { - "Config": { - "accessToken": "ABC...", - "valueFieldIdentifier": "properties.price", - "eventsToStandard": [ - { - "from": "Product Searched", - "to": "Search" - }, - { - "to": "ViewContent", - "from": "Product Searched" - }, - { - "to": "AddToCart", - "from": "Cart Checkout" - }, - { - "to": "AddPaymentInfo", - "from": "Card Details Added" - }, - { - "to": "Lead", - "from": "Order Completed" - }, - { - "to": "CompleteRegistration", - "from": "Signup" - }, - { - "to": "AddToWishlist", - "from": "Button Clicked" - } - ], - "eventsToIds": [ - { - "from": "Search", - "to": "582603376981640" - }, - { - "from": "Search", - "to": "506289934669334" - }, - { - "from": "ViewContent", - "to": "1166826033904512" - }, - { - "from": "AddToCart", - "to": "1148872185708962" - }, - { - "from": "CompleteRegistration", - "to": "597443908839411" - }, - { - "from": "Lead", - "to": "1024592094903800" - } - ], - "categoryToContent": [ - { - "from": "", - "to": "" - } - ], - "isHashRequired": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://graph.facebook.com/v16.0/1148872185708962/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22doby%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobm%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobd%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22phone%22%3A%5B%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%5D%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%5B%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%5D%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22order_id%22%3A%22485893487985894998%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Cart%20Checkout%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22phone%22%3A%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%22485893487985894998%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22AddToCart%22%2C%22content_type%22%3A%22e-commerce%22%7D%5D&access_token=ABC...", - "headers": {}, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'facebook_offline_conversions', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + traits: { + age: 23, + email: 'adc@test.com', + firstname: 'Test', + birthday: '2022-05-13T12:51:01.470Z', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36', + }, + event: 'Product Searched', + originalTimestamp: '2020-09-22T14:42:44.724Z', + timestamp: '2022-09-22T20:12:44.757+05:30', + userId: 'user@1', + }, + destination: { + Config: { + accessToken: 'ABC...', + }, + }, + metadata: { + secret: { + access_token: 'ABC', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'ABC', + }, + }, + statusCode: 400, + error: 'Message Type is not present. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'FACEBOOK_OFFLINE_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + traits: { + age: 23, + email: 'adc@test.com', + firstname: 'Test', + birthday: '2022-05-13T12:51:01.470Z', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36', + }, + event: 'Product Searched', + type: 'identify', + originalTimestamp: '2020-09-22T14:42:44.724Z', + timestamp: '2022-09-22T20:12:44.757+05:30', + userId: 'user@1', + }, + destination: { + Config: { + accessToken: 'ABC...', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Message type identify not supported.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'FACEBOOK_OFFLINE_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + abc: '1234', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'product searched', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Viewed', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + { + from: 'AddToWishlist', + to: '506289934669334', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Please Map Your Standard Events With Event Set Ids', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'FACEBOOK_OFFLINE_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + abc: '1234', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Button Clicked', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Viewed', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Please Map Your Standard Events With Event Set Ids', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'FACEBOOK_OFFLINE_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + email: 'test@rudderstack.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Product Viewed', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Viewed', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + isHashRequired: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/1166826033904512/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Viewed%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + email: 'test@rudderstack.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Product Searched', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Viewed', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + isHashRequired: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/582603376981640/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22Search%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/506289934669334/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22Search%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + email: 'test@rudderstack.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Product Searched', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Searched', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + isHashRequired: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/582603376981640/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/506289934669334/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/1166826033904512/events?upload_tag=rudderstack&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + email: 'test@rudderstack.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Product Searched', + properties: { + upload_tag: 'test campaign', + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Searched', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + isHashRequired: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/582603376981640/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/506289934669334/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/1166826033904512/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22order_id%22%3A%225241735%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Product%20Searched%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22GBP%22%2C%22value%22%3A31.98%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%225241735%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22ViewContent%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + email: 'test@rudderstack.com', + birthday: '2005-01-01T23:28:56.782Z', + firstName: 'test', + name: 'test rudderlabs', + address: { + city: 'kalkata', + state: 'west bangal', + country: 'india', + zip: '123456', + }, + phone: '9886775586', + gender: 'male', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + device: { + advertisingId: 'apple@123', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Cart Checkout', + properties: { + upload_tag: 'test campaign', + order_id: '485893487985894998', + value: 100, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'IND', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Searched', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + isHashRequired: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/1148872185708962/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22doby%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobm%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobd%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22phone%22%3A%5B%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%5D%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%5B%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%5D%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22order_id%22%3A%22485893487985894998%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Cart%20Checkout%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22phone%22%3A%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%22485893487985894998%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22AddToCart%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + email: 'test@rudderstack.com', + birthday: '2005-01-01T23:28:56.782Z', + firstName: 'test', + name: 'test rudderlabs', + address: { + city: 'kalkata', + state: 'west bangal', + country: 'india', + zip: '123456', + }, + phone: '9886775586', + gender: 'male', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + device: { + advertisingId: 'apple@123', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Cart Checkout', + properties: { + upload_tag: 'test campaign', + order_id: '485893487985894998', + value: 100, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'IND', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Searched', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + isHashRequired: false, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/1148872185708962/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22doby%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobm%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobd%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%22test%40rudderstack.com%22%5D%2C%22phone%22%3A%5B%229886775586%22%5D%2C%22gen%22%3A%22male%22%2C%22fn%22%3A%22test%22%2C%22ct%22%3A%22kalkata%22%2C%22zip%22%3A%5B%22123456%22%5D%2C%22madid%22%3A%22apple%40123%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22ln%22%3A%22rudderlabs%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22order_id%22%3A%22485893487985894998%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Cart%20Checkout%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22email%22%3A%22test%40rudderstack.com%22%2C%22phone%22%3A%229886775586%22%2C%22gen%22%3A%22male%22%2C%22fn%22%3A%22test%22%2C%22ct%22%3A%22kalkata%22%2C%22zip%22%3A%22123456%22%2C%22madid%22%3A%22apple%40123%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%22485893487985894998%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22ln%22%3A%22rudderlabs%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22AddToCart%22%2C%22content_type%22%3A%22product%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'facebook_offline_conversions', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { + email: 'test@rudderstack.com', + birthday: '2005-01-01T23:28:56.782Z', + firstName: 'test', + name: 'test rudderlabs', + address: { + city: 'kalkata', + state: 'west bangal', + country: 'india', + zip: '123456', + }, + phone: '9886775586', + gender: 'male', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.2', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'Fb Offline Conversion Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + device: { + advertisingId: 'apple@123', + }, + }, + integrations: { + FacebookOfflineConversions: { + contentType: 'e-commerce', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2022-09-21T12:05:19.394Z', + userId: 'user@1', + event: 'Cart Checkout', + properties: { + upload_tag: 'test campaign', + order_id: '485893487985894998', + value: 100, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'IND', + products: [ + { + id: 'product-bacon-jam', + category: 'Merch', + brand: '', + }, + { + id: 'product-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + { + id: 'offer-t-shirt', + category: 'Merch', + brand: 'Levis', + }, + ], + }, + }, + destination: { + Config: { + accessToken: 'ABC...', + valueFieldIdentifier: 'properties.price', + eventsToStandard: [ + { + from: 'Product Searched', + to: 'Search', + }, + { + to: 'ViewContent', + from: 'Product Searched', + }, + { + to: 'AddToCart', + from: 'Cart Checkout', + }, + { + to: 'AddPaymentInfo', + from: 'Card Details Added', + }, + { + to: 'Lead', + from: 'Order Completed', + }, + { + to: 'CompleteRegistration', + from: 'Signup', + }, + { + to: 'AddToWishlist', + from: 'Button Clicked', + }, + ], + eventsToIds: [ + { + from: 'Search', + to: '582603376981640', + }, + { + from: 'Search', + to: '506289934669334', + }, + { + from: 'ViewContent', + to: '1166826033904512', + }, + { + from: 'AddToCart', + to: '1148872185708962', + }, + { + from: 'CompleteRegistration', + to: '597443908839411', + }, + { + from: 'Lead', + to: '1024592094903800', + }, + ], + categoryToContent: [ + { + from: '', + to: '', + }, + ], + isHashRequired: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://graph.facebook.com/v16.0/1148872185708962/events?upload_tag=test campaign&data=%5B%7B%22match_keys%22%3A%7B%22doby%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobm%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22dobd%22%3A%22f388bc7cd953b951ffdf8e06275d94946dc52f03ed96536497fbe534469d38d6%22%2C%22extern_id%22%3A%22user%401%22%2C%22email%22%3A%5B%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%5D%2C%22phone%22%3A%5B%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%5D%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%5B%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%5D%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%7D%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22order_id%22%3A%22485893487985894998%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22quantity%22%3A1%2C%22brand%22%3A%22Levis%22%2C%22category%22%3A%22Merch%22%7D%5D%2C%22custom_data%22%3A%7B%22extern_id%22%3A%22user%401%22%2C%22event_name%22%3A%22Cart%20Checkout%22%2C%22event_time%22%3A1663761919%2C%22currency%22%3A%22IND%22%2C%22value%22%3A100%2C%22email%22%3A%221c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd%22%2C%22phone%22%3A%2274a39482392f83119041d571d5dace439d315faea8214fe8e815c00261b80615%22%2C%22gen%22%3A%220d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf%22%2C%22fn%22%3A%229f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08%22%2C%22ct%22%3A%22375aba919c30870659093b7ddcf6045ff7a8624dd4dba49ced8981bd4d0666e0%22%2C%22zip%22%3A%228d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92%22%2C%22madid%22%3A%22c20fa16907343eef642d10f0bdb81bf629e6aaf6c906f26eabda079ca9e5ab67%22%2C%22contents%22%3A%5B%7B%22id%22%3A%22product-bacon-jam%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22%22%7D%2C%7B%22id%22%3A%22product-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%2C%7B%22id%22%3A%22offer-t-shirt%22%2C%22category%22%3A%22Merch%22%2C%22brand%22%3A%22Levis%22%7D%5D%2C%22order_id%22%3A%22485893487985894998%22%2C%22upload_tag%22%3A%22test%20campaign%22%2C%22client_user_agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010_15_3)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F83.0.4103.97%20Safari%2F537.36%22%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22ln%22%3A%22dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251%22%2C%22shipping%22%3A4%2C%22coupon%22%3A%22APPARELSALE%22%7D%2C%22event_source_url%22%3A%22http%3A%2F%2F0.0.0.0%3A1112%2Ftests%2Fhtml%2Fecomm_test.html%22%2C%22event_name%22%3A%22AddToCart%22%2C%22content_type%22%3A%22e-commerce%22%7D%5D&access_token=ABC...', + headers: {}, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts new file mode 100644 index 0000000000..e4e4a7d4c8 --- /dev/null +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts @@ -0,0 +1,585 @@ +export const data = [ + { + name: 'facebook_pixel', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654773112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Invalid OAuth 2.0 access token', + destinationResponse: { + error: { + message: 'The access token could not be decrypted', + type: 'OAuthException', + code: 190, + fbtrace_id: 'fbpixel_trace_id', + }, + status: 500, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654773112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Request Processed Successfully', + destinationResponse: { + events_received: 1, + fbtrace_id: 'facebook_trace_id', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Event Timestamp Too Old', + destinationResponse: { + error: { + message: 'Invalid parameter', + type: 'OAuthException', + code: 100, + error_subcode: 2804003, + is_transient: false, + error_user_title: 'Event Timestamp Too Old', + error_user_msg: + 'The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.', + fbtrace_id: 'A6UyEgg_HdoiRX9duxcBOjb', + }, + status: 400, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 429, + body: { + output: { + status: 429, + message: 'API User Too Many Calls', + destinationResponse: { + error: { + message: 'User request limit reached', + type: 'OAuthException', + code: 17, + fbtrace_id: 'facebook_px_trace_id_4', + }, + status: 500, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + "Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation", + destinationResponse: { + error: { + message: + "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", + type: 'GraphMethodException', + code: 100, + error_subcode: 33, + fbtrace_id: 'facebook_px_trace_id_5', + }, + status: 400, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"d58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token', + params: { + destination: 'facebook_pixel', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Invalid Parameter', + destinationResponse: { + error: { + message: 'Invalid Parameter', + type: 'GraphMethodException', + code: 100, + error_subcode: 34, + fbtrace_id: 'facebook_px_trace_id_6', + }, + status: 404, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 6', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + destination: 'facebook_pixel', + }, + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Invalid Parameter', + destinationResponse: { + error: { + message: 'Unsupported post request. some problem with sent parameters', + type: 'GraphMethodException', + code: 100, + error_subcode: 38, + fbtrace_id: 'facebook_px_trace_id_6', + }, + status: 400, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 7', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + destination: 'facebook_pixel', + }, + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Capability or permissions issue.', + destinationResponse: { + error: { + message: 'Some error in permission', + type: 'GraphMethodException', + code: 3, + error_subcode: 10, + fbtrace_id: 'facebook_px_trace_id_7', + }, + status: 500, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'facebook_pixel', + description: 'Test 8', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + body: { + XML: {}, + FORM: { + data: [ + '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + ], + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: { + destination: 'facebook_pixel', + }, + userId: '', + headers: {}, + version: '1', + endpoint: + 'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: 'Unhandled random error', + destinationResponse: { + error: { + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }, + status: 412, + }, + statTags: { + destType: 'FACEBOOK_PIXEL', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + meta: 'unhandledStatusCode', + }, + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/facebook_pixel/network.ts b/test/integrations/destinations/facebook_pixel/network.ts new file mode 100644 index 0000000000..a63970c4c6 --- /dev/null +++ b/test/integrations/destinations/facebook_pixel/network.ts @@ -0,0 +1,190 @@ +import { data } from './dataDelivery/data'; +import { getFormData } from '../../../../src/adapters/network'; + +export const networkCallsData = [ + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token', + data: getFormData(data[0].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'The access token could not be decrypted', + type: 'OAuthException', + code: 190, + fbtrace_id: 'fbpixel_trace_id', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token', + data: getFormData(data[2].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Invalid parameter', + type: 'OAuthException', + code: 100, + error_subcode: 2804003, + is_transient: false, + error_user_title: 'Event Timestamp Too Old', + error_user_msg: + 'The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.', + fbtrace_id: 'A6UyEgg_HdoiRX9duxcBOjb', + }, + }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token', + data: getFormData(data[3].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'User request limit reached', + type: 'OAuthException', + code: 17, + fbtrace_id: 'facebook_px_trace_id_4', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token', + data: getFormData(data[4].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: + "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", + type: 'GraphMethodException', + code: 100, + error_subcode: 33, + fbtrace_id: 'facebook_px_trace_id_5', + }, + }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token', + data: getFormData(data[5].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Invalid Parameter', + type: 'GraphMethodException', + code: 100, + error_subcode: 34, + fbtrace_id: 'facebook_px_trace_id_6', + }, + }, + status: 404, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token', + data: getFormData(data[6].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Unsupported post request. some problem with sent parameters', + type: 'GraphMethodException', + code: 100, + error_subcode: 38, + fbtrace_id: 'facebook_px_trace_id_6', + }, + }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token', + data: getFormData(data[7].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Some error in permission', + type: 'GraphMethodException', + code: 3, + error_subcode: 10, + fbtrace_id: 'facebook_px_trace_id_7', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response', + data: getFormData(data[8].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }, + }, + status: 412, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token', + data: getFormData(data[1].input.request.body.body.FORM).toString(), + params: { destination: 'facebook_pixel' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { events_received: 1, fbtrace_id: 'facebook_trace_id' }, + status: 200, + statusText: 'OK', + }, + }, +]; diff --git a/test/integrations/destinations/fb/dataDelivery/data.ts b/test/integrations/destinations/fb/dataDelivery/data.ts new file mode 100644 index 0000000000..70538a6ea0 --- /dev/null +++ b/test/integrations/destinations/fb/dataDelivery/data.ts @@ -0,0 +1,357 @@ +export const data = [ + { + "name": "fb", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "event": "CUSTOM_APP_EVENTS", + "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", + "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", + "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", + "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"additional_bet_index\":0,\"battle_id\":\"N/A\",\"bet_amount\":9,\"bet_level\":1,\"bet_multiplier\":1,\"coin_balance\":9466052,\"current_module_name\":\"CasinoGameModule\",\"days_in_game\":0,\"extra_param\":\"N/A\",\"fb_profile\":\"0\",\"featureGameType\":\"N/A\",\"game_fps\":30,\"game_id\":\"fireEagleBase\",\"game_name\":\"FireEagleSlots\",\"gem_balance\":0,\"graphicsQuality\":\"HD\",\"idfa\":\"2bf99787-33d2-4ae2-a76a-c49672f97252\",\"internetReachability\":\"ReachableViaLocalAreaNetwork\",\"isLowEndDevice\":\"False\",\"is_auto_spin\":\"False\",\"is_turbo\":\"False\",\"isf\":\"False\",\"ishighroller\":\"False\",\"jackpot_win_amount\":90,\"jackpot_win_type\":\"Silver\",\"level\":6,\"lifetime_gem_balance\":0,\"no_of_spin\":1,\"player_total_battles\":0,\"player_total_shields\":0,\"start_date\":\"2019-08-01\",\"total_payments\":0,\"tournament_id\":\"T1561970819\",\"userId\":\"c82cbdff-e5be-4009-ac78-cdeea09ab4b1\",\"versionSessionCount\":2,\"win_amount\":0,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0" + }, + "JSON": {} + }, + "endpoint": "https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=invalid_access_token", + "files": {}, + "headers": { + "x-forwarded-for": "1.2.3.4" + }, + "method": "POST", + "statusCode": 200, + "type": "REST", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "version": "1", + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Invalid OAuth 2.0 access token", + "destinationResponse": { + "error": { + "message": "The access token could not be decrypted", + "type": "OAuthException", + "code": 190, + "fbtrace_id": "fbpixel_trace_id" + }, + "status": 500 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "fb", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "event": "CUSTOM_APP_EVENTS", + "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", + "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", + "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", + "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"additional_bet_index\":0,\"battle_id\":\"N/A\",\"bet_amount\":9,\"bet_level\":1,\"bet_multiplier\":1,\"coin_balance\":9466052,\"current_module_name\":\"CasinoGameModule\",\"days_in_game\":0,\"extra_param\":\"N/A\",\"fb_profile\":\"0\",\"featureGameType\":\"N/A\",\"game_fps\":30,\"game_id\":\"fireEagleBase\",\"game_name\":\"FireEagleSlots\",\"gem_balance\":0,\"graphicsQuality\":\"HD\",\"idfa\":\"2bf99787-33d2-4ae2-a76a-c49672f97252\",\"internetReachability\":\"ReachableViaLocalAreaNetwork\",\"isLowEndDevice\":\"False\",\"is_auto_spin\":\"False\",\"is_turbo\":\"False\",\"isf\":\"False\",\"ishighroller\":\"False\",\"jackpot_win_amount\":90,\"jackpot_win_type\":\"Silver\",\"level\":6,\"lifetime_gem_balance\":0,\"no_of_spin\":1,\"player_total_battles\":0,\"player_total_shields\":0,\"start_date\":\"2019-08-01\",\"total_payments\":0,\"tournament_id\":\"T1561970819\",\"userId\":\"c82cbdff-e5be-4009-ac78-cdeea09ab4b1\",\"versionSessionCount\":2,\"win_amount\":0,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0" + }, + "JSON": {} + }, + "endpoint": "https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=my_access_token", + "files": {}, + "headers": { + "x-forwarded-for": "1.2.3.4" + }, + "method": "POST", + "statusCode": 200, + "type": "REST", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "version": "1", + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "events_received": 1, + "fbtrace_id": "facebook_trace_id" + } + } + } + } + } + }, + + { + "name": "fb", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "body": { + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "event": "CUSTOM_APP_EVENTS", + "advertiser_id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "ud[fn]": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", + "ud[ge]": "62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a", + "ud[ln]": "3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3", + "ud[ph]": "588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f", + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",640,480,\"1.23\",0,0,0,\"Europe/Berlin\"]", + "app_user_id": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"spin_result\",\"_valueToSum\":400,\"fb_currency\":\"GBP\",\"additional_bet_index\":0,\"battle_id\":\"N/A\",\"bet_amount\":9,\"bet_level\":1,\"bet_multiplier\":1,\"coin_balance\":9466052,\"current_module_name\":\"CasinoGameModule\",\"days_in_game\":0,\"extra_param\":\"N/A\",\"fb_profile\":\"0\",\"featureGameType\":\"N/A\",\"game_fps\":30,\"game_id\":\"fireEagleBase\",\"game_name\":\"FireEagleSlots\",\"gem_balance\":0,\"graphicsQuality\":\"HD\",\"idfa\":\"2bf99787-33d2-4ae2-a76a-c49672f97252\",\"internetReachability\":\"ReachableViaLocalAreaNetwork\",\"isLowEndDevice\":\"False\",\"is_auto_spin\":\"False\",\"is_turbo\":\"False\",\"isf\":\"False\",\"ishighroller\":\"False\",\"jackpot_win_amount\":90,\"jackpot_win_type\":\"Silver\",\"level\":6,\"lifetime_gem_balance\":0,\"no_of_spin\":1,\"player_total_battles\":0,\"player_total_shields\":0,\"start_date\":\"2019-08-01\",\"total_payments\":0,\"tournament_id\":\"T1561970819\",\"userId\":\"c82cbdff-e5be-4009-ac78-cdeea09ab4b1\",\"versionSessionCount\":2,\"win_amount\":0,\"fb_content_id\":[\"123\",\"345\",\"567\"]}]", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0" + }, + "JSON": {} + }, + "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token", + "files": {}, + "headers": { + "x-forwarded-for": "1.2.3.4" + }, + "method": "POST", + "statusCode": 200, + "type": "REST", + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "version": "1", + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Event Timestamp Too Old", + "destinationResponse": { + "error": { + "message": "Invalid parameter", + "type": "OAuthException", + "code": 100, + "error_subcode": 2804003, + "is_transient": false, + "error_user_title": "Event Timestamp Too Old", + "error_user_msg": "The timestamp for this event is too far in the past. Events need to be sent from your server within 7 days of when they occurred. Enter a timestamp that has occurred within the last 7 days.", + "fbtrace_id": "A6UyEgg_HdoiRX9duxcBOjb" + }, + "status": 400 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "fb", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token", + "headers": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",0,100,\"50.00\",0,0,0,\"\"]", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"Viewed Screen\",\"fb_description\":\"Main.1233\"}]", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0", + "event": "CUSTOM_APP_EVENTS" + } + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "statusCode": 200, + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 429, + "body": { + "output": { + "status": 429, + "message": "API User Too Many Calls", + "destinationResponse": { + "error": { + "message": "User request limit reached", + "type": "OAuthException", + "code": 17, + "fbtrace_id": "facebook_px_trace_id_4" + }, + "status": 500 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "throttled", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "fb", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token", + "headers": {}, + "body": { + "JSON": {}, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": { + "extinfo": "[\"a2\",\"\",\"\",\"\",\"8.1.0\",\"Redmi 6\",\"\",\"\",\"Banglalink\",0,100,\"50.00\",0,0,0,\"\"]", + "custom_events": "[{\"_logTime\":1567333011693,\"_eventName\":\"Viewed Screen\",\"fb_description\":\"Main.1233\"}]", + "ud[em]": "48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08", + "advertiser_tracking_enabled": "0", + "application_tracking_enabled": "0", + "event": "CUSTOM_APP_EVENTS" + } + }, + "files": {}, + "userId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", + "statusCode": 200, + "params": { + "destination": "fb" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "status": 400, + "message": "Object with ID 'PIXEL_ID' does not exist, cannot be loaded due to missing permissions, or does not support this operation", + "destinationResponse": { + "error": { + "message": "Unsupported post request. Object with ID '1234567891234569' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api", + "type": "GraphMethodException", + "code": 100, + "error_subcode": 33, + "fbtrace_id": "facebook_px_trace_id_5" + }, + "status": 400 + }, + "statTags": { + "destType": "FB", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/fb/network.ts b/test/integrations/destinations/fb/network.ts new file mode 100644 index 0000000000..07a84a7e66 --- /dev/null +++ b/test/integrations/destinations/fb/network.ts @@ -0,0 +1,55 @@ +import { cloneDeep } from 'lodash'; +import { getFormData } from '../../../../src/adapters/network'; +import * as fbPixelNw from '../facebook_pixel/network'; +import { data } from './dataDelivery/data'; + +const fbPixelTcs = data + .filter((_, i) => [2, 3, 4].includes(i)) + .map((d) => { + const fbendpoint = d.input.request.body.endpoint; + const fbpTc = fbPixelNw.networkCallsData.filter((nw) => { + return nw.httpReq.url === fbendpoint; + })[0]; + const clonedFbpTc = cloneDeep(fbpTc); + const clonedFormData = cloneDeep(d.input.request.body.body.FORM); + clonedFbpTc.httpReq.data = getFormData(clonedFormData).toString(); + return clonedFbpTc; + }); + +export const networkCallsData = [ + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=invalid_access_token', + data: getFormData(data[0].input.request.body.body.FORM).toString(), + params: { destination: 'fb' }, + headers: { 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { + error: { + message: 'The access token could not be decrypted', + type: 'OAuthException', + code: 190, + fbtrace_id: 'fbpixel_trace_id', + }, + }, + status: 500, + }, + }, + { + httpReq: { + url: 'https://graph.facebook.com/v17.0/RudderFbApp/activities?access_token=my_access_token', + data: getFormData(data[1].input.request.body.body.FORM).toString(), + params: { destination: 'fb' }, + headers: { 'x-forwarded-for': '1.2.3.4', 'User-Agent': 'RudderLabs' }, + method: 'POST', + }, + httpRes: { + data: { events_received: 1, fbtrace_id: 'facebook_trace_id' }, + status: 200, + statusText: 'OK', + }, + }, + ...fbPixelTcs, +]; diff --git a/test/integrations/destinations/firehose/processor/data.ts b/test/integrations/destinations/firehose/processor/data.ts index faa14a6a44..0fad78ccc5 100644 --- a/test/integrations/destinations/firehose/processor/data.ts +++ b/test/integrations/destinations/firehose/processor/data.ts @@ -1,858 +1,877 @@ export const data = [ - { - "name": "firehose", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "region": "us-east-1", - "accessKeyID": "abc", - "accessKey": "xyz", - "mapEvents": [ - { - "from": "track", - "to": "ruchira-test-firehose" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { "email": "ruchira@rudderlabs.com" }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { "density": 2 } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "00000000000000000000000000", - "deliveryStreamMapTo": "ruchira-test-firehose" - }, - "statusCode": 200 - } - ] - } - } - }, { - "name": "firehose", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "region": "us-east-1", - "accessKeyID": "abc", - "accessKey": "xyz", - "mapEvents": [ - { - "from": "product added", - "to": "ruchira-test-firehose" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { "email": "ruchira@rudderlabs.com" }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { "density": 2 } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "00000000000000000000000000", - "deliveryStreamMapTo": "ruchira-test-firehose" - }, - "statusCode": 200 - } - ] - } - } - }, { - "name": "firehose", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "region": "us-east-1", - "accessKeyID": "abc", - "accessKey": "xyz", - "mapEvents": [ - { - "from": "*", - "to": "ruchira-test-firehose" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { "email": "ruchira@rudderlabs.com" }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { "density": 2 } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "00000000000000000000000000", - "deliveryStreamMapTo": "ruchira-test-firehose" - }, - "statusCode": 200 - } - ] - } - } - }, { - "name": "firehose", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "region": "us-east-1", - "accessKeyID": "abc", - "accessKey": "xyz", - "mapEvents": [ - { - "from": "test event", - "to": "ruchira-test-firehose" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "No delivery stream set for this event", - "statTags": { - "destType": "FIREHOSE", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination", - }, - "statusCode": 400 - } - ] - } - } - }, { - "name": "firehose", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "region": "us-east-1", - "accessKeyID": "abc", - "accessKey": "xyz", - "mapEvents": [ - { - "from": "*", - "to": "ruchira-test-firehose" - }, - { - "from": "track", - "to": "ruchira-test-firehose-1" - }, - { - "from": "product added", - "to": "ruchira-test-firehose-2" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "00000000000000000000000000", - "deliveryStreamMapTo": "ruchira-test-firehose-2" - }, - "statusCode": 200 - } - ] - } - } - }, { - "name": "firehose", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "region": "us-east-1", - "accessKeyID": "abc", - "accessKey": "xyz", - "mapEvents": [ - { - "from": "*", - "to": "ruchira-test-firehose" - }, - { - "from": "track", - "to": "ruchira-test-firehose-1" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "00000000000000000000000000", - "deliveryStreamMapTo": "ruchira-test-firehose-1" - }, - "statusCode": 200 - } - ] - } - } - }, { - "name": "firehose", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "region": "us-east-1", - "accessKeyID": "abc", - "accessKey": "xyz", - "mapEvents": [ - { - "from": "*", - "to": "ruchira-test-firehose" - }, - { - "from": "product added", - "to": "ruchira-test-firehose-1" - } - ] - }, - "DestinationDefinition": { - "DisplayName": "firehose", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "FIREHOSE" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Braze", - "Transformations": [] - }, - "metadata": { - "sourceType": "metadata.sourceType", - "destinationType": "metadata.destinationType", - "k8_namespace": "metadata.namespace" - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "destinationType": "metadata.destinationType", - "k8_namespace": "metadata.namespace", - "sourceType": "metadata.sourceType", - }, - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "00000000000000000000000000", - "deliveryStreamMapTo": "ruchira-test-firehose" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'firehose', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + region: 'us-east-1', + accessKeyID: 'abc', + accessKey: 'xyz', + mapEvents: [ + { + from: 'track', + to: 'ruchira-test-firehose', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { email: 'ruchira@rudderlabs.com' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { density: 2 }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '00000000000000000000000000', + deliveryStreamMapTo: 'ruchira-test-firehose', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'firehose', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + region: 'us-east-1', + accessKeyID: 'abc', + accessKey: 'xyz', + mapEvents: [ + { + from: 'product added', + to: 'ruchira-test-firehose', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { email: 'ruchira@rudderlabs.com' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { density: 2 }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '00000000000000000000000000', + deliveryStreamMapTo: 'ruchira-test-firehose', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'firehose', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + region: 'us-east-1', + accessKeyID: 'abc', + accessKey: 'xyz', + mapEvents: [ + { + from: '*', + to: 'ruchira-test-firehose', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { email: 'ruchira@rudderlabs.com' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { density: 2 }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '00000000000000000000000000', + deliveryStreamMapTo: 'ruchira-test-firehose', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'firehose', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + region: 'us-east-1', + accessKeyID: 'abc', + accessKey: 'xyz', + mapEvents: [ + { + from: 'test event', + to: 'ruchira-test-firehose', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'No delivery stream set for this event', + statTags: { + destType: 'FIREHOSE', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'firehose', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + region: 'us-east-1', + accessKeyID: 'abc', + accessKey: 'xyz', + mapEvents: [ + { + from: '*', + to: 'ruchira-test-firehose', + }, + { + from: 'track', + to: 'ruchira-test-firehose-1', + }, + { + from: 'product added', + to: 'ruchira-test-firehose-2', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '00000000000000000000000000', + deliveryStreamMapTo: 'ruchira-test-firehose-2', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'firehose', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + region: 'us-east-1', + accessKeyID: 'abc', + accessKey: 'xyz', + mapEvents: [ + { + from: '*', + to: 'ruchira-test-firehose', + }, + { + from: 'track', + to: 'ruchira-test-firehose-1', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '00000000000000000000000000', + deliveryStreamMapTo: 'ruchira-test-firehose-1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'firehose', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + region: 'us-east-1', + accessKeyID: 'abc', + accessKey: 'xyz', + mapEvents: [ + { + from: '*', + to: 'ruchira-test-firehose', + }, + { + from: 'product added', + to: 'ruchira-test-firehose-1', + }, + ], + }, + DestinationDefinition: { + DisplayName: 'firehose', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'FIREHOSE', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Braze', + Transformations: [], + }, + metadata: { + sourceType: 'metadata.sourceType', + destinationType: 'metadata.destinationType', + k8_namespace: 'metadata.namespace', + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: '', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationType: 'metadata.destinationType', + k8_namespace: 'metadata.namespace', + sourceType: 'metadata.sourceType', + }, + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: '', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '00000000000000000000000000', + deliveryStreamMapTo: 'ruchira-test-firehose', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/googlepubsub/processor/data.ts b/test/integrations/destinations/googlepubsub/processor/data.ts index 7603a4c248..0dffa57839 100644 --- a/test/integrations/destinations/googlepubsub/processor/data.ts +++ b/test/integrations/destinations/googlepubsub/processor/data.ts @@ -1,1294 +1,1317 @@ export const data = [ - { - "name": "googlepubsub", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "test" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "123456", - "topicId": "test", - "attributes": {} - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "product added", - "to": "test" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "123456", - "topicId": "test", - "attributes": {} - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "*", - "to": "test" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "userId": "123456", - "topicId": "test", - "attributes": {} - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "ruchira@rudderlabs.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "id": "72e528f869711c3d", - "manufacturer": "Google", - "model": "sdk_gphone_x86", - "name": "generic_x86_arm", - "token": "some_device_token", - "type": "android" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "event": "product added", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "00000000000000000000000000", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "test event", - "to": "test" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "No topic set for this event", - "statTags": { - "destType": "GOOGLEPUBSUB", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "No topic set for this event", - "statTags": { - "destType": "GOOGLEPUBSUB", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "No topic set for this event", - "statTags": { - "destType": "GOOGLEPUBSUB", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "test" - }, - { - "from": "*", - "to": "test a" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "userId": "abcdeeeeeeeexxxx111", - "topicId": "test", - "attributes": {} - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "test" - }, - { - "from": "*", - "to": "test a" - }, - { - "from": "product added", - "to": "test b" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "userId": "abcdeeeeeeeexxxx111", - "topicId": "test b", - "attributes": {} - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "Test-Topic" - } - ], - "eventToAttributesMap": [ - { - "from": "track", - "to": "name" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "userId": "abcdeeeeeeeexxxx111", - "topicId": "Test-Topic", - "attributes": { - "name": "Pizza" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "Test-Topic" - } - ], - "eventToAttributesMap": [ - { - "from": "track", - "to": "url" - }, - { - "from": "track", - "to": "title" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "userId": "abcdeeeeeeeexxxx111", - "topicId": "Test-Topic", - "attributes": { - "url": "https://dominos.com", - "title": "Pizza" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "Test-Topic" - } - ], - "eventToAttributesMap": [ - { - "from": "track", - "to": "url" - }, - { - "from": "track", - "to": "title" - }, - { - "from": "product added", - "to": "referrer" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com" - }, - "type": "track", - "event": "product added", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "userId": "abcdeeeeeeeexxxx111", - "topicId": "Test-Topic", - "attributes": { - "referrer": "https://google.com" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 11", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com", - "nestedObject": { - "this": "will be picked" - } - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "Test-Topic" - } - ], - "eventToAttributesMap": [ - { - "from": "track", - "to": "nestedObject.this" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com", - "nestedObject": { - "this": "will be picked" - } - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "userId": "abcdeeeeeeeexxxx111", - "topicId": "Test-Topic", - "attributes": { - "this": "will be picked" - } - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlepubsub", - "description": "Test 12", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com", - "nestedObject": { - "this": "will be picked" - } - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "destination": { - "Config": { - "credentials": "abc", - "eventToTopicMap": [ - { - "from": "track", - "to": "Test-Topic" - } - ], - "eventToAttributesMap": [ - { - "from": "track", - "to": "properties.nestedObject.this" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "message": { - "sentAt": "2020-08-28T15:11:56.167Z", - "category": "Food", - "messageId": "node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba", - "anonymousId": "abcdeeeeeeeexxxx111", - "context": { - "library": { - "name": "analytics-node", - "version": "0.0.3" - } - }, - "originalTimestamp": "2020-08-28T15:11:56.162Z", - "properties": { - "url": "https://dominos.com", - "title": "Pizza", - "referrer": "https://google.com", - "nestedObject": { - "this": "will be picked" - } - }, - "type": "track", - "name": "Pizza", - "_metadata": { - "nodeVersion": "10.22.0" - } - }, - "userId": "abcdeeeeeeeexxxx111", - "topicId": "Test-Topic", - "attributes": { - "this": "will be picked" - } - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'googlepubsub', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'test', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '123456', + topicId: 'test', + attributes: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'product added', + to: 'test', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '123456', + topicId: 'test', + attributes: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: '*', + to: 'test', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + userId: '123456', + topicId: 'test', + attributes: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + id: '72e528f869711c3d', + manufacturer: 'Google', + model: 'sdk_gphone_x86', + name: 'generic_x86_arm', + token: 'some_device_token', + type: 'android', + }, + screen: { + density: 2, + }, + }, + type: 'track', + event: 'product added', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '00000000000000000000000000', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'test event', + to: 'test', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'No topic set for this event', + statTags: { + destType: 'GOOGLEPUBSUB', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: '', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'No topic set for this event', + statTags: { + destType: 'GOOGLEPUBSUB', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: '', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'No topic set for this event', + statTags: { + destType: 'GOOGLEPUBSUB', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'test', + }, + { + from: '*', + to: 'test a', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + userId: 'abcdeeeeeeeexxxx111', + topicId: 'test', + attributes: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'test', + }, + { + from: '*', + to: 'test a', + }, + { + from: 'product added', + to: 'test b', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + userId: 'abcdeeeeeeeexxxx111', + topicId: 'test b', + attributes: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'Test-Topic', + }, + ], + eventToAttributesMap: [ + { + from: 'track', + to: 'name', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + userId: 'abcdeeeeeeeexxxx111', + topicId: 'Test-Topic', + attributes: { + name: 'Pizza', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'Test-Topic', + }, + ], + eventToAttributesMap: [ + { + from: 'track', + to: 'url', + }, + { + from: 'track', + to: 'title', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + userId: 'abcdeeeeeeeexxxx111', + topicId: 'Test-Topic', + attributes: { + url: 'https://dominos.com', + title: 'Pizza', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'Test-Topic', + }, + ], + eventToAttributesMap: [ + { + from: 'track', + to: 'url', + }, + { + from: 'track', + to: 'title', + }, + { + from: 'product added', + to: 'referrer', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + type: 'track', + event: 'product added', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + userId: 'abcdeeeeeeeexxxx111', + topicId: 'Test-Topic', + attributes: { + referrer: 'https://google.com', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + nestedObject: { + this: 'will be picked', + }, + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'Test-Topic', + }, + ], + eventToAttributesMap: [ + { + from: 'track', + to: 'nestedObject.this', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + nestedObject: { + this: 'will be picked', + }, + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + userId: 'abcdeeeeeeeexxxx111', + topicId: 'Test-Topic', + attributes: { + this: 'will be picked', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlepubsub', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + nestedObject: { + this: 'will be picked', + }, + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + destination: { + Config: { + credentials: 'abc', + eventToTopicMap: [ + { + from: 'track', + to: 'Test-Topic', + }, + ], + eventToAttributesMap: [ + { + from: 'track', + to: 'properties.nestedObject.this', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + sentAt: '2020-08-28T15:11:56.167Z', + category: 'Food', + messageId: + 'node-cfc5fb7ec83b82bc29e16336a11331e2-0ba97212-0f6e-44cd-a0f1-c20b8b7a7cba', + anonymousId: 'abcdeeeeeeeexxxx111', + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + originalTimestamp: '2020-08-28T15:11:56.162Z', + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + nestedObject: { + this: 'will be picked', + }, + }, + type: 'track', + name: 'Pizza', + _metadata: { + nodeVersion: '10.22.0', + }, + }, + userId: 'abcdeeeeeeeexxxx111', + topicId: 'Test-Topic', + attributes: { + this: 'will be picked', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/googlesheets/processor/data.ts b/test/integrations/destinations/googlesheets/processor/data.ts index a68a2a8b61..349ea7cb9e 100644 --- a/test/integrations/destinations/googlesheets/processor/data.ts +++ b/test/integrations/destinations/googlesheets/processor/data.ts @@ -1,1077 +1,1074 @@ export const data = [ - { - "name": "googlesheets", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - }, - "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": "OS-X", - "version": "19.02.3" - }, - "screen": { - "density": 2 - }, - "traits": { - "userId": "sheetuser001", - "firstName": "James", - "lastName": "Doe", - "address": { - "city": "Kolkata", - "country": "India", - "postalCode": "789003", - "state": "WB" - } - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "anonymousId": "anon_id", - "email": "jamesDoe@gmail.com", - "name": "James Doe", - "phone": "92374162212", - "gender": "M", - "employed": true, - "birthday": "1614775793", - "education": "Science", - "graduate": true, - "married": true, - "customerType": "Prime", - "custom_tags": [ - "Test_User", - "Interested_User", - "DIY_Hobby" - ], - "custom_mappings": { - "Office": "Trastkiv", - "Country": "Russia" - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "batch": { - "message": { - "0": { - "attributeKey": "messageId", - "attributeValue": "84e26acc-56a5-4835-8233-591137fca468" - }, - "1": { - "attributeKey": "First Name", - "attributeValue": "James" - }, - "2": { - "attributeKey": "Last Name", - "attributeValue": "Doe" - }, - "3": { - "attributeKey": "Birthday", - "attributeValue": "1614775793" - }, - "4": { - "attributeKey": "City", - "attributeValue": "kolkata" - }, - "5": { - "attributeKey": "Country", - "attributeValue": "India" - }, - "6": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "7": { - "attributeKey": "Offer", - "attributeValue": "" - }, - "8": { - "attributeKey": "Title Page", - "attributeValue": "" - }, - "9": { - "attributeKey": "Cart Value", - "attributeValue": "" - }, - "10": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "11": { - "attributeKey": "App Build", - "attributeValue": "1.0.0" - }, - "12": { - "attributeKey": "App Name", - "attributeValue": "RudderLabs JavaScript SDK" - }, - "13": { - "attributeKey": "Library Name", - "attributeValue": "RudderLabs JavaScript SDK" - }, - "14": { - "attributeKey": "IP", - "attributeValue": "0.0.0.0" - } - } - }, - "spreadSheet": "rudder_sheet", - "spreadSheetId": "rudder_sheet_id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlesheets", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - }, - "message": { - "type": "track", - "userId": "userTest004", - "event": "Added to Cart", - "properties": { - "name": "HomePage", - "revenue": 5.99, - "value": 5.5, - "offer": "Discount", - "Sale": false - }, - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata" - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "batch": { - "message": { - "0": { - "attributeKey": "messageId", - "attributeValue": "" - }, - "1": { - "attributeKey": "First Name", - "attributeValue": "" - }, - "2": { - "attributeKey": "Last Name", - "attributeValue": "" - }, - "3": { - "attributeKey": "Birthday", - "attributeValue": "" - }, - "4": { - "attributeKey": "City", - "attributeValue": "" - }, - "5": { - "attributeKey": "Country", - "attributeValue": "" - }, - "6": { - "attributeKey": "Revenue", - "attributeValue": 5.99 - }, - "7": { - "attributeKey": "Offer", - "attributeValue": "Discount" - }, - "8": { - "attributeKey": "Title Page", - "attributeValue": "" - }, - "9": { - "attributeKey": "Cart Value", - "attributeValue": "" - }, - "10": { - "attributeKey": "Revenue", - "attributeValue": 5.99 - }, - "11": { - "attributeKey": "App Build", - "attributeValue": "1" - }, - "12": { - "attributeKey": "App Name", - "attributeValue": "RudderAndroidClient" - }, - "13": { - "attributeKey": "Library Name", - "attributeValue": "com.rudderstack.android.sdk.core" - }, - "14": { - "attributeKey": "IP", - "attributeValue": "14.5.67.21" - } - } - }, - "spreadSheet": "rudder_sheet", - "spreadSheetId": "rudder_sheet_id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlesheets", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - }, - "message": { - "type": "page", - "userId": "userTest004", - "anonymousId": "anon-id-new", - "name": "1mg Cart", - "properties": { - "title": "Cart", - "path": "/", - "Cart Value": 7800, - "revenue": 7500 - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "batch": { - "message": { - "0": { - "attributeKey": "messageId", - "attributeValue": "" - }, - "1": { - "attributeKey": "First Name", - "attributeValue": "" - }, - "2": { - "attributeKey": "Last Name", - "attributeValue": "" - }, - "3": { - "attributeKey": "Birthday", - "attributeValue": "" - }, - "4": { - "attributeKey": "City", - "attributeValue": "" - }, - "5": { - "attributeKey": "Country", - "attributeValue": "" - }, - "6": { - "attributeKey": "Revenue", - "attributeValue": 7500 - }, - "7": { - "attributeKey": "Offer", - "attributeValue": "" - }, - "8": { - "attributeKey": "Title Page", - "attributeValue": "Cart" - }, - "9": { - "attributeKey": "Cart Value", - "attributeValue": 7800 - }, - "10": { - "attributeKey": "Revenue", - "attributeValue": 7500 - }, - "11": { - "attributeKey": "App Build", - "attributeValue": "" - }, - "12": { - "attributeKey": "App Name", - "attributeValue": "" - }, - "13": { - "attributeKey": "Library Name", - "attributeValue": "http" - }, - "14": { - "attributeKey": "IP", - "attributeValue": "14.5.67.21" - } - } - }, - "spreadSheet": "rudder_sheet", - "spreadSheetId": "rudder_sheet_id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlesheets", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - }, - "message": { - "type": "page", - "userId": "userTest005", - "anonymousId": "anon-id-test", - "name": "Viewed Home Screen", - "properties": { - "title": "Home", - "path": "/home" - }, - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "batch": { - "message": { - "0": { - "attributeKey": "messageId", - "attributeValue": "" - }, - "1": { - "attributeKey": "First Name", - "attributeValue": "" - }, - "2": { - "attributeKey": "Last Name", - "attributeValue": "" - }, - "3": { - "attributeKey": "Birthday", - "attributeValue": "" - }, - "4": { - "attributeKey": "City", - "attributeValue": "" - }, - "5": { - "attributeKey": "Country", - "attributeValue": "" - }, - "6": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "7": { - "attributeKey": "Offer", - "attributeValue": "" - }, - "8": { - "attributeKey": "Title Page", - "attributeValue": "Home" - }, - "9": { - "attributeKey": "Cart Value", - "attributeValue": "" - }, - "10": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "11": { - "attributeKey": "App Build", - "attributeValue": "" - }, - "12": { - "attributeKey": "App Name", - "attributeValue": "" - }, - "13": { - "attributeKey": "Library Name", - "attributeValue": "http" - }, - "14": { - "attributeKey": "IP", - "attributeValue": "14.5.67.21" - } - } - }, - "spreadSheet": "rudder_sheet", - "spreadSheetId": "rudder_sheet_id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlesheets", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - }, - "message": { - "type": "screen", - "name": "Trello home Screen", - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "batch": { - "message": { - "0": { - "attributeKey": "messageId", - "attributeValue": "" - }, - "1": { - "attributeKey": "First Name", - "attributeValue": "" - }, - "2": { - "attributeKey": "Last Name", - "attributeValue": "" - }, - "3": { - "attributeKey": "Birthday", - "attributeValue": "" - }, - "4": { - "attributeKey": "City", - "attributeValue": "" - }, - "5": { - "attributeKey": "Country", - "attributeValue": "" - }, - "6": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "7": { - "attributeKey": "Offer", - "attributeValue": "" - }, - "8": { - "attributeKey": "Title Page", - "attributeValue": "" - }, - "9": { - "attributeKey": "Cart Value", - "attributeValue": "" - }, - "10": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "11": { - "attributeKey": "App Build", - "attributeValue": "" - }, - "12": { - "attributeKey": "App Name", - "attributeValue": "" - }, - "13": { - "attributeKey": "Library Name", - "attributeValue": "http" - }, - "14": { - "attributeKey": "IP", - "attributeValue": "14.5.67.21" - } - } - }, - "spreadSheet": "rudder_sheet", - "spreadSheetId": "rudder_sheet_id", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "googlesheets", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id" - } - }, - "message": { - "type": "screen", - "name": "Trello home Screen", - "context": { - "ip": "14.5.67.21", - "library": { - "name": "http" - } - }, - "timestamp": "2020-02-02T00:23:09.544Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "No Spread Sheet set for this event", - "statTags": { - "destType": "GOOGLESHEETS", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'googlesheets', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, + 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: 'OS-X', + version: '19.02.3', + }, + screen: { + density: 2, + }, + traits: { + userId: 'sheetuser001', + firstName: 'James', + lastName: 'Doe', + address: { + city: 'Kolkata', + country: 'India', + postalCode: '789003', + state: 'WB', + }, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + type: 'identify', + traits: { + anonymousId: 'anon_id', + email: 'jamesDoe@gmail.com', + name: 'James Doe', + phone: '92374162212', + gender: 'M', + employed: true, + birthday: '1614775793', + education: 'Science', + graduate: true, + married: true, + customerType: 'Prime', + custom_tags: ['Test_User', 'Interested_User', 'DIY_Hobby'], + custom_mappings: { + Office: 'Trastkiv', + Country: 'Russia', + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: { + message: { + '0': { + attributeKey: 'messageId', + attributeValue: '84e26acc-56a5-4835-8233-591137fca468', + }, + '1': { + attributeKey: 'First Name', + attributeValue: 'James', + }, + '2': { + attributeKey: 'Last Name', + attributeValue: 'Doe', + }, + '3': { + attributeKey: 'Birthday', + attributeValue: '1614775793', + }, + '4': { + attributeKey: 'City', + attributeValue: 'kolkata', + }, + '5': { + attributeKey: 'Country', + attributeValue: 'India', + }, + '6': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '7': { + attributeKey: 'Offer', + attributeValue: '', + }, + '8': { + attributeKey: 'Title Page', + attributeValue: '', + }, + '9': { + attributeKey: 'Cart Value', + attributeValue: '', + }, + '10': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '11': { + attributeKey: 'App Build', + attributeValue: '1.0.0', + }, + '12': { + attributeKey: 'App Name', + attributeValue: 'RudderLabs JavaScript SDK', + }, + '13': { + attributeKey: 'Library Name', + attributeValue: 'RudderLabs JavaScript SDK', + }, + '14': { + attributeKey: 'IP', + attributeValue: '0.0.0.0', + }, + }, + }, + spreadSheet: 'rudder_sheet', + spreadSheetId: 'rudder_sheet_id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlesheets', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, + message: { + type: 'track', + userId: 'userTest004', + event: 'Added to Cart', + properties: { + name: 'HomePage', + revenue: 5.99, + value: 5.5, + offer: 'Discount', + Sale: false, + }, + context: { + ip: '14.5.67.21', + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: { + message: { + '0': { + attributeKey: 'messageId', + attributeValue: '', + }, + '1': { + attributeKey: 'First Name', + attributeValue: '', + }, + '2': { + attributeKey: 'Last Name', + attributeValue: '', + }, + '3': { + attributeKey: 'Birthday', + attributeValue: '', + }, + '4': { + attributeKey: 'City', + attributeValue: '', + }, + '5': { + attributeKey: 'Country', + attributeValue: '', + }, + '6': { + attributeKey: 'Revenue', + attributeValue: 5.99, + }, + '7': { + attributeKey: 'Offer', + attributeValue: 'Discount', + }, + '8': { + attributeKey: 'Title Page', + attributeValue: '', + }, + '9': { + attributeKey: 'Cart Value', + attributeValue: '', + }, + '10': { + attributeKey: 'Revenue', + attributeValue: 5.99, + }, + '11': { + attributeKey: 'App Build', + attributeValue: '1', + }, + '12': { + attributeKey: 'App Name', + attributeValue: 'RudderAndroidClient', + }, + '13': { + attributeKey: 'Library Name', + attributeValue: 'com.rudderstack.android.sdk.core', + }, + '14': { + attributeKey: 'IP', + attributeValue: '14.5.67.21', + }, + }, + }, + spreadSheet: 'rudder_sheet', + spreadSheetId: 'rudder_sheet_id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlesheets', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, + message: { + type: 'page', + userId: 'userTest004', + anonymousId: 'anon-id-new', + name: '1mg Cart', + properties: { + title: 'Cart', + path: '/', + 'Cart Value': 7800, + revenue: 7500, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: { + message: { + '0': { + attributeKey: 'messageId', + attributeValue: '', + }, + '1': { + attributeKey: 'First Name', + attributeValue: '', + }, + '2': { + attributeKey: 'Last Name', + attributeValue: '', + }, + '3': { + attributeKey: 'Birthday', + attributeValue: '', + }, + '4': { + attributeKey: 'City', + attributeValue: '', + }, + '5': { + attributeKey: 'Country', + attributeValue: '', + }, + '6': { + attributeKey: 'Revenue', + attributeValue: 7500, + }, + '7': { + attributeKey: 'Offer', + attributeValue: '', + }, + '8': { + attributeKey: 'Title Page', + attributeValue: 'Cart', + }, + '9': { + attributeKey: 'Cart Value', + attributeValue: 7800, + }, + '10': { + attributeKey: 'Revenue', + attributeValue: 7500, + }, + '11': { + attributeKey: 'App Build', + attributeValue: '', + }, + '12': { + attributeKey: 'App Name', + attributeValue: '', + }, + '13': { + attributeKey: 'Library Name', + attributeValue: 'http', + }, + '14': { + attributeKey: 'IP', + attributeValue: '14.5.67.21', + }, + }, + }, + spreadSheet: 'rudder_sheet', + spreadSheetId: 'rudder_sheet_id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlesheets', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, + message: { + type: 'page', + userId: 'userTest005', + anonymousId: 'anon-id-test', + name: 'Viewed Home Screen', + properties: { + title: 'Home', + path: '/home', + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: { + message: { + '0': { + attributeKey: 'messageId', + attributeValue: '', + }, + '1': { + attributeKey: 'First Name', + attributeValue: '', + }, + '2': { + attributeKey: 'Last Name', + attributeValue: '', + }, + '3': { + attributeKey: 'Birthday', + attributeValue: '', + }, + '4': { + attributeKey: 'City', + attributeValue: '', + }, + '5': { + attributeKey: 'Country', + attributeValue: '', + }, + '6': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '7': { + attributeKey: 'Offer', + attributeValue: '', + }, + '8': { + attributeKey: 'Title Page', + attributeValue: 'Home', + }, + '9': { + attributeKey: 'Cart Value', + attributeValue: '', + }, + '10': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '11': { + attributeKey: 'App Build', + attributeValue: '', + }, + '12': { + attributeKey: 'App Name', + attributeValue: '', + }, + '13': { + attributeKey: 'Library Name', + attributeValue: 'http', + }, + '14': { + attributeKey: 'IP', + attributeValue: '14.5.67.21', + }, + }, + }, + spreadSheet: 'rudder_sheet', + spreadSheetId: 'rudder_sheet_id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlesheets', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, + message: { + type: 'screen', + name: 'Trello home Screen', + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: { + message: { + '0': { + attributeKey: 'messageId', + attributeValue: '', + }, + '1': { + attributeKey: 'First Name', + attributeValue: '', + }, + '2': { + attributeKey: 'Last Name', + attributeValue: '', + }, + '3': { + attributeKey: 'Birthday', + attributeValue: '', + }, + '4': { + attributeKey: 'City', + attributeValue: '', + }, + '5': { + attributeKey: 'Country', + attributeValue: '', + }, + '6': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '7': { + attributeKey: 'Offer', + attributeValue: '', + }, + '8': { + attributeKey: 'Title Page', + attributeValue: '', + }, + '9': { + attributeKey: 'Cart Value', + attributeValue: '', + }, + '10': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '11': { + attributeKey: 'App Build', + attributeValue: '', + }, + '12': { + attributeKey: 'App Name', + attributeValue: '', + }, + '13': { + attributeKey: 'Library Name', + attributeValue: 'http', + }, + '14': { + attributeKey: 'IP', + attributeValue: '14.5.67.21', + }, + }, + }, + spreadSheet: 'rudder_sheet', + spreadSheetId: 'rudder_sheet_id', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'googlesheets', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + }, + }, + message: { + type: 'screen', + name: 'Trello home Screen', + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'No Spread Sheet set for this event', + statTags: { + destType: 'GOOGLESHEETS', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/googlesheets/router/data.ts b/test/integrations/destinations/googlesheets/router/data.ts index 1e323211e3..20fe270e5f 100644 --- a/test/integrations/destinations/googlesheets/router/data.ts +++ b/test/integrations/destinations/googlesheets/router/data.ts @@ -1,479 +1,482 @@ -export const data = [{ +export const data = [ + { name: 'googlesheets', description: 'Test 0', feature: 'router', module: 'destination', version: 'v0', input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - }, - "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": "OS-X", "version": "19.02.3" }, - "screen": { "density": 2 }, - "traits": { - "userId": "sheetuser001", - "firstName": "James", - "lastName": "Doe", - "address": { - "city": "Kolkata", - "country": "India", - "postalCode": "789003", - "state": "WB" - } - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "anonymousId": "anon_id", - "email": "jamesDoe@gmail.com", - "name": "James Doe", - "phone": "92374162212", - "gender": "M", - "employed": true, - "birthday": "1614775793", - "education": "Science", - "graduate": true, - "married": true, - "customerType": "Prime", - "custom_tags": ["Test_User", "Interested_User", "DIY_Hobby"], - "custom_mappings": { - "Office": "Trastkiv", - "Country": "Russia" - }, - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 789223, - "state": "WB", - "street": "" - } - }, - "integrations": { "All": true }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 1 - } - }, - { - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - }, - "message": { - "type": "track", - "userId": "userTest004", - "event": "Added to Cart", - "properties": { - "name": "HomePage", - "revenue": 5.99, - "value": 5.5, - "offer": "Discount", - "Sale": false - }, - "context": { - "ip": "14.5.67.21", - "app": { - "build": "1", - "name": "RudderAndroidClient", - "namespace": "com.rudderstack.demo.android", - "version": "1.0" - }, - "device": { - "id": "7e32188a4dab669f", - "manufacturer": "Google", - "model": "Android SDK built for x86", - "name": "generic_x86", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "0.1.4" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { "name": "Android", "version": "9" }, - "screen": { "density": 420, "height": 1794, "width": 1080 }, - "timezone": "Asia/Kolkata" - }, - "timestamp": "2020-02-02T00:23:09.544Z" - }, - "metadata": { - "jobId": 2 - } + request: { + body: { + input: [ + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', }, - ], - destType: 'googlesheets', + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, + 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: 'OS-X', version: '19.02.3' }, + screen: { density: 2 }, + traits: { + userId: 'sheetuser001', + firstName: 'James', + lastName: 'Doe', + address: { + city: 'Kolkata', + country: 'India', + postalCode: '789003', + state: 'WB', + }, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + type: 'identify', + traits: { + anonymousId: 'anon_id', + email: 'jamesDoe@gmail.com', + name: 'James Doe', + phone: '92374162212', + gender: 'M', + employed: true, + birthday: '1614775793', + education: 'Science', + graduate: true, + married: true, + customerType: 'Prime', + custom_tags: ['Test_User', 'Interested_User', 'DIY_Hobby'], + custom_mappings: { + Office: 'Trastkiv', + Country: 'Russia', + }, + address: { + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }, + }, + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 1, + }, }, + { + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, + message: { + type: 'track', + userId: 'userTest004', + event: 'Added to Cart', + properties: { + name: 'HomePage', + revenue: 5.99, + value: 5.5, + offer: 'Discount', + Sale: false, + }, + context: { + ip: '14.5.67.21', + app: { + build: '1', + name: 'RudderAndroidClient', + namespace: 'com.rudderstack.demo.android', + version: '1.0', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '0.1.4', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { name: 'Android', version: '9' }, + screen: { density: 420, height: 1794, width: 1080 }, + timezone: 'Asia/Kolkata', + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + metadata: { + jobId: 2, + }, + }, + ], + destType: 'googlesheets', }, + }, }, output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": { - "batch": [ - { - "message": { - "0": { - "attributeKey": "messageId", - "attributeValue": "84e26acc-56a5-4835-8233-591137fca468" - }, - "1": { - "attributeKey": "First Name", - "attributeValue": "James" - }, - "2": { - "attributeKey": "Last Name", - "attributeValue": "Doe" - }, - "3": { - "attributeKey": "Birthday", - "attributeValue": "1614775793" - }, - "4": { - "attributeKey": "City", - "attributeValue": "kolkata" - }, - "5": { - "attributeKey": "Country", - "attributeValue": "India" - }, - "6": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "7": { - "attributeKey": "Offer", - "attributeValue": "" - }, - "8": { - "attributeKey": "Title Page", - "attributeValue": "" - }, - "9": { - "attributeKey": "Cart Value", - "attributeValue": "" - }, - "10": { - "attributeKey": "Revenue", - "attributeValue": "" - }, - "11": { - "attributeKey": "App Build", - "attributeValue": "1.0.0" - }, - "12": { - "attributeKey": "App Name", - "attributeValue": "RudderLabs JavaScript SDK" - }, - "13": { - "attributeKey": "Library Name", - "attributeValue": "RudderLabs JavaScript SDK" - }, - "14": { - "attributeKey": "IP", - "attributeValue": "0.0.0.0" - } - } - }, - { - "message": { - "0": { - "attributeKey": "messageId", - "attributeValue": "" - }, - "1": { - "attributeKey": "First Name", - "attributeValue": "" - }, - "2": { - "attributeKey": "Last Name", - "attributeValue": "" - }, - "3": { - "attributeKey": "Birthday", - "attributeValue": "" - }, - "4": { - "attributeKey": "City", - "attributeValue": "" - }, - "5": { - "attributeKey": "Country", - "attributeValue": "" - }, - "6": { - "attributeKey": "Revenue", - "attributeValue": 5.99 - }, - "7": { - "attributeKey": "Offer", - "attributeValue": "Discount" - }, - "8": { - "attributeKey": "Title Page", - "attributeValue": "" - }, - "9": { - "attributeKey": "Cart Value", - "attributeValue": "" - }, - "10": { - "attributeKey": "Revenue", - "attributeValue": 5.99 - }, - "11": { - "attributeKey": "App Build", - "attributeValue": "1" - }, - "12": { - "attributeKey": "App Name", - "attributeValue": "RudderAndroidClient" - }, - "13": { - "attributeKey": "Library Name", - "attributeValue": "com.rudderstack.android.sdk.core" - }, - "14": { - "attributeKey": "IP", - "attributeValue": "14.5.67.21" - } - } - } - ], - "spreadSheetId": "rudder_sheet_id", - "spreadSheet": "rudder_sheet" - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "credentials": "{ sheets credentials }", - "eventKeyMap": [ - { - "from": "firstName", - "to": "First Name" - }, - { - "from": "lastName", - "to": "Last Name" - }, - { - "from": "birthday", - "to": "Birthday" - }, - { - "from": "address.city", - "to": "City" - }, - { - "from": "address.country", - "to": "Country" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "offer", - "to": "Offer" - }, - { - "from": "title", - "to": "Title Page" - }, - { - "from": "Cart Value", - "to": "Cart Value" - }, - { - "from": "revenue", - "to": "Revenue" - }, - { - "from": "context.app.build", - "to": "App Build" - }, - { - "from": "context.app.name", - "to": "App Name" - }, - { - "from": "context.library.name", - "to": "Library Name" - }, - { - "from": "context.ip", - "to": "IP" - } - ], - "sheetId": "rudder_sheet_id", - "sheetName": "rudder_sheet" - } - } + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + batch: [ + { + message: { + '0': { + attributeKey: 'messageId', + attributeValue: '84e26acc-56a5-4835-8233-591137fca468', + }, + '1': { + attributeKey: 'First Name', + attributeValue: 'James', + }, + '2': { + attributeKey: 'Last Name', + attributeValue: 'Doe', + }, + '3': { + attributeKey: 'Birthday', + attributeValue: '1614775793', + }, + '4': { + attributeKey: 'City', + attributeValue: 'kolkata', + }, + '5': { + attributeKey: 'Country', + attributeValue: 'India', + }, + '6': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '7': { + attributeKey: 'Offer', + attributeValue: '', + }, + '8': { + attributeKey: 'Title Page', + attributeValue: '', + }, + '9': { + attributeKey: 'Cart Value', + attributeValue: '', + }, + '10': { + attributeKey: 'Revenue', + attributeValue: '', + }, + '11': { + attributeKey: 'App Build', + attributeValue: '1.0.0', + }, + '12': { + attributeKey: 'App Name', + attributeValue: 'RudderLabs JavaScript SDK', + }, + '13': { + attributeKey: 'Library Name', + attributeValue: 'RudderLabs JavaScript SDK', + }, + '14': { + attributeKey: 'IP', + attributeValue: '0.0.0.0', + }, }, + }, + { + message: { + '0': { + attributeKey: 'messageId', + attributeValue: '', + }, + '1': { + attributeKey: 'First Name', + attributeValue: '', + }, + '2': { + attributeKey: 'Last Name', + attributeValue: '', + }, + '3': { + attributeKey: 'Birthday', + attributeValue: '', + }, + '4': { + attributeKey: 'City', + attributeValue: '', + }, + '5': { + attributeKey: 'Country', + attributeValue: '', + }, + '6': { + attributeKey: 'Revenue', + attributeValue: 5.99, + }, + '7': { + attributeKey: 'Offer', + attributeValue: 'Discount', + }, + '8': { + attributeKey: 'Title Page', + attributeValue: '', + }, + '9': { + attributeKey: 'Cart Value', + attributeValue: '', + }, + '10': { + attributeKey: 'Revenue', + attributeValue: 5.99, + }, + '11': { + attributeKey: 'App Build', + attributeValue: '1', + }, + '12': { + attributeKey: 'App Name', + attributeValue: 'RudderAndroidClient', + }, + '13': { + attributeKey: 'Library Name', + attributeValue: 'com.rudderstack.android.sdk.core', + }, + '14': { + attributeKey: 'IP', + attributeValue: '14.5.67.21', + }, + }, + }, ], + spreadSheetId: 'rudder_sheet_id', + spreadSheet: 'rudder_sheet', + }, + metadata: [ + { + jobId: 1, + }, + { + jobId: 2, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + credentials: '{ sheets credentials }', + eventKeyMap: [ + { + from: 'firstName', + to: 'First Name', + }, + { + from: 'lastName', + to: 'Last Name', + }, + { + from: 'birthday', + to: 'Birthday', + }, + { + from: 'address.city', + to: 'City', + }, + { + from: 'address.country', + to: 'Country', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'offer', + to: 'Offer', + }, + { + from: 'title', + to: 'Title Page', + }, + { + from: 'Cart Value', + to: 'Cart Value', + }, + { + from: 'revenue', + to: 'Revenue', + }, + { + from: 'context.app.build', + to: 'App Build', + }, + { + from: 'context.app.name', + to: 'App Name', + }, + { + from: 'context.library.name', + to: 'Library Name', + }, + { + from: 'context.ip', + to: 'IP', + }, + ], + sheetId: 'rudder_sheet_id', + sheetName: 'rudder_sheet', + }, + }, }, + ], }, + }, }, -}] \ No newline at end of file + }, +]; diff --git a/test/integrations/destinations/heap/router/data.ts b/test/integrations/destinations/heap/router/data.ts index 7f997d5f0e..24efbf4b15 100644 --- a/test/integrations/destinations/heap/router/data.ts +++ b/test/integrations/destinations/heap/router/data.ts @@ -1,805 +1,815 @@ -export const data = [{ +export const data = [ + { name: 'heap', description: 'Test 0', feature: 'router', module: 'destination', version: 'v0', input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "sampath", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "messageId": "fca2e71a-5d30-48e1-ba45-761c16e3820f", - "originalTimestamp": "2020-01-16T13:21:59.076Z", - "receivedAt": "2020-01-16T18:52:03.871+05:30", - "request_ip": "[::1]:62312", - "sentAt": "2020-01-16T13:22:03.85Z", - "timestamp": "2020-01-16T18:51:59.097+05:30", - "type": "identify", - "userId": "sampath" - } - }, - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "sampath", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "event": "Send Transactional Email", - "integrations": { - "All": true - }, - "messageId": "c0c5b892-0d54-449f-b85f-ebb39ff04e67", - "originalTimestamp": "2020-01-16T13:23:20.844Z", - "properties": { - "subject": "Welcome to My App!", - "variation": "A" - }, - "receivedAt": "2020-01-16T18:53:23.804+05:30", - "request_ip": "[::1]:62312", - "sentAt": "2020-01-16T13:23:23.782Z", - "timestamp": "2020-01-16T18:53:20.866+05:30", - "type": "track", - "userId": "sampath" - } - }, - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "sampath", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "event": "Send Transactional Email", - "integrations": { - "All": true - }, - "messageId": "c0c5b892-0d54-449f-b85f-ebb39ff04e67", - "originalTimestamp": "2020-01-16T13:23:20.844Z", - "properties": { - "subject": "Welcome to My App!", - "variation": "A", - "idempotencyKey": "1234" - }, - "receivedAt": "2020-01-16T18:53:23.804+05:30", - "request_ip": "[::1]:62312", - "sentAt": "2020-01-16T13:23:23.782Z", - "timestamp": "2020-01-16T18:53:20.866+05:30", - "type": "track", - "userId": "sampath" - } - }, - ], - destType: 'heap', + request: { + body: { + input: [ + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'sampath', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, + messageId: 'fca2e71a-5d30-48e1-ba45-761c16e3820f', + originalTimestamp: '2020-01-16T13:21:59.076Z', + receivedAt: '2020-01-16T18:52:03.871+05:30', + request_ip: '[::1]:62312', + sentAt: '2020-01-16T13:22:03.85Z', + timestamp: '2020-01-16T18:51:59.097+05:30', + type: 'identify', + userId: 'sampath', + }, + }, + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'sampath', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + event: 'Send Transactional Email', + integrations: { + All: true, + }, + messageId: 'c0c5b892-0d54-449f-b85f-ebb39ff04e67', + originalTimestamp: '2020-01-16T13:23:20.844Z', + properties: { + subject: 'Welcome to My App!', + variation: 'A', + }, + receivedAt: '2020-01-16T18:53:23.804+05:30', + request_ip: '[::1]:62312', + sentAt: '2020-01-16T13:23:23.782Z', + timestamp: '2020-01-16T18:53:20.866+05:30', + type: 'track', + userId: 'sampath', + }, + }, + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'sampath', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + event: 'Send Transactional Email', + integrations: { + All: true, + }, + messageId: 'c0c5b892-0d54-449f-b85f-ebb39ff04e67', + originalTimestamp: '2020-01-16T13:23:20.844Z', + properties: { + subject: 'Welcome to My App!', + variation: 'A', + idempotencyKey: '1234', + }, + receivedAt: '2020-01-16T18:53:23.804+05:30', + request_ip: '[::1]:62312', + sentAt: '2020-01-16T13:23:23.782Z', + timestamp: '2020-01-16T18:53:20.866+05:30', + type: 'track', + userId: 'sampath', + }, }, + ], + destType: 'heap', }, + }, }, output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://heapanalytics.com/api/add_user_properties", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "identity": "sampath", - "properties": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "app_id": "" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "sampath" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - } + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://heapanalytics.com/api/add_user_properties', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + identity: 'sampath', + properties: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://heapanalytics.com/api/track", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "identity": "sampath", - "event": "Send Transactional Email", - "properties": { - "subject": "Welcome to My App!", - "variation": "A" - }, - "app_id": "", - "timestamp": "2020-01-16T18:53:20.866+05:30" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "sampath" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - } + app_id: '', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'sampath', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://heapanalytics.com/api/track', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + identity: 'sampath', + event: 'Send Transactional Email', + properties: { + subject: 'Welcome to My App!', + variation: 'A', }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://heapanalytics.com/api/track", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "identity": "sampath", - "event": "Send Transactional Email", - "properties": { - "subject": "Welcome to My App!", - "variation": "A" - }, - "app_id": "", - "timestamp": "2020-01-16T18:53:20.866+05:30", - "idempotency_key": "1234" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "sampath" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - } + app_id: '', + timestamp: '2020-01-16T18:53:20.866+05:30', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'sampath', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://heapanalytics.com/api/track', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + identity: 'sampath', + event: 'Send Transactional Email', + properties: { + subject: 'Welcome to My App!', + variation: 'A', }, - ], + app_id: '', + timestamp: '2020-01-16T18:53:20.866+05:30', + idempotency_key: '1234', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'sampath', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, }, + ], }, + }, }, -}, { + }, + { name: 'heap', description: 'Test 1', feature: 'router', module: 'destination', version: 'v0', input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "sampath", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "messageId": "fca2e71a-5d30-48e1-ba45-761c16e3820f", - "originalTimestamp": "2020-01-16T13:21:59.076Z", - "receivedAt": "2020-01-16T18:52:03.871+05:30", - "request_ip": "[::1]:62312", - "sentAt": "2020-01-16T13:22:03.85Z", - "timestamp": "2020-01-16T18:51:59.097+05:30", - "type": "identify", - "userId": "sampath" - } - }, - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "sampath", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "event": "Send Transactional Email", - "integrations": { - "All": true - }, - "messageId": "c0c5b892-0d54-449f-b85f-ebb39ff04e67", - "originalTimestamp": "2020-01-16T13:23:20.844Z", - "properties": { - "subject": "Welcome to My App!", - "variation": "A" - }, - "receivedAt": "2020-01-16T18:53:23.804+05:30", - "request_ip": "[::1]:62312", - "sentAt": "2020-01-16T13:23:23.782Z", - "timestamp": "2020-01-16T18:53:20.866+05:30", - "type": "track", - "userId": "sampath" - } - }, - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": { - "jobId": 4 - }, - "message": { - "anonymousId": "sampath", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "messageId": "fca2e71a-5d30-48e1-ba45-761c16e3820f", - "originalTimestamp": "2020-01-16T13:21:59.076Z", - "receivedAt": "2020-01-16T18:52:03.871+05:30", - "request_ip": "[::1]:62312", - "sentAt": "2020-01-16T13:22:03.85Z", - "timestamp": "2020-01-16T18:51:59.097+05:30", - "userId": "sampath" - } - }, - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": { - "jobId": 5 - }, - "message": { - "anonymousId": "sampath", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "locale": "en-US", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36" - }, - "event": "Send Transactional Email", - "integrations": { - "All": true - }, - "messageId": "c0c5b892-0d54-449f-b85f-ebb39ff04e67", - "originalTimestamp": "2020-01-16T13:23:20.844Z", - "properties": { - "subject": "Welcome to My App!", - "variation": "A" - }, - "receivedAt": "2020-01-16T18:53:23.804+05:30", - "request_ip": "[::1]:62312", - "sentAt": "2020-01-16T13:23:23.782Z", - "timestamp": "2020-01-16T18:53:20.866+05:30", - "type": "page", - "userId": "sampath" - } - }, - ], - destType: 'heap', + request: { + body: { + input: [ + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'sampath', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, + messageId: 'fca2e71a-5d30-48e1-ba45-761c16e3820f', + originalTimestamp: '2020-01-16T13:21:59.076Z', + receivedAt: '2020-01-16T18:52:03.871+05:30', + request_ip: '[::1]:62312', + sentAt: '2020-01-16T13:22:03.85Z', + timestamp: '2020-01-16T18:51:59.097+05:30', + type: 'identify', + userId: 'sampath', + }, + }, + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'sampath', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + event: 'Send Transactional Email', + integrations: { + All: true, + }, + messageId: 'c0c5b892-0d54-449f-b85f-ebb39ff04e67', + originalTimestamp: '2020-01-16T13:23:20.844Z', + properties: { + subject: 'Welcome to My App!', + variation: 'A', + }, + receivedAt: '2020-01-16T18:53:23.804+05:30', + request_ip: '[::1]:62312', + sentAt: '2020-01-16T13:23:23.782Z', + timestamp: '2020-01-16T18:53:20.866+05:30', + type: 'track', + userId: 'sampath', + }, + }, + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: { + jobId: 4, + }, + message: { + anonymousId: 'sampath', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, + messageId: 'fca2e71a-5d30-48e1-ba45-761c16e3820f', + originalTimestamp: '2020-01-16T13:21:59.076Z', + receivedAt: '2020-01-16T18:52:03.871+05:30', + request_ip: '[::1]:62312', + sentAt: '2020-01-16T13:22:03.85Z', + timestamp: '2020-01-16T18:51:59.097+05:30', + userId: 'sampath', + }, }, + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: { + jobId: 5, + }, + message: { + anonymousId: 'sampath', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + event: 'Send Transactional Email', + integrations: { + All: true, + }, + messageId: 'c0c5b892-0d54-449f-b85f-ebb39ff04e67', + originalTimestamp: '2020-01-16T13:23:20.844Z', + properties: { + subject: 'Welcome to My App!', + variation: 'A', + }, + receivedAt: '2020-01-16T18:53:23.804+05:30', + request_ip: '[::1]:62312', + sentAt: '2020-01-16T13:23:23.782Z', + timestamp: '2020-01-16T18:53:20.866+05:30', + type: 'page', + userId: 'sampath', + }, + }, + ], + destType: 'heap', }, + }, }, output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://heapanalytics.com/api/add_user_properties", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "identity": "sampath", - "properties": { - "anonymousId": "sampath", - "email": "sampath@gmail.com" - }, - "app_id": "" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "sampath" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://heapanalytics.com/api/track", - "headers": { - "Content-Type": "application/json", - "Accept": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "identity": "sampath", - "event": "Send Transactional Email", - "properties": { - "subject": "Welcome to My App!", - "variation": "A" - }, - "app_id": "", - "timestamp": "2020-01-16T18:53:20.866+05:30" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "sampath" - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - } + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://heapanalytics.com/api/add_user_properties', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + identity: 'sampath', + properties: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', }, - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": [ - { - "jobId": 4 - } - ], - "batched": false, - "statusCode": 400, - "error": "invalid message type for heap", - "statTags": { - "destType": "HEAP", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "router", - "implementation": "native", - "module": "destination" - } - }, - { - "destination": { - "Config": { - "appId": "" - }, - "DestinationDefinition": { - "DisplayName": "Heap.io", - "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", - "Name": "HEAP" - }, - "Enabled": true, - "ID": "1WTcDSEOE437e4ePH10BJNELXmE", - "Name": "heap test", - "Transformations": [] - }, - "metadata": [ - { - "jobId": 5 - } - ], - "batched": false, - "statusCode": 400, - "error": "message type page not supported for heap", - "statTags": { - "destType": "HEAP", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "router", - "implementation": "native", - "module": "destination" - } + app_id: '', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'sampath', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://heapanalytics.com/api/track', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + params: {}, + body: { + JSON: { + identity: 'sampath', + event: 'Send Transactional Email', + properties: { + subject: 'Welcome to My App!', + variation: 'A', }, - ], + app_id: '', + timestamp: '2020-01-16T18:53:20.866+05:30', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'sampath', + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + }, + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: [ + { + jobId: 4, + }, + ], + batched: false, + statusCode: 400, + error: 'invalid message type for heap', + statTags: { + destType: 'HEAP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + }, + { + destination: { + Config: { + appId: '', + }, + DestinationDefinition: { + DisplayName: 'Heap.io', + ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV', + Name: 'HEAP', + }, + Enabled: true, + ID: '1WTcDSEOE437e4ePH10BJNELXmE', + Name: 'heap test', + Transformations: [], + }, + metadata: [ + { + jobId: 5, + }, + ], + batched: false, + statusCode: 400, + error: 'message type page not supported for heap', + statTags: { + destType: 'HEAP', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, }, + ], }, + }, }, -}] \ No newline at end of file + }, +]; diff --git a/test/integrations/destinations/impact/processor/data.ts b/test/integrations/destinations/impact/processor/data.ts index eb064e3a9c..e467956d62 100644 --- a/test/integrations/destinations/impact/processor/data.ts +++ b/test/integrations/destinations/impact/processor/data.ts @@ -1,2325 +1,2357 @@ export const data = [ - { - "name": "impact", - "description": "Identify Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": true, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "DeviceOs": "ios", - "AndroidId": "id", - "EventDate": "NOW", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "user123", - "PropertyId": "2323", - "DeviceOsVer": "1.12.3", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "CustomerEmail": "0c57fe03e81357df3acc1340bc9e353688e8f69e", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://trkapi.impact.com/PageLoad", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Identify Call when enableIdentifyEvents is disabled from config", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "identify events are disabled from Config", - "statTags": { - "destType": "IMPACT", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "impact", - "description": "Account SID is empty", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": true, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "accountSID : are required fields", - "statTags": { - "destType": "IMPACT", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "impact", - "description": "API Key is empty", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "jskafsdhgfbjcdsxzjhfnerscd", - "apiKey": "", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": true, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "apiKey : are required fields", - "statTags": { - "destType": "IMPACT", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "impact", - "description": "campaignId is empty", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "jskafsdhgfbjcdsxzjhfnerscd", - "apiKey": "hjsfbnrrcldkbnfsjknfdkfjne", - "campaignId": "", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": true, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "campaignId : are required fields", - "statTags": { - "destType": "IMPACT", - "errorCategory": "dataValidation", - "errorType": "configuration", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array to test conversion endpoint", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "products": [ - { - "brand": "zara", - "category": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "OrderId": "9217374917471", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Order Completed", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array without any custom products mapping", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Product Purchased", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "products": [ - { - "brand": "zara", - "category": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": "", - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "OrderId": "9217374917471", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Product Purchased", - "ItemQuantity1": 1, - "ItemCategory1": "wearables", - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array to test conversion endpoint with a custom products mapping", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "products": [ - { - "brand": "zara", - "variant": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "OrderId": "9217374917471", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemCategory1": "wearables", - "ItemPrice1": 332, - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Order Completed", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array to test conversion endpoint with a custom products mapping and custom property mapping", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "profit": 434, - "products": [ - { - "brand": "zara", - "variant": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "Money1": 434, - "OrderId": "9217374917471", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemCategory1": "wearables", - "ItemPrice1": 332, - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Order Completed", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array to test conversion endpoint with OS as android", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "profit": 434, - "products": [ - { - "brand": "zara", - "variant": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "Android", - "version": "9" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "device": { - "id": "78c53c15-32a1-4b65-adac-bec2d7bb8fab", - "advertisingId": "435o4GRlm" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "Money1": 434, - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "GoogAId": "435o4GRlm", - "OrderId": "9217374917471", - "DeviceOs": "Android", - "ItemSku1": "G-32", - "AndroidId": "78c53c15-32a1-4b65-adac-bec2d7bb8fab", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "DeviceOsVer": "9", - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Order Completed", - "ItemCategory1": "wearables", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array to test conversion endpoint with OS as ios", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "profit": 434, - "products": [ - { - "brand": "zara", - "variant": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "iOS", - "version": "15.2" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "device": { - "id": "78c53c15-32a1-4b65-adac-bec2d7bb8fab", - "advertisingId": "435o4GRlm" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppleIfa": "435o4GRlm", - "AppleIfv": "78c53c15-32a1-4b65-adac-bec2d7bb8fab", - "Money1": 434, - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "OrderId": "9217374917471", - "DeviceOs": "iOS", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "DeviceOsVer": "15.2", - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Order Completed", - "ItemCategory1": "wearables", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Page Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "page", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": true, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "DeviceOs": "ios", - "AndroidId": "id", - "EventDate": "NOW", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "user123", - "PropertyId": "2323", - "DeviceOsVer": "1.12.3", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "CustomerEmail": "0c57fe03e81357df3acc1340bc9e353688e8f69e", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://trkapi.impact.com/PageLoad", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Screen Call", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "type": "screen", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": true, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "DeviceOs": "ios", - "AndroidId": "id", - "EventDate": "NOW", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "user123", - "PropertyId": "2323", - "DeviceOsVer": "1.12.3", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "CustomerEmail": "0c57fe03e81357df3acc1340bc9e353688e8f69e", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://trkapi.impact.com/PageLoad", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Unsupported message type", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "group", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "products": [ - { - "brand": "zara", - "category": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Event type group is not supported", - "statTags": { - "destType": "IMPACT", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "impact", - "description": "Event type is empty", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "products": [ - { - "brand": "zara", - "category": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Event type is required", - "statTags": { - "destType": "IMPACT", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array to test conversion endpoint", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Order Completed", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "brand": "zara", - "category": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Purchased" - } - ], - "installEventNames": [ - { - "eventName": "App Installed" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "OrderId": "9217374917471", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Order Completed", - "ItemCategory1": "wearables", - "ItemQuantity1": 1, - "ItemPromoCode1": "10OFF-ROCKET", - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "impact", - "description": "Track Call with products array to test conversion endpoint with event mapping", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "event": "Product Ordered", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "profit": 434, - "products": [ - { - "brand": "zara", - "variant": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "iOS", - "version": "15.2" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "device": { - "id": "78c53c15-32a1-4b65-adac-bec2d7bb8fab", - "advertisingId": "435o4GRlm" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [ - { - "eventName": "Product Ordered" - } - ], - "installEventNames": [ - { - "eventName": "Product Ordered" - } - ] - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppleIfa": "435o4GRlm", - "AppleIfv": "78c53c15-32a1-4b65-adac-bec2d7bb8fab", - "Money1": 434, - "AppName": "RudderLabs JavaScript SDK", - "OrderId": "9217374917471", - "DeviceOs": "iOS", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "DeviceOsVer": "15.2", - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Product Ordered", - "ItemCategory1": "wearables", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200 - }, { - "output": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppleIfa": "435o4GRlm", - "AppleIfv": "78c53c15-32a1-4b65-adac-bec2d7bb8fab", - "Money1": 434, - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "OrderId": "9217374917471", - "DeviceOs": "iOS", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "DeviceOsVer": "15.2", - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Product Ordered", - "ItemCategory1": "wearables", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions", - "userId": "" - }, - "statusCode": 200, - } - ] - } - } - } -] \ No newline at end of file + { + name: 'impact', + description: 'Identify Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: true, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + DeviceOs: 'ios', + AndroidId: 'id', + EventDate: 'NOW', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'user123', + PropertyId: '2323', + DeviceOsVer: '1.12.3', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + CustomerEmail: '0c57fe03e81357df3acc1340bc9e353688e8f69e', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://trkapi.impact.com/PageLoad', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Identify Call when enableIdentifyEvents is disabled from config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'identify events are disabled from Config', + statTags: { + destType: 'IMPACT', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Account SID is empty', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: '', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: true, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'accountSID : are required fields', + statTags: { + destType: 'IMPACT', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'API Key is empty', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'jskafsdhgfbjcdsxzjhfnerscd', + apiKey: '', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: true, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'apiKey : are required fields', + statTags: { + destType: 'IMPACT', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'campaignId is empty', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'jskafsdhgfbjcdsxzjhfnerscd', + apiKey: 'hjsfbnrrcldkbnfsjknfdkfjne', + campaignId: '', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: true, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'campaignId : are required fields', + statTags: { + destType: 'IMPACT', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Track Call with products array to test conversion endpoint', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + products: [ + { + brand: 'zara', + category: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + OrderId: '9217374917471', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Order Completed', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Track Call with products array without any custom products mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Product Purchased', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + products: [ + { + brand: 'zara', + category: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: '', + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + OrderId: '9217374917471', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Product Purchased', + ItemQuantity1: 1, + ItemCategory1: 'wearables', + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: + 'Track Call with products array to test conversion endpoint with a custom products mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + products: [ + { + brand: 'zara', + variant: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + OrderId: '9217374917471', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemCategory1: 'wearables', + ItemPrice1: 332, + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Order Completed', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: + 'Track Call with products array to test conversion endpoint with a custom products mapping and custom property mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + profit: 434, + products: [ + { + brand: 'zara', + variant: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + Money1: 434, + OrderId: '9217374917471', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemCategory1: 'wearables', + ItemPrice1: 332, + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Order Completed', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Track Call with products array to test conversion endpoint with OS as android', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + profit: 434, + products: [ + { + brand: 'zara', + variant: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: 'Android', + version: '9', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + device: { + id: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + advertisingId: '435o4GRlm', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + Money1: 434, + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + GoogAId: '435o4GRlm', + OrderId: '9217374917471', + DeviceOs: 'Android', + ItemSku1: 'G-32', + AndroidId: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + DeviceOsVer: '9', + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Order Completed', + ItemCategory1: 'wearables', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Track Call with products array to test conversion endpoint with OS as ios', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + profit: 434, + products: [ + { + brand: 'zara', + variant: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: 'iOS', + version: '15.2', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + device: { + id: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + advertisingId: '435o4GRlm', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppleIfa: '435o4GRlm', + AppleIfv: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + Money1: 434, + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + OrderId: '9217374917471', + DeviceOs: 'iOS', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + DeviceOsVer: '15.2', + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Order Completed', + ItemCategory1: 'wearables', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Page Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'page', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: true, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + DeviceOs: 'ios', + AndroidId: 'id', + EventDate: 'NOW', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'user123', + PropertyId: '2323', + DeviceOsVer: '1.12.3', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + CustomerEmail: '0c57fe03e81357df3acc1340bc9e353688e8f69e', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://trkapi.impact.com/PageLoad', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Screen Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'screen', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: true, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + DeviceOs: 'ios', + AndroidId: 'id', + EventDate: 'NOW', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'user123', + PropertyId: '2323', + DeviceOsVer: '1.12.3', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + CustomerEmail: '0c57fe03e81357df3acc1340bc9e353688e8f69e', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://trkapi.impact.com/PageLoad', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Unsupported message type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: 'group', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + products: [ + { + brand: 'zara', + category: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event type group is not supported', + statTags: { + destType: 'IMPACT', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Event type is empty', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: '', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + products: [ + { + brand: 'zara', + category: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event type is required', + statTags: { + destType: 'IMPACT', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Track Call with products array to test conversion endpoint', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Order Completed', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + brand: 'zara', + category: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Purchased', + }, + ], + installEventNames: [ + { + eventName: 'App Installed', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + OrderId: '9217374917471', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Order Completed', + ItemCategory1: 'wearables', + ItemQuantity1: 1, + ItemPromoCode1: '10OFF-ROCKET', + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'impact', + description: 'Track Call with products array to test conversion endpoint with event mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + event: 'Product Ordered', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + profit: 434, + products: [ + { + brand: 'zara', + variant: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: 'iOS', + version: '15.2', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + device: { + id: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + advertisingId: '435o4GRlm', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [ + { + eventName: 'Product Ordered', + }, + ], + installEventNames: [ + { + eventName: 'Product Ordered', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppleIfa: '435o4GRlm', + AppleIfv: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + Money1: 434, + AppName: 'RudderLabs JavaScript SDK', + OrderId: '9217374917471', + DeviceOs: 'iOS', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + DeviceOsVer: '15.2', + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Product Ordered', + ItemCategory1: 'wearables', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + { + output: { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppleIfa: '435o4GRlm', + AppleIfv: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + Money1: 434, + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + OrderId: '9217374917471', + DeviceOs: 'iOS', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + DeviceOsVer: '15.2', + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Product Ordered', + ItemCategory1: 'wearables', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/impact/router/data.ts b/test/integrations/destinations/impact/router/data.ts index 5da4298d59..1e9cd9cc6e 100644 --- a/test/integrations/destinations/impact/router/data.ts +++ b/test/integrations/destinations/impact/router/data.ts @@ -1,324 +1,330 @@ export const data = [ - { - name: 'fb', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": true, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [{ "eventName": "Product Purchased" }], - "installEventNames": [{ "eventName": "App Installed" }] - } - }, - "metadata": { - "jobId": 1 - }, - "message": { - "type": "identify", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "user123", - "channel": "web", - "context": { - "os": { - "name": "android", - "version": "1.12.3" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "traits": { - "email": "user123@email.com", - "phone": "+917836362334", - "userId": "user123" - }, - "locale": "en-US", - "device": { - "token": "token", - "id": "id", - "type": "ios" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - } - }, - { - "message": { - "event": "Order Completed", - "type": "track", - "sentAt": "2021-01-03T17:02:53.195Z", - "userId": "Ujjwalab", - "channel": "web", - "properties": { - "orderId": "9217374917471", - "coupon": "10OFF-ROCKET", - "clickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "products": [ - { - "brand": "zara", - "category": "wearables", - "name": "Monopoly", - "price": 332, - "quantity": 1, - "sku": "G-32" - } - ] - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.1.11", - "namespace": "com.rudderlabs.javascript" - }, - "locale": "en-US", - "screen": { - "density": 2 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.11" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0" - }, - "rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f", - "messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff", - "anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35", - "originalTimestamp": "NOW" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [{ "eventName": "Product Purchased" }], - "installEventNames": [{ "eventName": "App Installed" }] - } - } - }, - ], - destType: 'impact', + { + name: 'fb', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: true, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [{ eventName: 'Product Purchased' }], + installEventNames: [{ eventName: 'App Installed' }], + }, + }, + metadata: { + jobId: 1, + }, + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'user123', + channel: 'web', + context: { + os: { + name: 'android', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'user123@email.com', + phone: '+917836362334', + userId: 'user123', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, }, + { + message: { + event: 'Order Completed', + type: 'track', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'Ujjwalab', + channel: 'web', + properties: { + orderId: '9217374917471', + coupon: '10OFF-ROCKET', + clickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + products: [ + { + brand: 'zara', + category: 'wearables', + name: 'Monopoly', + price: 332, + quantity: 1, + sku: 'G-32', + }, + ], + }, + context: { + os: { + name: '', + version: '', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + locale: 'en-US', + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f', + messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', + anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', + originalTimestamp: 'NOW', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [{ eventName: 'Product Purchased' }], + installEventNames: [{ eventName: 'App Installed' }], + }, + }, + }, + ], + destType: 'impact', }, - output: { - response: { - status: 200, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { body: { - output: [ - { - "batchedRequest": { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "DeviceOs": "ios", - "AndroidId": "id", - "EventDate": "NOW", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "user123", - "PropertyId": "2323", - "DeviceOsVer": "1.12.3", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "CustomerEmail": "0c57fe03e81357df3acc1340bc9e353688e8f69e", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://trkapi.impact.com/PageLoad" - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "sku", - "to": "ItemSku" - } - ], - "enableIdentifyEvents": true, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [{ "eventName": "Product Purchased" }], - "installEventNames": [{ "eventName": "App Installed" }] - } - } - }, - { - "batchedRequest": [ - { - "body": { - "XML": {}, - "FORM": { - "AppVer": "1.1.11", - "AppName": "RudderLabs JavaScript SDK", - "ClickId": "wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80", - "OrderId": "9217374917471", - "ItemSku1": "G-32", - "EventDate": "NOW", - "ItemName1": "Monopoly", - "UserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0", - "AppPackage": "1.0.0", - "CampaignId": "23224", - "CustomerId": "Ujjwalab", - "ItemBrand1": "zara", - "ItemPrice1": 332, - "EventTypeId": "56446", - "ImpactAppId": "2323", - "DeviceLocale": "en-US", - "EventTypeCode": "Order Completed", - "ItemQuantity1": 1, - "OrderPromoCode": "10OFF-ROCKET", - "CustomProfileId": "97c46c81-3140-456d-b2a9-690d70aaca35" - }, - "JSON": {}, - "JSON_ARRAY": {} - }, - "type": "REST", - "files": {}, - "method": "POST", - "params": {}, - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn" - }, - "version": "1", - "endpoint": "https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions" - } - ], - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "accountSID": "dfsgertrtff3erfc34rfwf", - "apiKey": "fghsdfgegvcergfvfdfsag", - "campaignId": "23224", - "impactAppId": "2323", - "eventTypeId": "56446", - "enableEmailHashing": true, - "rudderToImpactProperty": [ - { - "from": "properties.profit", - "to": "Money1" - } - ], - "productsMapping": [ - { - "from": "variant", - "to": "ItemCategory" - } - ], - "enableIdentifyEvents": false, - "enablePageEvents": false, - "enableScreenEvents": false, - "actionEventNames": [{ "eventName": "Product Purchased" }], - "installEventNames": [{ "eventName": "App Installed" }] - } - } - }, - ], + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + DeviceOs: 'ios', + AndroidId: 'id', + EventDate: 'NOW', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'user123', + PropertyId: '2323', + DeviceOsVer: '1.12.3', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + CustomerEmail: '0c57fe03e81357df3acc1340bc9e353688e8f69e', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: + 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://trkapi.impact.com/PageLoad', + }, + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'sku', + to: 'ItemSku', + }, + ], + enableIdentifyEvents: true, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [{ eventName: 'Product Purchased' }], + installEventNames: [{ eventName: 'App Installed' }], + }, + }, + }, + { + batchedRequest: [ + { + body: { + XML: {}, + FORM: { + AppVer: '1.1.11', + AppName: 'RudderLabs JavaScript SDK', + ClickId: 'wEWU47yhtzBnU-CTug3:7Wv4UkAzMbzkZ2lTz80', + OrderId: '9217374917471', + ItemSku1: 'G-32', + EventDate: 'NOW', + ItemName1: 'Monopoly', + UserAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + AppPackage: '1.0.0', + CampaignId: '23224', + CustomerId: 'Ujjwalab', + ItemBrand1: 'zara', + ItemPrice1: 332, + EventTypeId: '56446', + ImpactAppId: '2323', + DeviceLocale: 'en-US', + EventTypeCode: 'Order Completed', + ItemQuantity1: 1, + OrderPromoCode: '10OFF-ROCKET', + CustomProfileId: '97c46c81-3140-456d-b2a9-690d70aaca35', + }, + JSON: {}, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Authorization: + 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + }, + version: '1', + endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + }, + ], + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + accountSID: 'dfsgertrtff3erfc34rfwf', + apiKey: 'fghsdfgegvcergfvfdfsag', + campaignId: '23224', + impactAppId: '2323', + eventTypeId: '56446', + enableEmailHashing: true, + rudderToImpactProperty: [ + { + from: 'properties.profit', + to: 'Money1', + }, + ], + productsMapping: [ + { + from: 'variant', + to: 'ItemCategory', + }, + ], + enableIdentifyEvents: false, + enablePageEvents: false, + enableScreenEvents: false, + actionEventNames: [{ eventName: 'Product Purchased' }], + installEventNames: [{ eventName: 'App Installed' }], }, + }, }, + ], }, + }, }, + }, ]; diff --git a/test/integrations/destinations/indicative/processor/data.ts b/test/integrations/destinations/indicative/processor/data.ts index d99bf8ecb9..706fd25664 100644 --- a/test/integrations/destinations/indicative/processor/data.ts +++ b/test/integrations/destinations/indicative/processor/data.ts @@ -1,3263 +1,3284 @@ export const data = [ - { - "name": "indicative", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "userId": "123456", - "type": "identify", - "traits": { - "anonymousId": "anon_id", - "email": "sayan@gmail.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/identify", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "uniqueId": "123456", - "properties": { - "email": "sayan@gmail.com", - "address.city": "kolkata", - "address.country": "India", - "address.postalCode": 712136, - "address.state": "WB", - "address.street": "", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "123456" - }, - "statusCode": 200 - }, { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/alias", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "previousId": "anon_id", - "newId": "123456", - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "123456" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "sayan@gmail.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/identify", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "uniqueId": "123456", - "properties": { - "email": "sayan@gmail.com", - "address.city": "kolkata", - "address.country": "India", - "address.postalCode": 712136, - "address.state": "WB", - "address.street": "", - "ip": "0.0.0.0", - "age": 26, - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "123456" - }, - "statusCode": 200 - }, { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/alias", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "previousId": "123456", - "newId": "123456", - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "123456" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "request_ip": "1.1.1.1", - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "12345", - "eventName": "Page View ApplicationLoaded", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "eventTime": 1571051718299, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "12345" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "request_ip": "1.1.1.1", - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "name": "ApplicationLoaded", - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "12345", - "eventName": "Page View ApplicationLoaded", - "properties": { - "name": "ApplicationLoaded", - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "eventTime": 1571051718299, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "12345" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "request_ip": "1.1.1.1", - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "12345", - "eventName": "Page View", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "eventTime": 1571051718299, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "12345" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "request_ip": "1.1.1.1", - "type": "screen", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "name": "Home", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "12345", - "eventName": "Screen View Home", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "eventTime": 1571051718299, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "12345" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "originalTimestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "79313729-7fe5-4204-963a-dc46f4205e4e", - "originalTimestamp": "2020-01-24T06:29:02.366Z", - "previousId": "test_previous_id", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53711", - "sentAt": "2020-01-24T06:29:02.366Z", - "timestamp": "2020-01-24T11:59:02.403+05:30", - "type": "alias", - "userId": "test_new_user_id" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/alias", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "previousId": "test_previous_id", - "newId": "test_new_user_id", - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_new_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "79313729-7fe5-4204-963a-dc46f4205e4e", - "originalTimestamp": "2020-01-24T06:29:02.366Z", - "previousId": "test_previous_id", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53711", - "sentAt": "2020-01-24T06:29:02.366Z", - "timestamp": "2020-01-24T11:59:02.403+05:30", - "userId": "test_new_user_id" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Message Type is not present. Aborting message.", - "statTags": { - "destType": "INDICATIVE", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "type": "group", - "traits": { - "anonymousId": "123456", - "email": "sayan@gmail.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Message type group not supported", - "statTags": { - "destType": "INDICATIVE", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 11", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "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", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "test_anon_id", - "type": "identify", - "traits": { - "anonymousId": "test_anon_id", - "email": "sayan@gmail.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/identify", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "uniqueId": "test_anon_id", - "properties": { - "email": "sayan@gmail.com", - "address.city": "kolkata", - "address.country": "India", - "address.postalCode": 712136, - "address.state": "WB", - "address.street": "", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "userId": "test_anon_id", - "files": {} - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 12", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "searchResponse": { - "hits": [ - { - "Vrm": "026067", - "Make": "AUDI", - "Year": 2010, - "DName": "PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH", - "Model": "A5", - "Price": 13990, - "Mileage": 163000, - "DealerId": "1f338e5b-740f-6a38-bee1-ecff97acda69", - "Derivative": "A5 Cabrio 1.8 TFSI Cabrio" - }, - { - "Vrm": "4527", - "Make": "AUDI", - "Year": 2009, - "DName": "Stephan Walters - Autohaus Walters", - "Model": "A5", - "Price": 14450, - "Mileage": 99990, - "DealerId": "68c7b5ae-8cf0-6595-9fd2-8644b9682838", - "Derivative": "A5 Cabrio 40 TFSI S tronic S line Cabrio" - }, - { - "Vrm": "10007", - "Make": "AUDI", - "Year": 2017, - "DName": "ps kfz-vertrieb GmbH", - "Model": "A5", - "Price": 14580, - "Mileage": 151500, - "DealerId": "a107e9a8-ac3c-6790-bb84-052dd5eed5e8", - "Derivative": "A5 Sportback 2.0 TDI ultra S tronic Coupe" - }, - { - "Vrm": "031983", - "Make": "AUDI", - "Year": 2012, - "DName": "Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\"", - "Model": "A5", - "Price": 10980, - "Mileage": 197335, - "DealerId": "8a574713-2fbe-6f0c-b1a8-39ba7ee683fc", - "Derivative": "A5 2.0 TDI Sportback DPF multitronic Coupe" - }, - { - "Vrm": "042012", - "Make": "AUDI", - "Year": 2015, - "DName": "Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\"", - "Model": "A5", - "Price": 15980, - "Mileage": 144205, - "DealerId": "8a574713-2fbe-6f0c-b1a8-39ba7ee683fc", - "Derivative": "A5 Coupe 35 TDI S tronic S line Coupe" - }, - { - "Vrm": "002743", - "Make": "AUDI", - "Year": 2010, - "DName": "Auto Mayer e.K.Inh. Skelcim Imeri", - "Model": "A5", - "Price": 13980, - "Mileage": 121015, - "DealerId": "972258cb-132f-62a9-bd31-e02f9f70fa7b", - "Derivative": "A5 Cabrio 2.0 TDI DPF Cabrio" - }, - { - "Vrm": "205536_3895", - "Make": "AUDI", - "Year": 2011, - "DName": "Autohaus Löbau GmbH", - "Model": "A5", - "Price": 12790, - "Mileage": 89236, - "DealerId": "9e697219-293e-63a0-884a-2d03f77bbbef", - "Derivative": "A5 2.0 TDI Sportback DPF Coupe" - }, - { - "Vrm": "116265", - "Make": "AUDI", - "Year": 2016, - "DName": "Elspass Autoland GmbH & Co. KG", - "Model": "A1", - "Price": 14690, - "Mileage": 42800, - "DealerId": "00c1bf3f-b19d-6198-a509-c7f2ff73c29a", - "Derivative": "A1 1.0 TFSI ultra Limousine" - }, - { - "Vrm": "010159", - "Make": "AUDI", - "Year": 2013, - "DName": "Hermann Meyer GmbH & Co. KG", - "Model": "A1", - "Price": 9950, - "Mileage": 93996, - "DealerId": "35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "Derivative": "A1 1.4 TFSI Ambition Limousine" - }, - { - "Vrm": "010178", - "Make": "AUDI", - "Year": 2016, - "DName": "Hermann Meyer GmbH & Co. KG", - "Model": "A1", - "Price": 12950, - "Mileage": 69454, - "DealerId": "35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "Derivative": "A1 1.4 TFSI Sportback S tronic Attraction Limousine" - } - ], - "page": 0, - "merge": { - "nbHitsMax": 1000, - "nbHitslimit": 1000, - "nbSearchers": 2, - "nbHitsProcessed": 10, - "personalization": { - "impact": 100, - "enabled": true, - "profile": { - "time": 0, - "facets": {}, - "taskID": 0 - }, - "percentile": 0, - "nbPersoScanned": 0, - "nbPersoSkipped": 0, - "nbPersoReranked": 0, - "nbPersoReturned": 0, - "nbPersoSelected": 0, - "nbRelevanceBuckets": 8 - }, - "lastHitToDisplay": 10, - "nbHitsNumberingEnd": 10 - }, - "nbHits": 13, - "nbPages": 2, - "queryID": "c5a176f8493236fcbfe69c3298d41659", - "indexUsed": "Germany_prod_stock_Finance_0", - "serverUsed": "d85-de-1.algolia.net", - "hitsPerPage": 10, - "parsedQuery": "audi a5", - "timeoutHits": false, - "appliedRules": [ - { - "objectID": "1539345377254" - }, - { - "objectID": "1548767806494" - } - ], - "facets_stats": { - "Doors": { - "avg": 3, - "max": 5, - "min": 2, - "sum": 48 - }, - "Price": { - "avg": 13210, - "max": 15980, - "min": 9950, - "sum": 171730 - }, - "VrmYear": { - "avg": 2013, - "max": 2017, - "min": 2009, - "sum": 26171 - } - }, - "timeoutCounts": false - } - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "searchResponse.hits.Vrm": "026067,4527,10007,031983,042012,002743,205536_3895,116265,010159,010178", - "searchResponse.hits.Make": "AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI", - "searchResponse.hits.Year": "2010,2009,2017,2012,2015,2010,2011,2016,2013,2016", - "searchResponse.hits.DName": "PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH,Stephan Walters - Autohaus Walters,ps kfz-vertrieb GmbH,Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\",Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\",Auto Mayer e.K.Inh. Skelcim Imeri,Autohaus Löbau GmbH,Elspass Autoland GmbH & Co. KG,Hermann Meyer GmbH & Co. KG,Hermann Meyer GmbH & Co. KG", - "searchResponse.hits.Model": "A5,A5,A5,A5,A5,A5,A5,A1,A1,A1", - "searchResponse.hits.Price": "13990,14450,14580,10980,15980,13980,12790,14690,9950,12950", - "searchResponse.hits.Mileage": "163000,99990,151500,197335,144205,121015,89236,42800,93996,69454", - "searchResponse.hits.DealerId": "1f338e5b-740f-6a38-bee1-ecff97acda69,68c7b5ae-8cf0-6595-9fd2-8644b9682838,a107e9a8-ac3c-6790-bb84-052dd5eed5e8,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,972258cb-132f-62a9-bd31-e02f9f70fa7b,9e697219-293e-63a0-884a-2d03f77bbbef,00c1bf3f-b19d-6198-a509-c7f2ff73c29a,35d4fe7e-81a0-6e99-a575-6f62bffb8900,35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "searchResponse.hits.Derivative": "A5 Cabrio 1.8 TFSI Cabrio,A5 Cabrio 40 TFSI S tronic S line Cabrio,A5 Sportback 2.0 TDI ultra S tronic Coupe,A5 2.0 TDI Sportback DPF multitronic Coupe,A5 Coupe 35 TDI S tronic S line Coupe,A5 Cabrio 2.0 TDI DPF Cabrio,A5 2.0 TDI Sportback DPF Coupe,A1 1.0 TFSI ultra Limousine,A1 1.4 TFSI Ambition Limousine,A1 1.4 TFSI Sportback S tronic Attraction Limousine", - "searchResponse.page": 0, - "searchResponse.merge.nbHitsMax": 1000, - "searchResponse.merge.nbHitslimit": 1000, - "searchResponse.merge.nbSearchers": 2, - "searchResponse.merge.nbHitsProcessed": 10, - "searchResponse.merge.personalization.impact": 100, - "searchResponse.merge.personalization.enabled": true, - "searchResponse.merge.personalization.profile.time": 0, - "searchResponse.merge.personalization.profile.taskID": 0, - "searchResponse.merge.personalization.percentile": 0, - "searchResponse.merge.personalization.nbPersoScanned": 0, - "searchResponse.merge.personalization.nbPersoSkipped": 0, - "searchResponse.merge.personalization.nbPersoReranked": 0, - "searchResponse.merge.personalization.nbPersoReturned": 0, - "searchResponse.merge.personalization.nbPersoSelected": 0, - "searchResponse.merge.personalization.nbRelevanceBuckets": 8, - "searchResponse.merge.lastHitToDisplay": 10, - "searchResponse.merge.nbHitsNumberingEnd": 10, - "searchResponse.nbHits": 13, - "searchResponse.nbPages": 2, - "searchResponse.queryID": "c5a176f8493236fcbfe69c3298d41659", - "searchResponse.indexUsed": "Germany_prod_stock_Finance_0", - "searchResponse.serverUsed": "d85-de-1.algolia.net", - "searchResponse.hitsPerPage": 10, - "searchResponse.parsedQuery": "audi a5", - "searchResponse.timeoutHits": false, - "searchResponse.appliedRules.objectID": "1539345377254,1548767806494", - "searchResponse.facets_stats.Doors.avg": 3, - "searchResponse.facets_stats.Doors.max": 5, - "searchResponse.facets_stats.Doors.min": 2, - "searchResponse.facets_stats.Doors.sum": 48, - "searchResponse.facets_stats.Price.avg": 13210, - "searchResponse.facets_stats.Price.max": 15980, - "searchResponse.facets_stats.Price.min": 9950, - "searchResponse.facets_stats.Price.sum": 171730, - "searchResponse.facets_stats.VrmYear.avg": 2013, - "searchResponse.facets_stats.VrmYear.max": 2017, - "searchResponse.facets_stats.VrmYear.min": 2009, - "searchResponse.facets_stats.VrmYear.sum": 26171, - "searchResponse.timeoutCounts": false - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 13", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "1afmecIpsJm7D72aRTksxyODrwR", - "Name": "Segment", - "DestinationDefinition": { - "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", - "Name": "SEGMENT", - "DisplayName": "Segment", - "Config": { - "excludeKeys": [], - "includeKeys": [] - } - }, - "Config": { - "writeKey": "abcdefghijklmnopqrstuvwxyz" - }, - "Enabled": true, - "Transformations": [], - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.1.1-rc.2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.1.1-rc.2" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index4.html" - }, - "screen": { - "density": 2 - }, - "traits": { - "age": 23, - "email": "testmp@email.com", - "firstname": "Test Transformer" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" - }, - "event": "JuhuSearchResults", - "integrations": { - "All": true - }, - "messageId": "584fde02-901a-4964-a4a0-4078b999d5b2", - "originalTimestamp": "2020-04-17T14:55:31.372Z", - "traits": { - "searchResponse": { - "hits": [ - { - "Vrm": "026067", - "Make": "AUDI", - "Year": 2010, - "DName": "PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH", - "Model": "A5", - "Price": 13990, - "Mileage": 163000, - "DealerId": "1f338e5b-740f-6a38-bee1-ecff97acda69", - "Derivative": "A5 Cabrio 1.8 TFSI Cabrio" - }, - { - "Vrm": "4527", - "Make": "AUDI", - "Year": 2009, - "DName": "Stephan Walters - Autohaus Walters", - "Model": "A5", - "Price": 14450, - "Mileage": 99990, - "DealerId": "68c7b5ae-8cf0-6595-9fd2-8644b9682838", - "Derivative": "A5 Cabrio 40 TFSI S tronic S line Cabrio" - }, - { - "Vrm": "10007", - "Make": "AUDI", - "Year": 2017, - "DName": "ps kfz-vertrieb GmbH", - "Model": "A5", - "Price": 14580, - "Mileage": 151500, - "DealerId": "a107e9a8-ac3c-6790-bb84-052dd5eed5e8", - "Derivative": "A5 Sportback 2.0 TDI ultra S tronic Coupe" - }, - { - "Vrm": "031983", - "Make": "AUDI", - "Year": 2012, - "DName": "Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\"", - "Model": "A5", - "Price": 10980, - "Mileage": 197335, - "DealerId": "8a574713-2fbe-6f0c-b1a8-39ba7ee683fc", - "Derivative": "A5 2.0 TDI Sportback DPF multitronic Coupe" - }, - { - "Vrm": "042012", - "Make": "AUDI", - "Year": 2015, - "DName": "Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\"", - "Model": "A5", - "Price": 15980, - "Mileage": 144205, - "DealerId": "8a574713-2fbe-6f0c-b1a8-39ba7ee683fc", - "Derivative": "A5 Coupe 35 TDI S tronic S line Coupe" - }, - { - "Vrm": "002743", - "Make": "AUDI", - "Year": 2010, - "DName": "Auto Mayer e.K.Inh. Skelcim Imeri", - "Model": "A5", - "Price": 13980, - "Mileage": 121015, - "DealerId": "972258cb-132f-62a9-bd31-e02f9f70fa7b", - "Derivative": "A5 Cabrio 2.0 TDI DPF Cabrio" - }, - { - "Vrm": "205536_3895", - "Make": "AUDI", - "Year": 2011, - "DName": "Autohaus Löbau GmbH", - "Model": "A5", - "Price": 12790, - "Mileage": 89236, - "DealerId": "9e697219-293e-63a0-884a-2d03f77bbbef", - "Derivative": "A5 2.0 TDI Sportback DPF Coupe" - }, - { - "Vrm": "116265", - "Make": "AUDI", - "Year": 2016, - "DName": "Elspass Autoland GmbH & Co. KG", - "Model": "A1", - "Price": 14690, - "Mileage": 42800, - "DealerId": "00c1bf3f-b19d-6198-a509-c7f2ff73c29a", - "Derivative": "A1 1.0 TFSI ultra Limousine" - }, - { - "Vrm": "010159", - "Make": "AUDI", - "Year": 2013, - "DName": "Hermann Meyer GmbH & Co. KG", - "Model": "A1", - "Price": 9950, - "Mileage": 93996, - "DealerId": "35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "Derivative": "A1 1.4 TFSI Ambition Limousine" - }, - { - "Vrm": "010178", - "Make": "AUDI", - "Year": 2016, - "DName": "Hermann Meyer GmbH & Co. KG", - "Model": "A1", - "Price": 12950, - "Mileage": 69454, - "DealerId": "35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "Derivative": "A1 1.4 TFSI Sportback S tronic Attraction Limousine" - } - ], - "page": 0, - "merge": { - "nbHitsMax": 1000, - "nbHitslimit": 1000, - "nbSearchers": 2, - "nbHitsProcessed": 10, - "personalization": { - "impact": 100, - "enabled": true, - "profile": { - "time": 0, - "facets": {}, - "taskID": 0 - }, - "percentile": 0, - "nbPersoScanned": 0, - "nbPersoSkipped": 0, - "nbPersoReranked": 0, - "nbPersoReturned": 0, - "nbPersoSelected": 0, - "nbRelevanceBuckets": 8 - }, - "lastHitToDisplay": 10, - "nbHitsNumberingEnd": 10 - }, - "nbHits": 13, - "nbPages": 2, - "queryID": "c5a176f8493236fcbfe69c3298d41659", - "indexUsed": "Germany_prod_stock_Finance_0", - "serverUsed": "d85-de-1.algolia.net", - "hitsPerPage": 10, - "parsedQuery": "audi a5", - "timeoutHits": false, - "appliedRules": [ - { - "objectID": "1539345377254" - }, - { - "objectID": "1548767806494" - } - ], - "facets_stats": { - "Doors": { - "avg": 3, - "max": 5, - "min": 2, - "sum": 48 - }, - "Price": { - "avg": 13210, - "max": 15980, - "min": 9950, - "sum": 171730 - }, - "VrmYear": { - "avg": 2013, - "max": 2017, - "min": 2009, - "sum": 26171 - } - }, - "timeoutCounts": false - } - }, - "receivedAt": "2020-04-17T20:25:31.401+05:30", - "request_ip": "[::1]:57365", - "sentAt": "2020-04-17T14:55:31.372Z", - "timestamp": "2020-04-17T20:25:31.401+05:30", - "name": "test page", - "type": "identify", - "userId": "user12345" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/identify", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "uniqueId": "user12345", - "properties": { - "searchResponse.hits.Vrm": "026067,4527,10007,031983,042012,002743,205536_3895,116265,010159,010178", - "searchResponse.hits.Make": "AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI", - "searchResponse.hits.Year": "2010,2009,2017,2012,2015,2010,2011,2016,2013,2016", - "searchResponse.hits.DName": "PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH,Stephan Walters - Autohaus Walters,ps kfz-vertrieb GmbH,Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\",Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\",Auto Mayer e.K.Inh. Skelcim Imeri,Autohaus Löbau GmbH,Elspass Autoland GmbH & Co. KG,Hermann Meyer GmbH & Co. KG,Hermann Meyer GmbH & Co. KG", - "searchResponse.hits.Model": "A5,A5,A5,A5,A5,A5,A5,A1,A1,A1", - "searchResponse.hits.Price": "13990,14450,14580,10980,15980,13980,12790,14690,9950,12950", - "searchResponse.hits.Mileage": "163000,99990,151500,197335,144205,121015,89236,42800,93996,69454", - "searchResponse.hits.DealerId": "1f338e5b-740f-6a38-bee1-ecff97acda69,68c7b5ae-8cf0-6595-9fd2-8644b9682838,a107e9a8-ac3c-6790-bb84-052dd5eed5e8,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,972258cb-132f-62a9-bd31-e02f9f70fa7b,9e697219-293e-63a0-884a-2d03f77bbbef,00c1bf3f-b19d-6198-a509-c7f2ff73c29a,35d4fe7e-81a0-6e99-a575-6f62bffb8900,35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "searchResponse.hits.Derivative": "A5 Cabrio 1.8 TFSI Cabrio,A5 Cabrio 40 TFSI S tronic S line Cabrio,A5 Sportback 2.0 TDI ultra S tronic Coupe,A5 2.0 TDI Sportback DPF multitronic Coupe,A5 Coupe 35 TDI S tronic S line Coupe,A5 Cabrio 2.0 TDI DPF Cabrio,A5 2.0 TDI Sportback DPF Coupe,A1 1.0 TFSI ultra Limousine,A1 1.4 TFSI Ambition Limousine,A1 1.4 TFSI Sportback S tronic Attraction Limousine", - "searchResponse.page": 0, - "searchResponse.merge.nbHitsMax": 1000, - "searchResponse.merge.nbHitslimit": 1000, - "searchResponse.merge.nbSearchers": 2, - "searchResponse.merge.nbHitsProcessed": 10, - "searchResponse.merge.personalization.impact": 100, - "searchResponse.merge.personalization.enabled": true, - "searchResponse.merge.personalization.profile.time": 0, - "searchResponse.merge.personalization.profile.taskID": 0, - "searchResponse.merge.personalization.percentile": 0, - "searchResponse.merge.personalization.nbPersoScanned": 0, - "searchResponse.merge.personalization.nbPersoSkipped": 0, - "searchResponse.merge.personalization.nbPersoReranked": 0, - "searchResponse.merge.personalization.nbPersoReturned": 0, - "searchResponse.merge.personalization.nbPersoSelected": 0, - "searchResponse.merge.personalization.nbRelevanceBuckets": 8, - "searchResponse.merge.lastHitToDisplay": 10, - "searchResponse.merge.nbHitsNumberingEnd": 10, - "searchResponse.nbHits": 13, - "searchResponse.nbPages": 2, - "searchResponse.queryID": "c5a176f8493236fcbfe69c3298d41659", - "searchResponse.indexUsed": "Germany_prod_stock_Finance_0", - "searchResponse.serverUsed": "d85-de-1.algolia.net", - "searchResponse.hitsPerPage": 10, - "searchResponse.parsedQuery": "audi a5", - "searchResponse.timeoutHits": false, - "searchResponse.appliedRules.objectID": "1539345377254,1548767806494", - "searchResponse.facets_stats.Doors.avg": 3, - "searchResponse.facets_stats.Doors.max": 5, - "searchResponse.facets_stats.Doors.min": 2, - "searchResponse.facets_stats.Doors.sum": 48, - "searchResponse.facets_stats.Price.avg": 13210, - "searchResponse.facets_stats.Price.max": 15980, - "searchResponse.facets_stats.Price.min": 9950, - "searchResponse.facets_stats.Price.sum": 171730, - "searchResponse.facets_stats.VrmYear.avg": 2013, - "searchResponse.facets_stats.VrmYear.max": 2017, - "searchResponse.facets_stats.VrmYear.min": 2009, - "searchResponse.facets_stats.VrmYear.sum": 26171, - "searchResponse.timeoutCounts": false, - "browser": "Chrome", - "browser_version": "80.0.3987.163", - "device": "Macintosh", - "os": "Mac OS" - } - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "user12345" - }, - "statusCode": 200 - }, { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/alias", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "previousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", - "newId": "user12345" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "user12345" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 14", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html" - } - }, - "request_ip": "1.1.1.1", - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "12345", - "eventName": "Page View ApplicationLoaded", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "eventTime": 1571051718299, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "12345" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 15", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html" - } - }, - "request_ip": "1.1.1.1", - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "12345", - "eventName": "Page View ApplicationLoaded", - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "eventTime": 1571051718299, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "12345" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 16", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html" - } - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html", - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 17", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html" - } - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "searchResponse": { - "hits": [ - { - "Vrm": "026067", - "Make": "AUDI", - "Year": 2010, - "DName": "PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH", - "Model": "A5", - "Price": 13990, - "Mileage": 163000, - "DealerId": "1f338e5b-740f-6a38-bee1-ecff97acda69", - "Derivative": "A5 Cabrio 1.8 TFSI Cabrio" - }, - { - "Vrm": "4527", - "Make": "AUDI", - "Year": 2009, - "DName": "Stephan Walters - Autohaus Walters", - "Model": "A5", - "Price": 14450, - "Mileage": 99990, - "DealerId": "68c7b5ae-8cf0-6595-9fd2-8644b9682838", - "Derivative": "A5 Cabrio 40 TFSI S tronic S line Cabrio" - }, - { - "Vrm": "10007", - "Make": "AUDI", - "Year": 2017, - "DName": "ps kfz-vertrieb GmbH", - "Model": "A5", - "Price": 14580, - "Mileage": 151500, - "DealerId": "a107e9a8-ac3c-6790-bb84-052dd5eed5e8", - "Derivative": "A5 Sportback 2.0 TDI ultra S tronic Coupe" - }, - { - "Vrm": "031983", - "Make": "AUDI", - "Year": 2012, - "DName": "Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\"", - "Model": "A5", - "Price": 10980, - "Mileage": 197335, - "DealerId": "8a574713-2fbe-6f0c-b1a8-39ba7ee683fc", - "Derivative": "A5 2.0 TDI Sportback DPF multitronic Coupe" - }, - { - "Vrm": "042012", - "Make": "AUDI", - "Year": 2015, - "DName": "Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\"", - "Model": "A5", - "Price": 15980, - "Mileage": 144205, - "DealerId": "8a574713-2fbe-6f0c-b1a8-39ba7ee683fc", - "Derivative": "A5 Coupe 35 TDI S tronic S line Coupe" - }, - { - "Vrm": "002743", - "Make": "AUDI", - "Year": 2010, - "DName": "Auto Mayer e.K.Inh. Skelcim Imeri", - "Model": "A5", - "Price": 13980, - "Mileage": 121015, - "DealerId": "972258cb-132f-62a9-bd31-e02f9f70fa7b", - "Derivative": "A5 Cabrio 2.0 TDI DPF Cabrio" - }, - { - "Vrm": "205536_3895", - "Make": "AUDI", - "Year": 2011, - "DName": "Autohaus Löbau GmbH", - "Model": "A5", - "Price": 12790, - "Mileage": 89236, - "DealerId": "9e697219-293e-63a0-884a-2d03f77bbbef", - "Derivative": "A5 2.0 TDI Sportback DPF Coupe" - }, - { - "Vrm": "116265", - "Make": "AUDI", - "Year": 2016, - "DName": "Elspass Autoland GmbH & Co. KG", - "Model": "A1", - "Price": 14690, - "Mileage": 42800, - "DealerId": "00c1bf3f-b19d-6198-a509-c7f2ff73c29a", - "Derivative": "A1 1.0 TFSI ultra Limousine" - }, - { - "Vrm": "010159", - "Make": "AUDI", - "Year": 2013, - "DName": "Hermann Meyer GmbH & Co. KG", - "Model": "A1", - "Price": 9950, - "Mileage": 93996, - "DealerId": "35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "Derivative": "A1 1.4 TFSI Ambition Limousine" - }, - { - "Vrm": "010178", - "Make": "AUDI", - "Year": 2016, - "DName": "Hermann Meyer GmbH & Co. KG", - "Model": "A1", - "Price": 12950, - "Mileage": 69454, - "DealerId": "35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "Derivative": "A1 1.4 TFSI Sportback S tronic Attraction Limousine" - } - ], - "page": 0, - "merge": { - "nbHitsMax": 1000, - "nbHitslimit": 1000, - "nbSearchers": 2, - "nbHitsProcessed": 10, - "personalization": { - "impact": 100, - "enabled": true, - "profile": { - "time": 0, - "facets": {}, - "taskID": 0 - }, - "percentile": 0, - "nbPersoScanned": 0, - "nbPersoSkipped": 0, - "nbPersoReranked": 0, - "nbPersoReturned": 0, - "nbPersoSelected": 0, - "nbRelevanceBuckets": 8 - }, - "lastHitToDisplay": 10, - "nbHitsNumberingEnd": 10 - }, - "nbHits": 13, - "nbPages": 2, - "queryID": "c5a176f8493236fcbfe69c3298d41659", - "indexUsed": "Germany_prod_stock_Finance_0", - "serverUsed": "d85-de-1.algolia.net", - "hitsPerPage": 10, - "parsedQuery": "audi a5", - "timeoutHits": false, - "appliedRules": [ - { - "objectID": "1539345377254" - }, - { - "objectID": "1548767806494" - } - ], - "facets_stats": { - "Doors": { - "avg": 3, - "max": 5, - "min": 2, - "sum": 48 - }, - "Price": { - "avg": 13210, - "max": 15980, - "min": 9950, - "sum": 171730 - }, - "VrmYear": { - "avg": 2013, - "max": 2017, - "min": 2009, - "sum": 26171 - } - }, - "timeoutCounts": false - } - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html", - "searchResponse.hits.Vrm": "026067,4527,10007,031983,042012,002743,205536_3895,116265,010159,010178", - "searchResponse.hits.Make": "AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI", - "searchResponse.hits.Year": "2010,2009,2017,2012,2015,2010,2011,2016,2013,2016", - "searchResponse.hits.DName": "PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH,Stephan Walters - Autohaus Walters,ps kfz-vertrieb GmbH,Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\",Hüseyin Zan Fahrzeughandel \"Autopark Grendelmatt\",Auto Mayer e.K.Inh. Skelcim Imeri,Autohaus Löbau GmbH,Elspass Autoland GmbH & Co. KG,Hermann Meyer GmbH & Co. KG,Hermann Meyer GmbH & Co. KG", - "searchResponse.hits.Model": "A5,A5,A5,A5,A5,A5,A5,A1,A1,A1", - "searchResponse.hits.Price": "13990,14450,14580,10980,15980,13980,12790,14690,9950,12950", - "searchResponse.hits.Mileage": "163000,99990,151500,197335,144205,121015,89236,42800,93996,69454", - "searchResponse.hits.DealerId": "1f338e5b-740f-6a38-bee1-ecff97acda69,68c7b5ae-8cf0-6595-9fd2-8644b9682838,a107e9a8-ac3c-6790-bb84-052dd5eed5e8,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,972258cb-132f-62a9-bd31-e02f9f70fa7b,9e697219-293e-63a0-884a-2d03f77bbbef,00c1bf3f-b19d-6198-a509-c7f2ff73c29a,35d4fe7e-81a0-6e99-a575-6f62bffb8900,35d4fe7e-81a0-6e99-a575-6f62bffb8900", - "searchResponse.hits.Derivative": "A5 Cabrio 1.8 TFSI Cabrio,A5 Cabrio 40 TFSI S tronic S line Cabrio,A5 Sportback 2.0 TDI ultra S tronic Coupe,A5 2.0 TDI Sportback DPF multitronic Coupe,A5 Coupe 35 TDI S tronic S line Coupe,A5 Cabrio 2.0 TDI DPF Cabrio,A5 2.0 TDI Sportback DPF Coupe,A1 1.0 TFSI ultra Limousine,A1 1.4 TFSI Ambition Limousine,A1 1.4 TFSI Sportback S tronic Attraction Limousine", - "searchResponse.page": 0, - "searchResponse.merge.nbHitsMax": 1000, - "searchResponse.merge.nbHitslimit": 1000, - "searchResponse.merge.nbSearchers": 2, - "searchResponse.merge.nbHitsProcessed": 10, - "searchResponse.merge.personalization.impact": 100, - "searchResponse.merge.personalization.enabled": true, - "searchResponse.merge.personalization.profile.time": 0, - "searchResponse.merge.personalization.profile.taskID": 0, - "searchResponse.merge.personalization.percentile": 0, - "searchResponse.merge.personalization.nbPersoScanned": 0, - "searchResponse.merge.personalization.nbPersoSkipped": 0, - "searchResponse.merge.personalization.nbPersoReranked": 0, - "searchResponse.merge.personalization.nbPersoReturned": 0, - "searchResponse.merge.personalization.nbPersoSelected": 0, - "searchResponse.merge.personalization.nbRelevanceBuckets": 8, - "searchResponse.merge.lastHitToDisplay": 10, - "searchResponse.merge.nbHitsNumberingEnd": 10, - "searchResponse.nbHits": 13, - "searchResponse.nbPages": 2, - "searchResponse.queryID": "c5a176f8493236fcbfe69c3298d41659", - "searchResponse.indexUsed": "Germany_prod_stock_Finance_0", - "searchResponse.serverUsed": "d85-de-1.algolia.net", - "searchResponse.hitsPerPage": 10, - "searchResponse.parsedQuery": "audi a5", - "searchResponse.timeoutHits": false, - "searchResponse.appliedRules.objectID": "1539345377254,1548767806494", - "searchResponse.facets_stats.Doors.avg": 3, - "searchResponse.facets_stats.Doors.max": 5, - "searchResponse.facets_stats.Doors.min": 2, - "searchResponse.facets_stats.Doors.sum": 48, - "searchResponse.facets_stats.Price.avg": 13210, - "searchResponse.facets_stats.Price.max": 15980, - "searchResponse.facets_stats.Price.min": 9950, - "searchResponse.facets_stats.Price.sum": 171730, - "searchResponse.facets_stats.VrmYear.avg": 2013, - "searchResponse.facets_stats.VrmYear.max": 2017, - "searchResponse.facets_stats.VrmYear.min": 2009, - "searchResponse.facets_stats.VrmYear.sum": 26171, - "searchResponse.timeoutCounts": false - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 18", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - }, - "page": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html" - } - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "searchResponse": { - "primitiveArr1": [ - "abc", - "def" - ], - "primitiveArr2": [ - 1, - 2, - 3 - ], - "arrOfArr": [ - [ - "abc", - "def" - ], - [ - 1, - 2, - 3 - ] - ], - "emptyArr": [], - "complexArr1": [ - { - "crr1K1": { - "discardK1": "discardV1" - } - } - ] - } - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "path": "/tests/html/index4.html", - "referrer": "", - "search": "abc", - "title": "Test Page", - "url": "http://localhost/tests/html/index4.html", - "searchResponse.primitiveArr1": "abc,def", - "searchResponse.primitiveArr2": "1,2,3" - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 19", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - }, - "campaign": {} - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "indicative", - "description": "Test 20", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "message": { - "anonymousId": "8d872292709c6fbe", - "channel": "mobile", - "context": { - "app": { - "build": "1", - "name": "AMTestProject", - "namespace": "com.rudderstack.android.rudderstack.sampleAndroidApp", - "version": "1.0" - }, - "device": { - "id": "8d872292709c6fbe", - "manufacturer": "Google", - "model": "AOSPonIAEmulator", - "name": "generic_x86_arm", - "type": "android" - }, - "library": { - "name": "com.rudderstack.android.sdk.core", - "version": "1.0.2" - }, - "locale": "en-US", - "network": { - "carrier": "Android", - "bluetooth": false, - "cellular": true, - "wifi": true - }, - "os": { - "name": "Android", - "version": "9" - }, - "screen": { - "density": 420, - "height": 1794, - "width": 1080 - }, - "timezone": "Asia/Kolkata", - "traits": { - "address": { - "city": "kolkata", - "country": "India" - } - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "event": "Product Clicked", - "integrations": { - "All": true - }, - "messageId": "1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06", - "properties": { - "revenue": "30", - "currency": "USD", - "quantity": "5", - "test_key_2": { - "test_child_key_1": "test_child_value_1" - }, - "price": "58.0" - }, - "originalTimestamp": "2020-05-25T18:37:10.917Z", - "type": "track", - "userId": "sample_user_id" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "sample_user_id", - "eventName": "Product Clicked", - "properties": { - "revenue": "30", - "currency": "USD", - "quantity": "5", - "test_key_2.test_child_key_1": "test_child_value_1", - "price": "58.0", - "device": "Android 9", - "os": "Android" - }, - "eventTime": 1590431830917, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "sample_user_id" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'indicative', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + userId: '123456', + type: 'identify', + traits: { + anonymousId: 'anon_id', + email: 'sayan@gmail.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/identify', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + uniqueId: '123456', + properties: { + email: 'sayan@gmail.com', + 'address.city': 'kolkata', + 'address.country': 'India', + 'address.postalCode': 712136, + 'address.state': 'WB', + 'address.street': '', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '123456', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/alias', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + previousId: 'anon_id', + newId: '123456', + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '123456', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'sayan@gmail.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/identify', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + uniqueId: '123456', + properties: { + email: 'sayan@gmail.com', + 'address.city': 'kolkata', + 'address.country': 'India', + 'address.postalCode': 712136, + 'address.state': 'WB', + 'address.street': '', + ip: '0.0.0.0', + age: 26, + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '123456', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/alias', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + previousId: '123456', + newId: '123456', + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '123456', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + request_ip: '1.1.1.1', + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: '12345', + eventName: 'Page View ApplicationLoaded', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + eventTime: 1571051718299, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '12345', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + request_ip: '1.1.1.1', + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + name: 'ApplicationLoaded', + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: '12345', + eventName: 'Page View ApplicationLoaded', + properties: { + name: 'ApplicationLoaded', + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + eventTime: 1571051718299, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '12345', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + request_ip: '1.1.1.1', + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: '12345', + eventName: 'Page View', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + eventTime: 1571051718299, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '12345', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + request_ip: '1.1.1.1', + type: 'screen', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + name: 'Home', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: '12345', + eventName: 'Screen View Home', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + eventTime: 1571051718299, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '12345', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + originalTimestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '79313729-7fe5-4204-963a-dc46f4205e4e', + originalTimestamp: '2020-01-24T06:29:02.366Z', + previousId: 'test_previous_id', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53711', + sentAt: '2020-01-24T06:29:02.366Z', + timestamp: '2020-01-24T11:59:02.403+05:30', + type: 'alias', + userId: 'test_new_user_id', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/alias', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + previousId: 'test_previous_id', + newId: 'test_new_user_id', + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_new_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '79313729-7fe5-4204-963a-dc46f4205e4e', + originalTimestamp: '2020-01-24T06:29:02.366Z', + previousId: 'test_previous_id', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53711', + sentAt: '2020-01-24T06:29:02.366Z', + timestamp: '2020-01-24T11:59:02.403+05:30', + userId: 'test_new_user_id', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message Type is not present. Aborting message.', + statTags: { + destType: 'INDICATIVE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + type: 'group', + traits: { + anonymousId: '123456', + email: 'sayan@gmail.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message type group not supported', + statTags: { + destType: 'INDICATIVE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 11', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + 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', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'test_anon_id', + type: 'identify', + traits: { + anonymousId: 'test_anon_id', + email: 'sayan@gmail.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/identify', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + uniqueId: 'test_anon_id', + properties: { + email: 'sayan@gmail.com', + 'address.city': 'kolkata', + 'address.country': 'India', + 'address.postalCode': 712136, + 'address.state': 'WB', + 'address.street': '', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + userId: 'test_anon_id', + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 12', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + searchResponse: { + hits: [ + { + Vrm: '026067', + Make: 'AUDI', + Year: 2010, + DName: 'PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH', + Model: 'A5', + Price: 13990, + Mileage: 163000, + DealerId: '1f338e5b-740f-6a38-bee1-ecff97acda69', + Derivative: 'A5 Cabrio 1.8 TFSI Cabrio', + }, + { + Vrm: '4527', + Make: 'AUDI', + Year: 2009, + DName: 'Stephan Walters - Autohaus Walters', + Model: 'A5', + Price: 14450, + Mileage: 99990, + DealerId: '68c7b5ae-8cf0-6595-9fd2-8644b9682838', + Derivative: 'A5 Cabrio 40 TFSI S tronic S line Cabrio', + }, + { + Vrm: '10007', + Make: 'AUDI', + Year: 2017, + DName: 'ps kfz-vertrieb GmbH', + Model: 'A5', + Price: 14580, + Mileage: 151500, + DealerId: 'a107e9a8-ac3c-6790-bb84-052dd5eed5e8', + Derivative: 'A5 Sportback 2.0 TDI ultra S tronic Coupe', + }, + { + Vrm: '031983', + Make: 'AUDI', + Year: 2012, + DName: 'Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt"', + Model: 'A5', + Price: 10980, + Mileage: 197335, + DealerId: '8a574713-2fbe-6f0c-b1a8-39ba7ee683fc', + Derivative: 'A5 2.0 TDI Sportback DPF multitronic Coupe', + }, + { + Vrm: '042012', + Make: 'AUDI', + Year: 2015, + DName: 'Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt"', + Model: 'A5', + Price: 15980, + Mileage: 144205, + DealerId: '8a574713-2fbe-6f0c-b1a8-39ba7ee683fc', + Derivative: 'A5 Coupe 35 TDI S tronic S line Coupe', + }, + { + Vrm: '002743', + Make: 'AUDI', + Year: 2010, + DName: 'Auto Mayer e.K.Inh. Skelcim Imeri', + Model: 'A5', + Price: 13980, + Mileage: 121015, + DealerId: '972258cb-132f-62a9-bd31-e02f9f70fa7b', + Derivative: 'A5 Cabrio 2.0 TDI DPF Cabrio', + }, + { + Vrm: '205536_3895', + Make: 'AUDI', + Year: 2011, + DName: 'Autohaus Löbau GmbH', + Model: 'A5', + Price: 12790, + Mileage: 89236, + DealerId: '9e697219-293e-63a0-884a-2d03f77bbbef', + Derivative: 'A5 2.0 TDI Sportback DPF Coupe', + }, + { + Vrm: '116265', + Make: 'AUDI', + Year: 2016, + DName: 'Elspass Autoland GmbH & Co. KG', + Model: 'A1', + Price: 14690, + Mileage: 42800, + DealerId: '00c1bf3f-b19d-6198-a509-c7f2ff73c29a', + Derivative: 'A1 1.0 TFSI ultra Limousine', + }, + { + Vrm: '010159', + Make: 'AUDI', + Year: 2013, + DName: 'Hermann Meyer GmbH & Co. KG', + Model: 'A1', + Price: 9950, + Mileage: 93996, + DealerId: '35d4fe7e-81a0-6e99-a575-6f62bffb8900', + Derivative: 'A1 1.4 TFSI Ambition Limousine', + }, + { + Vrm: '010178', + Make: 'AUDI', + Year: 2016, + DName: 'Hermann Meyer GmbH & Co. KG', + Model: 'A1', + Price: 12950, + Mileage: 69454, + DealerId: '35d4fe7e-81a0-6e99-a575-6f62bffb8900', + Derivative: 'A1 1.4 TFSI Sportback S tronic Attraction Limousine', + }, + ], + page: 0, + merge: { + nbHitsMax: 1000, + nbHitslimit: 1000, + nbSearchers: 2, + nbHitsProcessed: 10, + personalization: { + impact: 100, + enabled: true, + profile: { + time: 0, + facets: {}, + taskID: 0, + }, + percentile: 0, + nbPersoScanned: 0, + nbPersoSkipped: 0, + nbPersoReranked: 0, + nbPersoReturned: 0, + nbPersoSelected: 0, + nbRelevanceBuckets: 8, + }, + lastHitToDisplay: 10, + nbHitsNumberingEnd: 10, + }, + nbHits: 13, + nbPages: 2, + queryID: 'c5a176f8493236fcbfe69c3298d41659', + indexUsed: 'Germany_prod_stock_Finance_0', + serverUsed: 'd85-de-1.algolia.net', + hitsPerPage: 10, + parsedQuery: 'audi a5', + timeoutHits: false, + appliedRules: [ + { + objectID: '1539345377254', + }, + { + objectID: '1548767806494', + }, + ], + facets_stats: { + Doors: { + avg: 3, + max: 5, + min: 2, + sum: 48, + }, + Price: { + avg: 13210, + max: 15980, + min: 9950, + sum: 171730, + }, + VrmYear: { + avg: 2013, + max: 2017, + min: 2009, + sum: 26171, + }, + }, + timeoutCounts: false, + }, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + 'searchResponse.hits.Vrm': + '026067,4527,10007,031983,042012,002743,205536_3895,116265,010159,010178', + 'searchResponse.hits.Make': 'AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI', + 'searchResponse.hits.Year': '2010,2009,2017,2012,2015,2010,2011,2016,2013,2016', + 'searchResponse.hits.DName': + 'PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH,Stephan Walters - Autohaus Walters,ps kfz-vertrieb GmbH,Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt",Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt",Auto Mayer e.K.Inh. Skelcim Imeri,Autohaus Löbau GmbH,Elspass Autoland GmbH & Co. KG,Hermann Meyer GmbH & Co. KG,Hermann Meyer GmbH & Co. KG', + 'searchResponse.hits.Model': 'A5,A5,A5,A5,A5,A5,A5,A1,A1,A1', + 'searchResponse.hits.Price': + '13990,14450,14580,10980,15980,13980,12790,14690,9950,12950', + 'searchResponse.hits.Mileage': + '163000,99990,151500,197335,144205,121015,89236,42800,93996,69454', + 'searchResponse.hits.DealerId': + '1f338e5b-740f-6a38-bee1-ecff97acda69,68c7b5ae-8cf0-6595-9fd2-8644b9682838,a107e9a8-ac3c-6790-bb84-052dd5eed5e8,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,972258cb-132f-62a9-bd31-e02f9f70fa7b,9e697219-293e-63a0-884a-2d03f77bbbef,00c1bf3f-b19d-6198-a509-c7f2ff73c29a,35d4fe7e-81a0-6e99-a575-6f62bffb8900,35d4fe7e-81a0-6e99-a575-6f62bffb8900', + 'searchResponse.hits.Derivative': + 'A5 Cabrio 1.8 TFSI Cabrio,A5 Cabrio 40 TFSI S tronic S line Cabrio,A5 Sportback 2.0 TDI ultra S tronic Coupe,A5 2.0 TDI Sportback DPF multitronic Coupe,A5 Coupe 35 TDI S tronic S line Coupe,A5 Cabrio 2.0 TDI DPF Cabrio,A5 2.0 TDI Sportback DPF Coupe,A1 1.0 TFSI ultra Limousine,A1 1.4 TFSI Ambition Limousine,A1 1.4 TFSI Sportback S tronic Attraction Limousine', + 'searchResponse.page': 0, + 'searchResponse.merge.nbHitsMax': 1000, + 'searchResponse.merge.nbHitslimit': 1000, + 'searchResponse.merge.nbSearchers': 2, + 'searchResponse.merge.nbHitsProcessed': 10, + 'searchResponse.merge.personalization.impact': 100, + 'searchResponse.merge.personalization.enabled': true, + 'searchResponse.merge.personalization.profile.time': 0, + 'searchResponse.merge.personalization.profile.taskID': 0, + 'searchResponse.merge.personalization.percentile': 0, + 'searchResponse.merge.personalization.nbPersoScanned': 0, + 'searchResponse.merge.personalization.nbPersoSkipped': 0, + 'searchResponse.merge.personalization.nbPersoReranked': 0, + 'searchResponse.merge.personalization.nbPersoReturned': 0, + 'searchResponse.merge.personalization.nbPersoSelected': 0, + 'searchResponse.merge.personalization.nbRelevanceBuckets': 8, + 'searchResponse.merge.lastHitToDisplay': 10, + 'searchResponse.merge.nbHitsNumberingEnd': 10, + 'searchResponse.nbHits': 13, + 'searchResponse.nbPages': 2, + 'searchResponse.queryID': 'c5a176f8493236fcbfe69c3298d41659', + 'searchResponse.indexUsed': 'Germany_prod_stock_Finance_0', + 'searchResponse.serverUsed': 'd85-de-1.algolia.net', + 'searchResponse.hitsPerPage': 10, + 'searchResponse.parsedQuery': 'audi a5', + 'searchResponse.timeoutHits': false, + 'searchResponse.appliedRules.objectID': '1539345377254,1548767806494', + 'searchResponse.facets_stats.Doors.avg': 3, + 'searchResponse.facets_stats.Doors.max': 5, + 'searchResponse.facets_stats.Doors.min': 2, + 'searchResponse.facets_stats.Doors.sum': 48, + 'searchResponse.facets_stats.Price.avg': 13210, + 'searchResponse.facets_stats.Price.max': 15980, + 'searchResponse.facets_stats.Price.min': 9950, + 'searchResponse.facets_stats.Price.sum': 171730, + 'searchResponse.facets_stats.VrmYear.avg': 2013, + 'searchResponse.facets_stats.VrmYear.max': 2017, + 'searchResponse.facets_stats.VrmYear.min': 2009, + 'searchResponse.facets_stats.VrmYear.sum': 26171, + 'searchResponse.timeoutCounts': false, + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 13', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '1afmecIpsJm7D72aRTksxyODrwR', + Name: 'Segment', + DestinationDefinition: { + ID: '1afjjahf0X5lSyNze7Xh7aqJs11', + Name: 'SEGMENT', + DisplayName: 'Segment', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: { + writeKey: 'abcdefghijklmnopqrstuvwxyz', + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'ac7722c2-ccb6-4ae2-baf6-1effe861f4cd', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1-rc.2', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1-rc.2', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/index4.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index4.html', + }, + screen: { + density: 2, + }, + traits: { + age: 23, + email: 'testmp@email.com', + firstname: 'Test Transformer', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36', + }, + event: 'JuhuSearchResults', + integrations: { + All: true, + }, + messageId: '584fde02-901a-4964-a4a0-4078b999d5b2', + originalTimestamp: '2020-04-17T14:55:31.372Z', + traits: { + searchResponse: { + hits: [ + { + Vrm: '026067', + Make: 'AUDI', + Year: 2010, + DName: 'PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH', + Model: 'A5', + Price: 13990, + Mileage: 163000, + DealerId: '1f338e5b-740f-6a38-bee1-ecff97acda69', + Derivative: 'A5 Cabrio 1.8 TFSI Cabrio', + }, + { + Vrm: '4527', + Make: 'AUDI', + Year: 2009, + DName: 'Stephan Walters - Autohaus Walters', + Model: 'A5', + Price: 14450, + Mileage: 99990, + DealerId: '68c7b5ae-8cf0-6595-9fd2-8644b9682838', + Derivative: 'A5 Cabrio 40 TFSI S tronic S line Cabrio', + }, + { + Vrm: '10007', + Make: 'AUDI', + Year: 2017, + DName: 'ps kfz-vertrieb GmbH', + Model: 'A5', + Price: 14580, + Mileage: 151500, + DealerId: 'a107e9a8-ac3c-6790-bb84-052dd5eed5e8', + Derivative: 'A5 Sportback 2.0 TDI ultra S tronic Coupe', + }, + { + Vrm: '031983', + Make: 'AUDI', + Year: 2012, + DName: 'Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt"', + Model: 'A5', + Price: 10980, + Mileage: 197335, + DealerId: '8a574713-2fbe-6f0c-b1a8-39ba7ee683fc', + Derivative: 'A5 2.0 TDI Sportback DPF multitronic Coupe', + }, + { + Vrm: '042012', + Make: 'AUDI', + Year: 2015, + DName: 'Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt"', + Model: 'A5', + Price: 15980, + Mileage: 144205, + DealerId: '8a574713-2fbe-6f0c-b1a8-39ba7ee683fc', + Derivative: 'A5 Coupe 35 TDI S tronic S line Coupe', + }, + { + Vrm: '002743', + Make: 'AUDI', + Year: 2010, + DName: 'Auto Mayer e.K.Inh. Skelcim Imeri', + Model: 'A5', + Price: 13980, + Mileage: 121015, + DealerId: '972258cb-132f-62a9-bd31-e02f9f70fa7b', + Derivative: 'A5 Cabrio 2.0 TDI DPF Cabrio', + }, + { + Vrm: '205536_3895', + Make: 'AUDI', + Year: 2011, + DName: 'Autohaus Löbau GmbH', + Model: 'A5', + Price: 12790, + Mileage: 89236, + DealerId: '9e697219-293e-63a0-884a-2d03f77bbbef', + Derivative: 'A5 2.0 TDI Sportback DPF Coupe', + }, + { + Vrm: '116265', + Make: 'AUDI', + Year: 2016, + DName: 'Elspass Autoland GmbH & Co. KG', + Model: 'A1', + Price: 14690, + Mileage: 42800, + DealerId: '00c1bf3f-b19d-6198-a509-c7f2ff73c29a', + Derivative: 'A1 1.0 TFSI ultra Limousine', + }, + { + Vrm: '010159', + Make: 'AUDI', + Year: 2013, + DName: 'Hermann Meyer GmbH & Co. KG', + Model: 'A1', + Price: 9950, + Mileage: 93996, + DealerId: '35d4fe7e-81a0-6e99-a575-6f62bffb8900', + Derivative: 'A1 1.4 TFSI Ambition Limousine', + }, + { + Vrm: '010178', + Make: 'AUDI', + Year: 2016, + DName: 'Hermann Meyer GmbH & Co. KG', + Model: 'A1', + Price: 12950, + Mileage: 69454, + DealerId: '35d4fe7e-81a0-6e99-a575-6f62bffb8900', + Derivative: 'A1 1.4 TFSI Sportback S tronic Attraction Limousine', + }, + ], + page: 0, + merge: { + nbHitsMax: 1000, + nbHitslimit: 1000, + nbSearchers: 2, + nbHitsProcessed: 10, + personalization: { + impact: 100, + enabled: true, + profile: { + time: 0, + facets: {}, + taskID: 0, + }, + percentile: 0, + nbPersoScanned: 0, + nbPersoSkipped: 0, + nbPersoReranked: 0, + nbPersoReturned: 0, + nbPersoSelected: 0, + nbRelevanceBuckets: 8, + }, + lastHitToDisplay: 10, + nbHitsNumberingEnd: 10, + }, + nbHits: 13, + nbPages: 2, + queryID: 'c5a176f8493236fcbfe69c3298d41659', + indexUsed: 'Germany_prod_stock_Finance_0', + serverUsed: 'd85-de-1.algolia.net', + hitsPerPage: 10, + parsedQuery: 'audi a5', + timeoutHits: false, + appliedRules: [ + { + objectID: '1539345377254', + }, + { + objectID: '1548767806494', + }, + ], + facets_stats: { + Doors: { + avg: 3, + max: 5, + min: 2, + sum: 48, + }, + Price: { + avg: 13210, + max: 15980, + min: 9950, + sum: 171730, + }, + VrmYear: { + avg: 2013, + max: 2017, + min: 2009, + sum: 26171, + }, + }, + timeoutCounts: false, + }, + }, + receivedAt: '2020-04-17T20:25:31.401+05:30', + request_ip: '[::1]:57365', + sentAt: '2020-04-17T14:55:31.372Z', + timestamp: '2020-04-17T20:25:31.401+05:30', + name: 'test page', + type: 'identify', + userId: 'user12345', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/identify', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + uniqueId: 'user12345', + properties: { + 'searchResponse.hits.Vrm': + '026067,4527,10007,031983,042012,002743,205536_3895,116265,010159,010178', + 'searchResponse.hits.Make': 'AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI', + 'searchResponse.hits.Year': '2010,2009,2017,2012,2015,2010,2011,2016,2013,2016', + 'searchResponse.hits.DName': + 'PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH,Stephan Walters - Autohaus Walters,ps kfz-vertrieb GmbH,Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt",Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt",Auto Mayer e.K.Inh. Skelcim Imeri,Autohaus Löbau GmbH,Elspass Autoland GmbH & Co. KG,Hermann Meyer GmbH & Co. KG,Hermann Meyer GmbH & Co. KG', + 'searchResponse.hits.Model': 'A5,A5,A5,A5,A5,A5,A5,A1,A1,A1', + 'searchResponse.hits.Price': + '13990,14450,14580,10980,15980,13980,12790,14690,9950,12950', + 'searchResponse.hits.Mileage': + '163000,99990,151500,197335,144205,121015,89236,42800,93996,69454', + 'searchResponse.hits.DealerId': + '1f338e5b-740f-6a38-bee1-ecff97acda69,68c7b5ae-8cf0-6595-9fd2-8644b9682838,a107e9a8-ac3c-6790-bb84-052dd5eed5e8,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,972258cb-132f-62a9-bd31-e02f9f70fa7b,9e697219-293e-63a0-884a-2d03f77bbbef,00c1bf3f-b19d-6198-a509-c7f2ff73c29a,35d4fe7e-81a0-6e99-a575-6f62bffb8900,35d4fe7e-81a0-6e99-a575-6f62bffb8900', + 'searchResponse.hits.Derivative': + 'A5 Cabrio 1.8 TFSI Cabrio,A5 Cabrio 40 TFSI S tronic S line Cabrio,A5 Sportback 2.0 TDI ultra S tronic Coupe,A5 2.0 TDI Sportback DPF multitronic Coupe,A5 Coupe 35 TDI S tronic S line Coupe,A5 Cabrio 2.0 TDI DPF Cabrio,A5 2.0 TDI Sportback DPF Coupe,A1 1.0 TFSI ultra Limousine,A1 1.4 TFSI Ambition Limousine,A1 1.4 TFSI Sportback S tronic Attraction Limousine', + 'searchResponse.page': 0, + 'searchResponse.merge.nbHitsMax': 1000, + 'searchResponse.merge.nbHitslimit': 1000, + 'searchResponse.merge.nbSearchers': 2, + 'searchResponse.merge.nbHitsProcessed': 10, + 'searchResponse.merge.personalization.impact': 100, + 'searchResponse.merge.personalization.enabled': true, + 'searchResponse.merge.personalization.profile.time': 0, + 'searchResponse.merge.personalization.profile.taskID': 0, + 'searchResponse.merge.personalization.percentile': 0, + 'searchResponse.merge.personalization.nbPersoScanned': 0, + 'searchResponse.merge.personalization.nbPersoSkipped': 0, + 'searchResponse.merge.personalization.nbPersoReranked': 0, + 'searchResponse.merge.personalization.nbPersoReturned': 0, + 'searchResponse.merge.personalization.nbPersoSelected': 0, + 'searchResponse.merge.personalization.nbRelevanceBuckets': 8, + 'searchResponse.merge.lastHitToDisplay': 10, + 'searchResponse.merge.nbHitsNumberingEnd': 10, + 'searchResponse.nbHits': 13, + 'searchResponse.nbPages': 2, + 'searchResponse.queryID': 'c5a176f8493236fcbfe69c3298d41659', + 'searchResponse.indexUsed': 'Germany_prod_stock_Finance_0', + 'searchResponse.serverUsed': 'd85-de-1.algolia.net', + 'searchResponse.hitsPerPage': 10, + 'searchResponse.parsedQuery': 'audi a5', + 'searchResponse.timeoutHits': false, + 'searchResponse.appliedRules.objectID': '1539345377254,1548767806494', + 'searchResponse.facets_stats.Doors.avg': 3, + 'searchResponse.facets_stats.Doors.max': 5, + 'searchResponse.facets_stats.Doors.min': 2, + 'searchResponse.facets_stats.Doors.sum': 48, + 'searchResponse.facets_stats.Price.avg': 13210, + 'searchResponse.facets_stats.Price.max': 15980, + 'searchResponse.facets_stats.Price.min': 9950, + 'searchResponse.facets_stats.Price.sum': 171730, + 'searchResponse.facets_stats.VrmYear.avg': 2013, + 'searchResponse.facets_stats.VrmYear.max': 2017, + 'searchResponse.facets_stats.VrmYear.min': 2009, + 'searchResponse.facets_stats.VrmYear.sum': 26171, + 'searchResponse.timeoutCounts': false, + browser: 'Chrome', + browser_version: '80.0.3987.163', + device: 'Macintosh', + os: 'Mac OS', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'user12345', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/alias', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + previousId: 'ac7722c2-ccb6-4ae2-baf6-1effe861f4cd', + newId: 'user12345', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'user12345', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 14', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + }, + }, + request_ip: '1.1.1.1', + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: '12345', + eventName: 'Page View ApplicationLoaded', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + eventTime: 1571051718299, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '12345', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 15', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + }, + }, + request_ip: '1.1.1.1', + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: '12345', + eventName: 'Page View ApplicationLoaded', + properties: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + eventTime: 1571051718299, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '12345', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + page: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + }, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 17', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + page: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + }, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + searchResponse: { + hits: [ + { + Vrm: '026067', + Make: 'AUDI', + Year: 2010, + DName: 'PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH', + Model: 'A5', + Price: 13990, + Mileage: 163000, + DealerId: '1f338e5b-740f-6a38-bee1-ecff97acda69', + Derivative: 'A5 Cabrio 1.8 TFSI Cabrio', + }, + { + Vrm: '4527', + Make: 'AUDI', + Year: 2009, + DName: 'Stephan Walters - Autohaus Walters', + Model: 'A5', + Price: 14450, + Mileage: 99990, + DealerId: '68c7b5ae-8cf0-6595-9fd2-8644b9682838', + Derivative: 'A5 Cabrio 40 TFSI S tronic S line Cabrio', + }, + { + Vrm: '10007', + Make: 'AUDI', + Year: 2017, + DName: 'ps kfz-vertrieb GmbH', + Model: 'A5', + Price: 14580, + Mileage: 151500, + DealerId: 'a107e9a8-ac3c-6790-bb84-052dd5eed5e8', + Derivative: 'A5 Sportback 2.0 TDI ultra S tronic Coupe', + }, + { + Vrm: '031983', + Make: 'AUDI', + Year: 2012, + DName: 'Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt"', + Model: 'A5', + Price: 10980, + Mileage: 197335, + DealerId: '8a574713-2fbe-6f0c-b1a8-39ba7ee683fc', + Derivative: 'A5 2.0 TDI Sportback DPF multitronic Coupe', + }, + { + Vrm: '042012', + Make: 'AUDI', + Year: 2015, + DName: 'Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt"', + Model: 'A5', + Price: 15980, + Mileage: 144205, + DealerId: '8a574713-2fbe-6f0c-b1a8-39ba7ee683fc', + Derivative: 'A5 Coupe 35 TDI S tronic S line Coupe', + }, + { + Vrm: '002743', + Make: 'AUDI', + Year: 2010, + DName: 'Auto Mayer e.K.Inh. Skelcim Imeri', + Model: 'A5', + Price: 13980, + Mileage: 121015, + DealerId: '972258cb-132f-62a9-bd31-e02f9f70fa7b', + Derivative: 'A5 Cabrio 2.0 TDI DPF Cabrio', + }, + { + Vrm: '205536_3895', + Make: 'AUDI', + Year: 2011, + DName: 'Autohaus Löbau GmbH', + Model: 'A5', + Price: 12790, + Mileage: 89236, + DealerId: '9e697219-293e-63a0-884a-2d03f77bbbef', + Derivative: 'A5 2.0 TDI Sportback DPF Coupe', + }, + { + Vrm: '116265', + Make: 'AUDI', + Year: 2016, + DName: 'Elspass Autoland GmbH & Co. KG', + Model: 'A1', + Price: 14690, + Mileage: 42800, + DealerId: '00c1bf3f-b19d-6198-a509-c7f2ff73c29a', + Derivative: 'A1 1.0 TFSI ultra Limousine', + }, + { + Vrm: '010159', + Make: 'AUDI', + Year: 2013, + DName: 'Hermann Meyer GmbH & Co. KG', + Model: 'A1', + Price: 9950, + Mileage: 93996, + DealerId: '35d4fe7e-81a0-6e99-a575-6f62bffb8900', + Derivative: 'A1 1.4 TFSI Ambition Limousine', + }, + { + Vrm: '010178', + Make: 'AUDI', + Year: 2016, + DName: 'Hermann Meyer GmbH & Co. KG', + Model: 'A1', + Price: 12950, + Mileage: 69454, + DealerId: '35d4fe7e-81a0-6e99-a575-6f62bffb8900', + Derivative: 'A1 1.4 TFSI Sportback S tronic Attraction Limousine', + }, + ], + page: 0, + merge: { + nbHitsMax: 1000, + nbHitslimit: 1000, + nbSearchers: 2, + nbHitsProcessed: 10, + personalization: { + impact: 100, + enabled: true, + profile: { + time: 0, + facets: {}, + taskID: 0, + }, + percentile: 0, + nbPersoScanned: 0, + nbPersoSkipped: 0, + nbPersoReranked: 0, + nbPersoReturned: 0, + nbPersoSelected: 0, + nbRelevanceBuckets: 8, + }, + lastHitToDisplay: 10, + nbHitsNumberingEnd: 10, + }, + nbHits: 13, + nbPages: 2, + queryID: 'c5a176f8493236fcbfe69c3298d41659', + indexUsed: 'Germany_prod_stock_Finance_0', + serverUsed: 'd85-de-1.algolia.net', + hitsPerPage: 10, + parsedQuery: 'audi a5', + timeoutHits: false, + appliedRules: [ + { + objectID: '1539345377254', + }, + { + objectID: '1548767806494', + }, + ], + facets_stats: { + Doors: { + avg: 3, + max: 5, + min: 2, + sum: 48, + }, + Price: { + avg: 13210, + max: 15980, + min: 9950, + sum: 171730, + }, + VrmYear: { + avg: 2013, + max: 2017, + min: 2009, + sum: 26171, + }, + }, + timeoutCounts: false, + }, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + 'searchResponse.hits.Vrm': + '026067,4527,10007,031983,042012,002743,205536_3895,116265,010159,010178', + 'searchResponse.hits.Make': 'AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI,AUDI', + 'searchResponse.hits.Year': '2010,2009,2017,2012,2015,2010,2011,2016,2013,2016', + 'searchResponse.hits.DName': + 'PISCA PROFESSIONAL INDUSTRIAL SOLUTION Consulting & Acquisition GmbH,Stephan Walters - Autohaus Walters,ps kfz-vertrieb GmbH,Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt",Hüseyin Zan Fahrzeughandel "Autopark Grendelmatt",Auto Mayer e.K.Inh. Skelcim Imeri,Autohaus Löbau GmbH,Elspass Autoland GmbH & Co. KG,Hermann Meyer GmbH & Co. KG,Hermann Meyer GmbH & Co. KG', + 'searchResponse.hits.Model': 'A5,A5,A5,A5,A5,A5,A5,A1,A1,A1', + 'searchResponse.hits.Price': + '13990,14450,14580,10980,15980,13980,12790,14690,9950,12950', + 'searchResponse.hits.Mileage': + '163000,99990,151500,197335,144205,121015,89236,42800,93996,69454', + 'searchResponse.hits.DealerId': + '1f338e5b-740f-6a38-bee1-ecff97acda69,68c7b5ae-8cf0-6595-9fd2-8644b9682838,a107e9a8-ac3c-6790-bb84-052dd5eed5e8,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,8a574713-2fbe-6f0c-b1a8-39ba7ee683fc,972258cb-132f-62a9-bd31-e02f9f70fa7b,9e697219-293e-63a0-884a-2d03f77bbbef,00c1bf3f-b19d-6198-a509-c7f2ff73c29a,35d4fe7e-81a0-6e99-a575-6f62bffb8900,35d4fe7e-81a0-6e99-a575-6f62bffb8900', + 'searchResponse.hits.Derivative': + 'A5 Cabrio 1.8 TFSI Cabrio,A5 Cabrio 40 TFSI S tronic S line Cabrio,A5 Sportback 2.0 TDI ultra S tronic Coupe,A5 2.0 TDI Sportback DPF multitronic Coupe,A5 Coupe 35 TDI S tronic S line Coupe,A5 Cabrio 2.0 TDI DPF Cabrio,A5 2.0 TDI Sportback DPF Coupe,A1 1.0 TFSI ultra Limousine,A1 1.4 TFSI Ambition Limousine,A1 1.4 TFSI Sportback S tronic Attraction Limousine', + 'searchResponse.page': 0, + 'searchResponse.merge.nbHitsMax': 1000, + 'searchResponse.merge.nbHitslimit': 1000, + 'searchResponse.merge.nbSearchers': 2, + 'searchResponse.merge.nbHitsProcessed': 10, + 'searchResponse.merge.personalization.impact': 100, + 'searchResponse.merge.personalization.enabled': true, + 'searchResponse.merge.personalization.profile.time': 0, + 'searchResponse.merge.personalization.profile.taskID': 0, + 'searchResponse.merge.personalization.percentile': 0, + 'searchResponse.merge.personalization.nbPersoScanned': 0, + 'searchResponse.merge.personalization.nbPersoSkipped': 0, + 'searchResponse.merge.personalization.nbPersoReranked': 0, + 'searchResponse.merge.personalization.nbPersoReturned': 0, + 'searchResponse.merge.personalization.nbPersoSelected': 0, + 'searchResponse.merge.personalization.nbRelevanceBuckets': 8, + 'searchResponse.merge.lastHitToDisplay': 10, + 'searchResponse.merge.nbHitsNumberingEnd': 10, + 'searchResponse.nbHits': 13, + 'searchResponse.nbPages': 2, + 'searchResponse.queryID': 'c5a176f8493236fcbfe69c3298d41659', + 'searchResponse.indexUsed': 'Germany_prod_stock_Finance_0', + 'searchResponse.serverUsed': 'd85-de-1.algolia.net', + 'searchResponse.hitsPerPage': 10, + 'searchResponse.parsedQuery': 'audi a5', + 'searchResponse.timeoutHits': false, + 'searchResponse.appliedRules.objectID': '1539345377254,1548767806494', + 'searchResponse.facets_stats.Doors.avg': 3, + 'searchResponse.facets_stats.Doors.max': 5, + 'searchResponse.facets_stats.Doors.min': 2, + 'searchResponse.facets_stats.Doors.sum': 48, + 'searchResponse.facets_stats.Price.avg': 13210, + 'searchResponse.facets_stats.Price.max': 15980, + 'searchResponse.facets_stats.Price.min': 9950, + 'searchResponse.facets_stats.Price.sum': 171730, + 'searchResponse.facets_stats.VrmYear.avg': 2013, + 'searchResponse.facets_stats.VrmYear.max': 2017, + 'searchResponse.facets_stats.VrmYear.min': 2009, + 'searchResponse.facets_stats.VrmYear.sum': 26171, + 'searchResponse.timeoutCounts': false, + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 18', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + page: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + }, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + searchResponse: { + primitiveArr1: ['abc', 'def'], + primitiveArr2: [1, 2, 3], + arrOfArr: [ + ['abc', 'def'], + [1, 2, 3], + ], + emptyArr: [], + complexArr1: [ + { + crr1K1: { + discardK1: 'discardV1', + }, + }, + ], + }, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + path: '/tests/html/index4.html', + referrer: '', + search: 'abc', + title: 'Test Page', + url: 'http://localhost/tests/html/index4.html', + 'searchResponse.primitiveArr1': 'abc,def', + 'searchResponse.primitiveArr2': '1,2,3', + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 19', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + campaign: {}, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'indicative', + description: 'Test 20', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + message: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSPonIAEmulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'kolkata', + country: 'India', + }, + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'Product Clicked', + integrations: { + All: true, + }, + messageId: '1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06', + properties: { + revenue: '30', + currency: 'USD', + quantity: '5', + test_key_2: { + test_child_key_1: 'test_child_value_1', + }, + price: '58.0', + }, + originalTimestamp: '2020-05-25T18:37:10.917Z', + type: 'track', + userId: 'sample_user_id', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'sample_user_id', + eventName: 'Product Clicked', + properties: { + revenue: '30', + currency: 'USD', + quantity: '5', + 'test_key_2.test_child_key_1': 'test_child_value_1', + price: '58.0', + device: 'Android 9', + os: 'Android', + }, + eventTime: 1590431830917, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'sample_user_id', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/indicative/router/data.ts b/test/integrations/destinations/indicative/router/data.ts index 4791ecc369..037d5d5c3d 100644 --- a/test/integrations/destinations/indicative/router/data.ts +++ b/test/integrations/destinations/indicative/router/data.ts @@ -1,313 +1,314 @@ export const data = [ - { - name: 'fb', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1", - "context": { - "device": { - "id": "df16bffa-5c3d-4fbb-9bce-3bab098129a7R", - "manufacturer": "Xiaomi", - "model": "Redmi 6", - "name": "xiaomi" - }, - "network": { - "carrier": "Banglalink" - }, - "os": { - "name": "android", - "version": "8.1.0" - }, - "traits": { - "address": { - "city": "Dhaka", - "country": "Bangladesh" - }, - "anonymousId": "c82cbdff-e5be-4009-ac78-cdeea09ab4b1" - } - }, - "event": "spin_result", - "integrations": { - "AM": true - }, - "message_id": "a80f82be-9bdc-4a9f-b2a5-15621ee41df8", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "userId": "test_user_id", - "timestamp": "2019-09-01T15:46:51.693Z", - "type": "track" - } - }, - { - "destination": { - "Config": { - "apiKey": "abcde" - } - }, - "metadata": { - "jobId": 2 - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "userId": "123456", - "type": "identify", - "traits": { - "anonymousId": "anon_id", - "email": "sayan@gmail.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - } - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - ], - destType: 'indicative', + { + name: 'fb', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + apiKey: 'abcde', }, + }, + metadata: { + jobId: 2, + }, + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + AM: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + userId: 'test_user_id', + timestamp: '2019-09-01T15:46:51.693Z', + type: 'track', + }, + }, + { + destination: { + Config: { + apiKey: 'abcde', + }, + }, + metadata: { + jobId: 2, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: 'anon_id', + userId: '123456', + type: 'identify', + traits: { + anonymousId: 'anon_id', + email: 'sayan@gmail.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, }, + ], + destType: 'indicative', }, - output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/event", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "eventUniqueId": "test_user_id", - "eventName": "spin_result", - "properties": { - "additional_bet_index": 0, - "battle_id": "N/A", - "bet_amount": 9, - "bet_level": 1, - "bet_multiplier": 1, - "coin_balance": 9466052, - "current_module_name": "CasinoGameModule", - "days_in_game": 0, - "extra_param": "N/A", - "fb_profile": "0", - "featureGameType": "N/A", - "game_fps": 30, - "game_id": "fireEagleBase", - "game_name": "FireEagleSlots", - "gem_balance": 0, - "graphicsQuality": "HD", - "idfa": "2bf99787-33d2-4ae2-a76a-c49672f97252", - "internetReachability": "ReachableViaLocalAreaNetwork", - "isLowEndDevice": "False", - "is_auto_spin": "False", - "is_turbo": "False", - "isf": "False", - "ishighroller": "False", - "jackpot_win_amount": 90, - "jackpot_win_type": "Silver", - "level": 6, - "lifetime_gem_balance": 0, - "no_of_spin": 1, - "player_total_battles": 0, - "player_total_shields": 0, - "start_date": "2019-08-01", - "total_payments": 0, - "tournament_id": "T1561970819", - "versionSessionCount": 2, - "win_amount": 0 - }, - "eventTime": 1567352811693, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "test_user_id" - } - ], - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde" - } - } - }, - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/identify", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "uniqueId": "123456", - "properties": { - "email": "sayan@gmail.com", - "address.city": "kolkata", - "address.country": "India", - "address.postalCode": 712136, - "address.state": "WB", - "address.street": "", - "browser": "Chrome", - "browser_version": "77.0.3865.90", - "device": "Macintosh", - "os": "Mac OS" - }, - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "123456" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.indicative.com/service/alias", - "headers": { - "Indicative-Client": "RudderStack", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "previousId": "anon_id", - "newId": "123456", - "apiKey": "abcde" - }, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "123456" - } - ], - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "abcde" - } - } - }, - ], + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/event', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + eventUniqueId: 'test_user_id', + eventName: 'spin_result', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + versionSessionCount: 2, + win_amount: 0, + }, + eventTime: 1567352811693, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'test_user_id', + }, + ], + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'abcde', + }, + }, + }, + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/identify', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + uniqueId: '123456', + properties: { + email: 'sayan@gmail.com', + 'address.city': 'kolkata', + 'address.country': 'India', + 'address.postalCode': 712136, + 'address.state': 'WB', + 'address.street': '', + browser: 'Chrome', + browser_version: '77.0.3865.90', + device: 'Macintosh', + os: 'Mac OS', + }, + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '123456', + }, + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.indicative.com/service/alias', + headers: { + 'Indicative-Client': 'RudderStack', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + previousId: 'anon_id', + newId: '123456', + apiKey: 'abcde', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '123456', + }, + ], + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'abcde', }, + }, }, + ], }, + }, }, + }, ]; diff --git a/test/integrations/destinations/intercom/dataDelivery/data.ts b/test/integrations/destinations/intercom/dataDelivery/data.ts new file mode 100644 index 0000000000..23bcdc6af2 --- /dev/null +++ b/test/integrations/destinations/intercom/dataDelivery/data.ts @@ -0,0 +1,90 @@ +export const data = [ + { + "name": "intercom", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.intercom.io/users/test1", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer intercomApiKey", + "Accept": "application/json", + "Intercom-Version": "1.4" + }, + "params": {}, + "body": { + "JSON": { + "email": "test_1@test.com", + "phone": "9876543210", + "name": "Test Name", + "signed_up_at": 1601493060, + "last_seen_user_agent": "unknown", + "update_last_request_at": true, + "user_id": "test_user_id_1", + "custom_attributes": { + "anonymousId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33", + "key1": "value1", + "address.city": "Kolkata", + "address.state": "West Bengal", + "originalArray[0].nested_field": "nested value", + "originalArray[0].tags[0]": "tag_1", + "originalArray[0].tags[1]": "tag_2", + "originalArray[0].tags[2]": "tag_3", + "originalArray[1].nested_field": "nested value", + "originalArray[1].tags[0]": "tag_1", + "originalArray[2].nested_field": "nested value" + } + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "userId": "58b21c2d-f8d5-4410-a2d0-b268a26b7e33" + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "[Intercom Response Handler] Request failed for destination intercom with status: 408", + "destinationResponse": { + "response": { + "type": "error.list", + "request_id": "000on04msi4jpk7d3u60", + "errors": [ + { + "code": "Request Timeout", + "message": "The server would not wait any longer for the client" + } + ] + }, + "status": 408 + }, + "statTags": { + "destType": "INTERCOM", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/intercom/network.ts b/test/integrations/destinations/intercom/network.ts index 9f064d63ea..e3bba3f260 100644 --- a/test/integrations/destinations/intercom/network.ts +++ b/test/integrations/destinations/intercom/network.ts @@ -90,4 +90,56 @@ const deleteNwData = [ }, }, ]; -export const networkCallsData = [...deleteNwData]; +const deliveryCallsData = [ + { + httpReq: { + url: 'https://api.intercom.io/users/test1', + data: { + email: 'test_1@test.com', + phone: '9876543210', + name: 'Test Name', + signed_up_at: 1601493060, + last_seen_user_agent: 'unknown', + update_last_request_at: true, + user_id: 'test_user_id_1', + custom_attributes: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + key1: 'value1', + 'address.city': 'Kolkata', + 'address.state': 'West Bengal', + 'originalArray[0].nested_field': 'nested value', + 'originalArray[0].tags[0]': 'tag_1', + 'originalArray[0].tags[1]': 'tag_2', + 'originalArray[0].tags[2]': 'tag_3', + 'originalArray[1].nested_field': 'nested value', + 'originalArray[1].tags[0]': 'tag_1', + 'originalArray[2].nested_field': 'nested value', + }, + }, + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer intercomApiKey', + Accept: 'application/json', + 'Intercom-Version': '1.4', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + type: 'error.list', + request_id: '000on04msi4jpk7d3u60', + errors: [ + { + code: 'Request Timeout', + message: 'The server would not wait any longer for the client', + }, + ], + }, + status: 408, + }, + }, +]; +export const networkCallsData = [...deleteNwData, ...deliveryCallsData]; + diff --git a/test/integrations/destinations/kafka/processor/data.ts b/test/integrations/destinations/kafka/processor/data.ts index 6284b88b84..1d5ce820d0 100644 --- a/test/integrations/destinations/kafka/processor/data.ts +++ b/test/integrations/destinations/kafka/processor/data.ts @@ -1,795 +1,795 @@ export const data = [ - { - "name": "kafka", - "description": "Test case with null destination config", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": null, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": true - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "metadata": { - "jobId": "jobId 0", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 0", - "rudderId": "randomRudderId" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": true - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "userId": "userId" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "kafka", - "description": "Test case without userId", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": null, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": true - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track" - }, - "metadata": { - "jobId": "jobId 1", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 1", - "rudderId": "randomRudderId" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": true - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track" - }, - "userId": "anonymousId" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "kafka", - "description": "Test case with null dest config and avro schema", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": null, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": { - "schemaId": "schema001" - } - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "metadata": { - "jobId": "jobId 2", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 2", - "rudderId": "randomRudderId" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": { - "schemaId": "schema001" - } - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "userId": "userId", - "schemaId": "schema001" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "kafka", - "description": "Test case with null dest config and integrations topic", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": null, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": { - "topic": "specific-topic" - } - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "metadata": { - "jobId": "jobId 3", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 3", - "rudderId": "randomRudderId<<>>specific-topic" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "integrations": { - "Kafka": { - "topic": "specific-topic" - } - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "userId": "userId", - "topic": "specific-topic" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "kafka", - "description": "Test case with dest config with default topic", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": { - "topic": "default-topic" - }, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "metadata": { - "jobId": "jobId 4", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 4", - "rudderId": "randomRudderId<<>>default-topic" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "event", - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "userId": "userId", - "topic": "default-topic" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "kafka", - "description": "Test case with dest config with event type topic", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": { - "topic": "default-topic", - "enableMultiTopic": true, - "eventTypeToTopicMap": [ - { - "from": "identify", - "to": "identify-topic" - }, - { - "from": "page", - "to": "page-topic" - }, - { - "from": "screen", - "to": "screen-topic" - }, - { - "from": "group", - "to": "group-topic" - }, - { - "from": "alias", - "to": "alias-topic" - } - ], - "eventToTopicMap": [ - { - "from": "Product Added", - "to": "product-added" - } - ] - }, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "identify", - "userId": "userId" - }, - "metadata": { - "jobId": "jobId 5", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 5", - "rudderId": "randomRudderId<<>>identify-topic" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "identify", - "userId": "userId" - }, - "userId": "userId", - "topic": "identify-topic" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "kafka", - "description": "Test case with dest config with event name topic", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": { - "topic": "default-topic", - "enableMultiTopic": true, - "eventTypeToTopicMap": [ - { - "from": "identify", - "to": "identify-topic" - }, - { - "from": "page", - "to": "page-topic" - }, - { - "from": "screen", - "to": "screen-topic" - }, - { - "from": "group", - "to": "group-topic" - }, - { - "from": "alias", - "to": "alias-topic" - } - ], - "eventToTopicMap": [ - { - "from": "Product Added", - "to": "product-added" - } - ] - }, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "Product Added", - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "metadata": { - "jobId": "jobId 6", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 6", - "rudderId": "randomRudderId<<>>product-added" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "Product Added", - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "userId": "userId", - "topic": "product-added" - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "kafka", - "description": "Test case with dest config with event name topic no match", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "ID": "kafkadestinationid", - "Name": "Kafka", - "Config": { - "topic": "default-topic", - "enableMultiTopic": true, - "eventTypeToTopicMap": [ - { - "from": "identify", - "to": "identify-topic" - }, - { - "from": "page", - "to": "page-topic" - }, - { - "from": "screen", - "to": "screen-topic" - }, - { - "from": "group", - "to": "group-topic" - }, - { - "from": "alias", - "to": "alias-topic" - } - ], - "eventToTopicMap": [ - { - "from": "Product Added", - "to": "product-added" - } - ] - }, - "Enabled": true, - "IsProcessorEnabled": true - }, - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "Product Added No match", - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "metadata": { - "jobId": "jobId 7", - "rudderId": "randomRudderId" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "jobId": "jobId 7", - "rudderId": "randomRudderId<<>>default-topic" - }, - "output": { - "message": { - "anonymousId": "anonymousId", - "context": { - "library": { - "name": "analytics-go", - "version": "3.0.0" - } - }, - "event": "Product Added No match", - "messageId": "messageId", - "originalTimestamp": "2019-07-18T15:00:00Z", - "properties": { - "key": "value" - }, - "receivedAt": "2019-07-18T15:00:00Z", - "sentAt": "2019-07-18T15:00:00Z", - "timestamp": "2019-07-18T15:00:00Z", - "type": "track", - "userId": "userId" - }, - "userId": "userId", - "topic": "default-topic" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'kafka', + description: 'Test case with null destination config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: null, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: true, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + metadata: { + jobId: 'jobId 0', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 0', + rudderId: 'randomRudderId', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: true, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + userId: 'userId', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kafka', + description: 'Test case without userId', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: null, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: true, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + }, + metadata: { + jobId: 'jobId 1', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 1', + rudderId: 'randomRudderId', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: true, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + }, + userId: 'anonymousId', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kafka', + description: 'Test case with null dest config and avro schema', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: null, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: { + schemaId: 'schema001', + }, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + metadata: { + jobId: 'jobId 2', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 2', + rudderId: 'randomRudderId', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: { + schemaId: 'schema001', + }, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + userId: 'userId', + schemaId: 'schema001', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kafka', + description: 'Test case with null dest config and integrations topic', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: null, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: { + topic: 'specific-topic', + }, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + metadata: { + jobId: 'jobId 3', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 3', + rudderId: 'randomRudderId<<>>specific-topic', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + integrations: { + Kafka: { + topic: 'specific-topic', + }, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + userId: 'userId', + topic: 'specific-topic', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kafka', + description: 'Test case with dest config with default topic', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: { + topic: 'default-topic', + }, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + metadata: { + jobId: 'jobId 4', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 4', + rudderId: 'randomRudderId<<>>default-topic', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'event', + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + userId: 'userId', + topic: 'default-topic', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kafka', + description: 'Test case with dest config with event type topic', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: { + topic: 'default-topic', + enableMultiTopic: true, + eventTypeToTopicMap: [ + { + from: 'identify', + to: 'identify-topic', + }, + { + from: 'page', + to: 'page-topic', + }, + { + from: 'screen', + to: 'screen-topic', + }, + { + from: 'group', + to: 'group-topic', + }, + { + from: 'alias', + to: 'alias-topic', + }, + ], + eventToTopicMap: [ + { + from: 'Product Added', + to: 'product-added', + }, + ], + }, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'identify', + userId: 'userId', + }, + metadata: { + jobId: 'jobId 5', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 5', + rudderId: 'randomRudderId<<>>identify-topic', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'identify', + userId: 'userId', + }, + userId: 'userId', + topic: 'identify-topic', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kafka', + description: 'Test case with dest config with event name topic', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: { + topic: 'default-topic', + enableMultiTopic: true, + eventTypeToTopicMap: [ + { + from: 'identify', + to: 'identify-topic', + }, + { + from: 'page', + to: 'page-topic', + }, + { + from: 'screen', + to: 'screen-topic', + }, + { + from: 'group', + to: 'group-topic', + }, + { + from: 'alias', + to: 'alias-topic', + }, + ], + eventToTopicMap: [ + { + from: 'Product Added', + to: 'product-added', + }, + ], + }, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'Product Added', + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + metadata: { + jobId: 'jobId 6', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 6', + rudderId: 'randomRudderId<<>>product-added', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'Product Added', + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + userId: 'userId', + topic: 'product-added', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'kafka', + description: 'Test case with dest config with event name topic no match', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: 'kafkadestinationid', + Name: 'Kafka', + Config: { + topic: 'default-topic', + enableMultiTopic: true, + eventTypeToTopicMap: [ + { + from: 'identify', + to: 'identify-topic', + }, + { + from: 'page', + to: 'page-topic', + }, + { + from: 'screen', + to: 'screen-topic', + }, + { + from: 'group', + to: 'group-topic', + }, + { + from: 'alias', + to: 'alias-topic', + }, + ], + eventToTopicMap: [ + { + from: 'Product Added', + to: 'product-added', + }, + ], + }, + Enabled: true, + IsProcessorEnabled: true, + }, + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'Product Added No match', + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + metadata: { + jobId: 'jobId 7', + rudderId: 'randomRudderId', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 'jobId 7', + rudderId: 'randomRudderId<<>>default-topic', + }, + output: { + message: { + anonymousId: 'anonymousId', + context: { + library: { + name: 'analytics-go', + version: '3.0.0', + }, + }, + event: 'Product Added No match', + messageId: 'messageId', + originalTimestamp: '2019-07-18T15:00:00Z', + properties: { + key: 'value', + }, + receivedAt: '2019-07-18T15:00:00Z', + sentAt: '2019-07-18T15:00:00Z', + timestamp: '2019-07-18T15:00:00Z', + type: 'track', + userId: 'userId', + }, + userId: 'userId', + topic: 'default-topic', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/keen/processor/data.ts b/test/integrations/destinations/keen/processor/data.ts index 9e4f164beb..c785decb8e 100644 --- a/test/integrations/destinations/keen/processor/data.ts +++ b/test/integrations/destinations/keen/processor/data.ts @@ -1,482 +1,489 @@ export const data = [ - { - "name": "keen", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "type": "page", - "context": null, - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "traits": { - "email": "test@gmail.com", - "anonymousId": "anon-id" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com", - "userId": "12345", - "keen": { - "addons": [] - }, - "anonymousId": "00000000000000000000000000", - "user": { - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com" - }, - "userId": "12345" - } - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.keen.io/3.0/projects/abcde/events/Viewed ApplicationLoaded page", - "userId": "12345", - "headers": { - "Content-Type": "application/json", - "Authorization": "xyz" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "keen", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "anonymousId": "123456", - "email": "sayan@gmail.com", - "address": { - "city": "kolkata", - "country": "India", - "postalCode": 712136, - "state": "WB", - "street": "" - }, - "ip": "0.0.0.0", - "age": 26 - }, - "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 - } - }, - "type": "identify", - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "123456", - "userId": "123456", - "integrations": { - "All": true - }, - "traits": { - "anonymousId": "my-anon-id", - "email": "test@gmail.com", - "address": { - "city": "kolkata-1", - "country": "US", - "postalCode": 712136, - "state": "CA", - "street": "" - } - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "error": "Event type identify is not supported", - "statTags": { - "destType": "KEEN", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "processor", - "implementation": "native", - "module": "destination" - }, - "statusCode": 400 - } - ] - } - } - }, - { - "name": "keen", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "traits": { - "email": "test@gmail.com", - "anonymousId": "anon-id" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "search": "abc", - "request_ip": "0.0.0.0", - "title": "Test Page", - "url": "www.rudderlabs.com", - "referrer": "Rudder", - "userId": "12345", - "keen": { - "addons": [ - { - "input": { - "ip": "request_ip" - }, - "name": "keen:ip_to_geo", - "output": "ip_geo_info" - }, - { - "input": { - "ua_string": "user_agent" - }, - "name": "keen:ua_parser", - "output": "parsed_user_agent" - } - ] - }, - "anonymousId": "00000000000000000000000000", - "user": { - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com" - }, - "userId": "12345" - }, - "path": "/test", - "user_agent": "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" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.keen.io/3.0/projects/abcde/events/Viewed ApplicationLoaded page", - "userId": "12345", - "headers": { - "Content-Type": "application/json", - "Authorization": "xyz" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - }, - { - "name": "keen", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event", - "request_ip": "1.1.1.1", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "traits": { - "email": "test@gmail.com", - "anonymousId": "anon-id" - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "request_ip": "1.1.1.1", - "user_time_spent": 50000, - "userId": "12345", - "keen": { - "addons": [ - { - "input": { - "ip": "request_ip" - }, - "name": "keen:ip_to_geo", - "output": "ip_geo_info" - }, - { - "input": { - "ua_string": "user_agent" - }, - "name": "keen:ua_parser", - "output": "parsed_user_agent" - } - ] - }, - "anonymousId": "00000000000000000000000000", - "user": { - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com" - }, - "userId": "12345" - }, - "user_agent": "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" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.keen.io/3.0/projects/abcde/events/test track event", - "userId": "12345", - "headers": { - "Content-Type": "application/json", - "Authorization": "xyz" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'keen', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + type: 'page', + context: null, + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + traits: { + email: 'test@gmail.com', + anonymousId: 'anon-id', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + userId: '12345', + keen: { + addons: [], + }, + anonymousId: '00000000000000000000000000', + user: { + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + }, + userId: '12345', + }, + }, + FORM: {}, + }, + files: {}, + endpoint: + 'https://api.keen.io/3.0/projects/abcde/events/Viewed ApplicationLoaded page', + userId: '12345', + headers: { + 'Content-Type': 'application/json', + Authorization: 'xyz', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'keen', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + anonymousId: '123456', + email: 'sayan@gmail.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + ip: '0.0.0.0', + age: 26, + }, + 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, + }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + integrations: { + All: true, + }, + traits: { + anonymousId: 'my-anon-id', + email: 'test@gmail.com', + address: { + city: 'kolkata-1', + country: 'US', + postalCode: 712136, + state: 'CA', + street: '', + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event type identify is not supported', + statTags: { + destType: 'KEEN', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'keen', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + traits: { + email: 'test@gmail.com', + anonymousId: 'anon-id', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + search: 'abc', + request_ip: '0.0.0.0', + title: 'Test Page', + url: 'www.rudderlabs.com', + referrer: 'Rudder', + userId: '12345', + keen: { + addons: [ + { + input: { + ip: 'request_ip', + }, + name: 'keen:ip_to_geo', + output: 'ip_geo_info', + }, + { + input: { + ua_string: 'user_agent', + }, + name: 'keen:ua_parser', + output: 'parsed_user_agent', + }, + ], + }, + anonymousId: '00000000000000000000000000', + user: { + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + }, + userId: '12345', + }, + path: '/test', + user_agent: + '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', + }, + FORM: {}, + }, + files: {}, + endpoint: + 'https://api.keen.io/3.0/projects/abcde/events/Viewed ApplicationLoaded page', + userId: '12345', + headers: { + 'Content-Type': 'application/json', + Authorization: 'xyz', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'keen', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event', + request_ip: '1.1.1.1', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + traits: { + email: 'test@gmail.com', + anonymousId: 'anon-id', + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + JSON: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + request_ip: '1.1.1.1', + user_time_spent: 50000, + userId: '12345', + keen: { + addons: [ + { + input: { + ip: 'request_ip', + }, + name: 'keen:ip_to_geo', + output: 'ip_geo_info', + }, + { + input: { + ua_string: 'user_agent', + }, + name: 'keen:ua_parser', + output: 'parsed_user_agent', + }, + ], + }, + anonymousId: '00000000000000000000000000', + user: { + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + }, + userId: '12345', + }, + user_agent: + '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', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://api.keen.io/3.0/projects/abcde/events/test track event', + userId: '12345', + headers: { + 'Content-Type': 'application/json', + Authorization: 'xyz', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/keen/router/data.ts b/test/integrations/destinations/keen/router/data.ts index b9deb365d2..d46d2363e2 100644 --- a/test/integrations/destinations/keen/router/data.ts +++ b/test/integrations/destinations/keen/router/data.ts @@ -1,303 +1,308 @@ export const data = [ - { - name: 'fb', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { + { + name: 'fb', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.300Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event', + request_ip: '1.1.1.1', + properties: { + user_actual_role: 'system_admin', + user_actual_id: 12345, + user_time_spent: 50000, + }, + integrations: { + All: true, + }, + traits: { + email: 'test@gmail.com', + anonymousId: 'anon-id', + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, + }, + }, + }, + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'sayan@gmail.com', + anonymousId: '12345', + }, + 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, + }, + }, + type: 'page', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '/test', + referrer: 'Rudder', + search: 'abc', + title: 'Test Page', + url: 'www.rudderlabs.com', + }, + traits: { + email: 'test@gmail.com', + anonymousId: 'anon-id', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, + }, + }, + }, + ], + destType: 'keen', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { body: { - input: [ + XML: {}, + JSON_ARRAY: {}, + JSON: { + user_actual_id: 12345, + user_actual_role: 'system_admin', + request_ip: '1.1.1.1', + user_time_spent: 50000, + userId: '12345', + keen: { + addons: [ { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.300Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event", - "request_ip": "1.1.1.1", - "properties": { - "user_actual_role": "system_admin", - "user_actual_id": 12345, - "user_time_spent": 50000 - }, - "integrations": { - "All": true - }, - "traits": { - "email": "test@gmail.com", - "anonymousId": "anon-id" - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } + input: { + ip: 'request_ip', + }, + name: 'keen:ip_to_geo', + output: 'ip_geo_info', }, { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "sayan@gmail.com", - "anonymousId": "12345" - }, - "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 - } - }, - "type": "page", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "/test", - "referrer": "Rudder", - "search": "abc", - "title": "Test Page", - "url": "www.rudderlabs.com" - }, - "traits": { - "email": "test@gmail.com", - "anonymousId": "anon-id" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } - } - ], - destType: 'keen', + input: { + ua_string: 'user_agent', + }, + name: 'keen:ua_parser', + output: 'parsed_user_agent', + }, + ], + }, + anonymousId: '00000000000000000000000000', + user: { + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + }, + userId: '12345', + }, + user_agent: + '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', + }, + FORM: {}, + }, + files: {}, + endpoint: 'https://api.keen.io/3.0/projects/abcde/events/test track event', + userId: '12345', + headers: { + 'Content-Type': 'application/json', + Authorization: 'xyz', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, }, + }, }, - }, - output: { - response: { - status: 200, + { + batchedRequest: { body: { - output: [ + XML: {}, + JSON_ARRAY: {}, + JSON: { + search: 'abc', + request_ip: '0.0.0.0', + title: 'Test Page', + url: 'www.rudderlabs.com', + referrer: 'Rudder', + userId: '12345', + keen: { + addons: [ { - "batchedRequest": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "user_actual_id": 12345, - "user_actual_role": "system_admin", - "request_ip": "1.1.1.1", - "user_time_spent": 50000, - "userId": "12345", - "keen": { - "addons": [ - { - "input": { - "ip": "request_ip" - }, - "name": "keen:ip_to_geo", - "output": "ip_geo_info" - }, - { - "input": { - "ua_string": "user_agent" - }, - "name": "keen:ua_parser", - "output": "parsed_user_agent" - } - ] - }, - "anonymousId": "00000000000000000000000000", - "user": { - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com" - }, - "userId": "12345" - }, - "user_agent": "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" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.keen.io/3.0/projects/abcde/events/test track event", - "userId": "12345", - "headers": { - "Content-Type": "application/json", - "Authorization": "xyz" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } + input: { + ip: 'request_ip', + }, + name: 'keen:ip_to_geo', + output: 'ip_geo_info', }, { - "batchedRequest": { - "body": { - "XML": {}, - "JSON_ARRAY": {}, - "JSON": { - "search": "abc", - "request_ip": "0.0.0.0", - "title": "Test Page", - "url": "www.rudderlabs.com", - "referrer": "Rudder", - "userId": "12345", - "keen": { - "addons": [ - { - "input": { - "ip": "request_ip" - }, - "name": "keen:ip_to_geo", - "output": "ip_geo_info" - }, - { - "input": { - "ua_string": "user_agent" - }, - "name": "keen:ua_parser", - "output": "parsed_user_agent" - } - ] - }, - "anonymousId": "00000000000000000000000000", - "user": { - "traits": { - "anonymousId": "anon-id", - "email": "test@gmail.com" - }, - "userId": "12345" - }, - "path": "/test", - "user_agent": "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" - }, - "FORM": {} - }, - "files": {}, - "endpoint": "https://api.keen.io/3.0/projects/abcde/events/Viewed ApplicationLoaded page", - "userId": "12345", - "headers": { - "Content-Type": "application/json", - "Authorization": "xyz" - }, - "version": "1", - "params": {}, - "type": "REST", - "method": "POST", - "statusCode": 200 - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "projectID": "abcde", - "writeKey": "xyz", - "ipAddon": true, - "uaAddon": true, - "urlAddon": true, - "referrerAddon": true - } - } - } - ], + input: { + ua_string: 'user_agent', + }, + name: 'keen:ua_parser', + output: 'parsed_user_agent', + }, + ], + }, + anonymousId: '00000000000000000000000000', + user: { + traits: { + anonymousId: 'anon-id', + email: 'test@gmail.com', + }, + userId: '12345', + }, + path: '/test', + user_agent: + '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', + }, + FORM: {}, + }, + files: {}, + endpoint: + 'https://api.keen.io/3.0/projects/abcde/events/Viewed ApplicationLoaded page', + userId: '12345', + headers: { + 'Content-Type': 'application/json', + Authorization: 'xyz', + }, + version: '1', + params: {}, + type: 'REST', + method: 'POST', + statusCode: 200, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + projectID: 'abcde', + writeKey: 'xyz', + ipAddon: true, + uaAddon: true, + urlAddon: true, + referrerAddon: true, }, + }, }, + ], }, + }, }, -]; \ No newline at end of file + }, +]; diff --git a/test/integrations/destinations/kissmetrics/processor/data.ts b/test/integrations/destinations/kissmetrics/processor/data.ts index 5185e23c37..ecd247a956 100644 --- a/test/integrations/destinations/kissmetrics/processor/data.ts +++ b/test/integrations/destinations/kissmetrics/processor/data.ts @@ -1,888 +1,894 @@ export const data = [ - { - "name": "kissmetrics", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "dd266c67-9199-4a52-ba32-f46ddde67312", - "originalTimestamp": "2020-01-24T06:29:02.358Z", - "properties": { - "path": "/tests/html/index2.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index2.html" - }, - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.359Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "page", - "userId": "" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 1, - "messageId": "dd266c67-9199-4a52-ba32-f46ddde67312", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/e", - "headers": {}, - "params": { - "Page-path": "/tests/html/index2.html", - "Page-referrer": "", - "Page-search": "", - "Page-title": "", - "Page-url": "http://localhost/tests/html/index2.html", - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_n": "Loaded a Page", - "_t": "1579847342", - "_d": 1 - }, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - }, - "statusCode": 200, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 1, - "messageId": "dd266c67-9199-4a52-ba32-f46ddde67312", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - } - }, - { - "name": "kissmetrics", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "city": "Disney-1", - "country": "India", - "email": "sayan@disney.com", - "firstname": "Sayan" - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53709", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 2, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/s", - "headers": {}, - "params": { - "city": "Disney-1", - "country": "India", - "email": "sayan@disney.com", - "firstname": "Sayan", - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_t": "1579847342", - "_d": 1 - }, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - }, - "statusCode": 200, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 2, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - } - }, - { - "name": "kissmetrics", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53709", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 2, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/s", - "headers": {}, - "params": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey", - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_t": "1579847342", - "_d": 1 - }, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - }, - "statusCode": 200, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 2, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - } - }, - { - "name": "kissmetrics", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "event": "test revenue kissmetrics", - "integrations": { - "All": true - }, - "messageId": "a6a0ad5a-bd26-4f19-8f75-38484e580fc7", - "originalTimestamp": "2020-01-24T06:29:02.364Z", - "properties": { - "currency": "USD", - "revenue": 50 - }, - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53710", - "sentAt": "2020-01-24T06:29:02.364Z", - "timestamp": "2020-01-24T11:59:02.403+05:30", - "type": "track", - "userId": "" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 3, - "messageId": "a6a0ad5a-bd26-4f19-8f75-38484e580fc7", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/e", - "headers": {}, - "params": { - "test revenue kissmetrics-currency": "USD", - "test revenue kissmetrics - revenue": 50, - "Billing Amount": 50, - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_n": "test revenue kissmetrics", - "_t": "1579847342", - "_d": 1 - }, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - }, - "statusCode": 200, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 3, - "messageId": "a6a0ad5a-bd26-4f19-8f75-38484e580fc7", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - } - }, - { - "name": "kissmetrics", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "79313729-7fe5-4204-963a-dc46f4205e4e", - "originalTimestamp": "2020-01-24T06:29:02.366Z", - "previousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53711", - "sentAt": "2020-01-24T06:29:02.366Z", - "timestamp": "2020-01-24T11:59:02.403+05:30", - "type": "alias", - "userId": "1234abc" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 4, - "messageId": "79313729-7fe5-4204-963a-dc46f4205e4e", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/a", - "headers": {}, - "params": { - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_n": "1234abc" - }, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "1234abc", - "statusCode": 200 - }, - "statusCode": 200, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 4, - "messageId": "79313729-7fe5-4204-963a-dc46f4205e4e", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - } - }, - { - "name": "kissmetrics", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "event": "KM Order Completed", - "integrations": { - "All": true - }, - "messageId": "aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a", - "originalTimestamp": "2020-01-24T06:29:02.367Z", - "properties": { - "affiliation": "Google Store", - "checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "coupon": "hasbros", - "currency": "USD", - "discount": 2.5, - "order_id": "50314b8e9bcf000000000000", - "products": [ - { - "category": "Games", - "image_url": "https:///www.example.com/product/path.jpg", - "name": "Monopoly: 3rd Edition", - "price": 19, - "product_id": "507f1f77bcf86cd799439011", - "quantity": 1, - "sku": "45790-32", - "url": "https://www.example.com/product/path" - }, - { - "category": "Games", - "name": "Uno Card Game", - "price": 3, - "product_id": "505bd76785ebb509fc183733", - "quantity": 2, - "sku": "46493-32" - } - ], - "revenue": 25, - "shipping": 3, - "subtotal": 22.5, - "tax": 2, - "total": 27.5 - }, - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53712", - "sentAt": "2020-01-24T06:29:02.368Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "track", - "userId": "" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 5, - "messageId": "aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/e", - "headers": {}, - "params": { - "KM Order Completed-affiliation": "Google Store", - "KM Order Completed-checkout_id": "fksdjfsdjfisjf9sdfjsd9f", - "KM Order Completed-coupon": "hasbros", - "KM Order Completed-currency": "USD", - "KM Order Completed-discount": 2.5, - "KM Order Completed-order_id": "50314b8e9bcf000000000000", - "KM Order Completed - revenue": 25, - "Billing Amount": 25, - "KM Order Completed-shipping": 3, - "KM Order Completed-subtotal": 22.5, - "KM Order Completed-tax": 2, - "KM Order Completed-total": 27.5, - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_n": "KM Order Completed", - "_t": "1579847342", - "_d": 1 - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 5, - "messageId": "aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/s", - "headers": {}, - "params": { - "KM Order Completed-category": "Games", - "KM Order Completed-image_url": "https:///www.example.com/product/path.jpg", - "KM Order Completed-name": "Monopoly: 3rd Edition", - "KM Order Completed-price": 19, - "KM Order Completed-product_id": "507f1f77bcf86cd799439011", - "KM Order Completed-quantity": 1, - "KM Order Completed-sku": "45790-32", - "KM Order Completed-url": "https://www.example.com/product/path", - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 5, - "messageId": "aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - }, - "statusCode": 200 - }, - { - "output": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/s", - "headers": {}, - "params": { - "KM Order Completed-category": "Games", - "KM Order Completed-name": "Uno Card Game", - "KM Order Completed-price": 3, - "KM Order Completed-product_id": "505bd76785ebb509fc183733", - "KM Order Completed-quantity": 2, - "KM Order Completed-sku": "46493-32", - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 5, - "messageId": "aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - }, - "statusCode": 200 - } - ] - } - } - } -] \ No newline at end of file + { + name: 'kissmetrics', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312', + originalTimestamp: '2020-01-24T06:29:02.358Z', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + }, + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.359Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'page', + userId: '', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 1, + messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/e', + headers: {}, + params: { + 'Page-path': '/tests/html/index2.html', + 'Page-referrer': '', + 'Page-search': '', + 'Page-title': '', + 'Page-url': 'http://localhost/tests/html/index2.html', + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _n: 'Loaded a Page', + _t: '1579847342', + _d: 1, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + statusCode: 200, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 1, + messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + }, + { + name: 'kissmetrics', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + city: 'Disney-1', + country: 'India', + email: 'sayan@disney.com', + firstname: 'Sayan', + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53709', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 2, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/s', + headers: {}, + params: { + city: 'Disney-1', + country: 'India', + email: 'sayan@disney.com', + firstname: 'Sayan', + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _t: '1579847342', + _d: 1, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + statusCode: 200, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 2, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + }, + { + name: 'kissmetrics', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53709', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 2, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/s', + headers: {}, + params: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _t: '1579847342', + _d: 1, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + statusCode: 200, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 2, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + }, + { + name: 'kissmetrics', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + event: 'test revenue kissmetrics', + integrations: { + All: true, + }, + messageId: 'a6a0ad5a-bd26-4f19-8f75-38484e580fc7', + originalTimestamp: '2020-01-24T06:29:02.364Z', + properties: { + currency: 'USD', + revenue: 50, + }, + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53710', + sentAt: '2020-01-24T06:29:02.364Z', + timestamp: '2020-01-24T11:59:02.403+05:30', + type: 'track', + userId: '', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 3, + messageId: 'a6a0ad5a-bd26-4f19-8f75-38484e580fc7', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/e', + headers: {}, + params: { + 'test revenue kissmetrics-currency': 'USD', + 'test revenue kissmetrics - revenue': 50, + 'Billing Amount': 50, + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _n: 'test revenue kissmetrics', + _t: '1579847342', + _d: 1, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + statusCode: 200, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 3, + messageId: 'a6a0ad5a-bd26-4f19-8f75-38484e580fc7', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + }, + { + name: 'kissmetrics', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '79313729-7fe5-4204-963a-dc46f4205e4e', + originalTimestamp: '2020-01-24T06:29:02.366Z', + previousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53711', + sentAt: '2020-01-24T06:29:02.366Z', + timestamp: '2020-01-24T11:59:02.403+05:30', + type: 'alias', + userId: '1234abc', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 4, + messageId: '79313729-7fe5-4204-963a-dc46f4205e4e', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/a', + headers: {}, + params: { + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _n: '1234abc', + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '1234abc', + statusCode: 200, + }, + statusCode: 200, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 4, + messageId: '79313729-7fe5-4204-963a-dc46f4205e4e', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + }, + { + name: 'kissmetrics', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + event: 'KM Order Completed', + integrations: { + All: true, + }, + messageId: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + originalTimestamp: '2020-01-24T06:29:02.367Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + revenue: 25, + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + }, + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53712', + sentAt: '2020-01-24T06:29:02.368Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'track', + userId: '', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 5, + messageId: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/e', + headers: {}, + params: { + 'KM Order Completed-affiliation': 'Google Store', + 'KM Order Completed-checkout_id': 'fksdjfsdjfisjf9sdfjsd9f', + 'KM Order Completed-coupon': 'hasbros', + 'KM Order Completed-currency': 'USD', + 'KM Order Completed-discount': 2.5, + 'KM Order Completed-order_id': '50314b8e9bcf000000000000', + 'KM Order Completed - revenue': 25, + 'Billing Amount': 25, + 'KM Order Completed-shipping': 3, + 'KM Order Completed-subtotal': 22.5, + 'KM Order Completed-tax': 2, + 'KM Order Completed-total': 27.5, + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _n: 'KM Order Completed', + _t: '1579847342', + _d: 1, + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 5, + messageId: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/s', + headers: {}, + params: { + 'KM Order Completed-category': 'Games', + 'KM Order Completed-image_url': 'https:///www.example.com/product/path.jpg', + 'KM Order Completed-name': 'Monopoly: 3rd Edition', + 'KM Order Completed-price': 19, + 'KM Order Completed-product_id': '507f1f77bcf86cd799439011', + 'KM Order Completed-quantity': 1, + 'KM Order Completed-sku': '45790-32', + 'KM Order Completed-url': 'https://www.example.com/product/path', + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 5, + messageId: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/s', + headers: {}, + params: { + 'KM Order Completed-category': 'Games', + 'KM Order Completed-name': 'Uno Card Game', + 'KM Order Completed-price': 3, + 'KM Order Completed-product_id': '505bd76785ebb509fc183733', + 'KM Order Completed-quantity': 2, + 'KM Order Completed-sku': '46493-32', + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 5, + messageId: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/kissmetrics/router/data.ts b/test/integrations/destinations/kissmetrics/router/data.ts index c1b5ea8649..bba00edf96 100644 --- a/test/integrations/destinations/kissmetrics/router/data.ts +++ b/test/integrations/destinations/kissmetrics/router/data.ts @@ -1,291 +1,293 @@ export const data = [ - { - name: 'fb', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "messageId": "dd266c67-9199-4a52-ba32-f46ddde67312", - "originalTimestamp": "2020-01-24T06:29:02.358Z", - "properties": { - "path": "/tests/html/index2.html", - "referrer": "", - "search": "", - "title": "", - "url": "http://localhost/tests/html/index2.html" - }, - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53708", - "sentAt": "2020-01-24T06:29:02.359Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "page", - "userId": "" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 1, - "messageId": "dd266c67-9199-4a52-ba32-f46ddde67312", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - }, - { - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - }, - "message": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.5" - }, - "ip": "0.0.0.0", - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.5" - }, - "locale": "en-GB", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "traits": { - "city": "Disney", - "country": "USA", - "email": "mickey@disney.com", - "firstname": "Mickey" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" - }, - "integrations": { - "All": true - }, - "traits": { - "city": "Disney-1", - "country": "India", - "email": "sayan@disney.com", - "firstname": "Sayan" - }, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "originalTimestamp": "2020-01-24T06:29:02.362Z", - "receivedAt": "2020-01-24T11:59:02.403+05:30", - "request_ip": "[::1]:53709", - "sentAt": "2020-01-24T06:29:02.363Z", - "timestamp": "2020-01-24T11:59:02.402+05:30", - "type": "identify", - "userId": "" - }, - "metadata": { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 2, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - } - ], - destType: 'kissmetrics', + { + name: 'fb', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312', + originalTimestamp: '2020-01-24T06:29:02.358Z', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + }, + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.359Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'page', + userId: '', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 1, + messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + }, + { + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + city: 'Disney-1', + country: 'India', + email: 'sayan@disney.com', + firstname: 'Sayan', + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53709', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '', + }, + metadata: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 2, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, }, + ], + destType: 'kissmetrics', }, - output: { - response: { - status: 200, - body: { - output: [ - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/e", - "headers": {}, - "params": { - "Page-path": "/tests/html/index2.html", - "Page-referrer": "", - "Page-search": "", - "Page-title": "", - "Page-url": "http://localhost/tests/html/index2.html", - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_n": "Loaded a Page", - "_t": "1579847342", - "_d": 1 - }, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - } - ], - "metadata": [ - { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 1, - "messageId": "dd266c67-9199-4a52-ba32-f46ddde67312", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - } - }, - { - "batchedRequest": [ - { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://trk.kissmetrics.com/s", - "headers": {}, - "params": { - "city": "Disney-1", - "country": "India", - "email": "sayan@disney.com", - "firstname": "Sayan", - "_k": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "_p": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "_t": "1579847342", - "_d": 1 - }, - "body": { - "JSON": {}, - "XML": {}, - "JSON_ARRAY": {}, - "FORM": {} - }, - "files": {}, - "userId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "statusCode": 200 - } - ], - "metadata": [ - { - "anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca", - "destinationId": "1WhcOCGgj9asZu850HvugU2C3Aq", - "destinationType": "KISSMETRICS", - "jobId": 2, - "messageId": "2536eda4-d638-4c93-8014-8ffe3f083214", - "sourceId": "1WjrlZIy1d41MCceOrFbDVPnOPY" - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256", - "prefixProperties": true, - "useNativeSDK": false - }, - "DestinationDefinition": { - "DisplayName": "Kiss Metrics", - "ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie", - "Name": "KISSMETRICS" - }, - "Enabled": true, - "ID": "1WhcOCGgj9asZu850HvugU2C3Aq", - "Name": "Kiss Metrics", - "Transformations": [] - } - } - ], + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/e', + headers: {}, + params: { + 'Page-path': '/tests/html/index2.html', + 'Page-referrer': '', + 'Page-search': '', + 'Page-title': '', + 'Page-url': 'http://localhost/tests/html/index2.html', + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _n: 'Loaded a Page', + _t: '1579847342', + _d: 1, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + ], + metadata: [ + { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 1, + messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, + }, + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://trk.kissmetrics.com/s', + headers: {}, + params: { + city: 'Disney-1', + country: 'India', + email: 'sayan@disney.com', + firstname: 'Sayan', + _k: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + _p: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + _t: '1579847342', + _d: 1, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + statusCode: 200, + }, + ], + metadata: [ + { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + destinationId: '1WhcOCGgj9asZu850HvugU2C3Aq', + destinationType: 'KISSMETRICS', + jobId: 2, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY', + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: '9432f11f70f8ce386f5110c8c924b3ec4f825256', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Kiss Metrics', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'KISSMETRICS', }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Kiss Metrics', + Transformations: [], + }, }, + ], }, + }, }, -]; \ No newline at end of file + }, +]; diff --git a/test/integrations/destinations/marketo/dataDelivery/data.ts b/test/integrations/destinations/marketo/dataDelivery/data.ts new file mode 100644 index 0000000000..47dd8e9236 --- /dev/null +++ b/test/integrations/destinations/marketo/dataDelivery/data.ts @@ -0,0 +1,490 @@ +export const data = [ + { + name: 'marketo', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test1', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_1', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + message: 'Request Processed Successfully', + destinationResponse: { + response: { + requestId: '664#17dae8c3d48', + result: [ + { + id: 1328328, + status: 'updated', + }, + ], + success: true, + }, + status: 200, + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test2', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_2', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + message: + 'Request Failed for marketo, Access token invalid (Retryable).during Marketo Response Handling', + destinationResponse: { + response: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '601', + message: 'Access token invalid', + }, + ], + }, + status: 200, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test3', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_3', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + message: + 'Request Failed for marketo, Requested resource not found (Aborted).during Marketo Response Handling', + destinationResponse: { + response: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '610', + message: 'Requested resource not found', + }, + ], + }, + status: 200, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test4', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_4', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + message: 'Request failed with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test5', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_5', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + message: 'Request failed with status: 500', + destinationResponse: { + response: '', + status: 500, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test6', + method: 'POST', + userId: '', + headers: { + Authorization: 'Bearer test_token_6', + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + message: 'Request failed with status: 400', + destinationResponse: { + response: '[[ENOTFOUND] :: DNS lookup failed]', + status: 400, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + { + name: 'marketo', + description: 'Test 6', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer access_token_success', + }, + body: { + JSON: { + action: 'createOrUpdate', + input: [ + { + Email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + FirstName: 'A', + LastName: 'M', + id: 4, + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + }, + ], + lookupField: 'id', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + params: { + destination: 'marketo', + }, + }, + }, + }, + output: { + response: { + status: 400, + message: 'Error occurred during Marketo Response Handling -> problem', + destinationResponse: { + response: { + requestId: '142e4#1835b117b76', + success: false, + errors: [ + { + code: 'random_marketo_code', + message: 'problem', + }, + ], + }, + status: 200, + }, + statTags: { + destType: 'MARKETO', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + meta: 'unhandledStatusCode', + module: 'destination', + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/marketo/network.ts b/test/integrations/destinations/marketo/network.ts new file mode 100644 index 0000000000..b0c6174281 --- /dev/null +++ b/test/integrations/destinations/marketo/network.ts @@ -0,0 +1,244 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test1', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_1', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '664#17dae8c3d48', + result: [ + { + id: 1328328, + status: 'updated', + }, + ], + success: true, + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test2', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_2', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '601', + message: 'Access token invalid', + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test3', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_3', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: 'a61c#17daea5968a', + success: false, + errors: [ + { + code: '610', + message: 'Requested resource not found', + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test4', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_4', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: {}, + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test5', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_5', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: '', + }, + { + httpReq: { + url: 'https://mktId.mktorest.com/rest/v1/leads.json/test6', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer test_token_6', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + code: '[ENOTFOUND] :: DNS lookup failed', + status: 400, + }, + }, + { + httpReq: { + url: 'https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json', + data: { + action: 'createOrUpdate', + input: [ + { + Email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail', + FirstName: 'A', + LastName: 'M', + id: 4, + userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704', + }, + ], + lookupField: 'id', + }, + headers: { + Authorization: 'Bearer access_token_success', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '142e4#1835b117b76', + success: false, + errors: [ + { + code: 'random_marketo_code', + message: 'problem', + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, +]; diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts new file mode 100644 index 0000000000..e3deebca9b --- /dev/null +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts @@ -0,0 +1,368 @@ +export const data = [ + { + "name": "marketo_static_list", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer Incorrect_token", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "marketo_static_list" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "requestId": "b6d1#18a8d2c10e7", + "result": [ + { + "id": 110, + "status": "skipped", + "reasons": [ + { + "code": "1015", + "message": "Lead not in list" + } + ] + }, + { + "id": 111, + "status": "removed" + }, + { + "id": 112, + "status": "removed" + } + ], + "success": true + }, + "status": 200 + }, + "status": 200 + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer Incorrect_token", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "marketo_static_list" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "message": "Request Failed for Marketo Static List, Access token invalid (Retryable).during Marketo Static List Response Handling", + "destinationResponse": { + "response": { + "requestId": "68d8#1846058ee27", + "success": false, + "errors": [ + { + "code": "601", + "message": "Access token invalid" + } + ] + }, + "status": 200 + }, + "statTags": { + "destType": "MARKETO_STATIC_LIST", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer token", + "Content-Type": "application/json" + }, + "body": { + "FORM": {}, + "JSON": { + "action": "createOrUpdate", + "input": [ + { + "City": "Tokyo", + "Country": "JP", + "Email": "gabi29@gmail.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328328, + "userId": "gabi_userId_45" + } + ], + "lookupField": "id" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {}, + "params": { + "destination": "marketo_static_list" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "requestId": "12d3c#1846057dce2", + "success": true, + "result": [ + { + "id": 1, + "status": "added" + }, + { + "id": 2, + "status": "added" + } + ] + }, + "status": 200 + } + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 3", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer token", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "FORM": {}, + "JSON": { + "action": "createOrUpdate", + "input": [ + { + "City": "Tokyo", + "Country": "JP", + "Email": "gabi29@gmail.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328328, + "userId": "gabi_userId_45" + }, + { + "City": "Tokyo", + "Country": "JP", + "Email": "b@s.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328329, + "userId": "ben_userId_45" + } + ], + "lookupField": "id" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {} + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "destinationResponse": "", + "message": "Request failed during: during Marketo Static List Response Handling, error: [{\"code\":\"1004\",\"message\":\"Lead not found\"}]", + "statTags": { + "destType": "MARKETO_STATIC_LIST", + "errorCategory": "dataValidation", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "instrumentation", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "status": 400 + } + } + } + } + }, + { + "name": "marketo_static_list", + "description": "Test 4", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "type": "REST", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6", + "method": "POST", + "userId": "", + "headers": { + "Authorization": "Bearer token", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "FORM": {}, + "JSON": { + "action": "createOrUpdate", + "input": [ + { + "City": "Tokyo", + "Country": "JP", + "Email": "gabi29@gmail.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328328, + "userId": "gabi_userId_45" + }, + { + "City": "Tokyo", + "Country": "JP", + "Email": "b@s.com", + "PostalCode": "100-0001", + "Title": "Owner", + "id": 1328329, + "userId": "ben_userId_45" + } + ], + "lookupField": "id" + }, + "JSON_ARRAY": {}, + "XML": {} + }, + "files": {} + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "requestId": "12d3c#1846057dce2", + "result": { + "id": 5, + "status": "skipped", + "reasons": [ + { + "code": "1015", + "message": "Lead not in list" + } + ] + }, + "success": true + }, + "status": 200 + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/marketo_static_list/network.ts b/test/integrations/destinations/marketo_static_list/network.ts index c369e1af26..5c13273859 100644 --- a/test/integrations/destinations/marketo_static_list/network.ts +++ b/test/integrations/destinations/marketo_static_list/network.ts @@ -1,3 +1,182 @@ +const deliveryCallsData = [ + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + params: { destination: 'marketo_static_list' }, + headers: { + Authorization: 'Bearer Incorrect_token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: 'b6d1#18a8d2c10e7', + result: [ + { id: 110, status: 'skipped', reasons: [{ code: '1015', message: 'Lead not in list' }] }, + { id: 111, status: 'removed' }, + { id: 112, status: 'removed' }, + ], + success: true, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + params: { destination: 'marketo_static_list' }, + headers: { + Authorization: 'Bearer Incorrect_token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '68d8#1846058ee27', + success: false, + errors: [{ code: '601', message: 'Access token invalid' }], + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + ], + lookupField: 'id', + }, + params: { destination: 'marketo_static_list' }, + headers: { + Authorization: 'Bearer token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '12d3c#1846057dce2', + result: [ + { id: 1, status: 'added' }, + { id: 2, status: 'added' }, + ], + success: true, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + { + City: 'Tokyo', + Country: 'JP', + Email: 'b@s.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328329, + userId: 'ben_userId_45', + }, + ], + lookupField: 'id', + }, + params: {}, + headers: { + Authorization: 'Bearer token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '12d3c#1846057dce2', + result: [ + { id: 1, status: 'added' }, + { id: 4, status: 'skipped', reasons: [{ code: '1004', message: 'Lead not found' }] }, + ], + success: true, + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', + data: { + action: 'createOrUpdate', + input: [ + { + City: 'Tokyo', + Country: 'JP', + Email: 'gabi29@gmail.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328328, + userId: 'gabi_userId_45', + }, + { + City: 'Tokyo', + Country: 'JP', + Email: 'b@s.com', + PostalCode: '100-0001', + Title: 'Owner', + id: 1328329, + userId: 'ben_userId_45', + }, + ], + lookupField: 'id', + }, + params: {}, + headers: { + Authorization: 'Bearer token', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + requestId: '12d3c#1846057dce2', + result: { + id: 5, + status: 'skipped', + reasons: [{ code: '1015', message: 'Lead not in list' }], + }, + success: true, + }, + status: 200, + }, + }, +]; export const networkCallsData = [ { httpReq: { @@ -19,4 +198,5 @@ export const networkCallsData = [ status: 200, }, }, + ...deliveryCallsData, ]; diff --git a/test/integrations/destinations/mp/network.ts b/test/integrations/destinations/mp/network.ts index a386451a21..cc5e265f43 100644 --- a/test/integrations/destinations/mp/network.ts +++ b/test/integrations/destinations/mp/network.ts @@ -1146,5 +1146,23 @@ const deleteNwData = [ }, }, }, + { + httpReq: { + method: 'post', + url: 'https://api-eu.mixpanel.com/engage', + data: [{ $distinct_id: 'rudder1', $token: 'test_token', $delete: null, $ignore_alias: true }], + headers: { + 'Content-Type': 'application/json', + Accept: 'text/plain', + }, + }, + httpRes: { + status: 200, + statusText: 'OK', + data: { + ' message': '1', + }, + }, + }, ]; export const networkCallsData = [...deleteNwData]; diff --git a/test/integrations/destinations/redis/processor/data.ts b/test/integrations/destinations/redis/processor/data.ts new file mode 100644 index 0000000000..72c78a1ad4 --- /dev/null +++ b/test/integrations/destinations/redis/processor/data.ts @@ -0,0 +1,661 @@ +export const data = [ + { + name: 'redis', + description: + 'Test 0: Covering flattened json, removing empty values, stringify array, prefix key from the config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: ' ', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: '[{"x":1,"y":2}]', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'UK', + lastname: 'Mouse', + omega: 'test', + 'omega v2': 'test', + '9mega': 'test', + 'mega&': 'test', + ome$ga: 'test', + alpha$: 'test', + 'ome_ ga': 'test', + '9mega________-________90': 'test', + Cízǔ: 'test', + CamelCase123Key: 'test', + '1CComega': 'test', + arrayProp: '[{"x":1,"y":2}]', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + traits: { + country: 'USA', + firstname: 'Mickey', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'TestPrefix:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'USA', + lastname: 'Mouse', + arrayProp: '[{"x":1,"y":2}]', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + firstname: 'Mickey', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestEmptyKey', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + country: 'UK', + lastname: 'Mouse', + arrayProp: [ + { + x: 1, + y: 2, + }, + ], + emptyKey: '', + nestedProp: { + innerProp1: 'innerPropVal1', + innerProp2: 'innerPropVal2', + innerProp3: {}, + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + traits: { + country: 'USA', + firstname: 'Mickey', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + key: 'TestEmptyKey:user:9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + fields: { + country: 'USA', + lastname: 'Mouse', + arrayProp: '[{"x":1,"y":2}]', + emptyKey: '', + 'nestedProp.innerProp1': 'innerPropVal1', + 'nestedProp.innerProp2': 'innerPropVal2', + firstname: 'Mickey', + }, + }, + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + message: { + anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.5', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.5', + }, + locale: 'en-GB', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '2536eda4-d638-4c93-8014-8ffe3f083214', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + userId: '9bb5d4c2-a7aa-4a36-9efb-dd2b1aec5d33', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'context or context.traits or traits is empty', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'REDIS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'redis', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + address: 'localhost:6379', + database: 'test', + prefix: 'TestPrefix', + }, + DestinationDefinition: { + DisplayName: 'Redis', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'REDIS', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'Redis', + Transformations: [], + }, + metadata: { + workspaceId: 'some-workspace-id', + }, + message: { + userId: 'some-user-id', + channel: 'sources', + context: { + sources: { + job_id: 'some-job-id', + version: 'some-version', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + profiles_model: 'some-model', + profiles_entity: 'some-entity', + profiles_id_type: 'some-id-type', + }, + }, + traits: { + MODEL_ID: '1691755780', + VALID_AT: '2023-08-11T11:32:44.963062Z', + USER_MAIN_ID: 'rid5530313526204a95efe71d98cd17d5a1', + CHURN_SCORE_7_DAYS: 0.027986, + PERCENTILE_CHURN_SCORE_7_DAYS: 0, + }, + messageId: 'some-message-id', + originalTimestamp: '2020-01-24T06:29:02.362Z', + receivedAt: '2020-01-24T11:59:02.403+05:30', + request_ip: '[::1]:53708', + sentAt: '2020-01-24T06:29:02.363Z', + timestamp: '2020-01-24T11:59:02.402+05:30', + type: 'identify', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + message: { + hash: 'some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id', + key: 'some-model', + value: + '{"MODEL_ID":"1691755780","VALID_AT":"2023-08-11T11:32:44.963062Z","USER_MAIN_ID":"rid5530313526204a95efe71d98cd17d5a1","CHURN_SCORE_7_DAYS":0.027986,"PERCENTILE_CHURN_SCORE_7_DAYS":0}', + }, + userId: 'some-user-id', + }, + metadata: { + workspaceId: 'some-workspace-id', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/revenue_cat/processor/data.ts b/test/integrations/destinations/revenue_cat/processor/data.ts new file mode 100644 index 0000000000..45ff5d8499 --- /dev/null +++ b/test/integrations/destinations/revenue_cat/processor/data.ts @@ -0,0 +1,1079 @@ +export const data = [ + { + "name": "revenue_cat", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "as9d920a5e75a18acb4a29abd9ec1e2e", + "xPlatform": "stripe" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "lastname": "Doe", + "density": "420", + "height": "1794", + "width": "1080", + "iterableCampaignId": "1234", + "iterableTemplateId": "1234" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "GET", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", + "headers": { + "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", + "headers": { + "Authorization": "Basic as9d920a5e75a18acb4a29abd9ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "attributes": { + "app_user_id": { + "value": "rudder1235678" + }, + "$email": { + "value": "chandan@companyname.com" + }, + "$phoneNumber": { + "value": "92374162212" + }, + "$ip": { + "value": "14.5.67.21" + }, + "$iterableCampaignId": { + "value": "1234" + }, + "$iterableTemplateId": { + "value": "1234" + }, + "$displayName": { + "value": "Doe" + }, + "lastname": { + "value": "Doe" + }, + "density": { + "value": "420" + }, + "height": { + "value": "1794" + }, + "width": { + "value": "1080" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "a5e75dfda29abd920ec1ec8a18acb42e", + "xPlatform": "stripe" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "firstname": "James", + "density": 420, + "height": 1794, + "width": 1080, + "iterableCampaignId": "1234", + "iterableTemplateId": "1234" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "GET", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", + "headers": { + "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", + "headers": { + "Authorization": "Basic a5e75dfda29abd920ec1ec8a18acb42e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "attributes": { + "app_user_id": { + "value": "rudder1235678" + }, + "$email": { + "value": "chandan@companyname.com" + }, + "$phoneNumber": { + "value": "92374162212" + }, + "$ip": { + "value": "14.5.67.21" + }, + "$iterableCampaignId": { + "value": "1234" + }, + "$iterableTemplateId": { + "value": "1234" + }, + "$displayName": { + "value": "James" + }, + "firstname": { + "value": "James" + }, + "density": { + "value": "420" + }, + "height": { + "value": "1794" + }, + "width": { + "value": "1080" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "xPlatform": "stripe" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "name": "John Doe" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Public API Key required for Authentication", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "REVENUE_CAT", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "a5e75d99c8a18acb4a29abd920ec1e2e" + } + }, + "message": { + "userId": "rudder1235678", + "channel": "web", + "context": { + "ip": "14.5.67.21", + "app": { + "build": "1", + "name": "RudderAndroidClient", + "namespace": "com.rudderstack.demo.android", + "version": "1.0" + }, + "device": { + "manufacturer": "Google", + "model": "Android SDK built for x86", + "name": "generic_x86", + "type": "android" + }, + "library": { + "name": "com.rudderstack.android.sdk.core", + "version": "0.1.4" + }, + "locale": "en-US", + "network": { + "carrier": "Android", + "bluetooth": false, + "cellular": true, + "wifi": true + }, + "campaign": { + "source": "google", + "medium": "medium", + "term": "keyword", + "content": "some content" + }, + "os": { + "name": "Android", + "version": "9" + }, + "screen": { + "density": 420, + "height": 1794, + "width": 1080 + }, + "timezone": "Asia/Mumbai", + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)" + }, + "type": "identify", + "traits": { + "email": "chandan@companyname.com", + "phone": "92374162212", + "name": "John Doe" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "GET", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678", + "headers": { + "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes", + "headers": { + "Authorization": "Basic a5e75d99c8a18acb4a29abd920ec1e2e", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "attributes": { + "app_user_id": { + "value": "rudder1235678" + }, + "$displayName": { + "value": "John Doe" + }, + "$email": { + "value": "chandan@companyname.com" + }, + "$phoneNumber": { + "value": "92374162212" + }, + "$ip": { + "value": "14.5.67.21" + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123", + "products": [ + { + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games", + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "X-Platform is required field", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "REVENUE_CAT", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "xPlatform": "stripe" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123", + "products": [ + { + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games", + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "345", + "currency": "USD", + "price": 3.45, + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "xPlatform": "stripe" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "products": [ + { + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games", + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + }, + { + "sku": "G-33", + "name": "SunGlass", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + { + "sku": "G-35", + "product_id": "1234sb", + "name": "Real-me", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "345", + "currency": "USD", + "price": 3.45, + "introductory_price": "250", + "is_restore": false, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "1234sb", + "currency": "USD", + "price": 14, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "revenue_cat", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "apiKey": "dummyApiKey", + "xPlatform": "stripe" + } + }, + "message": { + "type": "track", + "userId": "rudder123", + "properties": { + "checkout_id": "12345", + "order_id": "1234", + "affiliation": "Apple Store", + "total": 20, + "revenue": 15, + "shipping": 22, + "tax": 1, + "discount": 1.5, + "coupon": "ImagePro", + "currency": "USD", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.revenuecat.com/v1/receipts", + "headers": { + "Authorization": "Basic dummyApiKey", + "Content-Type": "application/json", + "X-Platform": "stripe" + }, + "params": {}, + "body": { + "JSON": { + "app_user_id": "rudder123", + "fetch_token": "dummyFetchToken", + "product_id": "123-sa", + "price": 14, + "currency": "USD", + "introductory_price": "350", + "is_restore": true, + "presented_offering_identifier": "123erd" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/rockerbox/processor/data.ts b/test/integrations/destinations/rockerbox/processor/data.ts new file mode 100644 index 0000000000..ff8f6d4620 --- /dev/null +++ b/test/integrations/destinations/rockerbox/processor/data.ts @@ -0,0 +1,749 @@ +export const data = [ + { + "name": "rockerbox", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "KDH4JNDHCFJHJ57SJOWJE490W01JFNHGDSSFHDKDSDF" + } + }, + "message": { + "context": { + "traits": { + "homwTown": "kanpur", + "age": "24" + } + }, + "type": "Identify", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Message type identify is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "ROCKERBOX", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "test id", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added To Cart", + "to": "conv.add_to_cart" + } + ], + "useNativeSDK": { + "web": false + }, + "clientAuthId": { + "web": "test-client-auth-id" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "Marketing Sample" + } + ] + }, + "customDomain": { + "web": "https://cookiedomain.com" + }, + "enableCookieSync": { + "web": true + } + } + }, + "message": { + "type": "track", + "event": "Product Added", + "sentAt": "2022-08-07T20:02:19.352Z", + "userId": "userSampleX138", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "locale": "en-IN", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 584, + "innerHeight": 789 + }, + "traits": { + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "last_name": "Stack", + "first_name": "Rudder", + "subscription": "youtube" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" + }, + "rudderId": "4a47e99b-2afc-45c6-b902-ed69282ca805", + "messageId": "1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93", + "properties": { + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt" + }, + "anonymousId": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-07T20:02:19.347Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "The event is not associated to a RockerBox event. Aborting!", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "ROCKERBOX", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "test id", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added", + "to": "conv.add_to_cart" + } + ], + "useNativeSDK": { + "web": false + }, + "clientAuthId": { + "web": "test-client-auth-id" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "Marketing Sample" + } + ] + }, + "customDomain": { + "web": "https://cookiedomain.com" + }, + "enableCookieSync": { + "web": true + } + } + }, + "message": { + "type": "track", + "event": "Product Added", + "sentAt": "2022-08-07T20:02:19.352Z", + "userId": "userSampleX138", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "locale": "en-IN", + "traits": { + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "last_name": "Stack", + "first_name": "Rudder" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" + }, + "rudderId": "4a47e99b-2afc-45c6-b902-ed69282ca805", + "messageId": "1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93", + "properties": { + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt" + }, + "anonymousId": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-07T20:02:19.347Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://webhooks.getrockerbox.com/rudderstack", + "headers": {}, + "params": { + "advertiser": "test id" + }, + "body": { + "JSON": { + "customer_id": "userSampleX138", + "anonymous_id": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "timestamp": 1659902539, + "conversion_source": "RudderStack", + "action": "conv.add_to_cart", + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "test id", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added", + "to": "conv.add_to_cart" + } + ], + "useNativeSDK": { + "web": false + }, + "clientAuthId": { + "web": "test-client-auth-id" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "Marketing Sample" + } + ] + }, + "customDomain": { + "web": "https://cookiedomain.com" + }, + "enableCookieSync": { + "web": true + } + } + }, + "message": { + "type": "track", + "event": "Product Added", + "sentAt": "2022-08-07T20:02:19.352Z", + "userId": "userSampleX138", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "locale": "en-IN", + "traits": { + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "last_name": "Stack", + "first_name": "Rudder" + }, + "externalId": [ + { + "type": "rockerboxExternalId", + "id": "rbUid" + } + ], + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" + }, + "rudderId": "4a47e99b-2afc-45c6-b902-ed69282ca805", + "messageId": "1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93", + "properties": { + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt", + "externalId": "rbUid", + "countryCode": "IN", + "listingId": "10101" + }, + "anonymousId": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-08-07T20:02:19.347Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://webhooks.getrockerbox.com/rudderstack", + "headers": {}, + "params": { + "advertiser": "test id" + }, + "body": { + "JSON": { + "customer_id": "userSampleX138", + "anonymous_id": "5f093403-1457-4a2c-b4e4-c61ec3bacf56", + "email": "userSampleX120@gmail.com", + "phone": "9878764736", + "timestamp": 1659902539, + "country_code": "IN", + "listing_id": "10101", + "conversion_source": "RudderStack", + "action": "conv.add_to_cart", + "checkout_id": "12345", + "product_url": "http://www.yourdomain.com/products/red-t-shirt", + "product_name": "Red T-shirt", + "externalId": "rbUid" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "hdowhfiqhfwaiwhrdafshbfacicolsa", + "eventFilteringOption": "disable", + "whitelistedEvents": [ + { + "eventName": "" + } + ], + "blacklistedEvents": [ + { + "eventName": "" + } + ], + "eventsMap": [ + { + "from": "Product Added", + "to": "conv.add_to_cart" + } + ], + "customPropsMapping": [ + { + "from": "unit_id", + "to": "unitID" + }, + { + "from": "merch_id", + "to": "merch_id" + }, + { + "from": "bounce_id", + "to": "bounceID" + } + ], + "useNativeSDK": { + "web": false + }, + "useNativeSDKToSend": { + "web": false + }, + "clientAuthId": { + "web": "" + }, + "oneTrustCookieCategories": { + "web": [ + { + "oneTrustCookieCategory": "" + } + ] + }, + "customDomain": { + "web": "" + }, + "enableCookieSync": { + "web": false + } + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "anonymousId": "anon_id", + "type": "track", + "traits": { + "userId": "anon_id", + "email": "jamesDoe@gmail.com", + "name": "James Doe", + "phone": "92374162212", + "gender": "M", + "employed": true, + "birthday": "1614775793", + "education": "Science", + "graduate": true, + "married": true, + "customerType": "Prime", + "msg_push": true, + "msgSms": true, + "msgemail": true, + "msgwhatsapp": false, + "custom_tags": [ + "Test_User", + "Interested_User", + "DIY_Hobby" + ], + "custom_mappings": { + "Office": "Trastkiv", + "Country": "Russia" + }, + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 789223, + "state": "WB", + "street": "" + } + }, + "properties": { + "unit_id": 123, + "merch_id": false, + "bounceiD": "fakefake", + "counce_id": "" + }, + "event": "Product Added", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "writeKey": "2D0yaayoBD7bp8uFomnBONdedcA", + "requestIP": "[::1]", + "receivedAt": "2022-08-08T01:32:19.369+05:30" + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://webhooks.getrockerbox.com/rudderstack", + "headers": {}, + "params": { + "advertiser": "hdowhfiqhfwaiwhrdafshbfacicolsa" + }, + "body": { + "JSON": { + "customer_id": "anon_id", + "anonymous_id": "anon_id", + "email": "jamesDoe@gmail.com", + "phone": "92374162212", + "timestamp": 1571043797, + "conversion_source": "RudderStack", + "action": "conv.add_to_cart", + "unit_id": 123, + "merch_id": false, + "bounceiD": "fakefake", + "counce_id": "" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "rockerbox", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "advertiserId": "KDH4JNDHCFJHJ57SJOWJE490W01JFNHGDSSFHDKDSDF" + } + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", + "locale": "en-US", + "ip": "0.0.0.0", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + } + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "type": "track", + "traits": { + "email": "jamesDoe@gmail.com", + "name": "James Doe", + "phone": "92374162212", + "gender": "M", + "employed": true, + "birthday": "1614775793", + "education": "Science", + "graduate": true, + "married": true, + "customerType": "Prime", + "msg_push": true, + "msgSms": true, + "msgemail": true, + "msgwhatsapp": false, + "custom_tags": [ + "Test_User", + "Interested_User", + "DIY_Hobby" + ], + "custom_mappings": { + "Office": "Trastkiv", + "Country": "Russia" + }, + "address": { + "city": "kolkata", + "country": "India", + "postalCode": 789223, + "state": "WB", + "street": "" + } + }, + "properties": { + "unit_id": 123, + "merch_id": false, + "bounceiD": "fakefake", + "counce_id": "" + }, + "event": "Product Added", + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Anyone of userId or anonymousId is required to make the call", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "ROCKERBOX", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/rockerbox/router/data.ts b/test/integrations/destinations/rockerbox/router/data.ts new file mode 100644 index 0000000000..caa8f1ba08 --- /dev/null +++ b/test/integrations/destinations/rockerbox/router/data.ts @@ -0,0 +1,314 @@ +export const data = [ + { + name: 'rockerbox', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + advertiserId: 'test id', + eventFilteringOption: 'disable', + whitelistedEvents: [ + { + eventName: '', + }, + ], + blacklistedEvents: [ + { + eventName: '', + }, + ], + eventsMap: [ + { + from: 'Product Added', + to: 'conv.add_to_cart', + }, + ], + useNativeSDK: { + web: false, + }, + clientAuthId: { + web: 'test-client-auth-id', + }, + oneTrustCookieCategories: { + web: [ + { + oneTrustCookieCategory: 'Marketing Sample', + }, + ], + }, + customDomain: { + web: 'https://cookiedomain.com', + }, + enableCookieSync: { + web: true, + }, + }, + }, + metadata: { + jobId: 1, + }, + message: { + type: 'track', + event: 'Product Added', + sentAt: '2022-08-07T20:02:19.352Z', + userId: 'userSampleX138', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + locale: 'en-IN', + traits: { + email: 'userSampleX120@gmail.com', + phone: '9878764736', + last_name: 'Stack', + first_name: 'Rudder', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36', + }, + rudderId: '4a47e99b-2afc-45c6-b902-ed69282ca805', + messageId: '1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93', + properties: { + checkout_id: '12345', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + product_name: 'Red T-shirt', + }, + anonymousId: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-07T20:02:19.347Z', + }, + writeKey: '2D0yaayoBD7bp8uFomnBONdedcA', + requestIP: '[::1]', + receivedAt: '2022-08-08T01:32:19.369+05:30', + }, + ], + destType: 'rockerbox', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + action: 'conv.add_to_cart', + anonymous_id: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + checkout_id: '12345', + conversion_source: 'RudderStack', + customer_id: 'userSampleX138', + email: 'userSampleX120@gmail.com', + phone: '9878764736', + product_name: 'Red T-shirt', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + timestamp: 1659902539, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://webhooks.getrockerbox.com/rudderstack', + files: {}, + headers: {}, + method: 'POST', + params: { advertiser: 'test id' }, + type: 'REST', + version: '1', + }, + destination: { + Config: { + advertiserId: 'test id', + blacklistedEvents: [{ eventName: '' }], + clientAuthId: { web: 'test-client-auth-id' }, + customDomain: { web: 'https://cookiedomain.com' }, + enableCookieSync: { web: true }, + eventFilteringOption: 'disable', + eventsMap: [{ from: 'Product Added', to: 'conv.add_to_cart' }], + oneTrustCookieCategories: { + web: [{ oneTrustCookieCategory: 'Marketing Sample' }], + }, + useNativeSDK: { web: false }, + whitelistedEvents: [{ eventName: '' }], + }, + }, + metadata: [{ jobId: 1 }], + statusCode: 200, + }, + ], + }, + }, + }, + }, + { + name: 'rockerbox', + description: 'Test 1', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + advertiserId: 'test id', + eventFilteringOption: 'disable', + whitelistedEvents: [ + { + eventName: '', + }, + ], + blacklistedEvents: [ + { + eventName: '', + }, + ], + eventsMap: [ + { + from: 'Product Viewed', + to: 'conv.add_to_cart', + }, + ], + useNativeSDK: { + web: false, + }, + clientAuthId: { + web: 'test-client-auth-id', + }, + oneTrustCookieCategories: { + web: [ + { + oneTrustCookieCategory: 'Marketing Sample', + }, + ], + }, + customDomain: { + web: 'https://cookiedomain.com', + }, + enableCookieSync: { + web: true, + }, + }, + }, + metadata: { + jobId: 2, + }, + message: { + type: 'track', + event: 'Product Viewed', + sentAt: '2022-08-07T20:02:19.352Z', + userId: 'userSampleX138', + channel: 'web', + context: { + os: { + name: '', + version: '', + }, + locale: 'en-IN', + traits: { + email: 'userSampleX120@gmail.com', + phone: '9878764736', + last_name: 'Stack', + first_name: 'Rudder', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36', + }, + rudderId: '4a47e99b-2afc-45c6-b902-ed69282ca805', + messageId: '1659902539347900-c622426c-a1dd-44c0-ac6d-d4dbee3f4a93', + properties: { + checkout_id: '12345', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + product_name: 'Red T-shirt', + }, + anonymousId: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-07T20:02:19.347Z', + }, + writeKey: '2D0yaayoBD7bp8uFomnBONdedcA', + requestIP: '[::1]', + receivedAt: '2022-08-08T01:32:19.369+05:30', + }, + ], + destType: 'rockerbox', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + action: 'conv.add_to_cart', + anonymous_id: '5f093403-1457-4a2c-b4e4-c61ec3bacf56', + checkout_id: '12345', + conversion_source: 'RudderStack', + customer_id: 'userSampleX138', + email: 'userSampleX120@gmail.com', + phone: '9878764736', + product_name: 'Red T-shirt', + product_url: 'http://www.yourdomain.com/products/red-t-shirt', + timestamp: 1659902539, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://webhooks.getrockerbox.com/rudderstack', + files: {}, + headers: {}, + method: 'POST', + params: { advertiser: 'test id' }, + type: 'REST', + version: '1', + }, + destination: { + Config: { + advertiserId: 'test id', + blacklistedEvents: [{ eventName: '' }], + clientAuthId: { web: 'test-client-auth-id' }, + customDomain: { web: 'https://cookiedomain.com' }, + enableCookieSync: { web: true }, + eventFilteringOption: 'disable', + eventsMap: [{ from: 'Product Viewed', to: 'conv.add_to_cart' }], + oneTrustCookieCategories: { + web: [{ oneTrustCookieCategory: 'Marketing Sample' }], + }, + useNativeSDK: { web: false }, + whitelistedEvents: [{ eventName: '' }], + }, + }, + metadata: [{ jobId: 2 }], + statusCode: 200, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/salesforce/dataDelivery/data.ts b/test/integrations/destinations/salesforce/dataDelivery/data.ts new file mode 100644 index 0000000000..504159cc6f --- /dev/null +++ b/test/integrations/destinations/salesforce/dataDelivery/data.ts @@ -0,0 +1,833 @@ +import { AxiosError } from 'axios'; +import MockAdapter from 'axios-mock-adapter'; + +export const data = [ + { + name: 'salesforce', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Request for destination: salesforce Processed Successfully', + destinationResponse: { + response: { + statusText: 'No Content', + }, + status: 204, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to "INVALID_SESSION_ID", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: [ + { + message: 'Session expired or invalid', + errorCode: 'INVALID_SESSION_ID', + }, + ], + status: 401, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer Incorrect_token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + 'Salesforce Request Failed: "401" due to "INVALID_HEADER_TYPE", (Aborted) during Salesforce Response Handling', + destinationResponse: { + response: [ + { + message: 'INVALID_HEADER_TYPE', + errorCode: 'INVALID_AUTH_HEADER', + }, + ], + status: 401, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 429, + body: { + output: { + status: 429, + message: + 'Salesforce Request Failed - due to "REQUEST_LIMIT_EXCEEDED", (Throttled) during Salesforce Response Handling', + destinationResponse: { + response: [ + { + message: 'Request limit exceeded', + errorCode: 'REQUEST_LIMIT_EXCEEDED', + }, + ], + status: 403, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to "Server Unavailable", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: [ + { + message: 'Server Unavailable', + errorCode: 'SERVER_UNAVAILABLE', + }, + ], + status: 503, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: + 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) during Salesforce Response Handling', + destinationResponse: { + response: { + error: 'invalid_grant', + error_description: 'authentication failure', + }, + status: 400, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 6', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + destinationResponse: { + response: { + errorCode: 'SERVER_UNAVAILABLE', + message: 'Server Unavailable', + }, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + status: 503, + }, + message: + 'Salesforce Request Failed - due to "{"message":"Server Unavailable","errorCode":"SERVER_UNAVAILABLE"}", (Retryable) during Salesforce Response Handling', + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + status: 500, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 7', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + method: 'POST', + endpoint: + 'https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + body: { + JSON: { + Planning_Categories__c: 'pc', + External_ID__c: 123, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Request for destination: salesforce Processed Successfully', + destinationResponse: { + response: { + searchRecords: [ + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA', + }, + Id: 'a0J75100002w97gEAA', + External_ID__c: 'external_id', + }, + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI', + }, + Id: 'a0J75200002w9ZsEAI', + External_ID__c: 'external_id TEST', + }, + ], + }, + status: 200, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + }, + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 8', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to ""[ECONNABORTED] :: Connection aborted"", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: '[ECONNABORTED] :: Connection aborted', + status: 500, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + // params has `{ destination: salesforce }` + mockAdapter + .onPost( + 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101', + { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + Accept: 'application/json, text/plain, */*', + }, + ) + .abortRequest(); + }, + }, + { + name: 'salesforce', + description: 'Test 9', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + files: {}, + method: 'POST', + userId: '', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + }, + version: '1', + endpoint: 'https://rudder.my.salesforce.com/services/data/v50.0/sobjects/Lead/102', + body: { + XML: {}, + FORM: {}, + JSON: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + JSON_ARRAY: {}, + }, + metadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + params: { + destination: 'salesforce', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: + 'Salesforce Request Failed - due to ""[EAI_AGAIN] :: Temporary failure in name resolution"", (Retryable) during Salesforce Response Handling', + destinationResponse: { + response: '[EAI_AGAIN] :: Temporary failure in name resolution', + status: 500, + rudderJobMetadata: { + destInfo: { + authKey: '2HezPl1w11opbFSxnLDEgZ7kWTf', + }, + }, + }, + statTags: { + destType: 'SALESFORCE', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + // params has `{ destination: salesforce }` + mockAdapter + .onPost( + 'https://rudder.my.salesforce.com/services/data/v50.0/sobjects/Lead/102', + { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + Accept: 'application/json, text/plain, */*', + }, + ) + .reply((config) => { + // @ts-ignore + const err = AxiosError.from('DNS not found', 'EAI_AGAIN', config); + return Promise.reject(err); + }); + }, + }, +]; diff --git a/test/integrations/destinations/salesforce/network.ts b/test/integrations/destinations/salesforce/network.ts new file mode 100644 index 0000000000..396fad9d69 --- /dev/null +++ b/test/integrations/destinations/salesforce/network.ts @@ -0,0 +1,326 @@ +const tfProxyMocksData = [ + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { statusText: 'No Content' }, + status: 204, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }], + status: 401, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer Incorrect_token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'INVALID_HEADER_TYPE', errorCode: 'INVALID_AUTH_HEADER' }], + status: 401, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'Request limit exceeded', errorCode: 'REQUEST_LIMIT_EXCEEDED' }], + status: 403, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: [{ message: 'Server Unavailable', errorCode: 'SERVER_UNAVAILABLE' }], + status: 503, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { error: 'invalid_grant', error_description: 'authentication failure' }, + status: 400, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7', + data: { + Email: 'denis.kornilov@sbermarket.ru', + Company: 'sbermarket.ru', + LastName: 'Корнилов', + FirstName: 'Денис', + LeadSource: 'App Signup', + account_type__c: 'free_trial', + }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + message: 'Server Unavailable', + errorCode: 'SERVER_UNAVAILABLE', + }, + status: 503, + }, + }, + { + httpReq: { + url: 'https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c', + data: { Planning_Categories__c: 'pc', External_ID__c: 123 }, + params: { destination: 'salesforce' }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer token', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + searchRecords: [ + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA', + }, + Id: 'a0J75100002w97gEAA', + External_ID__c: 'external_id', + }, + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI', + }, + Id: 'a0J75200002w9ZsEAI', + External_ID__c: 'external_id TEST', + }, + ], + }, + status: 200, + }, + }, +]; + +const transformationMocksData = [ + { + httpReq: { + url: 'https://login.salesforce.com/services/oauth2/token?username=testsalesforce1453@gmail.com&password=dummyPassword1dummyInitialAccessToken&client_id=undefined&client_secret=undefined&grant_type=password', + method: 'POST', + }, + httpRes: { + status: 200, + data: { + access_token: + '00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + instance_url: 'https://ap15.salesforce.com', + id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', + token_type: 'Bearer', + issued_at: '1582343657644', + signature: 'XRgUHXVBSWhLHZVoVFZby/idWXdAPA5lMW/ZdLMzB8o=', + }, + }, + }, + { + httpReq: { + url: 'https://test.salesforce.com/services/oauth2/token?username=test.c97-qvpd@force.com.test&password=dummyPassword27fiy1FKcO9sohsxq1v6J88sg&client_id=undefined&client_secret=undefined&grant_type=password', + method: 'POST', + }, + httpRes: { + status: 200, + data: { + access_token: + '00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + instance_url: 'https://ap15.salesforce.com', + id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', + token_type: 'Bearer', + issued_at: '1582343657644', + signature: 'XRgUHXVBSWhLHZVoVFZby/idWXdAPA5lMW/ZdLMzB8o=', + abc: '123', + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons%40initech.com&sobject=Lead&Lead.fields=id', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons%40initech.com&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons%40initech.com&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=peter.gibbons1%40initech.com&sobject=Lead&Lead.fields=id', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [ + { + attributes: { + type: 'Lead', + url: '/services/data/v50.0/sobjects/Lead/leadId', + }, + Id: 'leadId', + }, + ], + }, + }, + }, + { + httpReq: { + url: 'https://ap15.salesforce.com/services/data/v50.0/parameterizedSearch/?q=ddv_ua%2B%7B%7B1234*245%7D%7D%40bugFix.com&sobject=Lead&Lead.fields=id,IsConverted,ConvertedContactId,IsDeleted', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + searchRecords: [ + { + attributes: { + type: 'Lead', + url: '/services/data/v50.0/sobjects/Lead/leadId', + }, + Id: 'leadId', + }, + ], + }, + }, + }, +]; +export const networkCallsData = [...tfProxyMocksData, ...transformationMocksData]; diff --git a/test/integrations/destinations/salesforce/processor/data.ts b/test/integrations/destinations/salesforce/processor/data.ts new file mode 100644 index 0000000000..ad0dbb6843 --- /dev/null +++ b/test/integrations/destinations/salesforce/processor/data.ts @@ -0,0 +1,1384 @@ +export const data = [ + { + name: 'salesforce', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + LeadSource: 'RudderLabs', + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + LeadSource: 'RudderLabs', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + LeadSource: 'RudderLabs', + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'track', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'message type track is not supported', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'SALESFORCE', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + LeadSource: 'RudderLabs', + customKey: 'customValue', + customNullValue: null, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + userId: '', + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + LeadSource: 'RudderLabs', + customKey__c: 'customValue', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + LeadSource: 'RudderLabs', + customKey: 'customValue', + customNullValue: null, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + PostalCode: '94115', + LastName: 'n/a', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'n/a', + LeadSource: 'RudderLabs', + customKey__c: 'customValue', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + City: 'east greenwich', + Company: 'Initech', + Country: 'USA', + Email: 'peter.gibbons@initech.com', + FirstName: 'Peter', + LastName: 'Gibbons', + Phone: '570-690-4150', + PostalCode: '94115', + Rating: 'Hot', + State: 'California', + Street: '19123 forest lane', + Title: 'VP of Derp', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + externalId: [ + { + type: 'Salesforce-Contact', + id: 'sf-contact-id', + }, + ], + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Contact/sf-contact-id?_HttpMethod=PATCH', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email__c: 'peter.gibbons@initech.com', + Phone__c: '570-690-4150', + Rating__c: 'Hot', + Title__c: 'VP of Derp', + FirstName__c: 'Peter', + LastName: 'n/a', + LastName__c: 'Gibbons', + PostalCode__c: '94115', + City__c: 'east greenwich', + Country__c: 'USA', + State__c: 'California', + Street__c: '19123 forest lane', + Company__c: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + mapProperty: false, + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + externalId: [ + { + type: 'Salesforce-Lead', + id: 'sf-contact-id', + }, + ], + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/sf-contact-id?_HttpMethod=PATCH', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + userId: '', + body: { + JSON: { + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: '7fiy1FKcO9sohsxq1v6J88sg', + password: 'dummyPassword2', + userName: 'test.c97-qvpd@force.com.test', + sandbox: true, + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1ut7LcVW1QC56y2EoTNo7ZwBWSY', + Name: 'Test SF', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: '7fiy1FKcO9sohsxq1v6J88sg', + password: 'dummyPassword2', + userName: 'test.c97-qvpd@force.com.test', + sandbox: true, + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1ut7LcVW1QC56y2EoTNo7ZwBWSY', + Name: 'Test SF', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + id: 'a005g0000383kmUAAQ', + type: 'SALESFORCE-custom_object__c', + identifierType: 'Id', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'john@rs.com', + firstname: 'john doe', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + userId: '', + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + email: 'john@rs.com', + firstname: 'john doe', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + ], + }, + }, + }, + { + name: 'salesforce', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + initialAccessToken: '7fiy1FKcO9sohsxq1v6J88sg', + password: 'dummyPassword2', + userName: 'test.c97-qvpd@force.com.test', + sandbox: true, + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1ut7LcVW1QC56y2EoTNo7ZwBWSY', + Name: 'Test SF', + Transformations: [], + }, + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + id: 'a005g0000383kmUAAQ', + type: 'SALESFORCE-custom_object__c', + identifierType: 'Id', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + email: 'john@rs.com', + firstname: 'john doe', + Id: 'some-id', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + email: 'john@rs.com', + firstname: 'john doe', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/salesforce/router/data.ts b/test/integrations/destinations/salesforce/router/data.ts new file mode 100644 index 0000000000..8c36d3a785 --- /dev/null +++ b/test/integrations/destinations/salesforce/router/data.ts @@ -0,0 +1,635 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'salesforce', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + destType: 'salesforce', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'ddv_ua+{{1234*245}}@bugFix.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + destType: 'salesforce', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/leadId?_HttpMethod=PATCH', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'ddv_ua+{{1234*245}}@bugFix.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 2', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + ip: '0.0.0.0', + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36', + }, + integrations: { + All: true, + }, + traits: { + anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76', + company: 'Initech', + address: { + city: 'east greenwich', + country: 'USA', + state: 'California', + street: '19123 forest lane', + postalCode: '94115', + }, + email: 'peter.gibbons@initech.com', + name: 'Peter Gibbons', + phone: '570-690-4150', + rating: 'Hot', + title: 'VP of Derp', + }, + messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8', + originalTimestamp: '2020-01-27T12:20:55.301Z', + receivedAt: '2020-01-27T17:50:58.657+05:30', + request_ip: '14.98.244.60', + sentAt: '2020-01-27T12:20:56.849Z', + timestamp: '2020-01-27T17:50:57.109+05:30', + type: 'identify', + userId: '1e7673da-9473-49c6-97f7-da848ecafa76', + }, + metadata: { + jobId: 3, + }, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + destType: 'salesforce', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + jobId: 3, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + }, + }, + }, + }, + { + name: 'salesforce', + description: 'Test 3', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + statusCode: 200, + }, + metadata: { + jobId: 4, + }, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + destType: 'salesforce', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', + headers: { + 'Content-Type': 'application/json', + Authorization: + 'Bearer 00D2v000002lXbX!ARcAQJBSGNA1Rq.MbUdtmlREscrN_nO3ckBz6kc4jRQGxqAzNkhT1XZIF0yPqyCQSnezWO3osMw1ewpjToO7q41E9.LvedWY', + }, + params: {}, + body: { + JSON: { + Email: 'peter.gibbons@initech.com', + Phone: '570-690-4150', + Rating: 'Hot', + Title: 'VP of Derp', + FirstName: 'Peter', + LastName: 'Gibbons', + PostalCode: '94115', + City: 'east greenwich', + Country: 'USA', + State: 'California', + Street: '19123 forest lane', + Company: 'Initech', + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + statusCode: 200, + }, + metadata: [ + { + destInfo: { + authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + }, + jobId: 4, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + initialAccessToken: 'dummyInitialAccessToken', + password: 'dummyPassword1', + userName: 'testsalesforce1453@gmail.com', + }, + DestinationDefinition: { + DisplayName: 'Salesforce', + ID: '1T96GHZ0YZ1qQSLULHCoJkow9KC', + Name: 'SALESFORCE', + }, + Enabled: true, + ID: '1WqFFH5esuVPnUgHkvEoYxDcX3y', + Name: 'tst', + Transformations: [], + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/segment/processor/data.ts b/test/integrations/destinations/segment/processor/data.ts new file mode 100644 index 0000000000..0a140e2b99 --- /dev/null +++ b/test/integrations/destinations/segment/processor/data.ts @@ -0,0 +1,670 @@ +export const data = [ + { + "name": "segment", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "writeKey": "abcdefghijklmnopqrstuvwxyz" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.2" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { + "density": 2 + }, + "traits": { + "age": 23, + "email": "testmp@rudderstack.com", + "firstname": "Test Kafka" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "258b77c6-442d-4bdc-8729-f0e4cef41353", + "name": "home", + "originalTimestamp": "2020-04-17T14:55:31.367Z", + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "receivedAt": "2020-04-17T20:25:31.381+05:30", + "request_ip": "[::1]:57363", + "sentAt": "2020-04-17T14:55:31.367Z", + "timestamp": "2020-04-17T20:25:31.381+05:30", + "type": "page", + "userId": "user12345" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "userId": "user12345", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "page", + "userId": "user12345", + "traits": { + "age": 23, + "email": "testmp@rudderstack.com", + "firstname": "Test Kafka" + }, + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "timeStamp": "2020-04-17T20:25:31.381+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "writeKey": "abcdefghijklmnopqrstuvwxyz" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.2" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { + "density": 2 + }, + "traits": { + "age": 23, + "email": "testmp@email.com", + "firstname": "Test Transformer" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "023a3a48-190a-4968-9394-a8e99b81a3c0", + "originalTimestamp": "2020-04-17T14:55:31.37Z", + "receivedAt": "2020-04-17T20:25:31.401+05:30", + "request_ip": "[::1]:57364", + "sentAt": "2020-04-17T14:55:31.37Z", + "timestamp": "2020-04-17T20:25:31.401+05:30", + "type": "identify", + "userId": "user12345" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "userId": "user12345", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "identify", + "userId": "user12345", + "traits": { + "age": 23, + "email": "testmp@email.com", + "firstname": "Test Transformer" + }, + "timeStamp": "2020-04-17T20:25:31.401+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "writeKey": "abcdefghijklmnopqrstuvwxyz" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.2" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { + "density": 2 + }, + "traits": { + "age": 23, + "email": "testmp@email.com", + "firstname": "Test Transformer" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "event": "test track with property", + "integrations": { + "All": true + }, + "messageId": "584fde02-901a-4964-a4a0-4078b999d5b2", + "originalTimestamp": "2020-04-17T14:55:31.372Z", + "properties": { + "test_prop_1": "test prop", + "test_prop_2": 1232 + }, + "receivedAt": "2020-04-17T20:25:31.401+05:30", + "request_ip": "[::1]:57365", + "sentAt": "2020-04-17T14:55:31.372Z", + "timestamp": "2020-04-17T20:25:31.401+05:30", + "type": "track", + "userId": "user12345" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "userId": "user12345", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "track", + "userId": "user12345", + "event": "test track with property", + "traits": { + "age": 23, + "email": "testmp@email.com", + "firstname": "Test Transformer" + }, + "properties": { + "test_prop_1": "test prop", + "test_prop_2": 1232 + }, + "timeStamp": "2020-04-17T20:25:31.401+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "statusCode": 200 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "writeKey": "abcdefghijklmnopqrstuvwxyz" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.2" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { + "density": 2 + }, + "traits": { + "age": 23, + "email": "testmp@rudderstack.com", + "firstname": "Test Kafka" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "258b77c6-442d-4bdc-8729-f0e4cef41353", + "name": "home", + "originalTimestamp": "2020-04-17T14:55:31.367Z", + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "receivedAt": "2020-04-17T20:25:31.381+05:30", + "request_ip": "[::1]:57363", + "sentAt": "2020-04-17T14:55:31.367Z", + "timestamp": "2020-04-17T20:25:31.381+05:30", + "type": "page", + "userId": "user12345" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "type": "page", + "userId": "user12345", + "traits": { + "age": 23, + "email": "testmp@rudderstack.com", + "firstname": "Test Kafka" + }, + "properties": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "timeStamp": "2020-04-17T20:25:31.381+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "userId": "user12345", + "statusCode": 200 + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "segment", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1afmecIpsJm7D72aRTksxyODrwR", + "Name": "Segment", + "DestinationDefinition": { + "ID": "1afjjahf0X5lSyNze7Xh7aqJs11", + "Name": "SEGMENT", + "DisplayName": "Segment", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "writeKey": "abcdefghijklmnopqrstuvwxyz" + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.2" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.2" + }, + "locale": "en-GB", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/index4.html", + "referrer": "", + "search": "", + "title": "", + "url": "http://localhost/tests/html/index4.html" + }, + "screen": { + "density": 2 + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36" + }, + "event": "test track with property", + "integrations": { + "All": true + }, + "messageId": "584fde02-901a-4964-a4a0-4078b999d5b2", + "originalTimestamp": "2020-04-17T14:55:31.372Z", + "properties": { + "test_prop_1": "test prop", + "test_prop_2": 1232 + }, + "receivedAt": "2020-04-17T20:25:31.401+05:30", + "request_ip": "[::1]:57365", + "sentAt": "2020-04-17T14:55:31.372Z", + "timestamp": "2020-04-17T20:25:31.401+05:30", + "type": "track", + "userId": "user12345" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.segment.io/v1/batch", + "headers": { + "Content-Type": "application/json", + "Authorization": "Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6" + }, + "params": {}, + "body": { + "JSON": { + "batch": [ + { + "anonymousId": "ac7722c2-ccb6-4ae2-baf6-1effe861f4cd", + "type": "track", + "userId": "user12345", + "event": "test track with property", + "properties": { + "test_prop_1": "test prop", + "test_prop_2": 1232 + }, + "timeStamp": "2020-04-17T20:25:31.401+05:30" + } + ] + }, + "XML": {}, + "JSON_ARRAY": {}, + "FORM": {} + }, + "files": {}, + "userId": "user12345", + "statusCode": 200 + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/shynet/processor/data.ts b/test/integrations/destinations/shynet/processor/data.ts new file mode 100644 index 0000000000..b3485bc8d5 --- /dev/null +++ b/test/integrations/destinations/shynet/processor/data.ts @@ -0,0 +1,218 @@ +export const data = [ + { + name: 'shynet', + description: 'Test 0: Page Call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + shynetServiceUrl: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + heartBeat: 5000, + }, + }, + message: { + type: 'page', + sentAt: '2022-08-22T13:39:21.034Z', + channel: 'web', + context: { + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.2.20', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + path: '/Testing/test/ourSdk.html', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + initial_referrer: '$direct', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '', + }, + locale: 'en-US', + screen: { + width: 1440, + height: 900, + density: 2, + innerWidth: 536, + innerHeight: 689, + }, + traits: { + email: '12312@!fma', + city: 'Pune', + revenue: 93889, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.2.20', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36', + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: 'bf412108-0357-4330-b119-7305e767823c', + messageId: 'bf412108-0357-4330-b119-7305e767823r', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-22T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + location: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + idempotency: 'bf412108-0357-4330-b119-7305e767823r', + }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + userId: '', + method: 'POST', + params: {}, + headers: { + 'Content-Type': 'application/json', + }, + version: '1', + endpoint: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'shynet', + description: 'Test 1: Page Call without heartBeat Mentioned', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + shynetServiceUrl: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + }, + }, + message: { + type: 'page', + sentAt: '2022-08-22T13:39:21.034Z', + channel: 'web', + context: { + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.2.20', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + path: '/Testing/test/ourSdk.html', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + referrer: 'http://127.0.0.1:7307/Testing/test/', + initial_referrer: '$direct', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '', + loadTime: 45, + }, + locale: 'en-US', + screen: { + width: 1440, + height: 900, + density: 2, + innerWidth: 536, + innerHeight: 689, + }, + traits: { + email: '12312@!fma', + city: 'Pune', + revenue: 93889, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.2.20', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36', + }, + properties: { + loadTime: 45, + }, + rudderId: '553b5522-c575-40a7-8072-9741c5f9a647', + anonymousId: '675467tfhjgjhfcghjc', + messageId: 'bf412108-0357-4330-b119-7305e767823r', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-22T13:39:21.032Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://9710-103-211-12-1.in.ngrok.io/ingress/5b3470a9-be69-4298-9ec1-3fe3f483738c/script.js', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + loadTime: 45, + referrer: 'http://127.0.0.1:7307/Testing/test/', + location: 'http://127.0.0.1:7307/Testing/test/ourSdk.html', + idempotency: 'bf412108-0357-4330-b119-7305e767823r', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/slack/processor/data.ts b/test/integrations/destinations/slack/processor/data.ts new file mode 100644 index 0000000000..be05a13ab5 --- /dev/null +++ b/test/integrations/destinations/slack/processor/data.ts @@ -0,0 +1,1982 @@ +export const data = [ + { + "name": "slack", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "originalTimestamp": "2020-03-23T03:46:30.916Z", + "properties": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "receivedAt": "2020-03-23T09:16:31.041+05:30", + "request_ip": "[::1]:52056", + "sentAt": "2020-03-23T03:46:30.916Z", + "timestamp": "2020-03-23T09:16:31.041+05:30", + "type": "identify", + "userId": "12345" + }, + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"Identified my-namehiji: hulala \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ], + "denyListOfEvents": [ + { + "eventName": "black_event" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "originalTimestamp": "2020-03-23T03:46:30.916Z", + "properties": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "receivedAt": "2020-03-23T09:16:31.041+05:30", + "request_ip": "[::1]:52056", + "sentAt": "2020-03-23T03:46:30.916Z", + "timestamp": "2020-03-23T09:16:31.041+05:30", + "type": "page", + "userId": "12345" + }, + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 126, + "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Event type page is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "12345", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "", + "referrer": "", + "search": "", + "title": "", + "url": "" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "traits": { + "country": "USA", + "email": "test@domain.com", + "hiji": "hulala-1", + "name": "my-name-1" + }, + "integrations": { + "All": true + }, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "originalTimestamp": "2020-03-23T03:41:46.122Z", + "receivedAt": "2020-03-23T09:11:46.244+05:30", + "request_ip": "[::1]:52055", + "sentAt": "2020-03-23T03:41:46.123Z", + "timestamp": "2020-03-23T09:11:46.243+05:30", + "type": "identify", + "userId": "12345" + }, + "metadata": { + "anonymousId": "12345", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 123, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"identified my-name-1 with hiji: hulala-1 \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "12345", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 123, + "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "incomingWebhooksType": "modern", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ], + "denyListOfEvents": [ + { + "eventName": "black_event" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_isent1", + "integrations": { + "All": true + }, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "originalTimestamp": "2020-03-23T03:46:30.921Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52057", + "sentAt": "2020-03-23T03:46:30.921Z", + "timestamp": "2020-03-23T09:16:31.064+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/id1/id2/demo", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "incomingWebhooksType": "modern", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "is", + "eventChannel": "example_channel", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "is", + "eventChannel": "example_channel", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ], + "denyListOfEvents": [ + { + "eventName": "black_event" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_testis", + "integrations": { + "All": true + }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/id1/id2/example", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "incomingWebhooksType": "modern", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "test_eventing_test", + "eventChannel": "example_channel", + "eventRegex": false + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "", + "eventChannel": "example_channel", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ], + "denyListOfEvents": [ + { + "eventName": "black_event" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_test", + "integrations": { + "All": true + }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/id1/id2/example", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"my-name did test_eventing_test\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "incomingWebhooksType": "legacy", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ], + "denyListOfEvents": [ + { + "eventName": "black_event" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_isent1", + "integrations": { + "All": true + }, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "originalTimestamp": "2020-03-23T03:46:30.921Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52057", + "sentAt": "2020-03-23T03:46:30.921Z", + "timestamp": "2020-03-23T09:16:31.064+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "incomingWebhooksType": "legacy", + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example", + "eventName": "is", + "eventRegex": true + }, + { + "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1", + "eventChannel": "example-of-legacy", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ], + "denyListOfEvents": [ + { + "eventName": "black_event" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_testis", + "integrations": { + "All": true + }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"channel\":\"example-of-legacy\",\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_eventing_testis", + "integrations": { + "All": true + }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "integrations": { + "All": true + }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Event name is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "identifyTemplate": "identified {{name}} with {{traits}}", + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.1.1-rc.1" + }, + "ip": "0.0.0.0", + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.1.1-rc.1" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "page": { + "path": "/tests/html/script-test.html", + "referrer": "http://localhost:1111/tests/html/", + "search": "", + "title": "", + "url": "http://localhost:1111/tests/html/script-test.html" + }, + "screen": { + "density": 1.7999999523162842 + }, + "traits": { + "country": "India", + "email": "name@domain.com", + "hiji": "hulala", + "name": "my-name" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" + }, + "event": "test_isent1", + "integrations": { + "All": true + }, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "originalTimestamp": "2020-03-23T03:46:30.921Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52057", + "sentAt": "2020-03-23T03:46:30.921Z", + "timestamp": "2020-03-23T09:16:31.064+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 128, + "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 400, + "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "SLACK", + "module": "destination", + "implementation": "native", + "feature": "processor", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL" + } + } + ] + } + } + }, + { + "name": "slack", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "Name": "test-slack", + "DestinationDefinition": { + "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV", + "Name": "SLACK", + "DisplayName": "Slack", + "Config": { + "excludeKeys": [], + "includeKeys": [] + } + }, + "Config": { + "eventChannelSettings": [ + { + "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo", + "eventName": "is", + "eventRegex": true + } + ], + "eventTemplateSettings": [ + { + "eventName": "is", + "eventRegex": true, + "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}" + }, + { + "eventName": "", + "eventRegex": false, + "eventTemplate": "" + } + ], + "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "whitelistedTraitsSettings": [ + { + "trait": "hiji" + }, + { + "trait": "" + } + ] + }, + "Enabled": true, + "Transformations": [], + "IsProcessorEnabled": true + }, + "message": { + "anonymousId": "00000000000000000000000000", + "channel": "web", + "context": {}, + "event": "black_event", + "integrations": { + "All": true + }, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "originalTimestamp": "2020-03-23T03:46:30.922Z", + "properties": { + "currency": "USD", + "key1": "test_val1", + "key2": "test_val2", + "revenue": 30, + "user_actual_id": 12345 + }, + "receivedAt": "2020-03-23T09:16:31.064+05:30", + "request_ip": "[::1]:52054", + "sentAt": "2020-03-23T03:46:30.923Z", + "timestamp": "2020-03-23T09:16:31.063+05:30", + "type": "track", + "userId": "12345" + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "payload": "{\"text\":\"User 12345 did black_event\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}" + } + }, + "files": {}, + "userId": "12345", + "statusCode": 200 + }, + "metadata": { + "anonymousId": "00000000000000000000000000", + "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL", + "destinationType": "SLACK", + "jobId": 129, + "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8", + "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/slack/router/data.ts b/test/integrations/destinations/slack/router/data.ts new file mode 100644 index 0000000000..87b1fe3b22 --- /dev/null +++ b/test/integrations/destinations/slack/router/data.ts @@ -0,0 +1,425 @@ +export const data = [ + { + name: 'slack', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + Name: 'test-slack', + DestinationDefinition: { + ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV', + Name: 'SLACK', + DisplayName: 'Slack', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: { + eventChannelSettings: [ + { + eventChannel: '#slack_integration', + eventName: 'is', + eventRegex: true, + }, + { + eventChannel: '', + eventName: '', + eventRegex: false, + }, + { + eventChannel: '', + eventName: '', + eventRegex: false, + }, + ], + eventTemplateSettings: [ + { + eventName: 'is', + eventRegex: true, + eventTemplate: + '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}', + }, + { + eventName: '', + eventRegex: false, + eventTemplate: '', + }, + ], + identifyTemplate: 'identified {{name}} with {{traits}}', + webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo', + whitelistedTraitsSettings: [ + { + trait: 'hiji', + }, + { + trait: '', + }, + ], + }, + Enabled: true, + Transformations: [], + IsrouterEnabled: true, + }, + message: { + anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1-rc.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1-rc.1', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + page: { + path: '/tests/html/script-test.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/script-test.html', + }, + screen: { + density: 1.7999999523162842, + }, + traits: { + country: 'India', + email: 'name@domain.com', + hiji: 'hulala', + name: 'my-name', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + integrations: { + All: true, + }, + messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780', + originalTimestamp: '2020-03-23T03:46:30.916Z', + properties: { + path: '/tests/html/script-test.html', + referrer: 'http://localhost:1111/tests/html/', + search: '', + title: '', + url: 'http://localhost:1111/tests/html/script-test.html', + }, + receivedAt: '2020-03-23T09:16:31.041+05:30', + request_ip: '[::1]:52056', + sentAt: '2020-03-23T03:46:30.916Z', + timestamp: '2020-03-23T09:16:31.041+05:30', + type: 'page', + userId: '12345', + }, + metadata: { + anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + destinationType: 'SLACK', + jobId: 126, + messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780', + sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp', + }, + }, + ], + destType: 'slack', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + eventChannelSettings: [ + { eventChannel: '#slack_integration', eventName: 'is', eventRegex: true }, + { eventChannel: '', eventName: '', eventRegex: false }, + { eventChannel: '', eventName: '', eventRegex: false }, + ], + eventTemplateSettings: [ + { + eventName: 'is', + eventRegex: true, + eventTemplate: + '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}', + }, + { eventName: '', eventRegex: false, eventTemplate: '' }, + ], + identifyTemplate: 'identified {{name}} with {{traits}}', + webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo', + whitelistedTraitsSettings: [{ trait: 'hiji' }, { trait: '' }], + }, + DestinationDefinition: { + Config: { excludeKeys: [], includeKeys: [] }, + DisplayName: 'Slack', + ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV', + Name: 'SLACK', + }, + Enabled: true, + ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + IsrouterEnabled: true, + Name: 'test-slack', + Transformations: [], + }, + error: 'Event type page is not supported', + metadata: [ + { + anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + destinationType: 'SLACK', + jobId: 126, + messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780', + sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp', + }, + ], + statTags: { + destType: 'SLACK', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + }, + { + name: 'slack', + description: 'Test 1', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + Name: 'test-slack', + DestinationDefinition: { + ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV', + Name: 'SLACK', + DisplayName: 'Slack', + Config: { + excludeKeys: [], + includeKeys: [], + }, + }, + Config: { + eventChannelSettings: [ + { + eventChannel: '#slack_integration', + eventName: 'is', + eventRegex: true, + }, + { + eventChannel: '', + eventName: '', + eventRegex: false, + }, + { + eventChannel: '', + eventName: '', + eventRegex: false, + }, + ], + eventTemplateSettings: [ + { + eventName: 'is', + eventRegex: true, + eventTemplate: + '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}', + }, + { + eventName: '', + eventRegex: false, + eventTemplate: '', + }, + ], + identifyTemplate: 'identified {{name}} with {{traits}}', + webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo', + whitelistedTraitsSettings: [ + { + trait: 'hiji', + }, + { + trait: '', + }, + ], + }, + Enabled: true, + Transformations: [], + IsrouterEnabled: true, + }, + message: { + anonymousId: '12345', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.1-rc.1', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.1-rc.1', + }, + locale: 'en-US', + os: { + name: '', + version: '', + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + screen: { + density: 1.7999999523162842, + }, + traits: { + country: 'India', + email: 'name@domain.com', + hiji: 'hulala', + name: 'my-name', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + traits: { + country: 'USA', + email: 'test@domain.com', + hiji: 'hulala-1', + name: 'my-name-1', + }, + integrations: { + All: true, + }, + messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777', + originalTimestamp: '2020-03-23T03:41:46.122Z', + receivedAt: '2020-03-23T09:11:46.244+05:30', + request_ip: '[::1]:52055', + sentAt: '2020-03-23T03:41:46.123Z', + timestamp: '2020-03-23T09:11:46.243+05:30', + type: 'identify', + userId: '12345', + }, + metadata: { + anonymousId: '12345', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + destinationType: 'SLACK', + jobId: 123, + messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777', + sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp', + }, + }, + ], + destType: 'slack', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: [ + { + body: { + FORM: { + payload: + '{"text":"identified my-name-1 with hiji: hulala-1 ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + }, + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo', + files: {}, + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + method: 'POST', + params: {}, + statusCode: 200, + type: 'REST', + userId: '12345', + version: '1', + }, + ], + destination: { + Config: { + eventChannelSettings: [ + { eventChannel: '#slack_integration', eventName: 'is', eventRegex: true }, + { eventChannel: '', eventName: '', eventRegex: false }, + { eventChannel: '', eventName: '', eventRegex: false }, + ], + eventTemplateSettings: [ + { + eventName: 'is', + eventRegex: true, + eventTemplate: + '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}', + }, + { eventName: '', eventRegex: false, eventTemplate: '' }, + ], + identifyTemplate: 'identified {{name}} with {{traits}}', + webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo', + whitelistedTraitsSettings: [{ trait: 'hiji' }, { trait: '' }], + }, + DestinationDefinition: { + Config: { excludeKeys: [], includeKeys: [] }, + DisplayName: 'Slack', + ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV', + Name: 'SLACK', + }, + Enabled: true, + ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + IsrouterEnabled: true, + Name: 'test-slack', + Transformations: [], + }, + metadata: [ + { + anonymousId: '12345', + destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL', + destinationType: 'SLACK', + jobId: 123, + messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777', + sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp', + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/snapchat_conversion/processor/data.ts b/test/integrations/destinations/snapchat_conversion/processor/data.ts new file mode 100644 index 0000000000..ed38673d95 --- /dev/null +++ b/test/integrations/destinations/snapchat_conversion/processor/data.ts @@ -0,0 +1,4300 @@ +export const data = [ + { + name: 'snapchat_conversion', + description: 'Test case for Page event-> PAGE_VIEW ', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'web', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'page', + name: 'Home Page Viewed', + properties: { + title: 'Home | RudderStack', + url: 'http://www.rudderstack.com', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + }, + }, + metadata: { + jobId: 20, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 20, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + userId: '', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'PAGE_VIEW', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'WEB', + page_url: 'http://www.rudderstack.com', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Prodcuts Searched event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + firstName: 'john', + middleName: 'victor', + lastName: 'doe', + city: 'some_city', + state: 'some_state', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + brands: 'abc', + query: 't-shirts', + event_conversion_type: 'web', + number_items: 4, + click_id: 'some_click_id', + description: 'Products Searched event for conversion type offline', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 21, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 21, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + number_items: 4, + click_id: 'some_click_id', + description: 'Products Searched event for conversion type offline', + hashed_first_name_sha: + '96d9632f363564cc3032521409cf22a852f2032eec099ed5967c0d000cec607a', + hashed_last_name_sha: + '799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f', + hashed_state_sha: + '6db488fc98e30afdf67a05a6da916805b02891ce58f03970c6deff79129c5f1c', + hashed_middle_name_sha: + '99bde068af2d49ed7fc8b8fa79abe13a6059e0db320bb73459fd96624bb4b33f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Track event without event Key', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + country: 'IN', + zicode: 'Sxp-12345', + region: 'some_region', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 22, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event name is required', + metadata: { + jobId: 22, + destinationId: 'd2', + workspaceId: 'w2', + }, + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Identify event which is not supported in this destination', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'identify', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 23, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 23, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Event type identify is not supported', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Pixel id is not set as a destination config field', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 24, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 24, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Pixel Id is required for web and offline events', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Prodcuts Searched event for conversion type web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'web', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + }, + }, + metadata: { + jobId: 25, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 25, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'WEB', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case where appId is not present in destination config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + }, + }, + metadata: { + jobId: 26, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 26, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Snap App Id is required for app events', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case where snap app id is not present in destination config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + }, + }, + metadata: { + jobId: 27, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 27, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: 'Snap App Id is required for app events', + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Product Searched event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + delivery_method: 'in_store', + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 28, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 28, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + delivery_method: 'in_store', + device_model: 'AOSP on IA Emulator', + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test Case for Product List Viewed event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + country: 'IN', + zipcode: 'Sxp-12345', + region: 'some_region', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product List Viewed', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 29, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 29, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'VIEW_CONTENT', + item_ids: ['123', '123'], + price: '56', + country: 'IN', + hashed_zip: 'cbb2704f5b334a0cec32e5463d1fd9355f6ef73987bfe0ebb8389b7617452152', + region: 'some_region', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for checkout_started event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'checkout_started', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: '2', + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 30, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 30, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'START_CHECKOUT', + item_ids: ['123', '123'], + price: '42', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test Case for Order Completed event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Order Completed', + properties: { + brands: ['brand01', 'brand02'], + products: [ + { + product_id: '123', + price: '14', + quantity: 1, + }, + { + product_id: '124', + price: 14, + quantity: 3, + }, + ], + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 31, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 31, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'PURCHASE', + item_ids: ['123', '124'], + brands: ['brand01', 'brand02'], + price: '56', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test Case for Product Added event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Added', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 32, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 32, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_ids: '123', + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'ADD_CART', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'web', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Viewed', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + number_items: 14, + quantity: 1, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 33, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 33, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_ids: '123', + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'WEB', + pixel_id: 'dummyPixelId', + number_items: 14, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Viewed', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + quantity: 1, + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 34, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 34, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_ids: '123', + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + number_items: 1, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Payment Info Entered event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Payment Info Entered', + properties: { + checkout_id: '12dfdfdf3', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 35, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 35, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + transaction_id: '12dfdfdf3', + event_type: 'ADD_BILLING', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Subscribe event where conversion type is web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'subscribe', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 36, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 36, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'SUBSCRIBE', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Promotion Viewed event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Promotion Viewed', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 37, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 37, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'AD_VIEW', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Promotion Clicked event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Promotion clicked', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 38, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 38, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'AD_CLICK', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for save event for conversion type offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: '', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'save', + properties: { + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 39, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 39, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'SAVE', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is web', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Viewed', + properties: { + eventConversionType: 'web', + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + url: 'hjhb.com', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 40, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 40, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + page_url: 'hjhb.com', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'WEB', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Viewed event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Viewed', + properties: { + eventConversionType: 'offline', + checkout_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + url: 'hjhb.com', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 41, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 41, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + price: '14', + currency: 'USD', + event_type: 'VIEW_CONTENT', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Product Searched event where conversion type is offline', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + event_tag: 'offline', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + metadata: { + jobId: 42, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 42, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + event_tag: 'offline', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: + 'Test Case for Product Added To Whishlist event where conversion type is mobile app', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Added to Wishlist', + properties: { + product_id: '123', + price: '14', + category: 'shoes', + currency: 'USD', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 43, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 43, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + item_category: 'shoes', + item_ids: '123', + price: '14', + currency: 'USD', + event_type: 'ADD_TO_WISHLIST', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Test case for Products Searched event using event mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'ProdSearched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [ + { + from: 'ProdSearched', + to: 'products_searched', + }, + ], + }, + }, + metadata: { + jobId: 44, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 44, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + userId: '', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: "Test case event doesn't match with snapchat events", + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'ProdSearched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [], + }, + }, + metadata: { + jobId: 45, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 45, + destinationId: 'd2', + workspaceId: 'w2', + }, + error: "Event ProdSearched doesn't match with Snapchat Events!", + statTags: { + destType: 'SNAPCHAT_CONVERSION', + destinationId: 'd2', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'w2', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: + 'test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product Added to Cart', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [ + { + from: 'Product_Added_To_Cart', + to: 'products_searched', + }, + ], + }, + }, + metadata: { + jobId: 46, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 46, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: + 'test event naming (i.e passed vs the names provided in webapp) by bringing them to a common ground - here destination config need to be modified', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product_Added_to_Cart', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + rudderEventsToSnapEvents: [ + { + from: 'Product Added To Cart', + to: 'products_searched', + }, + ], + }, + }, + metadata: { + jobId: 47, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 47, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + search_string: 't-shirts', + event_type: 'SEARCH', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Enable deduplication with duplication key as email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + request_ip: '127.0.0.1', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Order Completed', + properties: { + products: [ + { + product_id: '123', + price: '14', + quantity: 1, + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + revenue: '100', + custom_dedup_id: '1234', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + deduplicationKey: 'properties.custom_dedup_id', + enableDeduplication: true, + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 48, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 48, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'PURCHASE', + item_ids: ['123', '123'], + client_dedup_id: '1234', + hashed_ip_address: + '12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0', + price: '100', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Mapping revenue to price for product list viewed event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product List Viewed', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + revenue: '100', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 49, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 49, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'VIEW_CONTENT', + item_ids: ['123', '123'], + price: '100', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'snapchat_conversion', + description: 'Mapping revenue to price for product list viewed event', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + channel: 'mobile', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Product List Viewed', + properties: { + products: [ + { + product_id: '123', + price: '14', + }, + { + product_id: '123', + price: 14, + quantity: 3, + }, + ], + revenue: '100', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: false, + }, + }, + Config: { + apiKey: 'dummyApiKey', + pixelId: 'dummyPixelId', + appId: 'dhfeih44f', + snapAppId: 'hfhdhfd', + }, + }, + metadata: { + jobId: 50, + destinationId: 'd2', + workspaceId: 'w2', + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 50, + destinationId: 'd2', + workspaceId: 'w2', + }, + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + Authorization: 'Bearer dummyApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_type: 'VIEW_CONTENT', + item_ids: ['123', '123'], + price: '100', + hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + timestamp: '1650625078', + event_conversion_type: 'MOBILE_APP', + snap_app_id: 'hfhdhfd', + app_id: 'dhfeih44f', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: (_) => { + // @ts-ignore + Date.now = jest.fn(() => new Date('2022-04-23T10:57:58Z')); + }, +})); diff --git a/test/integrations/destinations/snapchat_conversion/router/data.ts b/test/integrations/destinations/snapchat_conversion/router/data.ts new file mode 100644 index 0000000000..bfa9acd4d2 --- /dev/null +++ b/test/integrations/destinations/snapchat_conversion/router/data.ts @@ -0,0 +1,449 @@ +import { FEATURES, IMPLEMENTATIONS, MODULES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'snapchat_conversion', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + }, + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + }, + { + message: { + messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be', + originalTimestamp: '2022-04-22T10:57:58Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + context: { + traits: { + email: 'test@email.com', + phone: '+91 2111111 ', + }, + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + device: { + advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a', + id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', + manufacturer: 'Google', + name: 'generic_x86_arm', + type: 'ios', + attTrackingStatus: 3, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + locale: 'en-US', + os: { + name: 'iOS', + version: '14.4.1', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'ga4AppInstanceId', + id: 'f0dd99v4f979fb997ce453373900f891', + }, + ], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', + }, + type: 'track', + event: 'Products Searched', + properties: { + query: 't-shirts', + event_conversion_type: 'web', + }, + integrations: { + All: true, + }, + sentAt: '2022-04-22T10:57:58Z', + }, + metadata: { + jobId: 3, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + destType: 'snapchat_conversion', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://tr.snapchat.com/v2/conversion', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: { + batch: + '[{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"}]', + }, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + }, + { + jobId: 2, + }, + { + jobId: 3, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + }, + mockFns: (_) => { + // @ts-ignore + Date.now = jest.fn(() => new Date('2022-04-22T10:57:58Z')); + }, + }, + { + name: 'snapchat_conversion', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'track', + event: 'Product List Viewed', + sentAt: '2022-08-01T15:04:58.764Z', + userId: 'd131b5f1fc@nana.sa', + channel: 'mobile', + context: { + os: { + name: 'iOS', + version: '15.5', + }, + app: { + name: 'CFBundleDisplayName', + build: '12.43.0.16', + version: '12.43.0', + namespace: 'iShopCloud.com', + }, + device: { + id: 'f244e389-d899-40a0-9673-1db87a8db7d3', + name: 'iPhone Monerah', + type: 'iOS', + model: 'iPhone', + manufacturer: 'Apple', + }, + locale: 'ar-SA', + screen: { + width: 896, + height: 414, + density: 2, + }, + traits: { + email: 'm@gmail.com', + phone: '00966556747779', + userId: 'd131b5f1fc@nana.sa', + address: { + city: 'الرياض', + country: 'sa', + }, + country: 'sa', + lastName: '', + firstName: 'منيرة ام عمر', + anonymousId: 'f244e389-d899-40a0-9673-1db87a8db7d3', + 'Mobile Number': '00966556747779', + 'Last App Close': '2022-07-29T21:43:30.342Z', + 'Activation code': '9997', + 'Activation date': '2022-03-24 19:37:42', + 'First App Close': '2022-05-18 07:53:03', + 'Mobile Number Status': 'Active', + 'Last Activated Device': { + UUID: 'F244E389-D899-40A0-9673-1DB87A8DB7D3', + Platform: 'IOS', + 'App Version': '12.38.0', + 'App Language': 'AR', + 'Platform Version': '15.4', + }, + ml_availability_segment: -1, + }, + library: { + name: 'rudder-ios-library', + version: '1.0.7', + }, + network: { + wifi: true, + carrier: 'unavailable', + cellular: false, + bluetooth: false, + }, + timezone: 'Asia/Riyadh', + userAgent: 'unknown', + externalId: [ + { + id: 'CBEDC847-F22C-447C-85DE-2BB693240F8E', + type: 'brazeExternalId', + }, + ], + }, + rudderId: '8fd7a036-fcbd-4ec3-b498-ea2cbf1df629', + messageId: '1659366289-4126c107-c1e1-4ee1-b534-fb49afca197b', + timestamp: '2022-08-01T15:04:49.593Z', + properties: { + Parent: 'Testing', + 'List ID': 'CAT00002903', + store_id: 'STR00001959', + 'List Name': 'User', + session_id: '', + 'Viewed From': 'home', + 'Category Position': 2, + 'Banner Position Segment': 'B', + category_personalise_segment: 'B', + }, + receivedAt: '2022-08-01T15:04:59.091Z', + request_ip: '78.95.64.84', + anonymousId: 'f244e389-d899-40a0-9673-1db87a8db7d3', + integrations: { + All: true, + }, + originalTimestamp: '2022-08-01T15:04:49.266Z', + }, + metadata: { + jobId: 4, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + appId: 'jahsdfjk-5487-asdfa-9957-7c74eb8d3e80', + snapAppId: '', + enableDeduplication: false, + rudderEventsToSnapEvents: [ + { + from: 'Product List Viewed', + to: 'product_list_viewed', + }, + ], + }, + }, + }, + ], + destType: 'snapchat_conversion', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [ + { + jobId: 4, + }, + ], + batched: false, + statusCode: 400, + error: 'Snap App Id is required for app events', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: FEATURES.ROUTER, + implementation: IMPLEMENTATIONS.NATIVE, + module: MODULES.DESTINATION, + destType: 'SNAPCHAT_CONVERSION', + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + apiKey: 'dummyApiKey', + appId: 'jahsdfjk-5487-asdfa-9957-7c74eb8d3e80', + snapAppId: '', + enableDeduplication: false, + rudderEventsToSnapEvents: [ + { + from: 'Product List Viewed', + to: 'product_list_viewed', + }, + ], + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts new file mode 100644 index 0000000000..2ed5625fe8 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts @@ -0,0 +1,222 @@ +export const data = [ + { + "name": "snapchat_custom_audience", + "description": "Test 0", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer abcd123", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "snapchat_custom_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 200, + "body": { + "output": { + "status": 200, + "message": "Request Processed Successfully", + "destinationResponse": { + "response": { + "request_status": "SUCCESS", + "request_id": "12345", + "users": [ + { + "sub_request_status": "SUCCESS", + "user": { + "number_uploaded_users": 1 + } + } + ] + }, + "status": 200 + } + } + } + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 1", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/456/users", + "headers": { + "Authorization": "Bearer abcd123", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "snapchat_custom_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 500, + "body": { + "output": { + "status": 500, + "destinationResponse": { + "response": "unauthorized", + "status": 401 + }, + "message": "Failed with unauthorized during snapchat_custom_audience response transformation", + "statTags": { + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + }, + "authErrorCategory": "REFRESH_TOKEN" + } + } + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 2", + "feature": "dataDelivery", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/789/users", + "headers": { + "Authorization": "Bearer abcd123", + "Content-Type": "application/json" + }, + "body": { + "JSON": { + "users": [ + { + "id": "123456", + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "params": { + "destination": "snapchat_custom_audience" + } + }, + "method": "POST" + } + }, + "output": { + "response": { + "status": 400, + "body": { + "output": { + "authErrorCategory": "AUTH_STATUS_INACTIVE", + "status": 400, + "destinationResponse": { + "response": { + "request_status": "ERROR", + "request_id": "98e2a602-3cf4-4596-a8f9-7f034161f89a", + "debug_message": "Caller does not have permission", + "display_message": "We're sorry, but the requested resource is not available at this time", + "error_code": "E3002" + }, + "status": 403 + }, + "message": "undefined during snapchat_custom_audience response transformation", + "statTags": { + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "aborted", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + } + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/snapchat_custom_audience/network.ts b/test/integrations/destinations/snapchat_custom_audience/network.ts new file mode 100644 index 0000000000..9be134c202 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/network.ts @@ -0,0 +1,84 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://adsapi.snapchat.com/v1/segments/123/users', + data: { + users: [ + { + schema: ['EMAIL_SHA256'], + data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], + }, + ], + }, + params: { destination: 'snapchat_custom_audience' }, + headers: { + Authorization: 'Bearer abcd123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + request_status: 'SUCCESS', + request_id: '12345', + users: [{ sub_request_status: 'SUCCESS', user: { number_uploaded_users: 1 } }], + }, + status: 200, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://adsapi.snapchat.com/v1/segments/456/users', + data: { + users: [ + { + schema: ['EMAIL_SHA256'], + data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], + }, + ], + }, + params: { destination: 'snapchat_custom_audience' }, + headers: { + Authorization: 'Bearer abcd123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: 'unauthorized', status: 401, statusText: 'Unauthorized' }, + }, + { + httpReq: { + url: 'https://adsapi.snapchat.com/v1/segments/789/users', + data: { + users: [ + { + id: '123456', + schema: ['EMAIL_SHA256'], + data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], + }, + ], + }, + params: { destination: 'snapchat_custom_audience' }, + headers: { + Authorization: 'Bearer abcd123', + 'Content-Type': 'application/json', + 'User-Agent': 'RudderLabs', + }, + method: 'DELETE', + }, + httpRes: { + data: { + request_status: 'ERROR', + request_id: '98e2a602-3cf4-4596-a8f9-7f034161f89a', + debug_message: 'Caller does not have permission', + display_message: "We're sorry, but the requested resource is not available at this time", + error_code: 'E3002', + }, + status: 403, + statusText: 'Forbidden', + }, + }, +]; diff --git a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts new file mode 100644 index 0000000000..9ad6106c7e --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts @@ -0,0 +1,1404 @@ +export const data = [ + { + "name": "snapchat_custom_audience", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "add": [ + { + "email": "test@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": true, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "remove": [ + { + "email": "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "add": [ + { + "email": "test@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ], + "remove": [ + { + "email": "test@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "add": [ + { + "email": "test@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + }, + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ], + [ + "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "remove": [ + { + "email": "test@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + }, + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419" + ], + [ + "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audience", + "properties": { + "listData": { + "add": [ + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Event type audience is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "properties": { + "listData": { + "add": [ + { + "email": "test@rudderstack.com", + "phone": "@09876543210", + "firstName": "rudderlabs", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Message properties is not present. Aborting message", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "listData is not present inside properties. Aborting message", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "abc": "123" + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Neither 'add' nor 'remove' property is present inside 'listData'. Aborting message", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "remove": [ + { + "email": "", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + }, + { + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 400, + "error": "Required schema parameter email is not found from payload", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SNAPCHAT_CUSTOM_AUDIENCE", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "email" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "remove": [ + { + "email": "abcd@abc.com", + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + }, + { + "phone": "@09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "DELETE", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "EMAIL_SHA256" + ], + "data": [ + [ + "8c37cbc5d9abb3082303c6548571cfc7655a4546ddc1e943f041fc9126e7274a" + ] + ], + "id": "123" + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 12", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "phone" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "add": [ + { + "email": "test@abc.com", + "phone": "09876543210", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "PHONE_SHA256" + ], + "data": [ + [ + "7619ee8cea49187f309616e30ecf54be072259b43760f1f550a644945d5572f2" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "snapchat_custom_audience", + "description": "Test 13", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "destination": { + "Config": { + "segmentId": "123", + "disableHashing": false, + "schema": "mobileAdId" + } + }, + "message": { + "userId": "user 1", + "anonymousId": "anon-id-new", + "event": "event1", + "type": "audiencelist", + "properties": { + "listData": { + "add": [ + { + "email": "test@abc.com", + "phone": "09876543210", + "mobileId": "1334", + "firstName": "test", + "lastName": "rudderlabs", + "country": "US", + "postalCode": "1245" + } + ] + }, + "enablePartialFailure": true + }, + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "timestamp": "2020-02-02T00:23:09.544Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://adsapi.snapchat.com/v1/segments/123/users", + "headers": { + "Authorization": "Bearer dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "users": [ + { + "schema": [ + "MOBILE_AD_ID_SHA256" + ], + "data": [ + [ + "eb43272640b269219a01caf99c5a4122d6edc0916d45ac13c0ce80ca3ad2def0" + ] + ] + } + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "metadata": { + "secret": { + "access_token": "dummyAccessToken", + "refresh_token": "dummyRefreshToken", + "developer_token": "dummyDeveloperToken" + } + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/snapchat_custom_audience/router/data.ts b/test/integrations/destinations/snapchat_custom_audience/router/data.ts new file mode 100644 index 0000000000..2807201e73 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/router/data.ts @@ -0,0 +1,124 @@ +import { FEATURES, MODULES } from '../../../../../src/v0/util/tags'; + +const DEST_TYPE = 'snapchat_custom_audience'; + +export const data = [ + { + name: DEST_TYPE, + description: 'Test 0', + feature: FEATURES.ROUTER, + module: MODULES.DESTINATION, + version: 'v0', + input: { + request: { + body: { + input: [ + { + metadata: { + secret: { + access_token: 'dummyAccessToken', + refresh_token: 'dummyRefreshToken', + developer_token: 'dummyDeveloperToken', + }, + }, + destination: { + Config: { + segmentId: '123', + disableHashing: false, + schema: 'email', + }, + }, + message: { + userId: 'user 1', + anonymousId: 'anon-id-new', + event: 'event1', + type: 'audiencelist', + properties: { + listData: { + add: [ + { + email: 'test@abc.com', + phone: '@09876543210', + firstName: 'test', + lastName: 'rudderlabs', + country: 'US', + postalCode: '1245', + }, + ], + }, + enablePartialFailure: true, + }, + context: { + ip: '14.5.67.21', + library: { + name: 'http', + }, + }, + timestamp: '2020-02-02T00:23:09.544Z', + }, + }, + ], + destType: DEST_TYPE, + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummyAccessToken', + }, + params: {}, + body: { + JSON: { + users: [ + { + data: [ + ['d3142c8f9c9129484daf28df80cc5c955791efed5e69afabb603bc8cb9ffd419'], + ], + schema: ['EMAIL_SHA256'], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [ + { + secret: { + access_token: 'dummyAccessToken', + developer_token: 'dummyDeveloperToken', + refresh_token: 'dummyRefreshToken', + }, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + disableHashing: false, + schema: 'email', + segmentId: '123', + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/splitio/processor/data.ts b/test/integrations/destinations/splitio/processor/data.ts new file mode 100644 index 0000000000..6f77c6f562 --- /dev/null +++ b/test/integrations/destinations/splitio/processor/data.ts @@ -0,0 +1,915 @@ +export const data = [ + { + "name": "splitio", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "traits": { + "martin": 21.565, + "trafficTypeName": "user", + "vertical": "restaurant", + "eventTypeId": "page_load end to end", + "timestamp": 1513357833000, + "GMV": false + }, + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "traits": { + "abc": "new-val", + "key": "key_user_0", + "value": "0.93" + }, + "library": { + "name": "http" + } + }, + "type": "group", + "groupId": "group1", + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "group", + "key": "user123", + "timestamp": 1579566094208, + "environmentName": "staging", + "trafficTypeName": "user", + "properties": { + "martin": 21.565, + "vertical": "restaurant", + "GMV": false + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "traits": { + "martin": 21.565, + "trafficTypeName": "user", + "eventTypeId": "page_load end to end", + "timestamp": 1513357833000, + "address": { + "city": "San Francisco", + "state": "CA", + "country": "USA" + }, + "key1": { + "a": "a" + }, + "key2": [ + 1, + 2, + 3 + ], + "key3": { + "key4": {} + }, + "key5": null + }, + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "traits": { + "abc": "new-val", + "key": "key_user_0" + }, + "library": { + "name": "http" + } + }, + "type": "identify", + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "identify", + "key": "user123", + "timestamp": 1579566094208, + "environmentName": "staging", + "trafficTypeName": "user", + "properties": { + "martin": 21.565, + "address.city": "San Francisco", + "address.state": "CA", + "address.country": "USA", + "key1.a": "a", + "key2[0]": 1, + "key2[1]": 2, + "key2[2]": 3 + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "event": "splitio_test_1", + "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", + "properties": { + "eventTypeId": "page_load", + "trafficTypeName": "user", + "key": "key_user_0", + "timestamp": 1513357833000, + "value": "0.93", + "martin": 21.565, + "vertical": "restaurant", + "GMV": true, + "abc": "new-val", + "property1": { + "property2": 1, + "property3": "test", + "property4": { + "subProp1": { + "a": "a", + "b": "b" + }, + "subProp2": [ + "a", + "b" + ], + "subProp3": { + "prop": {} + } + } + }, + "properties5": null + }, + "receivedAt": "2021-03-01T22:55:54.806Z", + "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", + "timestamp": "2021-03-01T22:55:54.771Z", + "type": "track", + "userId": "user 1" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "production", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "splitio_test_1", + "key": "user 1", + "timestamp": 1614639354771, + "value": 0.93, + "environmentName": "production", + "trafficTypeName": "user", + "properties": { + "martin": 21.565, + "vertical": "restaurant", + "GMV": true, + "abc": "new-val", + "property1.property2": 1, + "property1.property3": "test", + "property1.property4.subProp1.a": "a", + "property1.property4.subProp1.b": "b", + "property1.property4.subProp2[0]": "a", + "property1.property4.subProp2[1]": "b" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "name": "splitio_test_1", + "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", + "properties": { + "eventTypeId": "page_load", + "trafficTypeName": "user", + "key": "key_user_0", + "timestamp": 1513357833000, + "value": "0.93", + "martin": 21.565, + "vertical": "restaurant", + "GMV": true, + "abc": "new-val" + }, + "receivedAt": "2021-03-01T22:55:54.806Z", + "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", + "timestamp": "2021-03-01T22:55:54.771Z", + "type": "page", + "userId": "user 1" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "production", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "Viewed_splitio_test_1_page", + "key": "user 1", + "timestamp": 1614639354771, + "value": 0.93, + "environmentName": "production", + "trafficTypeName": "user", + "properties": { + "martin": 21.565, + "vertical": "restaurant", + "GMV": true, + "abc": "new-val" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "name": "splitio_test_1", + "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", + "properties": { + "eventTypeId": "page_load", + "trafficTypeName": "user", + "key": "key_user_0", + "timestamp": 1513357833000, + "value": "0.93", + "martin": 21.565, + "vertical": "restaurant", + "GMV": true, + "abc": "new-val" + }, + "receivedAt": "2021-03-01T22:55:54.806Z", + "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", + "timestamp": "2021-03-01T22:55:54.771Z", + "type": "screen", + "userId": "user 1" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "Viewed_splitio_test_1_screen", + "key": "user 1", + "timestamp": 1614639354771, + "value": 0.93, + "environmentName": "staging", + "trafficTypeName": "user", + "properties": { + "martin": 21.565, + "vertical": "restaurant", + "GMV": true, + "abc": "new-val" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "traits": { + "abc": "new-val", + "key": "key_user_0", + "newProperty": "1", + "martin": 21.565, + "vertical": "restaurant", + "GMV": false + }, + "library": { + "name": "http" + } + }, + "type": "identify", + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "identify", + "key": "user123", + "timestamp": 1579566094208, + "environmentName": "staging", + "trafficTypeName": "user", + "properties": { + "abc": "new-val", + "newProperty": "1", + "martin": 21.565, + "vertical": "restaurant", + "GMV": false + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "traits": { + "abc": "new-val", + "key": "key_user_0", + "newProperty": "1" + }, + "library": { + "name": "http" + } + }, + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SPLITIO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "traits": { + "abc": "new-val", + "key": "key_user_0", + "newProperty": "1" + }, + "library": { + "name": "http" + } + }, + "type": "abc", + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type abc is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SPLITIO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "name": "@$%%^&", + "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", + "properties": { + "eventTypeId": "page_load", + "trafficTypeName": "user", + "key": "key_user_0", + "timestamp": 1513357833000, + "value": "0.93", + "martin": 21.565, + "vertical": "restaurant", + "GMV": true, + "abc": "new-val" + }, + "receivedAt": "2021-03-01T22:55:54.806Z", + "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", + "timestamp": "2021-03-01T22:55:54.771Z", + "type": "page", + "userId": "user 1" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "production", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "eventTypeId does not match with ideal format /^[\\dA-Za-z][\\w.-]{0,79}$/", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "SPLITIO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "name": "1pplication accepted", + "messageId": "9b200548-5961-4448-9dbc-098b7ce85751", + "category": "food", + "properties": { + "eventTypeId": "page_load", + "trafficTypeName": "user", + "key": "key_user_0", + "timestamp": 1513357833000, + "value": "bc2", + "martin": 21.565, + "vertical": [ + "restaurant", + "mall" + ], + "GMV": true, + "abc": "new-val" + }, + "receivedAt": "2021-03-01T22:55:54.806Z", + "rudderId": "6886eb9e-215d-4f61-a651-4b8ef18aaea3", + "timestamp": "2021-03-01T22:55:54.771Z", + "type": "page", + "userId": "user 1" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "production", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "Viewed_1pplication_accepted_page", + "key": "user 1", + "timestamp": 1614639354771, + "environmentName": "production", + "trafficTypeName": "user", + "properties": { + "martin": 21.565, + "vertical[0]": "restaurant", + "vertical[1]": "mall", + "GMV": true, + "abc": "new-val", + "category": "food" + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "splitio", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "userId": "user123", + "messageId": "c73198a8-41d8-4426-9fd9-de167194d5f3", + "rudderId": "bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5", + "context": { + "ip": "14.5.67.21", + "library": { + "name": "http" + } + }, + "type": "identify", + "timestamp": "2020-01-21T00:21:34.208Z", + "writeKey": "1pe7u01A7rYOrvacE6WSgI6ESXh", + "receivedAt": "2021-04-19T14:53:18.215+05:30", + "requestIP": "[::1]" + }, + "destination": { + "Config": { + "apiKey": "abcde", + "environment": "staging", + "trafficType": "user" + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://events.split.io/api/events", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer abcde" + }, + "params": {}, + "body": { + "JSON": { + "eventTypeId": "identify", + "key": "user123", + "timestamp": 1579566094208, + "environmentName": "staging", + "trafficTypeName": "user", + "properties": {} + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/splitio/router/data.ts b/test/integrations/destinations/splitio/router/data.ts new file mode 100644 index 0000000000..1004756812 --- /dev/null +++ b/test/integrations/destinations/splitio/router/data.ts @@ -0,0 +1,224 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'splitio', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + traits: { + martin: 21.565000000000001, + trafficTypeName: 'user', + vertical: 'restaurant', + eventTypeId: 'page_load end to end', + timestamp: 1513357833000, + GMV: false, + }, + userId: 'user123', + messageId: 'c73198a8-41d8-4426-9fd9-de167194d5f3', + rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5', + context: { + ip: '14.5.67.21', + traits: { + abc: 'new-val', + key: 'key_user_0', + value: '0.93', + }, + library: { + name: 'http', + }, + }, + type: 'group', + groupId: 'group1', + timestamp: '2020-01-21T00:21:34.208Z', + writeKey: '1pe7u01A7rYOrvacE6WSgI6ESXh', + receivedAt: '2021-04-19T14:53:18.215+05:30', + requestIP: '[::1]', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'abcde', + environment: 'staging', + trafficType: 'user', + }, + }, + }, + ], + destType: 'splitio', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://events.split.io/api/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer abcde', + }, + params: {}, + body: { + JSON: { + eventTypeId: 'group', + key: 'user123', + timestamp: 1579566094208, + environmentName: 'staging', + trafficTypeName: 'user', + properties: { + martin: 21.565, + vertical: 'restaurant', + GMV: false, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'abcde', + environment: 'staging', + trafficType: 'user', + }, + }, + }, + ], + }, + }, + }, + }, + { + name: 'splitio', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + traits: { + martin: 21.565000000000001, + trafficTypeName: 'user', + eventTypeId: 'page_load end to end', + timestamp: 1513357833000, + }, + userId: 'user123', + messageId: 'c73198a8-41d8-4426-9fd9-de167194d5f3', + rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5', + context: { + ip: '14.5.67.21', + traits: { + abc: 'new-val', + key: 'key_user_0', + }, + library: { + name: 'http', + }, + }, + type: 'identify', + timestamp: '2020-01-21T00:21:34.208Z', + writeKey: '1pe7u01A7rYOrvacE6WSgI6ESXh', + receivedAt: '2021-04-19T14:53:18.215+05:30', + requestIP: '[::1]', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'abcde', + environment: 'staging', + trafficType: 'user', + }, + }, + }, + ], + destType: 'splitio', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://events.split.io/api/events', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer abcde', + }, + params: {}, + body: { + JSON: { + eventTypeId: 'identify', + key: 'user123', + timestamp: 1579566094208, + environmentName: 'staging', + trafficTypeName: 'user', + properties: { + martin: 21.565, + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'abcde', + environment: 'staging', + trafficType: 'user', + }, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/statsig/processor/data.ts b/test/integrations/destinations/statsig/processor/data.ts new file mode 100644 index 0000000000..c76ce506dc --- /dev/null +++ b/test/integrations/destinations/statsig/processor/data.ts @@ -0,0 +1,1511 @@ +export const data = [ + { + name: 'statsig', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSPonIAEmulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'identify@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9112340345', + username: 'john_sparrow', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'Product Clicked', + integrations: { + All: true, + }, + messageId: '1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06', + properties: { + revenue: '30', + currency: 'USD', + quantity: '5', + test_key_2: { + test_child_key_1: 'test_child_value_1', + }, + price: '58.0', + }, + originalTimestamp: '2020-05-25T18:37:10.917Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'track', + userId: 'sample_user_id', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + secretKey: 'secret-tHe5ecr37', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack', + headers: { + 'STATSIG-API-KEY': 'secret-tHe5ecr37', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSPonIAEmulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'identify@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9112340345', + username: 'john_sparrow', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'Product Clicked', + integrations: { + All: true, + }, + messageId: '1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06', + properties: { + revenue: '30', + currency: 'USD', + quantity: '5', + test_key_2: { + test_child_key_1: 'test_child_value_1', + }, + price: '58.0', + }, + originalTimestamp: '2020-05-25T18:37:10.917Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'track', + userId: 'sample_user_id', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'statsig', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'identify@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'identify', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'identify', + userId: 'sample_user_id', + }, + destination: { + DestinationDefinition: { + Config: { + cdkEnabled: true, + }, + }, + Config: { + secretKey: 'secret-tHe5ecr37', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack', + headers: { + 'STATSIG-API-KEY': 'secret-tHe5ecr37', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'identify@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'identify', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'identify', + userId: 'sample_user_id', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'statsig', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'page@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'page', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'page', + userId: 'sample_user_id', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + secretKey: 'secret-tHe5ecr37', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack', + headers: { + 'STATSIG-API-KEY': 'secret-tHe5ecr37', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'page@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'page', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'page', + userId: 'sample_user_id', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'statsig', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'screen@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'screen', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'screen', + userId: 'sample_user_id', + }, + destination: { + DestinationDefinition: { + Config: { + cdkEnabled: true, + }, + }, + Config: { + secretKey: 'secret-tHe5ecr37', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack', + headers: { + 'STATSIG-API-KEY': 'secret-tHe5ecr37', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'screen@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'screen', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'screen', + userId: 'sample_user_id', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'statsig', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'screen@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'screen', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'screen', + userId: 'sample_user_id', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + secretKey: 'secret-4n07h3rsecr3t', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack', + headers: { + 'STATSIG-API-KEY': 'secret-4n07h3rsecr3t', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: '8d872292709c6fbe', + channel: 'mobile', + context: { + app: { + build: '1', + name: 'AMTestProject', + namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp', + version: '1.0', + }, + device: { + id: '8d872292709c6fbe', + manufacturer: 'Google', + model: 'AOSP on IA Emulator', + name: 'generic_x86_arm', + type: 'android', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.2', + }, + locale: 'en-US', + network: { + carrier: 'Android', + bluetooth: false, + cellular: true, + wifi: true, + }, + os: { + name: 'Android', + version: '9', + }, + screen: { + density: 420, + height: 1794, + width: 1080, + }, + timezone: 'Asia/Kolkata', + traits: { + address: { + city: 'Kolkata', + country: 'India', + postalcode: '700096', + state: 'West bengal', + street: 'Park Street', + }, + age: '30', + anonymousId: '8d872292709c6fbe', + birthday: '2020-05-26', + createdat: '18th March 2020', + description: 'Premium User for 3 years', + email: 'screen@test.com', + firstname: 'John', + userId: 'sample_user_id', + lastname: 'Sparrow', + name: 'John Sparrow', + id: 'sample_user_id', + phone: '9876543210', + username: 'john_sparrow', + quantity: '5', + price: '56.0', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + event: 'screen', + integrations: { + All: true, + }, + messageId: '1590431830865-3be680d6-7dcd-4b05-8460-f3acc30046d9', + originalTimestamp: '2020-05-25T18:37:10.865Z', + sentAt: '2020-05-25T18:37:10.917Z', + type: 'screen', + userId: 'sample_user_id', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'statsig', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.5', + }, + traits: { + name: 'Shehan Study', + category: 'SampleIdentify', + email: 'test@rudderstack.com', + plan: 'Open source', + logins: 5, + createdAt: 1599264000, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.5', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36', + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 0.8999999761581421, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + test: 'other value', + }, + page: { + path: '/destinations/amplitude', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/amplitude', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'alias', + messageId: 'dd46338d-5f83-493b-bd28-3b48f55d0be8', + originalTimestamp: '2020-10-20T08:14:28.778Z', + anonymousId: 'my-anonymous-id-new', + userId: 'newUserIdAlias', + integrations: { + All: true, + }, + previousId: 'sampleusrRudder3', + sentAt: '2020-10-20T08:14:28.778Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkEnabled: true, + }, + }, + Config: { + secretKey: 'secret-tHe5ecr37', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack', + headers: { + 'STATSIG-API-KEY': 'secret-tHe5ecr37', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.5', + }, + traits: { + name: 'Shehan Study', + category: 'SampleIdentify', + email: 'test@rudderstack.com', + plan: 'Open source', + logins: 5, + createdAt: 1599264000, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.5', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36', + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 0.8999999761581421, + }, + campaign: { + source: 'google', + medium: 'medium', + term: 'keyword', + content: 'some content', + name: 'some campaign', + test: 'other value', + }, + page: { + path: '/destinations/amplitude', + referrer: '', + search: '', + title: '', + url: 'https://docs.rudderstack.com/destinations/amplitude', + category: 'destination', + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + }, + }, + type: 'alias', + messageId: 'dd46338d-5f83-493b-bd28-3b48f55d0be8', + originalTimestamp: '2020-10-20T08:14:28.778Z', + anonymousId: 'my-anonymous-id-new', + userId: 'newUserIdAlias', + integrations: { + All: true, + }, + previousId: 'sampleusrRudder3', + sentAt: '2020-10-20T08:14:28.778Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'statsig', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + type: 'group', + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + secretKey: 'secret-tHe5ecr37', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack', + headers: { + 'STATSIG-API-KEY': 'secret-tHe5ecr37', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + type: 'group', + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'statsig', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: '123456', + type: 'NOT_A_TYPE', + traits: { + anonymousId: '123456', + email: 'test@rudderstack.com', + address: { + city: 'kolkata', + country: 'India', + postalCode: 712136, + state: 'WB', + street: '', + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + DestinationDefinition: { + Config: { + cdkEnabled: true, + }, + }, + Config: { + secretKey: 'secret-tHe5ecr37', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + 'Bad event. Original error: message type "NOT_A_TYPE" not supported for "statsig"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'STATSIG', + module: 'destination', + implementation: 'cdkV1', + destinationId: 'd1', + workspaceId: 'w1', + feature: 'processor', + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/tiktok_ads/dataDelivery/data.ts b/test/integrations/destinations/tiktok_ads/dataDelivery/data.ts new file mode 100644 index 0000000000..810e1de475 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/dataDelivery/data.ts @@ -0,0 +1,672 @@ +import { AxiosError } from 'axios'; +import MockAxiosAdapter from 'axios-mock-adapter'; +import lodash from 'lodash'; + +export const data = [ + { + name: 'tiktok_ads', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'successResponse', + }, + body: { + JSON: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: '1077218', + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: '1197218', + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[TIKTOK_ADS Response Handler] - Request Processed Successfully', + destinationResponse: { + response: { + code: 0, + message: 'OK', + }, + status: 200, + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidDataTypeResponse', + }, + body: { + JSON: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: 1077218, + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: 1197218, + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Request failed with status: 40002', + destinationResponse: { + response: { + code: 40002, + message: 'Batch.0.properties.contents.0.content_id: Not a valid string', + }, + status: 200, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidPermissionsResponse', + }, + body: { + JSON: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: 1077218, + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: 1197218, + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + status: 400, + message: 'Request failed with status: 40001', + destinationResponse: { + response: { + code: 40001, + message: + 'No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account.', + }, + status: 200, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 3', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'tooManyRequests', + }, + body: { + JSON: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: 1077218, + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: 1197218, + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + params: { + destination: 'tiktok_ads', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 429, + body: { + output: { + status: 429, + message: 'Request failed with status: 40100', + destinationResponse: { + response: { + code: 40100, + message: 'Too many requests. Please retry in some time.', + }, + status: 200, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 4', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': '502-BadGateway', + }, + params: { + destination: 'tiktok_ads', + }, + body: { + JSON: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: 1077218, + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: 1197218, + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 502, + body: { + output: { + status: 502, + message: 'Request failed with status: 502', + destinationResponse: { + response: + '\r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
nginx
\r\n\r\n\r\n', + status: 502, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 5', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }, + params: { + destination: 'tiktok_ads', + }, + body: { + JSON: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: 1077218, + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: 1197218, + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, + body: { + output: { + status: 500, + message: 'Request failed with status: 500', + destinationResponse: { + response: '[ECONNRESET] :: Connection reset by peer', + status: 500, + }, + statTags: { + destType: 'TIKTOK_ADS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAxiosAdapter) => { + mockAdapter + .onPost( + 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + { + asymmetricMatch: (actual) => { + const expected = { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: 1077218, // casted to string + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: 1197218, // casted to string + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }; + const isMatched = lodash.isMatch(actual, expected); + return isMatched; + }, + }, + { + asymmetricMatch: (actualHeader) => { + const isMatched = lodash.isMatch(actualHeader, { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }); + return isMatched; + }, + }, + ) + .reply((config) => { + // @ts-ignore + const err = AxiosError.from('Connection reset by peer', 'ECONNRESET', config); + return Promise.reject(err); + }); + }, + }, +]; diff --git a/test/integrations/destinations/tiktok_ads/network.ts b/test/integrations/destinations/tiktok_ads/network.ts new file mode 100644 index 0000000000..1cf0920259 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/network.ts @@ -0,0 +1,241 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' }, + { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { callback: '123ATXSfe' }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'successResponse', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { data: { code: 0, message: 'OK' }, status: 200 }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { price: 8, quantity: 2, content_type: 'socks', content_id: 1077218 }, + { price: 30, quantity: 1, content_type: 'dress', content_id: 1197218 }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { callback: '123ATXSfe' }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidDataTypeResponse', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + code: 40002, + message: 'Batch.0.properties.contents.0.content_id: Not a valid string', + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { price: 8, quantity: 2, content_type: 'socks', content_id: 1077218 }, + { price: 30, quantity: 1, content_type: 'dress', content_id: 1197218 }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { callback: '123ATXSfe' }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'invalidPermissionsResponse', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { + code: 40001, + message: + 'No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account.', + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { price: 8, quantity: 2, content_type: 'socks', content_id: 1077218 }, + { price: 30, quantity: 1, content_type: 'dress', content_id: 1197218 }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { callback: '123ATXSfe' }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': 'tooManyRequests', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: { code: 40100, message: 'Too many requests. Please retry in some time.' }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://business-api.tiktok.com/open_api/v1.2/pixel/batch/', + data: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + event: 'CompletePayment', + event_id: '1616318632825_357', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { price: 8, quantity: 2, content_type: 'socks', content_id: 1077218 }, + { price: 30, quantity: 1, content_type: 'dress', content_id: 1197218 }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { callback: '123ATXSfe' }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + external_id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + params: { destination: 'tiktok_ads' }, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + 'test-dest-response-key': '502-BadGateway', + 'User-Agent': 'RudderLabs', + }, + method: 'POST', + }, + httpRes: { + data: '\r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
nginx
\r\n\r\n\r\n', + status: 502, + }, + }, +]; diff --git a/test/integrations/destinations/tiktok_ads/processor/data.ts b/test/integrations/destinations/tiktok_ads/processor/data.ts new file mode 100644 index 0000000000..38fec1e1e0 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/processor/data.ts @@ -0,0 +1,4690 @@ +export const data = [ + { + "name": "tiktok_ads", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout started", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "InitiateCheckout", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist1", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event name (product added to wishlist1) is not valid, must be mapped to one of standard events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "Product Added to Wishlist", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "sample rudder test_event_code", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "AddToWishlist", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "sample rudder test_event_code", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "1234" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "SubscriBe", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "+868987675687", + "email": "sample@sample.com" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "Subscribe", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "1d96e70d2bf54087e33586457cde2790825bee7b1a3b05d26481cb12ec8e63fd", + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", + "external_id": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "payment info entered", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "AddPaymentInfo", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event name is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type is required", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "type": "track", + "event": "payment info entered", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "AddPaymentInfo", + "event_id": "1616318632825_357", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "submitform", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "SubmitForm", + "event_id": "16163186328257", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 12", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "submitform", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131" + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "SubmitForm", + "event_id": "16163186328257", + "timestamp": "2020-09-17T19:49:27Z", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 13", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "contact", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "Contact", + "event_id": "16163186328257", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 14", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "identify", + "event": "contact", + "properties": { + "eventId": "16163186328257", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type identify is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 15", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 16", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "order completed", + "properties": { + "eventId": "1616318632825_357", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "PlaceAnOrder", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 17", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "traits": { + "email": "user@sample.com", + "phone": "+919912345678" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "SubscriBe", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "TEST0000000011", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "+918987674657", + "email": "sample@rudder.com" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "Subscribe", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "TEST0000000011", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "1b6abcebb79b2208929967160ba291656f3fcd4f00e93b6a846c1e56c0e177c6", + "email": "02e47a94635c1ffd6f6a69fe2c7a92dbfbb9d5e2ebddb54810520b34989b66a7", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 18", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "traits": { + "email": "user@sample.com", + "phone": "+919912345678" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "locale": "en-US", + "ip": "13.57.97.131", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "SubscriBe", + "properties": { + "eventId": "1616318632825_357", + "testEventCode": "TEST0000000011", + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "", + "email": "" + } + }, + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "Subscribe", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "test_event_code": "TEST0000000011", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "241102c24fa8a642e3d1346a31fbce3dd312563c015ae577a2253cb8652581eb", + "email": "a344da1fac6201ed1c1f20a07e1b55bb896a5ac0abd269c1e9daf1afbbffca3b", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 19", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "ad": { + "callback": "999ATXSfe" + }, + "page": { + "url": "http://rudder.mywebsite.com/purchase", + "referrer": "http://rudder.mywebsite.com" + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46, + "context": { + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "999ATXSfe" + }, + "page": { + "url": "http://rudder.mywebsite.com/purchase", + "referrer": "http://rudder.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 20", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false, + "eventsToStandard": [ + { + "from": "abc", + "to": "download" + }, + { + "from": "abc", + "to": "search" + }, + { + "from": "def", + "to": "search" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "search", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 21", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false, + "eventsToStandard": [ + { + "from": "def", + "to": "download" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event name (abc) is not valid, must be mapped to one of standard events", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 22", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false, + "eventsToStandard": [ + { + "from": "abc", + "to": "download" + }, + { + "from": "def", + "to": "download" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 23", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "+371234567890123", + "email": "sample@sample.com" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true, + "eventsToStandard": [ + { + "from": "abc", + "to": "download" + }, + { + "from": "def", + "to": "download" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "6080191ec608e10062e9257702cbca694cfe1bfa53944ba5701119d8f8b99ad6", + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 24", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "abc", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "+3712345678", + "email": "sample@sample.com" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": true, + "eventsToStandard": [ + { + "from": "abc", + "to": "download" + }, + { + "from": "def", + "to": "download" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "download", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "6e6c1bb39126b3ecf537e62847909b1372a1a22de9b28d85960e12c78f322035", + "email": "774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa", + "external_id": "f0f3ec74bbef8580d7de80624dea93c05d828c748715199fe71bc7f5a67aa8b3" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 25", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "products": [ + { + "product_id": 123, + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "contents": [ + { + "price": 8, + "quantity": 2, + "content_type": "socks", + "content_id": "1077218" + }, + { + "price": 30, + "quantity": 1, + "content_type": "dress", + "content_id": "1197218" + } + ], + "currency": "USD", + "value": 46 + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 26", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "products": [ + { + "product_id": 123, + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "contentType": "product_group", + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "product_id": 345, + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "contentType": "product_group", + "quantity": 2 + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "currency": "USD", + "value": 46, + "contents": [ + { + "content_type": "product_group", + "content_id": "123", + "content_category": "Games", + "content_name": "Monopoly", + "price": 14, + "quantity": 1 + }, + { + "content_type": "product_group", + "content_id": "345", + "content_name": "UNO", + "price": 3.45, + "quantity": 2 + } + ] + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 27", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "eventId": "1616318632825_357", + "products": [ + { + "contentType": "product_group", + "product_id": "123", + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "contentType": "product_group", + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "currency": "USD", + "value": 46, + "contents": [ + { + "content_type": "product_group", + "content_id": "123", + "content_category": "Games", + "content_name": "Monopoly", + "price": 14, + "quantity": 1 + }, + { + "content_type": "product_group", + "content_id": "345", + "content_category": "Games", + "content_name": "UNO", + "price": 3.45, + "quantity": 2 + } + ] + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads", + "description": "Test 28", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "web", + "context": { + "app": { + "build": "1.0.0", + "name": "RudderLabs JavaScript SDK", + "namespace": "com.rudderlabs.javascript", + "version": "1.0.0" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.0.0" + }, + "userAgent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion", + "ip": "13.57.97.131", + "locale": "en-US", + "os": { + "name": "", + "version": "" + }, + "screen": { + "density": 2 + }, + "externalId": [ + { + "type": "tiktokExternalId", + "id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + } + ] + }, + "messageId": "84e26acc-56a5-4835-8233-591137fca468", + "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", + "originalTimestamp": "2019-10-14T09:03:17.562Z", + "timestamp": "2020-09-17T19:49:27Z", + "type": "track", + "event": "checkout step completed", + "properties": { + "category": "Urban", + "status": "processed", + "name": "games", + "contentType": "product_group", + "productId": "qqw21221341234", + "eventId": "1616318632825_357", + "products": [ + { + "product_id": "123", + "sku": "G-32", + "name": "Monopoly", + "price": 14, + "quantity": 1, + "category": "Games", + "url": "https://www.website.com/product/path", + "image_url": "https://www.website.com/product/path.jpg" + }, + { + "product_id": "345", + "sku": "F-32", + "name": "UNO", + "price": 3.45, + "quantity": 2, + "category": "Games" + } + ], + "currency": "USD", + "value": 46, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f" + } + } + }, + "integrations": { + "All": true + }, + "sentAt": "2019-10-14T09:03:22.563Z" + }, + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "pixelCode": "A1T8T4UYGVIQA8ORZMX9", + "hashUserProperties": false + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/pixel/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "pixel_code": "A1T8T4UYGVIQA8ORZMX9", + "event": "CompletePayment", + "event_id": "1616318632825_357", + "timestamp": "2020-09-17T19:49:27Z", + "properties": { + "content_category": "Urban", + "status": "processed", + "content_name": "games", + "content_id": "qqw21221341234", + "content_type": "product_group", + "currency": "USD", + "value": 46, + "contents": [ + { + "content_type": "product_group", + "content_id": "123", + "content_category": "Games", + "content_name": "Monopoly", + "price": 14, + "quantity": 1 + }, + { + "content_type": "product_group", + "content_id": "345", + "content_category": "Games", + "content_name": "UNO", + "price": 3.45, + "quantity": 2 + } + ] + }, + "context": { + "ad": { + "callback": "123ATXSfe" + }, + "page": { + "url": "http://demo.mywebsite.com/purchase", + "referrer": "http://demo.mywebsite.com" + }, + "user": { + "phone_number": "2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea", + "email": "dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f", + "external_id": "f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc" + }, + "ip": "13.57.97.131", + "user_agent": "Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion" + }, + "partner_name": "RudderStack" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/tiktok_ads/router/data.ts b/test/integrations/destinations/tiktok_ads/router/data.ts new file mode 100644 index 0000000000..60bb5628ca --- /dev/null +++ b/test/integrations/destinations/tiktok_ads/router/data.ts @@ -0,0 +1,809 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'tiktok_ads', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + ip: '13.57.97.131', + locale: 'en-US', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'tiktokExternalId', + id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + ], + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + timestamp: '2020-09-17T19:49:27Z', + type: 'track', + event: 'checkout step completed', + properties: { + eventId: '1616318632825_357', + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: '1077218', + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: '1197218', + }, + ], + currency: 'USD', + value: 46.0, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + }, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 5, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + locale: 'en-US', + ip: '13.57.97.131', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'tiktokExternalId', + id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + ], + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + timestamp: '2020-09-17T19:49:27Z', + type: 'track', + event: 'checkout started', + properties: { + eventId: '1616318632825_357', + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + }, + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: '1077218', + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: '1197218', + }, + ], + currency: 'USD', + value: 46.0, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + locale: 'en-US', + ip: '13.57.97.131', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'tiktokExternalId', + id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + ], + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + timestamp: '2020-09-17T19:49:27Z', + type: 'track', + event: 'download', + properties: { + eventId: '1616318632825_357', + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + ip: '13.57.97.131', + }, + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: '1077218', + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: '1197218', + }, + ], + currency: 'USD', + value: 46.0, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + locale: 'en-US', + ip: '13.57.97.131', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'tiktokExternalId', + id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + ], + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + timestamp: '2020-09-17T19:49:27Z', + type: 'track', + event: 'search', + properties: { + eventId: '1616318632825_357', + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + ip: '13.57.97.131', + }, + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: '1077218', + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: '1197218', + }, + ], + currency: 'USD', + value: 46.0, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 4, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + ], + destType: 'tiktok_ads', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.3/pixel/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + batch: [ + { + event: 'CompletePayment', + event_id: '1616318632825_357', + type: 'track', + timestamp: '2020-09-17T19:49:27Z', + properties: { + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: '1077218', + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: '1197218', + }, + ], + currency: 'USD', + value: 46, + }, + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + email: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + external_id: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + }, + ip: '13.57.97.131', + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + }, + { + event: 'InitiateCheckout', + event_id: '1616318632825_357', + type: 'track', + timestamp: '2020-09-17T19:49:27Z', + context: { + ad: { + callback: '123ATXSfe', + }, + ip: '13.57.97.131', + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + email: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + external_id: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + }, + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + properties: { + value: 46, + contents: [ + { + price: 8, + quantity: 2, + content_id: '1077218', + content_type: 'socks', + }, + { + price: 30, + quantity: 1, + content_id: '1197218', + content_type: 'dress', + }, + ], + currency: 'USD', + }, + }, + { + event: 'Download', + event_id: '1616318632825_357', + type: 'track', + timestamp: '2020-09-17T19:49:27Z', + context: { + ad: { + callback: '123ATXSfe', + }, + ip: '13.57.97.131', + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + email: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + external_id: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + }, + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + properties: { + value: 46, + contents: [ + { + price: 8, + quantity: 2, + content_id: '1077218', + content_type: 'socks', + }, + { + price: 30, + quantity: 1, + content_id: '1197218', + content_type: 'dress', + }, + ], + currency: 'USD', + }, + }, + { + event: 'Search', + event_id: '1616318632825_357', + type: 'track', + timestamp: '2020-09-17T19:49:27Z', + context: { + ad: { + callback: '123ATXSfe', + }, + ip: '13.57.97.131', + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + email: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + external_id: + 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc', + phone_number: + '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea', + }, + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + properties: { + value: 46, + contents: [ + { + price: 8, + quantity: 2, + content_id: '1077218', + content_type: 'socks', + }, + { + price: 30, + quantity: 1, + content_id: '1197218', + content_type: 'dress', + }, + ], + currency: 'USD', + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 5, + }, + { + jobId: 1, + }, + { + jobId: 2, + }, + { + jobId: 4, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: false, + }, + }, + }, + ], + }, + }, + }, + }, + { + name: 'tiktok_ads', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + anonymousId: '21e13f4bc7ceddad', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + locale: 'en-US', + ip: '13.57.97.131', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'tiktokExternalId', + id: '1234', + }, + ], + }, + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + timestamp: '2020-09-17T19:49:27Z', + type: 'track', + event: 'Product Added to Wishlist', + properties: { + eventId: '1616318632825_357', + testEventCode: 'sample rudder test_event_code', + context: { + ad: { + callback: '123ATXSfe', + }, + page: { + url: 'http://demo.mywebsite.com/purchase', + referrer: 'http://demo.mywebsite.com', + }, + user: { + phone_number: '+858987675687', + email: 'sample@sample.com', + }, + userAgent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + ip: '13.57.97.131', + }, + contents: [ + { + price: 8, + quantity: 2, + content_type: 'socks', + content_id: '1077218', + }, + { + price: 30, + quantity: 1, + content_type: 'dress', + content_id: '1197218', + }, + ], + currency: 'USD', + value: 46.0, + }, + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 3, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: true, + }, + }, + }, + ], + destType: 'tiktok_ads', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: [ + { + body: { + FORM: {}, + JSON: { + context: { + ad: { + callback: '123ATXSfe', + }, + ip: '13.57.97.131', + page: { + referrer: 'http://demo.mywebsite.com', + url: 'http://demo.mywebsite.com/purchase', + }, + user: { + external_id: + '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + phone_number: + '4443dd476f2be18201447ef046731c1a715accee4edc5192641a3b4c3ba921c7', + email: '774efc08cebab8c50c0f0eb2d3a2d2e560872a64f6c1617314c4f03b1c3d4dfa', + }, + user_agent: + 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion', + }, + event: 'AddToWishlist', + event_id: '1616318632825_357', + pixel_code: 'A1T8T4UYGVIQA8ORZMX9', + partner_name: 'RudderStack', + properties: { + contents: [ + { + content_id: '1077218', + content_type: 'socks', + price: 8, + quantity: 2, + }, + { + content_id: '1197218', + content_type: 'dress', + price: 30, + quantity: 1, + }, + ], + currency: 'USD', + value: 46, + }, + test_event_code: 'sample rudder test_event_code', + timestamp: '2020-09-17T19:49:27Z', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://business-api.tiktok.com/open_api/v1.3/pixel/track/', + files: {}, + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + ], + destination: { + Config: { + accessToken: 'dummyAccessToken', + pixelCode: 'A1T8T4UYGVIQA8ORZMX9', + hashUserProperties: true, + }, + }, + metadata: [ + { + jobId: 3, + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts new file mode 100644 index 0000000000..a4ff796f37 --- /dev/null +++ b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts @@ -0,0 +1,618 @@ +export const data = [ + { + "name": "tiktok_ads_offline_events", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "type": "Identify", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type identify is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "TIKTOK_ADS_OFFLINE_EVENTS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": false + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7181537436256731137", + "eventId": "1616318632825_352", + "order_id": "abc_xyz", + "shop_id": "123abc", + "currency": "USD", + "value": 46, + "price": 8, + "quantity": 2, + "content_type": "product1234", + "product_id": "1077218", + "name": "socks", + "category": "Men's cloth" + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7181537436256731137", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "properties": { + "order_id": "abc_xyz", + "shop_id": "123abc", + "currency": "USD", + "value": 46, + "event_channel": "web", + "contents": [ + { + "content_name": "socks", + "content_type": "product1234", + "content_category": "Men's cloth", + "content_id": "1077218", + "price": 8, + "quantity": 2 + } + ] + }, + "event": "Subscribe", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7181537436256731137", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "1234567890" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7181537436256731137", + "eventId": "1616318632825_352", + "prop1": "val1" + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7181537436256731137", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "properties": { + "event_channel": "web" + }, + "event": "Subscribe", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7181537436256731137", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true, + "eventsToStandard": [ + { + "from": "RandomEvent", + "to": "SubmitForm" + } + ] + } + }, + "message": { + "event": "RandomEvent", + "context": { + "traits": { + "phone": "1234567890" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7185009018564395009", + "eventId": "1616318632003_004", + "prop1": "val1" + }, + "userId": "eventIdn01", + "timestamp": "2023-01-03", + "type": "track" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7185009018564395009", + "event_id": "1616318632003_004", + "timestamp": "2023-01-03", + "properties": { + "event_channel": "web" + }, + "event": "SubmitForm", + "partner_name": "RudderStack", + "context": { + "user": { + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7185009018564395009", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "hashUserProperties": true + } + }, + "message": { + "type": "track", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Access Token not found", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "configuration", + "destType": "TIKTOK_ADS_OFFLINE_EVENTS", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true + } + }, + "message": { + "event": "subscribe", + "context": { + "traits": { + "phone": "1234567890", + "email": "random@mail.com" + }, + "channel": "web" + }, + "properties": { + "eventSetId": "7181537436256731137", + "eventId": "1616318632825_352", + "products": [ + { + "price": 8, + "quantity": 2, + "content_type": "product1", + "product_id": "1077218", + "name": "socks", + "category": "Men's cloth" + }, + { + "price": 18, + "quantity": 12, + "content_type": "product2", + "product_id": "1077219", + "name": "socks1", + "category": "Men's cloth1" + } + ] + }, + "type": "track", + "userId": "eventIdn01", + "timestamp": "2023-01-03" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7181537436256731137", + "event_id": "1616318632825_352", + "timestamp": "2023-01-03", + "properties": { + "event_channel": "web", + "contents": [ + { + "content_name": "socks", + "content_type": "product1", + "content_category": "Men's cloth", + "content_id": "1077218", + "price": 8, + "quantity": 2 + }, + { + "content_name": "socks1", + "content_type": "product2", + "content_category": "Men's cloth1", + "content_id": "1077219", + "price": 18, + "quantity": 12 + } + ] + }, + "event": "Subscribe", + "partner_name": "RudderStack", + "context": { + "user": { + "emails": [ + "d9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16" + ], + "phone_numbers": [ + "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7181537436256731137", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "tiktok_ads_offline_events", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "accessToken": "dummyAccessToken", + "hashUserProperties": true, + "eventsToStandard": [ + { + "from": "CompletePayment", + "to": "Purchase" + } + ] + } + }, + "message": { + "type": "track", + "event": "CompletePayment", + "sentAt": "2023-03-22T00:02:33.802Z", + "traits": { + "email": [ + "efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900", + "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" + ], + "phone": [ + "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", + "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f" + ] + }, + "userId": "60241286212", + "channel": "sources", + "context": { + "sources": { + "job_id": "2N4WuoNQpGYmCPASUvnV86QyhY4/Syncher", + "version": "v1.20.0", + "job_run_id": "cgd4a063b2fn2e1j0q90", + "task_run_id": "cgd4a063b2fn2e1j0qa0" + } + }, + "recordId": "16322", + "rudderId": "5b4ed73f-69aa-4198-88d1-3d4d509acbf1", + "messageId": "cgd4b663b2fn2e1j8th0", + "timestamp": "2023-03-22T00:02:33.170Z", + "properties": { + "phone": "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05", + "value": 32.839999999999996, + "emails": "[\"efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900\",\"078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]", + "eventId": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", + "currency": "USD", + "order_id": 60241286212, + "eventSetId": "7211223771099742210", + "event_name": "CompletePayment" + }, + "receivedAt": "2023-03-22T00:02:33.171Z", + "request_ip": "10.7.78.187", + "anonymousId": "60241286212", + "originalTimestamp": "2023-03-22T00:02:33.802Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/", + "headers": { + "Access-Token": "dummyAccessToken", + "Content-Type": "application/json" + }, + "params": {}, + "body": { + "JSON": { + "event_set_id": "7211223771099742210", + "event_id": "8965fb56-090f-47a5-aa7f-bbab22d9ec90", + "timestamp": "2023-03-22T00:02:33.170Z", + "properties": { + "order_id": 60241286212, + "currency": "USD", + "value": 32.839999999999996 + }, + "event": "Purchase", + "partner_name": "RudderStack", + "context": { + "user": { + "emails": [ + "4dc75b075057df6f6b729e74a9feed1244dcf8ceb7903eaba13203f3268ae4b9", + "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" + ], + "phone_numbers": [ + "28b7b205c2936d2ded022d2587fb2677a76e560e921b3ad615b739b0238baa5d", + "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68" + ] + } + } + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "event_set_id": "7211223771099742210", + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts new file mode 100644 index 0000000000..c479da741b --- /dev/null +++ b/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts @@ -0,0 +1,416 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'tiktok_ads_offline_events', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + metadata: { + jobId: 1, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + message: { + event: 'subscribe', + context: { + traits: { + phone: '1234567890', + }, + channel: 'web', + }, + properties: { + eventSetId: '7181537436256731137', + eventId: '1616318632825_352', + order_id: 'abc_xyz', + shop_id: '123abc', + currency: 'USD', + value: 46.0, + price: 8, + quantity: 2, + content_type: 'product1234', + product_id: '1077218', + name: 'socks', + category: "Men's cloth", + }, + type: 'track', + userId: 'eventIdn01', + timestamp: '2023-01-03', + }, + }, + { + metadata: { + jobId: 2, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + message: { + event: 'subscribe', + context: { + traits: { + phone: '1234567890', + email: 'random@mail.com', + }, + channel: 'web', + }, + properties: { + eventSetId: '7181537436256731137', + eventId: '1616318632825_352', + products: [ + { + price: 8, + quantity: 2, + content_type: 'product1', + product_id: '1077218', + name: 'socks', + category: "Men's cloth", + }, + { + price: 18, + quantity: 12, + content_type: 'product2', + product_id: '1077219', + name: 'socks1', + category: "Men's cloth1", + }, + ], + }, + type: 'track', + userId: 'eventIdn01', + timestamp: '2023-01-03', + }, + }, + ], + destType: 'tiktok_ads_offline_events', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: true, + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_set_id: '7181537436256731137', + partner_name: 'RudderStack', + batch: [ + { + event_set_id: '7181537436256731137', + event: 'Subscribe', + event_id: '1616318632825_352', + timestamp: '2023-01-03', + partner_name: 'RudderStack', + context: { + user: { + phone_numbers: [ + 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646', + ], + }, + }, + properties: { + order_id: 'abc_xyz', + shop_id: '123abc', + contents: [ + { + price: 8, + quantity: 2, + content_type: 'product1234', + content_id: '1077218', + content_name: 'socks', + content_category: "Men's cloth", + }, + ], + event_channel: 'web', + currency: 'USD', + value: 46.0, + }, + }, + { + event_set_id: '7181537436256731137', + event: 'Subscribe', + event_id: '1616318632825_352', + timestamp: '2023-01-03', + partner_name: 'RudderStack', + context: { + user: { + phone_numbers: [ + 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646', + ], + emails: [ + 'd9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16', + ], + }, + }, + properties: { + event_channel: 'web', + contents: [ + { + price: 8, + quantity: 2, + content_type: 'product1', + content_id: '1077218', + content_name: 'socks', + content_category: "Men's cloth", + }, + { + price: 18, + quantity: 12, + content_type: 'product2', + content_id: '1077219', + content_name: 'socks1', + content_category: "Men's cloth1", + }, + ], + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + metadata: [ + { + jobId: 1, + }, + { + jobId: 2, + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, + { + name: 'tiktok_ads_offline_events', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + metadata: { + jobId: 3, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + message: { + event: 'subscribe', + context: { + traits: { + phone: '1234567890', + }, + channel: 'web', + }, + properties: { + eventSetId: '6071537445256731123', + eventId: '1616318632825_352', + currency: 'USD', + value: 46.0, + price: 8, + content_type: 'product1234', + }, + type: 'track', + userId: 'eventIdn01', + timestamp: '2023-01-03', + }, + }, + ], + destType: 'tiktok_ads_offline_events', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: true, + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/batch/', + headers: { + 'Access-Token': 'dummyAccessToken', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + event_set_id: '6071537445256731123', + partner_name: 'RudderStack', + batch: [ + { + event_set_id: '6071537445256731123', + event: 'Subscribe', + event_id: '1616318632825_352', + timestamp: '2023-01-03', + partner_name: 'RudderStack', + context: { + user: { + phone_numbers: [ + 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646', + ], + }, + }, + properties: { + contents: [ + { + price: 8, + content_type: 'product1234', + }, + ], + event_channel: 'web', + currency: 'USD', + value: 46.0, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + metadata: [ + { + jobId: 3, + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, + { + name: 'tiktok_ads_offline_events', + description: 'Test 2', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + metadata: { + jobId: 4, + }, + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + message: { + context: { + traits: { + phone: '1234567890', + }, + channel: 'web', + }, + properties: { + eventSetId: '2345676543', + eventId: '1616318632825_352', + }, + type: 'track', + userId: 'eventIdn01', + timestamp: '2023-01-03', + }, + }, + ], + destType: 'tiktok_ads_offline_events', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + destination: { + Config: { + accessToken: 'dummyAccessToken', + hashUserProperties: true, + }, + }, + batched: false, + error: 'Event name is required', + metadata: [ + { + jobId: 4, + }, + ], + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TIKTOK_ADS_OFFLINE_EVENTS', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/twitter_ads/processor/data.ts b/test/integrations/destinations/twitter_ads/processor/data.ts new file mode 100644 index 0000000000..b6a7512880 --- /dev/null +++ b/test/integrations/destinations/twitter_ads/processor/data.ts @@ -0,0 +1,906 @@ +const authHeaderConstant = + 'OAuth oauth_consumer_key="qwe", oauth_nonce="V1kMh028kZLLhfeYozuL0B45Pcx6LvuW", oauth_signature="Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1685603652", oauth_token="dummyAccessToken", oauth_version="1.0"'; + +export const data = [ + { + name: 'twitter_ads', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + contents: [ + { + price: '123.3345', + quantity: '12', + id: '12', + }, + { + price: 200, + quantity: 11, + id: '4', + }, + ], + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2023-06-01T06:03:08.739Z', + number_items: 2, + price_currency: 'USD', + value: '25', + conversion_id: '213123', + contents: [ + { + content_id: '12', + content_price: 123.3345, + num_items: 12, + }, + { + content_id: '4', + content_price: 200, + num_items: 11, + }, + ], + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + }, + { + twclid: '543', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + conversionTime: '2023-06-01T06:03:08.739Z', + eventId: '429047995', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-2dfsdf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 400, + error: '[TWITTER ADS]: one of twclid, phone or email must be present in properties.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + pixelId: 'dummyPixelId', + conversionTime: '2023-06-01T06:03:08.739Z', + eventId: '429047995', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25.55, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-324fdsf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + event_id: '429047995', + conversion_time: '2023-06-01T06:03:08.739Z', + number_items: 2, + price_currency: 'USD', + value: '25.55', + conversion_id: '213123', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + }, + { + twclid: '543', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + pixelId: 'dummyPixelId', + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-324fdsf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 400, + error: + "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + pixelId: 'dummyPixelId', + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: ' ', + twitterEventId: 'tw-324fdsf', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-324fdsf', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 400, + error: + "[TWITTER ADS]: Event - 'Home Page' do not have a corresponding eventId in configuration. Aborting", + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + db: '19950715', + lastname: 'Rudderlabs', + firstName: 'Test', + address: { + city: 'Kolkata', + state: 'WB', + zip: '700114', + country: 'IN', + }, + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + conversionTime: '2023-06-01T06:03:08.739Z', + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'USD', + priceCurrency: 'USD', + conversionId: '213123', + numberItems: '2323', + phone: '+919927455678', + twclid: '543', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + email: 'abc@ax.com', + contents: [ + { + price: '123.3345', + quantity: '12', + id: '12', + }, + { + price: 200, + quantity: 11, + id: '4', + }, + ], + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2023-06-01T06:03:08.739Z', + number_items: 2, + price_currency: 'USD', + value: '25', + conversion_id: '213123', + contents: [ + { + content_id: '12', + content_price: 123.3345, + num_items: 12, + }, + { + content_id: '4', + content_price: 200, + num_items: 11, + }, + ], + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + }, + { + twclid: '543', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: (_) => { + jest.mock('../../../../../src/v0/destinations/twitter_ads/util', () => ({ + getAuthHeaderForRequest: (_a, _b) => { + return { Authorization: authHeaderConstant }; + }, + })); + }, +})); diff --git a/test/integrations/destinations/variance/processor/data.ts b/test/integrations/destinations/variance/processor/data.ts new file mode 100644 index 0000000000..ae33b75e5f --- /dev/null +++ b/test/integrations/destinations/variance/processor/data.ts @@ -0,0 +1,953 @@ +export const data = [ + { + name: 'variance', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + user_properties: { + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + fb_profile: '0', + game_fps: 30, + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: false, + level: 6, + lifetime_gem_balance: 0, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + webhookUrl: 'http://6b0e6a60.ngrok.io', + authHeader: 'Basic MVA4dUtGOF=', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'http://6b0e6a60.ngrok.io', + headers: { + authorization: 'Basic MVA4dUtGOF=', + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + user_properties: { + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + fb_profile: '0', + game_fps: 30, + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: false, + level: 6, + lifetime_gem_balance: 0, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'variance', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + user_properties: { + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + fb_profile: '0', + game_fps: 30, + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: false, + level: 6, + lifetime_gem_balance: 0, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkEnabled: true, + }, + }, + Config: { + webhookUrl: 'https://6b0e6a60.ngrok.io/n', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://6b0e6a60.ngrok.io/n', + headers: { + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + user_properties: { + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + fb_profile: '0', + game_fps: 30, + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: false, + level: 6, + lifetime_gem_balance: 0, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'variance', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + user_properties: { + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + fb_profile: '0', + game_fps: 30, + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: false, + level: 6, + lifetime_gem_balance: 0, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + }, + }, + destination: { + DestinationDefinition: { + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + webhookUrl: 'https://6b0e6a60.', + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://6b0e6a60.', + headers: { + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + user_properties: { + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + fb_profile: '0', + game_fps: 30, + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: false, + level: 6, + lifetime_gem_balance: 0, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, + { + name: 'variance', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + request_ip: '127.0.0.1', + }, + destination: { + DestinationDefinition: { + Config: { + cdkEnabled: true, + }, + }, + Config: { + webhookUrl: 'http://6b0e6a60.ngrok.io', + header: [ + { + from: 'test1', + to: 'value1', + }, + { + from: 'test2', + to: 'value2', + }, + ], + }, + }, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'http://6b0e6a60.ngrok.io', + headers: { + 'content-type': 'application/json', + }, + params: {}, + body: { + JSON: { + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + context: { + device: { + id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', + manufacturer: 'Xiaomi', + model: 'Redmi 6', + name: 'xiaomi', + }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, + traits: { + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + ip: '127.0.0.1', + }, + event: 'spin_result', + integrations: { + All: true, + }, + message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', + properties: { + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + }, + timestamp: '2019-09-01T15:46:51.693229+05:30', + originalTimestamp: '2019-09-01T15:46:51.693229+05:30', + sentAt: '2019-09-01T15:46:51.693229+05:30', + type: 'track', + request_ip: '127.0.0.1', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + }, + statusCode: 200, + metadata: { + destinationId: 'd1', + workspaceId: 'w1', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/vero/processor/data.ts b/test/integrations/destinations/vero/processor/data.ts new file mode 100644 index 0000000000..7834f0a541 --- /dev/null +++ b/test/integrations/destinations/vero/processor/data.ts @@ -0,0 +1,818 @@ +export const data = [ + { + "name": "vero", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "homwTown": "kanpur", + "age": "24" + } + }, + "type": "Identify", + "userId": "yash001", + "originalTimestamp": "2019-10-14T09:03:17.562Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "yash001", + "data": { + "homwTown": "kanpur", + "age": "24" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1001@tech.com" + } + }, + "type": "Identify", + "userId": "user1001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "user1001", + "email": "user1001@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1002@tech.com" + } + }, + "type": "Identify", + "anonymousId": "b4ffheww8eisndbdjgdewifewfgerwibderv" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "b4ffheww8eisndbdjgdewifewfgerwibderv", + "email": "user1002@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "address": "Caravela Beach Goa", + "homwTown": "Mawsynram", + "email": "user1005@tech.com" + } + }, + "integrations": { + "vero": { + "tags": { + "add": [ + "a", + "b" + ] + } + } + }, + "type": "Identify", + "userId": "fprediruser001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "fprediruser001", + "email": "user1005@tech.com", + "data": { + "address": "Caravela Beach Goa", + "homwTown": "Mawsynram" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "fprediruser001", + "auth_token": "testAuthToken", + "add": [ + "a", + "b" + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "event": "Random event with nonexisting userId and email", + "properties": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "type": "track", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/events/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "identity": { + "id": "eventIdn01", + "email": "eventIdn01@sample.com" + }, + "event_name": "Random event with nonexisting userId and email", + "data": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "event": "Random event with existing userId and some tags removed", + "properties": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "integrations": { + "Vero": { + "tags": { + "remove": [ + "a" + ] + } + } + }, + "type": "track", + "userId": "fprediruser001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/events/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "identity": { + "id": "fprediruser001", + "email": "eventIdn01@sample.com" + }, + "event_name": "Random event with existing userId and some tags removed", + "data": { + "movieWatched": 3, + "gamesPlayed": 4, + "email": "eventIdn01@sample.com" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + }, + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.getvero.com/api/v2/users/tags/edit", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "fprediruser001", + "auth_token": "testAuthToken", + "remove": [ + "a" + ] + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 6", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "type": "alias", + "userId": "sample101", + "previousId": "newsamplel01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.getvero.com/api/v2/users/reidentify", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "new_id": "sample101", + "id": "newsamplel01", + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 7", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1001@tech.com" + }, + "os": { + "name": "android" + }, + "device": { + "token": "qwertyuioiuytrewwertyu", + "name": "Mi" + } + }, + "type": "Identify", + "userId": "user1001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "user1001", + "email": "user1001@tech.com", + "data": {}, + "channels": { + "platform": "android", + "address": "qwertyuioiuytrewwertyu", + "device": "Mi", + "type": "push" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 8", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "context": { + "traits": { + "email": "user1001@tech.com" + }, + "device": { + "token": "qwertyuioiuytrewwertyu", + "name": "Mi" + } + }, + "type": "Identify", + "userId": "user1001" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "user1001", + "email": "user1001@tech.com", + "data": {}, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 9", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "event": "unsubscribe", + "type": "track", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/users/unsubscribe", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "id": "eventIdn01", + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 10", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "name": "Rudderstack", + "properties": { + "title": "rudderstack", + "path": "/" + }, + "type": "page", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.getvero.com/api/v2/events/track", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "identity": { + "id": "eventIdn01" + }, + "event_name": "Viewed Rudderstack Page", + "data": { + "title": "rudderstack", + "path": "/" + }, + "auth_token": "testAuthToken" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "vero", + "description": "Test 11", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "authToken": "testAuthToken" + } + }, + "message": { + "groupId": "1234", + "traits": { + "name": "MyGroup", + "industry": "IT", + "employees": 450, + "plan": "basic" + }, + "type": "group", + "userId": "eventIdn01" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "statusCode": 400, + "error": "Event type group is not supported", + "statTags": { + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "destType": "VERO", + "module": "destination", + "implementation": "native", + "feature": "processor" + } + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/vero/router/data.ts b/test/integrations/destinations/vero/router/data.ts new file mode 100644 index 0000000000..17aba359d1 --- /dev/null +++ b/test/integrations/destinations/vero/router/data.ts @@ -0,0 +1,367 @@ +import { FEATURES } from '../../../../../src/v0/util/tags'; + +export const data = [ + { + name: 'vero', + description: 'Test 0', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: { + jobId: 1, + }, + message: { + context: { + traits: { + email: 'user001@tech.com', + }, + }, + type: 'Identify', + userId: 'user001', + }, + }, + ], + destType: 'vero', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getvero.com/api/v2/users/track', + headers: {}, + params: {}, + body: { + JSON: { + id: 'user001', + email: 'user001@tech.com', + data: {}, + auth_token: 'testAuthToken', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: [ + { + jobId: 1, + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, + { + name: 'vero', + description: 'Test 1', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: { + jobId: 2, + }, + message: { + context: { + traits: { + email: 'user002@tech.com', + }, + }, + type: 'Identify', + anonymousId: 'b4ffheww8eisndbdjgdewifewfgerwibderv', + }, + }, + ], + destType: 'vero', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getvero.com/api/v2/users/track', + headers: {}, + params: {}, + body: { + JSON: { + id: 'b4ffheww8eisndbdjgdewifewfgerwibderv', + email: 'user002@tech.com', + data: {}, + auth_token: 'testAuthToken', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: [ + { + jobId: 2, + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, + { + name: 'vero', + description: 'Test 2', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: { + jobId: 3, + }, + message: { + context: { + traits: { + address: 'Caravela Beach Goa', + homwTown: 'Mawsynram', + email: 'user005@tech.com', + }, + }, + integrations: { + vero: { + tags: { + add: ['a', 'b'], + }, + }, + }, + type: 'Identify', + userId: 'fprediruser001', + }, + }, + ], + destType: 'vero', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getvero.com/api/v2/users/track', + headers: {}, + params: {}, + body: { + JSON: { + id: 'fprediruser001', + email: 'user005@tech.com', + data: { + address: 'Caravela Beach Goa', + homwTown: 'Mawsynram', + }, + auth_token: 'testAuthToken', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'PUT', + endpoint: 'https://api.getvero.com/api/v2/users/tags/edit', + headers: {}, + params: {}, + body: { + JSON: { + auth_token: 'testAuthToken', + id: 'fprediruser001', + add: ['a', 'b'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: [ + { + jobId: 3, + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, + { + name: 'vero', + description: 'Test 3', + feature: FEATURES.ROUTER, + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: { + jobId: 4, + }, + message: { + event: 'Random event with nonexisting userId and email', + properties: { + movieWatched: 3, + gamesPlayed: 4, + email: 'eventIdn02@sample.com', + }, + type: 'track', + userId: 'eventIdn01', + }, + }, + ], + destType: 'vero', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.getvero.com/api/v2/events/track', + headers: {}, + params: {}, + body: { + JSON: { + identity: { + id: 'eventIdn01', + email: 'eventIdn02@sample.com', + }, + event_name: 'Random event with nonexisting userId and email', + data: { + movieWatched: 3, + gamesPlayed: 4, + email: 'eventIdn02@sample.com', + }, + auth_token: 'testAuthToken', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + destination: { + Config: { + authToken: 'testAuthToken', + }, + }, + metadata: [ + { + jobId: 4, + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, +];