diff --git a/.github/workflows/build-pr-artifacts.yml b/.github/workflows/build-pr-artifacts.yml index 9938563bf0..f6aaa18940 100644 --- a/.github/workflows/build-pr-artifacts.yml +++ b/.github/workflows/build-pr-artifacts.yml @@ -7,6 +7,10 @@ on: - reopened - synchronize +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: generate-tag-names: runs-on: ubuntu-latest diff --git a/.github/workflows/build-push-docker-image.yml b/.github/workflows/build-push-docker-image.yml index 885ecf4fd6..1e7281479e 100644 --- a/.github/workflows/build-push-docker-image.yml +++ b/.github/workflows/build-push-docker-image.yml @@ -45,13 +45,13 @@ jobs: uses: docker/setup-buildx-action@v3.4.0 - name: Login to DockerHub - uses: docker/login-action@v3.2.0 + uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} - name: Build Docker Image - uses: docker/build-push-action@v6.4.1 + uses: docker/build-push-action@v6.5.0 with: context: . file: ${{ inputs.dockerfile }} @@ -67,7 +67,7 @@ jobs: docker run ${{ inputs.build_tag }} npm run test:ts:ci - name: Build and Push Multi-platform Images - uses: docker/build-push-action@v6.4.1 + uses: docker/build-push-action@v6.5.0 with: context: . file: ${{ inputs.dockerfile }} @@ -96,13 +96,13 @@ jobs: uses: docker/setup-buildx-action@v3.4.0 - name: Login to DockerHub - uses: docker/login-action@v3.2.0 + uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} - name: Build Docker Image - uses: docker/build-push-action@v6.4.1 + uses: docker/build-push-action@v6.5.0 with: context: . file: ${{ inputs.dockerfile }} @@ -118,7 +118,7 @@ jobs: docker run ${{ inputs.build_tag }} npm run test:ts:ci - name: Build and Push Multi-platform Images - uses: docker/build-push-action@v6.4.1 + uses: docker/build-push-action@v6.5.0 with: context: . file: ${{ inputs.dockerfile }} @@ -143,7 +143,7 @@ jobs: uses: docker/setup-buildx-action@v3.4.0 - name: Login to DockerHub - uses: docker/login-action@v3.2.0 + uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index 48098e276c..74c96d70ad 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -8,6 +8,10 @@ on: - reopened - synchronize +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: check-pr-title: name: Check PR Title diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 1e8889c011..7f6d068e15 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -2,6 +2,10 @@ name: Commitlint on: [push] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: commitlint: runs-on: ubuntu-latest diff --git a/.github/workflows/component-test-report.yml b/.github/workflows/component-test-report.yml index 936ec53742..02df1478d4 100644 --- a/.github/workflows/component-test-report.yml +++ b/.github/workflows/component-test-report.yml @@ -7,6 +7,10 @@ on: - reopened - synchronize +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + permissions: id-token: write # allows the JWT to be requested from GitHub's OIDC provider contents: read # This is required for actions/checkout diff --git a/.github/workflows/dt-test-and-report-code-coverage.yml b/.github/workflows/dt-test-and-report-code-coverage.yml index c3fc6150a6..755eb24397 100644 --- a/.github/workflows/dt-test-and-report-code-coverage.yml +++ b/.github/workflows/dt-test-and-report-code-coverage.yml @@ -8,6 +8,10 @@ on: pull_request: types: ['opened', 'reopened', 'synchronize'] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: coverage: name: Code Coverage diff --git a/.github/workflows/prepare-for-dev-deploy.yml b/.github/workflows/prepare-for-dev-deploy.yml index 9eb705aa52..66020feef0 100644 --- a/.github/workflows/prepare-for-dev-deploy.yml +++ b/.github/workflows/prepare-for-dev-deploy.yml @@ -10,6 +10,10 @@ on: branches: - develop +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: report-coverage: name: Report Code Coverage diff --git a/.github/workflows/prepare-for-prod-dt-deploy.yml b/.github/workflows/prepare-for-prod-dt-deploy.yml index fedbac8ba1..4a4d656e78 100644 --- a/.github/workflows/prepare-for-prod-dt-deploy.yml +++ b/.github/workflows/prepare-for-prod-dt-deploy.yml @@ -10,6 +10,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: report-coverage: name: Report Code Coverage diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index a6f7271d9c..a5afed6dee 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -10,6 +10,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: report-coverage: name: Report Code Coverage diff --git a/.github/workflows/prepare-for-staging-deploy.yml b/.github/workflows/prepare-for-staging-deploy.yml index 46cd731d19..4a4bf44f75 100644 --- a/.github/workflows/prepare-for-staging-deploy.yml +++ b/.github/workflows/prepare-for-staging-deploy.yml @@ -9,6 +9,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: generate-tag-names: runs-on: ubuntu-latest diff --git a/.github/workflows/ut-tests.yml b/.github/workflows/ut-tests.yml index 87e7d1fde8..2f2f303219 100644 --- a/.github/workflows/ut-tests.yml +++ b/.github/workflows/ut-tests.yml @@ -7,6 +7,10 @@ on: - reopened - synchronize +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: ut_tests: name: UT Tests diff --git a/.github/workflows/verify-server-start.yml b/.github/workflows/verify-server-start.yml index 332434c817..f87ed57eb8 100644 --- a/.github/workflows/verify-server-start.yml +++ b/.github/workflows/verify-server-start.yml @@ -4,6 +4,10 @@ on: pull_request: types: ['opened', 'reopened', 'synchronize'] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: check-health: runs-on: ubuntu-latest diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 1ae1caee23..a03037d4ad 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -3,6 +3,10 @@ name: Verify on: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + jobs: formatting-lint: name: Check for formatting & lint errors diff --git a/.husky/commit-msg b/.husky/commit-msg index 9db017095e..84dc58a421 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,2 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" npm run commit-msg diff --git a/.husky/pre-commit b/.husky/pre-commit index d4a43dd13e..af964838e1 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,2 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" npm run pre-commit diff --git a/CHANGELOG.md b/CHANGELOG.md index 2223b8aa2d..5659f1fd9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,56 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.74.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.74.0...v1.74.1) (2024-08-08) + + +### Bug Fixes + +* sendgrid read root traits ([#3642](https://github.com/rudderlabs/rudder-transformer/issues/3642)) ([5acad70](https://github.com/rudderlabs/rudder-transformer/commit/5acad707d3125f3d50380d886f5fecb1406836cd)) + +## [1.74.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.73.1...v1.74.0) (2024-08-05) + + +### Features + +* detach user and company in intercom identify call ([#3580](https://github.com/rudderlabs/rudder-transformer/issues/3580)) ([286c44a](https://github.com/rudderlabs/rudder-transformer/commit/286c44a47e8451486bde281b8c938df59945cdfc)) +* onboard new api for klaviyo 15-06-2024 ([#3574](https://github.com/rudderlabs/rudder-transformer/issues/3574)) ([44baab9](https://github.com/rudderlabs/rudder-transformer/commit/44baab9298d171efe1209b3ec360d15e84a4190c)) +* supporting device token type using integrations object ([#3620](https://github.com/rudderlabs/rudder-transformer/issues/3620)) ([14e776e](https://github.com/rudderlabs/rudder-transformer/commit/14e776e659b745c814d31cd049fc4051c1e6735d)) +* updated examples for swagger ([#3526](https://github.com/rudderlabs/rudder-transformer/issues/3526)) ([5e22fa0](https://github.com/rudderlabs/rudder-transformer/commit/5e22fa0555b98e83ca1b11f16e87f367d1f85ca8)) + + +### Bug Fixes + +* customerio page undefined name ([#3613](https://github.com/rudderlabs/rudder-transformer/issues/3613)) ([adc2a4a](https://github.com/rudderlabs/rudder-transformer/commit/adc2a4a6650c9d9add26be51999f5b3078c59f15)) +* facebook conversion version upgrade ([#3607](https://github.com/rudderlabs/rudder-transformer/issues/3607)) ([9d06546](https://github.com/rudderlabs/rudder-transformer/commit/9d065467f376a047d1cebb095de0b33be6e32206)) +* fb custom audience version upgrade from v18 to v20 ([#3604](https://github.com/rudderlabs/rudder-transformer/issues/3604)) ([c2d7555](https://github.com/rudderlabs/rudder-transformer/commit/c2d7555dcea5e476f276eec5926d392f58dbd7fa)) +* fb pixel and fb app events version upgrade ([#3606](https://github.com/rudderlabs/rudder-transformer/issues/3606)) ([7caf476](https://github.com/rudderlabs/rudder-transformer/commit/7caf4762be2c527725a2bdfb090a626d40723c36)) +* rakuten for amount list ([#3612](https://github.com/rudderlabs/rudder-transformer/issues/3612)) ([2fb7e6b](https://github.com/rudderlabs/rudder-transformer/commit/2fb7e6b4bc2b7524f6fa86a54596f7c6550fa51a)) +* shopify: incorporate new shopify cart token format ([#3626](https://github.com/rudderlabs/rudder-transformer/issues/3626)) ([0d3c042](https://github.com/rudderlabs/rudder-transformer/commit/0d3c0426571f14e88b5b8a703065935713ce8198)) + +### [1.73.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.73.0...v1.73.1) (2024-08-02) + + +### Bug Fixes + +* update getAuthErrCategory and update error message for garl ([#3629](https://github.com/rudderlabs/rudder-transformer/issues/3629)) ([feadfcf](https://github.com/rudderlabs/rudder-transformer/commit/feadfcf6009ccc9b972634347448ba9428696ebb)) + +## [1.73.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.72.2...v1.73.0) (2024-07-31) + + +### Features + + +### Bug Fixes + + +### [1.72.4](https://github.com/rudderlabs/rudder-transformer/compare/v1.72.3...v1.72.4) (2024-07-25) + + +### Bug Fixes + +* added support for ga4 v2 hybrid mode ([#3586](https://github.com/rudderlabs/rudder-transformer/issues/3586)) ([dedca07](https://github.com/rudderlabs/rudder-transformer/commit/dedca0796ee12478d57e020ef3c254afabc6e105)) + ### [1.72.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.72.2...v1.72.3) (2024-07-24) diff --git a/go/go.sum b/go/go.sum index e20fa14b0b..60ce688a04 100644 --- a/go/go.sum +++ b/go/go.sum @@ -4,6 +4,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go/webhook/testcases/testcases.go b/go/webhook/testcases/testcases.go index 92a808dcbd..1810fed7b8 100644 --- a/go/webhook/testcases/testcases.go +++ b/go/webhook/testcases/testcases.go @@ -33,7 +33,7 @@ type Input struct { } type Request struct { Method string - RawQuery string `json:"query"` + RawQuery string `json:"query_parameters"` Headers map[string]string Body json.RawMessage } @@ -41,7 +41,7 @@ type Request struct { type Output struct { Response Response Queue []json.RawMessage - ErrQueue []json.RawMessage `json:"err_queue"` + ErrQueue []json.RawMessage `json:"errQueue"` } type Response struct { diff --git a/go/webhook/testcases/testdata/testcases/adjust/simple_track_call.json b/go/webhook/testcases/testdata/testcases/adjust/simple_track_call.json index ce508cacff..1a2f5e7b6b 100644 --- a/go/webhook/testcases/testdata/testcases/adjust/simple_track_call.json +++ b/go/webhook/testcases/testdata/testcases/adjust/simple_track_call.json @@ -19,7 +19,8 @@ }, "headers": { "Content-Type": "application/json" - } + }, + "method": "GET" } }, "output": { @@ -29,6 +30,7 @@ }, "queue": [ { + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", "context": { "library": { "name": "unknown", @@ -54,13 +56,11 @@ "custom": "custom", "tracker_name": "dummy" }, - "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", "receivedAt": "2024-03-03T04:48:29.000Z", "request_ip": "192.0.2.30", "messageId": "00000000-0000-0000-0000-000000000000" } ], "errQueue": [] - }, - "skip": "FIXME" + } } diff --git a/go/webhook/testcases/testdata/testcases/adjust/simple_track_call_with_no_query_parameters.json b/go/webhook/testcases/testdata/testcases/adjust/simple_track_call_with_no_query_parameters.json index f8e5a480a0..e110978b65 100644 --- a/go/webhook/testcases/testdata/testcases/adjust/simple_track_call_with_no_query_parameters.json +++ b/go/webhook/testcases/testdata/testcases/adjust/simple_track_call_with_no_query_parameters.json @@ -10,7 +10,8 @@ }, "headers": { "Content-Type": "application/json" - } + }, + "method": "GET" } }, "output": { @@ -19,7 +20,13 @@ "body": "Query_parameters is missing" }, "queue": [], - "errQueue": [null] + "errQueue": [ + { + "id": "adjust", + "updated_at": "2023-02-10T12:16:07.251Z", + "created_at": "2023-02-10T12:05:04.402Z" + } + ] }, "skip": "FIXME" } diff --git a/go/webhook/testcases/testdata/testcases/appcenter/test_0.json b/go/webhook/testcases/testdata/testcases/appcenter/test_0.json new file mode 100644 index 0000000000..b458fcc149 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appcenter/test_0.json @@ -0,0 +1,28 @@ +{ + "name": "appcenter", + "description": "test-0", + "input": { + "request": { + "body": { + "text": "Hello from your abc-test app in App Center!", + "sent_at": "2023-01-02T07: 53: 28.3117824Z", + "url": "https://appcenter.ms/users/abc-rudderstack.com/apps/abc-test" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": { + "text": "Hello from your abc-test app in App Center!", + "sent_at": "2023-01-02T07: 53: 28.3117824Z", + "url": "https://appcenter.ms/users/abc-rudderstack.com/apps/abc-test" + } + }, + "queue": [], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appcenter/test_1.json b/go/webhook/testcases/testdata/testcases/appcenter/test_1.json new file mode 100644 index 0000000000..514c484294 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appcenter/test_1.json @@ -0,0 +1,82 @@ +{ + "name": "appcenter", + "description": "test-1", + "input": { + "request": { + "body": { + "app_name": "MSAppCenterTesting", + "branch": "master", + "build_status": "Succeeded", + "build_id": "1", + "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1", + "build_reason": "manual", + "finish_time": "2021-03-02T16:41:29.891411Z", + "icon_link": null, + "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", + "os": "Android", + "start_time": "2021-03-02T16:34:13.9184874Z", + "source_version": "7ed5c7b279316f19e9a0c45bb0fb49c0655471af", + "sent_at": "2021-03-02T16:41:55.8819564Z" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "APPCENTER" + }, + "app": { + "name": "MSAppCenterTesting", + "build": "1" + }, + "device": { + "type": "Android" + }, + "os": { + "name": "Android" + } + }, + "integrations": { + "APPCENTER": false + }, + "properties": { + "app_name": "MSAppCenterTesting", + "branch": "master", + "build_status": "Succeeded", + "build_id": "1", + "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1", + "build_reason": "manual", + "finish_time": "2021-03-02T16:41:29.891411Z", + "icon_link": null, + "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", + "os": "Android", + "start_time": "2021-03-02T16:34:13.9184874Z", + "source_version": "7ed5c7b279316f19e9a0c45bb0fb49c0655471af", + "sent_at": "2021-03-02T16:41:55.8819564Z" + }, + "type": "track", + "event": "Build Succeeded", + "originalTimeStamp": "2021-03-02T16:34:13.9184874Z", + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "sentAt": "2021-03-02T16:41:55.8819564Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appcenter/test_2.json b/go/webhook/testcases/testdata/testcases/appcenter/test_2.json new file mode 100644 index 0000000000..c1ed71362f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appcenter/test_2.json @@ -0,0 +1,82 @@ +{ + "name": "appcenter", + "description": "test-2", + "input": { + "request": { + "body": { + "app_name": "MSAppCenterTesting", + "branch": "master", + "build_status": "Broken", + "build_id": "2", + "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2", + "build_reason": "automatic", + "finish_time": "2021-03-02T16:52:04.2587506Z", + "icon_link": null, + "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", + "os": "Android", + "start_time": "2021-03-02T16:50:52.2584107Z", + "source_version": "0624e1e3e48eaf2371c37316208ff83bdd5c123b", + "sent_at": "2021-03-02T16:52:35.8848052Z" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "APPCENTER" + }, + "app": { + "name": "MSAppCenterTesting", + "build": "2" + }, + "device": { + "type": "Android" + }, + "os": { + "name": "Android" + } + }, + "integrations": { + "APPCENTER": false + }, + "properties": { + "app_name": "MSAppCenterTesting", + "branch": "master", + "build_status": "Broken", + "build_id": "2", + "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2", + "build_reason": "automatic", + "finish_time": "2021-03-02T16:52:04.2587506Z", + "icon_link": null, + "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", + "os": "Android", + "start_time": "2021-03-02T16:50:52.2584107Z", + "source_version": "0624e1e3e48eaf2371c37316208ff83bdd5c123b", + "sent_at": "2021-03-02T16:52:35.8848052Z" + }, + "type": "track", + "event": "Build Failed", + "originalTimeStamp": "2021-03-02T16:50:52.2584107Z", + "sentAt": "2021-03-02T16:52:35.8848052Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appcenter/test_3.json b/go/webhook/testcases/testdata/testcases/appcenter/test_3.json new file mode 100644 index 0000000000..992f160f6e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appcenter/test_3.json @@ -0,0 +1,98 @@ +{ + "name": "appcenter", + "description": "test-3", + "input": { + "request": { + "body": { + "app_name": "MSAppCenterTesting", + "app_display_name": "MSAppCenterTesting", + "release_id": "1", + "platform": "Android", + "uploaded_at": "2021-03-02T17:49:35.463Z", + "fingerprint": "9cbdc86d96c5359d2af3972fdda46624", + "release_notes": "Degraded to 4.0.0", + "version": "1614707021", + "short_version": "1.0", + "min_os": "7.1", + "mandatory_update": true, + "size": 2919106, + "provisioning_profile_name": null, + "provisioning_profile_type": null, + "bundle_identifier": "tech.desusai.msappcentertesting", + "install_link": "https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email", + "icon_link": "https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r", + "distribution_group_id": "00000000-0000-0000-0000-000000000000", + "installable": true, + "sent_at": "2021-03-02T17:49:37.127635Z", + "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "APPCENTER" + }, + "app": { + "name": "MSAppCenterTesting", + "version": "1.0", + "namespace": "tech.desusai.msappcentertesting" + }, + "device": { + "type": "Android" + }, + "os": { + "name": "Android" + } + }, + "integrations": { + "APPCENTER": false + }, + "properties": { + "app_name": "MSAppCenterTesting", + "app_display_name": "MSAppCenterTesting", + "release_id": "1", + "platform": "Android", + "uploaded_at": "2021-03-02T17:49:35.463Z", + "fingerprint": "9cbdc86d96c5359d2af3972fdda46624", + "release_notes": "Degraded to 4.0.0", + "version": "1614707021", + "short_version": "1.0", + "min_os": "7.1", + "mandatory_update": true, + "size": 2919106, + "provisioning_profile_name": null, + "provisioning_profile_type": null, + "bundle_identifier": "tech.desusai.msappcentertesting", + "install_link": "https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email", + "icon_link": "https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r", + "distribution_group_id": "00000000-0000-0000-0000-000000000000", + "installable": true, + "sent_at": "2021-03-02T17:49:37.127635Z", + "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" + }, + "type": "track", + "event": "Released Version 1.0", + "sentAt": "2021-03-02T17:49:37.127635Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appcenter/test_4.json b/go/webhook/testcases/testdata/testcases/appcenter/test_4.json new file mode 100644 index 0000000000..456276a0dd --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appcenter/test_4.json @@ -0,0 +1,81 @@ +{ + "name": "appcenter", + "description": "test-4", + "input": { + "request": { + "body": { + "id": "1139624368u", + "name": "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)", + "reason": "java.lang.ArithmeticException: divide by zero", + "file_name": null, + "line_number": null, + "url": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u", + "app_display_name": "MSAppCenterTesting", + "app_platform": "Java", + "app_version": "1.0(1)", + "stack_trace": [ + "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);" + ], + "affected_users": 0, + "crash_count": 0, + "sent_at": "2021-03-02T18:14:33.9713246Z", + "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "APPCENTER" + }, + "app": { + "name": "MSAppCenterTesting", + "version": "1.0(1)" + } + }, + "integrations": { + "APPCENTER": false + }, + "properties": { + "id": "1139624368u", + "name": "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)", + "reason": "java.lang.ArithmeticException: divide by zero", + "file_name": null, + "line_number": null, + "url": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u", + "app_display_name": "MSAppCenterTesting", + "app_platform": "Java", + "app_version": "1.0(1)", + "stack_trace": [ + "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);" + ], + "affected_users": 0, + "crash_count": 0, + "sent_at": "2021-03-02T18:14:33.9713246Z", + "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" + }, + "type": "track", + "event": "App Crashed", + "sentAt": "2021-03-02T18:14:33.9713246Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_0.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_0.json new file mode 100644 index 0000000000..b75b4a6323 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_0.json @@ -0,0 +1,294 @@ +{ + "name": "appsflyer", + "description": "test-0", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "device_type": "iPhoneXR", + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "ios", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "AF" + }, + "ip": "1.1.1.1", + "timezone": "UTC", + "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "app": { + "namespace": "com.appsflyer.AppsFlyer", + "version": "1.4.1", + "name": "AppsFlyer" + }, + "device": { + "model": "iPhoneXR", + "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "adTrackingEnabled": true + }, + "network": { + "wifi": true + }, + "os": { + "name": "ios", + "version": "12.3.1" + }, + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + }, + "userId": "hi.from@appsflyer.example.com" + }, + "externalId": [ + { + "type": "appsflyerExternalId", + "value": "1547985076649-5309999" + } + ] + }, + "integrations": { + "AF": false + }, + "properties": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "oaid": null, + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "af_sub3": null, + "contributor_3_match_type": null, + "af_ad_id": null, + "contributor_3_touch_time": null, + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "type": "track", + "event": "My Apps", + "userId": "hi.from@appsflyer.example.com", + "timestamp": "2020-01-15 14:57:24.898", + "originalTimestamp": "2020-01-15 14:57:24.898", + "platform": "ios", + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_1.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_1.json new file mode 100644 index 0000000000..7487945395 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_1.json @@ -0,0 +1,294 @@ +{ + "name": "appsflyer", + "description": "test-1", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "device_type": "Nokia 5.3", + "idfa": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "android", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "AF" + }, + "ip": "1.1.1.1", + "timezone": "UTC", + "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "app": { + "namespace": "com.appsflyer.AppsFlyer", + "version": "1.4.1", + "name": "AppsFlyer" + }, + "device": { + "model": "Nokia 5.3", + "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "adTrackingEnabled": true + }, + "network": { + "wifi": true + }, + "os": { + "name": "android", + "version": "12.3.1" + }, + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + }, + "userId": "hi.from@appsflyer.example.com" + }, + "externalId": [ + { + "type": "appsflyerExternalId", + "value": "1547985076649-5309999" + } + ] + }, + "integrations": { + "AF": false + }, + "properties": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "oaid": null, + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "af_sub3": null, + "contributor_3_match_type": null, + "af_ad_id": null, + "contributor_3_touch_time": null, + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "type": "track", + "event": "My Apps", + "userId": "hi.from@appsflyer.example.com", + "timestamp": "2020-01-15 14:57:24.898", + "originalTimestamp": "2020-01-15 14:57:24.898", + "platform": "android", + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_2.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_2.json new file mode 100644 index 0000000000..80589c1e47 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_2.json @@ -0,0 +1,246 @@ +{ + "name": "appsflyer", + "description": "test-2", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "device_type": "iPhoneXR", + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "ios", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Unknwon event type from Appsflyer\n" + }, + "queue": [], + "errQueue": [ + { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "device_type": "iPhoneXR", + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "ios", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + } + ] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_3.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_3.json new file mode 100644 index 0000000000..d12cc9ec36 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_3.json @@ -0,0 +1,291 @@ +{ + "name": "appsflyer", + "description": "test-3", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "device_type": "iPhoneXR", + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "ios", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "AF" + }, + "ip": "1.1.1.1", + "timezone": "UTC", + "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "app": { + "namespace": "com.appsflyer.AppsFlyer", + "version": "1.4.1", + "name": "AppsFlyer" + }, + "device": { + "model": "iPhoneXR", + "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "adTrackingEnabled": true + }, + "network": { + "wifi": true + }, + "os": { + "name": "ios", + "version": "12.3.1" + }, + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "externalId": [ + { + "type": "appsflyerExternalId", + "value": "1547985076649-5309999" + } + ] + }, + "integrations": { + "AF": false + }, + "type": "track", + "event": "My Apps", + "properties": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "oaid": null, + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "af_sub3": null, + "contributor_3_match_type": null, + "af_ad_id": null, + "contributor_3_touch_time": null, + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "timestamp": "2020-01-15 14:57:24.898", + "originalTimestamp": "2020-01-15 14:57:24.898", + "platform": "ios", + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_4.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_4.json new file mode 100644 index 0000000000..ba4f20f690 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_4.json @@ -0,0 +1,292 @@ +{ + "name": "appsflyer", + "description": "test-4", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "ios", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "AF" + }, + "ip": "1.1.1.1", + "timezone": "UTC", + "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "app": { + "namespace": "com.appsflyer.AppsFlyer", + "version": "1.4.1", + "name": "AppsFlyer" + }, + "device": { + "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "adTrackingEnabled": true + }, + "network": { + "wifi": true + }, + "os": { + "name": "ios", + "version": "12.3.1" + }, + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + }, + "userId": "hi.from@appsflyer.example.com" + }, + "externalId": [ + { + "type": "appsflyerExternalId", + "value": "1547985076649-5309999" + } + ] + }, + "integrations": { + "AF": false + }, + "properties": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "oaid": null, + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "af_sub3": null, + "contributor_3_match_type": null, + "af_ad_id": null, + "contributor_3_touch_time": null, + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "type": "track", + "event": "My Apps", + "userId": "hi.from@appsflyer.example.com", + "timestamp": "2020-01-15 14:57:24.898", + "originalTimestamp": "2020-01-15 14:57:24.898", + "platform": "ios", + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_5.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_5.json new file mode 100644 index 0000000000..b00c4a727e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_5.json @@ -0,0 +1,292 @@ +{ + "name": "appsflyer", + "description": "test-5", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "watchos", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "AF" + }, + "ip": "1.1.1.1", + "timezone": "UTC", + "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "app": { + "namespace": "com.appsflyer.AppsFlyer", + "version": "1.4.1", + "name": "AppsFlyer" + }, + "device": { + "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "adTrackingEnabled": true + }, + "network": { + "wifi": true + }, + "os": { + "name": "watchos", + "version": "12.3.1" + }, + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + }, + "userId": "hi.from@appsflyer.example.com" + }, + "externalId": [ + { + "type": "appsflyerExternalId", + "value": "1547985076649-5309999" + } + ] + }, + "integrations": { + "AF": false + }, + "properties": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "oaid": null, + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "af_sub3": null, + "contributor_3_match_type": null, + "af_ad_id": null, + "contributor_3_touch_time": null, + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "type": "track", + "event": "My Apps", + "userId": "hi.from@appsflyer.example.com", + "timestamp": "2020-01-15 14:57:24.898", + "originalTimestamp": "2020-01-15 14:57:24.898", + "platform": "watchos", + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_6.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_6.json new file mode 100644 index 0000000000..1a451c988f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_6.json @@ -0,0 +1,292 @@ +{ + "name": "appsflyer", + "description": "test-6", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "ipados", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "AF" + }, + "ip": "1.1.1.1", + "timezone": "UTC", + "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "app": { + "namespace": "com.appsflyer.AppsFlyer", + "version": "1.4.1", + "name": "AppsFlyer" + }, + "device": { + "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "adTrackingEnabled": true + }, + "network": { + "wifi": true + }, + "os": { + "name": "ipados", + "version": "12.3.1" + }, + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + }, + "userId": "hi.from@appsflyer.example.com" + }, + "externalId": [ + { + "type": "appsflyerExternalId", + "value": "1547985076649-5309999" + } + ] + }, + "integrations": { + "AF": false + }, + "properties": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "oaid": null, + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "af_sub3": null, + "contributor_3_match_type": null, + "af_ad_id": null, + "contributor_3_touch_time": null, + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "type": "track", + "event": "My Apps", + "userId": "hi.from@appsflyer.example.com", + "timestamp": "2020-01-15 14:57:24.898", + "originalTimestamp": "2020-01-15 14:57:24.898", + "platform": "ipados", + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/appsflyer/test_7.json b/go/webhook/testcases/testdata/testcases/appsflyer/test_7.json new file mode 100644 index 0000000000..f5f496aeba --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/appsflyer/test_7.json @@ -0,0 +1,292 @@ +{ + "name": "appsflyer", + "description": "test-7", + "input": { + "request": { + "body": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "customer_user_id": "hi.from@appsflyer.example.com", + "is_lat": null, + "contributor_2_af_prt": null, + "bundle_id": "com.appsflyer.AppsFlyer", + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "app_version": "1.4.1", + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "city": "Khu Pho Binh Hoa", + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "app_name": "AppsFlyer", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "postal_code": "823941", + "wifi": true, + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "country_code": "VN", + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "appsflyer_id": "1547985076649-5309999", + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "ip": "1.1.1.1", + "oaid": null, + "event_time": "2020-01-15 14:57:24.898", + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "android_id": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "carrier": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "os_version": "12.3.1", + "platform": "tvos", + "af_sub3": null, + "contributor_3_match_type": null, + "selected_timezone": "UTC", + "af_ad_id": null, + "contributor_3_touch_time": null, + "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "AF" + }, + "ip": "1.1.1.1", + "timezone": "UTC", + "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", + "app": { + "namespace": "com.appsflyer.AppsFlyer", + "version": "1.4.1", + "name": "AppsFlyer" + }, + "device": { + "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", + "adTrackingEnabled": true + }, + "network": { + "wifi": true + }, + "os": { + "name": "tvos", + "version": "12.3.1" + }, + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + }, + "userId": "hi.from@appsflyer.example.com" + }, + "externalId": [ + { + "type": "appsflyerExternalId", + "value": "1547985076649-5309999" + } + ] + }, + "integrations": { + "AF": false + }, + "properties": { + "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", + "device_category": "phone", + "af_sub1": null, + "is_lat": null, + "contributor_2_af_prt": null, + "gp_broadcast_referrer": "", + "contributor_2_touch_time": null, + "contributor_3_touch_type": null, + "event_source": "SDK", + "af_cost_value": null, + "contributor_1_match_type": null, + "contributor_3_af_prt": null, + "custom_data": null, + "contributor_2_touch_type": null, + "gp_install_begin": null, + "amazon_aid": null, + "gp_referrer": null, + "af_cost_model": null, + "af_c_id": null, + "attributed_touch_time_selected_timezone": null, + "selected_currency": "USD", + "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "install_time": "2019-01-20 04:51:16.000", + "operator": null, + "attributed_touch_type": null, + "af_attribution_lookback": null, + "campaign_type": null, + "keyword_match_type": null, + "af_adset_id": null, + "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", + "contributor_2_media_source": null, + "conversion_type": null, + "contributor_2_match_type": null, + "api_version": "2.0", + "attributed_touch_time": null, + "revenue_in_selected_currency": null, + "is_retargeting": false, + "gp_click_time": null, + "contributor_1_af_prt": null, + "match_type": null, + "dma": "None", + "http_referrer": null, + "af_sub5": null, + "af_prt": null, + "event_revenue_currency": "USD", + "store_reinstall": null, + "install_app_store": null, + "media_source": "organic", + "deeplink_url": null, + "campaign": null, + "af_keywords": null, + "region": "AS", + "cost_in_selected_currency": null, + "event_value": "{}", + "oaid": null, + "is_receipt_validated": null, + "contributor_1_campaign": null, + "af_sub4": null, + "imei": null, + "contributor_3_campaign": null, + "event_revenue_usd": null, + "af_sub2": null, + "original_url": null, + "contributor_2_campaign": null, + "contributor_3_media_source": null, + "af_adset": null, + "af_ad": null, + "state": "57", + "network_account_id": null, + "retargeting_conversion_type": null, + "af_channel": null, + "af_cost_currency": null, + "contributor_1_media_source": null, + "keyword_id": null, + "device_download_time": "2019-01-20 04:51:16.000", + "contributor_1_touch_type": null, + "af_reengagement_window": null, + "af_siteid": null, + "language": "en-US", + "app_id": "id1217828636", + "contributor_1_touch_time": null, + "event_revenue": null, + "af_ad_type": null, + "event_name": "My Apps", + "af_sub_siteid": null, + "advertising_id": null, + "af_sub3": null, + "contributor_3_match_type": null, + "af_ad_id": null, + "contributor_3_touch_time": null, + "is_primary_attribution": true, + "sdk_version": "v4.10.0", + "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" + }, + "type": "track", + "event": "My Apps", + "userId": "hi.from@appsflyer.example.com", + "timestamp": "2020-01-15 14:57:24.898", + "originalTimestamp": "2020-01-15 14:57:24.898", + "platform": "tvos", + "traits": { + "address": { + "city": "Khu Pho Binh Hoa", + "zip": "823941", + "country": "VN" + } + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/auth0/add_member_to_an_organization.json b/go/webhook/testcases/testdata/testcases/auth0/add_member_to_an_organization.json index 77fbd643c8..27a230ae26 100644 --- a/go/webhook/testcases/testdata/testcases/auth0/add_member_to_an_organization.json +++ b/go/webhook/testcases/testdata/testcases/auth0/add_member_to_an_organization.json @@ -121,6 +121,5 @@ } ], "errQueue": [] - }, - "skip": "dynamic anonymousId" + } } diff --git a/go/webhook/testcases/testdata/testcases/auth0/empty_batch.json b/go/webhook/testcases/testdata/testcases/auth0/empty_batch.json index 709ee35525..6d87cbb292 100644 --- a/go/webhook/testcases/testdata/testcases/auth0/empty_batch.json +++ b/go/webhook/testcases/testdata/testcases/auth0/empty_batch.json @@ -11,11 +11,10 @@ }, "output": { "response": { - "status": 200, - "body": "OK" + "status": 400, + "body": "Empty batch payload\n" }, "queue": [], - "errQueue": [] - }, - "skip": "dynamic anonymousId" + "errQueue": [[]] + } } diff --git a/go/webhook/testcases/testdata/testcases/auth0/missing_user_id.json b/go/webhook/testcases/testdata/testcases/auth0/missing_user_id.json index 8dc148b4c2..bed8064f97 100644 --- a/go/webhook/testcases/testdata/testcases/auth0/missing_user_id.json +++ b/go/webhook/testcases/testdata/testcases/auth0/missing_user_id.json @@ -92,6 +92,5 @@ } ], "errQueue": [] - }, - "skip": "dynamic anonymousId" + } } diff --git a/go/webhook/testcases/testdata/testcases/auth0/missing_user_id_for_all_the_requests_in_a_batch.json b/go/webhook/testcases/testdata/testcases/auth0/missing_user_id_for_all_the_requests_in_a_batch.json index 774ab7e7e2..b9428c4cd2 100644 --- a/go/webhook/testcases/testdata/testcases/auth0/missing_user_id_for_all_the_requests_in_a_batch.json +++ b/go/webhook/testcases/testdata/testcases/auth0/missing_user_id_for_all_the_requests_in_a_batch.json @@ -138,6 +138,5 @@ } ], "errQueue": [] - }, - "skip": "dynamic anonymousId" + } } diff --git a/go/webhook/testcases/testdata/testcases/auth0/successful_signup.json b/go/webhook/testcases/testdata/testcases/auth0/successful_signup.json index 91fba2bd4b..8f5bc96776 100644 --- a/go/webhook/testcases/testdata/testcases/auth0/successful_signup.json +++ b/go/webhook/testcases/testdata/testcases/auth0/successful_signup.json @@ -501,6 +501,5 @@ } ], "errQueue": [] - }, - "skip": "dynamic anonymousId" + } } diff --git a/go/webhook/testcases/testdata/testcases/auth0/update_tenant_settings.json b/go/webhook/testcases/testdata/testcases/auth0/update_tenant_settings.json index da005184ad..139d68d69d 100644 --- a/go/webhook/testcases/testdata/testcases/auth0/update_tenant_settings.json +++ b/go/webhook/testcases/testdata/testcases/auth0/update_tenant_settings.json @@ -552,6 +552,5 @@ } ], "errQueue": [] - }, - "skip": "dynamic anonymousId" + } } diff --git a/go/webhook/testcases/testdata/testcases/braze/event_mapping_done_in_ui.json b/go/webhook/testcases/testdata/testcases/braze/event_mapping_done_in_ui.json new file mode 100644 index 0000000000..99260d1b34 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/event_mapping_done_in_ui.json @@ -0,0 +1,97 @@ +{ + "name": "braze", + "description": "event mapping done in UI", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.messages.inappmessage.Click", + "properties": { + "device_model": "samsung" + }, + "user": { + "user_id": "user_id", + "external_user_id": "externalUserId" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "users.messages.inappmessage.Click", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "user_id", + "context": { + "device": { + "model": "samsung" + }, + "integration": { + "name": "Braze" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "In-App Message Clicked", + "integrations": { + "Braze": false + }, + "type": "track", + "userId": "externalUserId", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + }, + "skip": "Custom source config" +} diff --git a/go/webhook/testcases/testdata/testcases/braze/the_event_is_not_mapped_in_the_ui.json b/go/webhook/testcases/testdata/testcases/braze/the_event_is_not_mapped_in_the_ui.json new file mode 100644 index 0000000000..1c0c57d24e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/the_event_is_not_mapped_in_the_ui.json @@ -0,0 +1,96 @@ +{ + "name": "braze", + "description": "The event is not mapped in the UI", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.messages.inappmessage.Click", + "properties": { + "device_model": "samsung" + }, + "user": { + "user_id": "user_id", + "external_user_id": "externalUserId" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "user_id", + "context": { + "device": { + "model": "samsung" + }, + "integration": { + "name": "Braze" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "users.messages.inappmessage.Click", + "integrations": { + "Braze": false + }, + "type": "track", + "userId": "externalUserId", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_behaviors_app_session_start_event.json b/go/webhook/testcases/testdata/testcases/braze/users_behaviors_app_session_start_event.json new file mode 100644 index 0000000000..6bece93f98 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_behaviors_app_session_start_event.json @@ -0,0 +1,113 @@ +{ + "name": "braze", + "description": "users.behaviors.app.SessionStart event", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.behaviors.app.SessionStart", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "device_id": "fedcba87-6543-210f-edc-ba9876543210" + }, + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "platform": "ios", + "os_version": "iOS10.3.1", + "device_model": "iPhone7Plus", + "session_id": "b1234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Braze" + }, + "device": { + "id": "fedcba87-6543-210f-edc-ba9876543210", + "model": "iPhone7Plus" + }, + "os": { + "version": "iOS10.3.1", + "name": "ios" + } + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.behaviors.app.SessionStart", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "session_id": "b1234567-89ab-cdef-0123-456789abcdef" + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_behaviors_custom_event_any_custom_event.json b/go/webhook/testcases/testdata/testcases/braze/users_behaviors_custom_event_any_custom_event.json new file mode 100644 index 0000000000..0e91adba2f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_behaviors_custom_event_any_custom_event.json @@ -0,0 +1,131 @@ +{ + "name": "braze", + "description": "users.behaviors.CustomEvent any custom event", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.behaviors.CustomEvent", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "device_id": "fedcba87-6543-210f-edc-ba9876543210", + "timezone": "America/Chicago" + }, + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "platform": "ios", + "os_version": "iOS10.3.1", + "device_model": "iPhone7Plus", + "name": "customeventname", + "ad_id": "01234567-89ab-cdef-0123-456789abcdef", + "ad_id_type": "roku_ad_id", + "ad_tracking_enabled": true, + "custom_properties": { + "stringpropertyname": "a", + "numberpropertyname": 1, + "listpropertyname": ["a", "b"] + } + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Braze" + }, + "device": { + "id": "fedcba87-6543-210f-edc-ba9876543210", + "model": "iPhone7Plus", + "advertisingId": "01234567-89ab-cdef-0123-456789abcdef", + "adTrackingEnabled": true + }, + "timezone": "America/Chicago", + "os": { + "version": "iOS10.3.1", + "name": "ios" + } + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.behaviors.CustomEvent", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "name": "customeventname", + "ad_id_type": "roku_ad_id", + "custom_properties": { + "stringpropertyname": "a", + "numberpropertyname": 1, + "listpropertyname": ["a", "b"] + } + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_behaviors_purchase_event.json b/go/webhook/testcases/testdata/testcases/braze/users_behaviors_purchase_event.json new file mode 100644 index 0000000000..a361aecdd0 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_behaviors_purchase_event.json @@ -0,0 +1,135 @@ +{ + "name": "braze", + "description": "users.behaviors.Purchase event", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.behaviors.Purchase", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "device_id": "fedcba87-6543-210f-edc-ba9876543210", + "timezone": "America/Chicago" + }, + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "platform": "ios", + "os_version": "iOS10.3.1", + "device_model": "iPhone7Plus", + "product_id": "1234", + "price": 12.34, + "currency": "AED", + "ad_id": "01234567-89ab-cdef-0123-456789abcdef", + "ad_id_type": "roku_ad_id", + "ad_tracking_enabled": true, + "purchase_properties": { + "stringpropertyname": "a", + "numberpropertyname": 1, + "listpropertyname": ["a", "b"] + } + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Braze" + }, + "device": { + "id": "fedcba87-6543-210f-edc-ba9876543210", + "model": "iPhone7Plus", + "advertisingId": "01234567-89ab-cdef-0123-456789abcdef", + "adTrackingEnabled": true + }, + "timezone": "America/Chicago", + "os": { + "version": "iOS10.3.1", + "name": "ios" + } + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.behaviors.Purchase", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "product_id": "1234", + "price": 12.34, + "currency": "AED", + "ad_id_type": "roku_ad_id", + "purchase_properties": { + "stringpropertyname": "a", + "numberpropertyname": 1, + "listpropertyname": ["a", "b"] + } + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_messages_email_open_event.json b/go/webhook/testcases/testdata/testcases/braze/users_messages_email_open_event.json new file mode 100644 index 0000000000..f66795c51b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_messages_email_open_event.json @@ -0,0 +1,117 @@ +{ + "name": "braze", + "description": "users.messages.email.Open event", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.messages.email.Open", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "timezone": "America/Chicago" + }, + "properties": { + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "My Cool Canvas", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "dispatch_id": "12345qwert", + "email_address": "test@test.com", + "send_id": "f123456789abcdef01234567", + "user_agent": "Mozilla/5.0(Macintosh;IntelMacOSX10_13_5)AppleWebKit/537.36(KHTML,likeGecko)Chrome/67.0.3396.99Safari/537.36" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Braze" + }, + "timezone": "America/Chicago", + "userAgent": "Mozilla/5.0(Macintosh;IntelMacOSX10_13_5)AppleWebKit/537.36(KHTML,likeGecko)Chrome/67.0.3396.99Safari/537.36" + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.messages.email.Open", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "traits": { + "email": "test@test.com" + }, + "properties": { + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "My Cool Canvas", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "dispatch_id": "12345qwert", + "send_id": "f123456789abcdef01234567" + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_messages_inappmessage_click_event.json b/go/webhook/testcases/testdata/testcases/braze/users_messages_inappmessage_click_event.json new file mode 100644 index 0000000000..51f9655cdf --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_messages_inappmessage_click_event.json @@ -0,0 +1,125 @@ +{ + "name": "braze", + "description": "users.messages.inappmessage.Click event", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.messages.inappmessage.Click", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "device_id": "fedcba87-6543-210f-edc-ba9876543210", + "timezone": "America/Chicago" + }, + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "My Cool Campaign", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "platform": "android", + "os_version": "Android (N)", + "device_model": "Nexus 5X", + "button_id": "0", + "send_id": "f123456789abcdef01234567" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Braze" + }, + "device": { + "id": "fedcba87-6543-210f-edc-ba9876543210", + "model": "Nexus 5X" + }, + "timezone": "America/Chicago", + "os": { + "version": "Android (N)", + "name": "android" + } + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.messages.inappmessage.Click", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "My Cool Campaign", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "button_id": "0", + "send_id": "f123456789abcdef01234567" + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_messages_pushnotification_send_event.json b/go/webhook/testcases/testdata/testcases/braze/users_messages_pushnotification_send_event.json new file mode 100644 index 0000000000..f2b5ed982e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_messages_pushnotification_send_event.json @@ -0,0 +1,121 @@ +{ + "name": "braze", + "description": "users.messages.pushnotification.Send event", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.messages.pushnotification.Send", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "device_id": "fedcba87-6543-210f-edc-ba9876543210", + "timezone": "America/Chicago" + }, + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "platform": "ios", + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "My Cool Campaign", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "send_id": "f123456789abcdef01234567", + "dispatch_id": "01234567-89ab-cdef-0123-456789abcdef" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Braze" + }, + "device": { + "id": "fedcba87-6543-210f-edc-ba9876543210" + }, + "timezone": "America/Chicago", + "os": { + "name": "ios" + } + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.messages.pushnotification.Send", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "properties": { + "app_id": "01234567-89ab-cdef-0123-456789abcdef", + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "My Cool Campaign", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "send_id": "f123456789abcdef01234567", + "dispatch_id": "01234567-89ab-cdef-0123-456789abcdef" + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_event.json b/go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_event.json new file mode 100644 index 0000000000..f6fb446f9f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_event.json @@ -0,0 +1,117 @@ +{ + "name": "braze", + "description": "users.messages.sms.Delivery event", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.messages.sms.Delivery", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "timezone": "America/Chicago" + }, + "properties": { + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "MyCoolCanvas", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "dispatch_id": "12345qwert", + "to_phone_number": "+16462345678", + "subscription_group_id": "41234567-89ab-cdef-0123-456789abcdef", + "from_phone_number": "+12123470922" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "timezone": "America/Chicago", + "integration": { + "name": "Braze" + } + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.messages.sms.Delivery", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "traits": { + "phone": "+16462345678" + }, + "properties": { + "canvas_id": "11234567-89ab-cdef-0123-456789abcdef", + "canvas_name": "MyCoolCanvas", + "canvas_variation_id": "31234567-89ab-cdef-0123-456789abcdef", + "canvas_step_id": "41234567-89ab-cdef-0123-456789abcdef", + "dispatch_id": "12345qwert", + "subscription_group_id": "41234567-89ab-cdef-0123-456789abcdef", + "from_phone_number": "+12123470922" + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_send.json b/go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_send.json new file mode 100644 index 0000000000..1700cfaf29 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/braze/users_messages_sms_delivery_send.json @@ -0,0 +1,115 @@ +{ + "name": "braze", + "description": "users.messages.sms.Delivery send", + "input": { + "request": { + "body": { + "events": [ + { + "event_type": "users.messages.sms.Delivery", + "id": "a1234567-89ab-cdef-0123-456789abcdef", + "time": 1477502783, + "user": { + "user_id": "0123456789abcdef01234567", + "external_user_id": "user_id", + "timezone": "America/Chicago" + }, + "properties": { + "campaign_id": "11234567-89ab-cdef-0123-456789abcdef", + "campaign_name": "Test Campaign", + "dispatch_id": "12345qwert", + "message_variation_id": "c1234567-89ab-cdef-0123-456789abcdef", + "to_phone_number": "+16462345678", + "subscription_group_id": "41234567-89ab-cdef-0123-456789abcdef", + "from_phone_number": "+12123470922" + } + } + ], + "source": { + "ID": "2hgvYyU5TYaFvVzBge6tF2UKoeG", + "OriginalID": "", + "Name": "Braze source", + "SourceDefinition": { + "ID": "1lh9senY3vrBg4JQXswWzyYBTOO", + "Name": "Braze", + "Category": "webhook", + "Type": "cloud" + }, + "Config": { + "customMapping": [ + { + "from": "randomEvent", + "to": "In-App Message Clicked" + } + ] + }, + "Enabled": true, + "WorkspaceID": "2hSS1hZ8kuCpUZAAYsQucAFdob9", + "Destinations": null, + "WriteKey": "2hgvYykpvMaE5Eg47Au8RWC9Yza", + "DgSourceTrackingPlanConfig": { + "sourceId": "", + "version": 0, + "config": null, + "mergedConfig": null, + "deleted": false, + "trackingPlan": { + "id": "", + "version": 0 + } + }, + "Transient": false, + "GeoEnrichment": { + "Enabled": false + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "timezone": "America/Chicago", + "integration": { + "name": "Braze" + } + }, + "integrations": { + "Braze": false + }, + "type": "track", + "event": "users.messages.sms.Delivery", + "messageId": "a1234567-89ab-cdef-0123-456789abcdef", + "anonymousId": "0123456789abcdef01234567", + "userId": "user_id", + "traits": { + "phone": "+16462345678" + }, + "properties": { + "campaign_id": "11234567-89ab-cdef-0123-456789abcdef", + "campaign_name": "Test Campaign", + "dispatch_id": "12345qwert", + "message_variation_id": "c1234567-89ab-cdef-0123-456789abcdef", + "subscription_group_id": "41234567-89ab-cdef-0123-456789abcdef", + "from_phone_number": "+12123470922" + }, + "timestamp": "2016-10-26T17:26:23.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_0.json b/go/webhook/testcases/testdata/testcases/canny/test_0.json new file mode 100644 index 0000000000..889b38a350 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_0.json @@ -0,0 +1,137 @@ +{ + "name": "canny", + "description": "test-0", + "input": { + "request": { + "body": { + "created": "2022-07-28T10:52:46.294Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 13, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-28T10:52:46.172Z", + "customFields": [ + { + "id": "62e13820d7949d44b92d3876", + "name": "abc", + "value": "123" + } + ], + "details": "Array of images", + "eta": null, + "id": "62e26a7e1d4ea13c124337bd", + "imageURLs": [ + "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", + "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" + ], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Custom Fields Testing", + "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" + }, + "objectType": "post", + "type": "post.created" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "post.created", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-28T10:52:46.294Z", + "originalTimestamp": "2022-07-28T10:52:46.294Z", + "type": "track", + "properties": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 13, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-28T10:52:46.172Z", + "customFields": [ + { + "id": "62e13820d7949d44b92d3876", + "name": "abc", + "value": "123" + } + ], + "details": "Array of images", + "eta": null, + "id": "62e26a7e1d4ea13c124337bd", + "imageURLs": [ + "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", + "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" + ], + "objectType": "post", + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Custom Fields Testing", + "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_1.json b/go/webhook/testcases/testdata/testcases/canny/test_1.json new file mode 100644 index 0000000000..caac99d3d8 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_1.json @@ -0,0 +1,135 @@ +{ + "name": "canny", + "description": "test-1", + "input": { + "request": { + "body": { + "created": "2022-07-26T10:35:16.390Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 10, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-26T08:18:52.459Z", + "deletedBy": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "details": "This is the post's details", + "eta": null, + "id": "62dfa36c9950e94655320fe7", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-4" + }, + "objectType": "post", + "type": "post.deleted" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "post.deleted", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-26T10:35:16.390Z", + "originalTimestamp": "2022-07-26T10:35:16.390Z", + "type": "track", + "properties": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 10, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-26T08:18:52.459Z", + "deletedBy": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "details": "This is the post's details", + "eta": null, + "id": "62dfa36c9950e94655320fe7", + "imageURLs": [], + "objectType": "post", + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-4" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_10.json b/go/webhook/testcases/testdata/testcases/canny/test_10.json new file mode 100644 index 0000000000..4189302961 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_10.json @@ -0,0 +1,149 @@ +{ + "name": "canny", + "description": "test-10", + "input": { + "request": { + "body": { + "created": "2022-07-26T11:32:31.378Z", + "object": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T11:32:31.263Z", + "id": "62dfd0cfb2870d468c9618f5", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 0, + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "score": 1, + "voter": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": "123" + } + }, + "objectType": "vote", + "type": "vote.created" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "123", + "event": "vote.created", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-26T11:32:31.378Z", + "originalTimestamp": "2022-07-26T11:32:31.378Z", + "type": "track", + "properties": { + "objectType": "vote", + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T11:32:31.263Z", + "id": "62dfd0cfb2870d468c9618f5", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 0, + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "score": 1 + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_11.json b/go/webhook/testcases/testdata/testcases/canny/test_11.json new file mode 100644 index 0000000000..45112e7ea4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_11.json @@ -0,0 +1,140 @@ +{ + "name": "canny", + "description": "test-11", + "input": { + "request": { + "body": { + "created": "2022-07-26T18:09:27.358Z", + "object": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T08:22:31.109Z", + "id": "62dfa4479950e9465532a338", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 1, + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "planned", + "tags": [ + { + "id": "62e02db67ad24c46bc175f56", + "name": "abc-tag", + "postCount": 1, + "url": "https://rudder.canny.io/admin/board/features?tags=abc-tag" + } + ], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "score": 0, + "voter": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": null, + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + } + }, + "objectType": "vote", + "type": "vote.deleted" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Missing essential fields from Canny. Error: (TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received null)\n" + }, + "queue": [], + "errQueue": [ + { + "created": "2022-07-26T18:09:27.358Z", + "object": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T08:22:31.109Z", + "id": "62dfa4479950e9465532a338", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 1, + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "planned", + "tags": [ + { + "id": "62e02db67ad24c46bc175f56", + "name": "abc-tag", + "postCount": 1, + "url": "https://rudder.canny.io/admin/board/features?tags=abc-tag" + } + ], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "score": 0, + "voter": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": null, + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + } + }, + "objectType": "vote", + "type": "vote.deleted" + } + ] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_12.json b/go/webhook/testcases/testdata/testcases/canny/test_12.json new file mode 100644 index 0000000000..73340ab335 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_12.json @@ -0,0 +1,108 @@ +{ + "name": "canny", + "description": "test-12", + "input": { + "request": { + "body": { + "created": "2022-07-26T10:35:16.390Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 10, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-26T08:18:52.459Z", + "deletedBy": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "details": "This is the post's details", + "eta": null, + "id": "62dfa36c9950e94655320fe7", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-4" + }, + "objectType": "post" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Missing essential fields from Canny\n" + }, + "queue": [], + "errQueue": [ + { + "created": "2022-07-26T10:35:16.390Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 10, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-26T08:18:52.459Z", + "deletedBy": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "details": "This is the post's details", + "eta": null, + "id": "62dfa36c9950e94655320fe7", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-4" + }, + "objectType": "post" + } + ] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_2.json b/go/webhook/testcases/testdata/testcases/canny/test_2.json new file mode 100644 index 0000000000..28050f11ed --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_2.json @@ -0,0 +1,133 @@ +{ + "name": "canny", + "description": "test-2", + "input": { + "request": { + "body": { + "created": "2022-07-26T18:32:28.337Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "category": null, + "commentCount": 0, + "created": "2022-07-26T10:43:43.752Z", + "details": "This is the post's details", + "eta": null, + "id": "62dfc55ffe7f6f465b9b4568", + "imageURLs": [], + "issue": { + "description": "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", + "id": "10001", + "key": "TES-2", + "status": "To Do", + "summary": "Canny Source Testing", + "url": "https://rudderstack-user.atlassian.net/browse/TES-2" + }, + "owner": null, + "score": 2, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-8" + }, + "objectType": "post", + "type": "post.jira_issue_linked" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "post.jira_issue_linked", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-26T18:32:28.337Z", + "originalTimestamp": "2022-07-26T18:32:28.337Z", + "type": "track", + "properties": { + "by": null, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "category": null, + "commentCount": 0, + "created": "2022-07-26T10:43:43.752Z", + "details": "This is the post's details", + "eta": null, + "id": "62dfc55ffe7f6f465b9b4568", + "imageURLs": [], + "issue": { + "description": "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", + "id": "10001", + "key": "TES-2", + "status": "To Do", + "summary": "Canny Source Testing", + "url": "https://rudderstack-user.atlassian.net/browse/TES-2" + }, + "objectType": "post", + "owner": null, + "score": 2, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-8" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_3.json b/go/webhook/testcases/testdata/testcases/canny/test_3.json new file mode 100644 index 0000000000..526340e90e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_3.json @@ -0,0 +1,133 @@ +{ + "name": "canny", + "description": "test-3", + "input": { + "request": { + "body": { + "created": "2022-07-27T04:08:24.377Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "category": null, + "commentCount": 0, + "created": "2022-07-26T11:32:31.228Z", + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "issue": { + "description": "Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2", + "id": "10002", + "key": "TES-3", + "status": "To Do", + "summary": "Images testing", + "url": "https://rudderstack-user.atlassian.net/browse/TES-3" + }, + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "objectType": "post", + "type": "post.jira_issue_unlinked" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "post.jira_issue_unlinked", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-27T04:08:24.377Z", + "originalTimestamp": "2022-07-27T04:08:24.377Z", + "type": "track", + "properties": { + "objectType": "post", + "by": null, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "category": null, + "commentCount": 0, + "created": "2022-07-26T11:32:31.228Z", + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "issue": { + "description": "Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2", + "id": "10002", + "key": "TES-3", + "status": "To Do", + "summary": "Images testing", + "url": "https://rudderstack-user.atlassian.net/browse/TES-3" + }, + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_4.json b/go/webhook/testcases/testdata/testcases/canny/test_4.json new file mode 100644 index 0000000000..3af2ad99fc --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_4.json @@ -0,0 +1,157 @@ +{ + "name": "canny", + "description": "test-4", + "input": { + "request": { + "body": { + "created": "2022-07-26T18:07:03.143Z", + "object": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "changeComment": { + "imageURLs": ["https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp"], + "value": "" + }, + "changedAt": "2022-07-26T18:07:03.143Z", + "changer": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "commentCount": 1, + "created": "2022-07-26T08:22:31.089Z", + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "jira": { + "linkedIssues": [], + "linkedIssueIDs": [] + }, + "owner": null, + "score": 2, + "status": "planned", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "objectType": "post", + "type": "post.status_changed" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "post.status_changed", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-26T18:07:03.143Z", + "originalTimestamp": "2022-07-26T18:07:03.143Z", + "type": "track", + "properties": { + "objectType": "post", + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "changeComment": { + "imageURLs": ["https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp"], + "value": "" + }, + "changedAt": "2022-07-26T18:07:03.143Z", + "changer": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "commentCount": 1, + "created": "2022-07-26T08:22:31.089Z", + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "jira": { + "linkedIssues": [], + "linkedIssueIDs": [] + }, + "owner": null, + "score": 2, + "status": "planned", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_5.json b/go/webhook/testcases/testdata/testcases/canny/test_5.json new file mode 100644 index 0000000000..6efb211c58 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_5.json @@ -0,0 +1,153 @@ +{ + "name": "canny", + "description": "test-5", + "input": { + "request": { + "body": { + "created": "2022-07-26T10:52:17.712Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 11, + "url": "https://rudder.canny.io/admin/board/features" + }, + "created": "2022-07-26T10:52:17.618Z", + "id": "62dfc761af6e2b467381b103", + "imageURLs": ["https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp"], + "internal": true, + "mentions": [], + "parentID": null, + "post": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 1, + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "owner": null, + "score": 2, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "private": false, + "value": "webhook-test" + }, + "objectType": "comment", + "type": "comment.created" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "comment.created", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-26T10:52:17.712Z", + "originalTimestamp": "2022-07-26T10:52:17.712Z", + "type": "track", + "properties": { + "objectType": "comment", + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 11, + "url": "https://rudder.canny.io/admin/board/features" + }, + "created": "2022-07-26T10:52:17.618Z", + "id": "62dfc761af6e2b467381b103", + "imageURLs": ["https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp"], + "internal": true, + "mentions": [], + "parentID": null, + "post": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 1, + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "owner": null, + "score": 2, + "status": "open", + "tags": [], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "private": false, + "value": "webhook-test" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_6.json b/go/webhook/testcases/testdata/testcases/canny/test_6.json new file mode 100644 index 0000000000..0cd90c97b4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_6.json @@ -0,0 +1,149 @@ +{ + "name": "canny", + "description": "test-6", + "input": { + "request": { + "body": { + "created": "2022-07-27T04:12:09.290Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "created": "2022-07-27T04:11:59.942Z", + "id": "62e0bb0faf6e2b467328b133", + "imageURLs": [], + "parentID": null, + "post": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 0, + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "private": false, + "value": "good" + }, + "objectType": "comment", + "type": "comment.deleted" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "comment.deleted", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-27T04:12:09.290Z", + "originalTimestamp": "2022-07-27T04:12:09.290Z", + "type": "track", + "properties": { + "objectType": "comment", + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "created": "2022-07-27T04:11:59.942Z", + "id": "62e0bb0faf6e2b467328b133", + "imageURLs": [], + "parentID": null, + "post": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 0, + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "private": false, + "value": "good" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_7.json b/go/webhook/testcases/testdata/testcases/canny/test_7.json new file mode 100644 index 0000000000..fd525def22 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_7.json @@ -0,0 +1,149 @@ +{ + "name": "canny", + "description": "test-7", + "input": { + "request": { + "body": { + "created": "2022-07-26T11:32:31.378Z", + "object": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T11:32:31.263Z", + "id": "62dfd0cfb2870d468c9618f5", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 0, + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "score": 1, + "voter": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + } + }, + "objectType": "vote", + "type": "vote.created" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "vote.created", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-26T11:32:31.378Z", + "originalTimestamp": "2022-07-26T11:32:31.378Z", + "type": "track", + "properties": { + "objectType": "vote", + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T11:32:31.263Z", + "id": "62dfd0cfb2870d468c9618f5", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 0, + "details": "Array of images", + "eta": null, + "id": "62dfd0cfb2870d468c9618dd", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Images testing", + "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" + }, + "score": 1 + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_8.json b/go/webhook/testcases/testdata/testcases/canny/test_8.json new file mode 100644 index 0000000000..13f1153196 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_8.json @@ -0,0 +1,163 @@ +{ + "name": "canny", + "description": "test-8", + "input": { + "request": { + "body": { + "created": "2022-07-26T18:09:27.358Z", + "object": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T08:22:31.109Z", + "id": "62dfa4479950e9465532a338", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 1, + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "planned", + "tags": [ + { + "id": "62e02db67ad24c46bc175f56", + "name": "abc-tag", + "postCount": 1, + "url": "https://rudder.canny.io/admin/board/features?tags=abc-tag" + } + ], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "score": 0, + "voter": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + } + }, + "objectType": "vote", + "type": "vote.deleted" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "event": "vote.deleted", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-26T18:09:27.358Z", + "originalTimestamp": "2022-07-26T18:09:27.358Z", + "type": "track", + "properties": { + "objectType": "vote", + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 12, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "created": "2022-07-26T08:22:31.109Z", + "id": "62dfa4479950e9465532a338", + "post": { + "author": { + "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": null + }, + "by": null, + "category": null, + "commentCount": 1, + "details": "This is the post's details", + "eta": null, + "id": "62dfa4479950e9465532a31e", + "imageURLs": [], + "owner": null, + "score": 1, + "status": "planned", + "tags": [ + { + "id": "62e02db67ad24c46bc175f56", + "name": "abc-tag", + "postCount": 1, + "url": "https://rudder.canny.io/admin/board/features?tags=abc-tag" + } + ], + "title": "Post Title", + "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" + }, + "score": 0 + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/canny/test_9.json b/go/webhook/testcases/testdata/testcases/canny/test_9.json new file mode 100644 index 0000000000..e36cffb52b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/canny/test_9.json @@ -0,0 +1,137 @@ +{ + "name": "canny", + "description": "test-9", + "input": { + "request": { + "body": { + "created": "2022-07-28T10:52:46.294Z", + "object": { + "author": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "id": "62d14c90fff7c80d0ec08375", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser", + "userID": "sampleuserId" + }, + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 13, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-28T10:52:46.172Z", + "customFields": [ + { + "id": "62e13820d7949d44b92d3876", + "name": "abc", + "value": "123" + } + ], + "details": "Array of images", + "eta": null, + "id": "62e26a7e1d4ea13c124337bd", + "imageURLs": [ + "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", + "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" + ], + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Custom Fields Testing", + "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" + }, + "objectType": "post", + "type": "post.created" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "sampleuserId", + "event": "post.created", + "integrations": { + "Canny": false + }, + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Canny", + "version": "1.0.0" + }, + "traits": { + "created": "2022-07-15T11:16:32.648Z", + "email": "test@rudderstack.com", + "isAdmin": true, + "name": "Rudder Test", + "url": "https://rudder.canny.io/admin/users/dummyUser" + }, + "externalId": [ + { + "type": "cannyUserId", + "id": "62d14c90fff7c80d0ec08375" + } + ] + }, + "timestamp": "2022-07-28T10:52:46.294Z", + "originalTimestamp": "2022-07-28T10:52:46.294Z", + "type": "track", + "properties": { + "board": { + "created": "2022-07-25T12:11:19.895Z", + "id": "62de88676bc28b44aaaf25cc", + "name": "features", + "postCount": 13, + "url": "https://rudder.canny.io/admin/board/features" + }, + "by": null, + "category": null, + "commentCount": 0, + "created": "2022-07-28T10:52:46.172Z", + "customFields": [ + { + "id": "62e13820d7949d44b92d3876", + "name": "abc", + "value": "123" + } + ], + "details": "Array of images", + "eta": null, + "id": "62e26a7e1d4ea13c124337bd", + "imageURLs": [ + "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", + "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" + ], + "objectType": "post", + "owner": null, + "score": 1, + "status": "open", + "tags": [], + "title": "Custom Fields Testing", + "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/close_crm/group_creation.json b/go/webhook/testcases/testdata/testcases/close_crm/group_creation.json index bff58cdf04..24bb4546b4 100644 --- a/go/webhook/testcases/testdata/testcases/close_crm/group_creation.json +++ b/go/webhook/testcases/testdata/testcases/close_crm/group_creation.json @@ -4,38 +4,36 @@ "input": { "request": { "body": { + "subscription_id": "whsub_123", "event": { - "subscription_id": "whsub_123", - "event": { - "id": "ev_123", - "date_created": "2024-06-13T03:53:33.917000", - "date_updated": "2024-06-13T03:53:33.917000", - "organization_id": "orga_123", - "user_id": "user_123", - "request_id": "req_123", - "api_key_id": null, - "oauth_client_id": null, - "oauth_scope": null, - "object_type": "group", - "object_id": "group_123", - "lead_id": null, - "action": "created", - "changed_fields": [], - "meta": { - "request_path": "/api/v1/graphql/", - "request_method": "POST" - }, - "data": { - "id": "group_123", - "name": "Test group", - "members": [ - { - "user_id": "user_123" - } - ] - }, - "previous_data": {} - } + "id": "ev_123", + "date_created": "2024-06-13T03:53:33.917000", + "date_updated": "2024-06-13T03:53:33.917000", + "organization_id": "orga_123", + "user_id": "user_123", + "request_id": "req_123", + "api_key_id": null, + "oauth_client_id": null, + "oauth_scope": null, + "object_type": "group", + "object_id": "group_123", + "lead_id": null, + "action": "created", + "changed_fields": [], + "meta": { + "request_path": "/api/v1/graphql/", + "request_method": "POST" + }, + "data": { + "id": "group_123", + "name": "Test group", + "members": [ + { + "user_id": "user_123" + } + ] + }, + "previous_data": {} }, "source": {} }, diff --git a/go/webhook/testcases/testdata/testcases/close_crm/lead_deletion.json b/go/webhook/testcases/testdata/testcases/close_crm/lead_deletion.json index 4e7076e03d..3b8a2ce578 100644 --- a/go/webhook/testcases/testdata/testcases/close_crm/lead_deletion.json +++ b/go/webhook/testcases/testdata/testcases/close_crm/lead_deletion.json @@ -4,46 +4,44 @@ "input": { "request": { "body": { + "subscription_id": "whsub_123", "event": { - "subscription_id": "whsub_123", - "event": { - "id": "ev_123", - "date_created": "2024-06-14T05:16:04.138000", - "date_updated": "2024-06-14T05:16:04.138000", + "id": "ev_123", + "date_created": "2024-06-14T05:16:04.138000", + "date_updated": "2024-06-14T05:16:04.138000", + "organization_id": "orga_123", + "user_id": "user_123", + "request_id": "req_123", + "api_key_id": "api_123", + "oauth_client_id": null, + "oauth_scope": null, + "object_type": "lead", + "object_id": "lead_123", + "lead_id": "lead_123", + "action": "deleted", + "changed_fields": [], + "meta": { + "request_path": "/api/v1/lead/lead_123/", + "request_method": "DELETE" + }, + "data": {}, + "previous_data": { + "created_by_name": "Rudder User", + "addresses": [], + "description": "", + "url": null, + "date_created": "2024-06-14T05:13:42.239000+00:00", + "status_id": "stat_123", + "contact_ids": ["cont_123"], + "id": "lead_12", + "date_updated": "2024-06-14T05:13:42.262000+00:00", + "updated_by_name": "Rudder User", + "status_label": "Potential", + "name": "test name", + "display_name": "test name", "organization_id": "orga_123", - "user_id": "user_123", - "request_id": "req_123", - "api_key_id": "api_123", - "oauth_client_id": null, - "oauth_scope": null, - "object_type": "lead", - "object_id": "lead_123", - "lead_id": "lead_123", - "action": "deleted", - "changed_fields": [], - "meta": { - "request_path": "/api/v1/lead/lead_123/", - "request_method": "DELETE" - }, - "data": {}, - "previous_data": { - "created_by_name": "Rudder User", - "addresses": [], - "description": "", - "url": null, - "date_created": "2024-06-14T05:13:42.239000+00:00", - "status_id": "stat_123", - "contact_ids": ["cont_123"], - "id": "lead_12", - "date_updated": "2024-06-14T05:13:42.262000+00:00", - "updated_by_name": "Rudder User", - "status_label": "Potential", - "name": "test name", - "display_name": "test name", - "organization_id": "orga_123", - "updated_by": "user_123", - "created_by": "user_123" - } + "updated_by": "user_123", + "created_by": "user_123" } }, "source": {} diff --git a/go/webhook/testcases/testdata/testcases/close_crm/lead_update.json b/go/webhook/testcases/testdata/testcases/close_crm/lead_update.json index 186724a793..99cdfe061c 100644 --- a/go/webhook/testcases/testdata/testcases/close_crm/lead_update.json +++ b/go/webhook/testcases/testdata/testcases/close_crm/lead_update.json @@ -5,65 +5,63 @@ "request": { "body": { "event": { - "event": { - "date_created": "2019-01-15T12:48:23.395000", - "meta": { - "request_method": "PUT", - "request_path": "/api/v1/opportunity/object_id/" - }, - "id": "ev_123", - "action": "updated", - "date_updated": "2019-01-15T12:48:23.395000", - "changed_fields": [ - "confidence", - "date_updated", - "status_id", - "status_label", - "status_type" - ], - "previous_data": { - "status_type": "active", - "confidence": 70, - "date_updated": "2019-01-15T12:47:39.873000+00:00", - "status_id": "stat_123", - "status_label": "Active" - }, - "organization_id": "orga_123", - "data": { - "contact_name": "Mr. Jones", - "user_name": "Joe Kemp", - "value_period": "one_time", - "updated_by_name": "Joe Kemp", - "date_created": "2019-01-15T12:41:24.496000+00:00", - "user_id": "user_123", - "updated_by": "user_123", - "value_currency": "USD", - "organization_id": "orga_123", - "status_label": "Won", - "contact_id": "cont_123", - "status_type": "won", - "created_by_name": "Joe Kemp", - "id": "id_12", - "lead_name": "KLine", - "date_lost": null, - "note": "", - "date_updated": "2019-01-15T12:48:23.392000+00:00", - "status_id": "stat_12", - "value": 100000, - "created_by": "user_123", - "value_formatted": "$1,000", - "date_won": "2019-01-15", - "lead_id": "lead_123", - "confidence": 100 - }, - "request_id": "req_123", - "object_id": "object_id", + "date_created": "2019-01-15T12:48:23.395000", + "meta": { + "request_method": "PUT", + "request_path": "/api/v1/opportunity/object_id/" + }, + "id": "ev_123", + "action": "updated", + "date_updated": "2019-01-15T12:48:23.395000", + "changed_fields": [ + "confidence", + "date_updated", + "status_id", + "status_label", + "status_type" + ], + "previous_data": { + "status_type": "active", + "confidence": 70, + "date_updated": "2019-01-15T12:47:39.873000+00:00", + "status_id": "stat_123", + "status_label": "Active" + }, + "organization_id": "orga_123", + "data": { + "contact_name": "Mr. Jones", + "user_name": "Joe Kemp", + "value_period": "one_time", + "updated_by_name": "Joe Kemp", + "date_created": "2019-01-15T12:41:24.496000+00:00", "user_id": "user_123", - "object_type": "opportunity", - "lead_id": "lead_123" + "updated_by": "user_123", + "value_currency": "USD", + "organization_id": "orga_123", + "status_label": "Won", + "contact_id": "cont_123", + "status_type": "won", + "created_by_name": "Joe Kemp", + "id": "id_12", + "lead_name": "KLine", + "date_lost": null, + "note": "", + "date_updated": "2019-01-15T12:48:23.392000+00:00", + "status_id": "stat_12", + "value": 100000, + "created_by": "user_123", + "value_formatted": "$1,000", + "date_won": "2019-01-15", + "lead_id": "lead_123", + "confidence": 100 }, - "subscription_id": "whsub_123" + "request_id": "req_123", + "object_id": "object_id", + "user_id": "user_123", + "object_type": "opportunity", + "lead_id": "lead_123" }, + "subscription_id": "whsub_123", "source": {} }, "headers": { diff --git a/go/webhook/testcases/testdata/testcases/cordial/multiple_object_input_event_with_batched_payload.json b/go/webhook/testcases/testdata/testcases/cordial/multiple_object_input_event_with_batched_payload.json new file mode 100644 index 0000000000..1217608454 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/cordial/multiple_object_input_event_with_batched_payload.json @@ -0,0 +1,326 @@ +{ + "name": "cordial", + "description": "Multiple object Input event with batched payload", + "input": { + "request": { + "body": [ + { + "contact": { + "_id": "633b2fd70a12be027e0b0xxx", + "lang_locale": "EN-US", + "channels": { + "email": { + "address": "johndoe@example.com", + "subscribeStatus": "none" + } + }, + "createdAt": "2022-10-03T18:54:15+0000", + "email_sha256_hash": "f959bdf883831ebb96612eb9xxxx1e0c9481780adf5f70xxx862155531bf61df", + "first_name": "john", + "last_name": "doe", + "lastUpdateSource": "cordial", + "lastModified": "2024-07-24T07:52:46+0000", + "cID": "633b2fd70a12be027e0b0xxx" + }, + "event": { + "_id": "66a0b2ce5344b55fxxxc5a64", + "cID": "633b2fd70a12be027e0b0xxx", + "ts": "2024-07-24T07:52:46+00:00", + "ats": "2024-07-24T07:52:39+0000", + "g": { + "countryISO": "PL", + "country": "Poland", + "state": "MZ", + "city": "Warszawa", + "postalCode": "00-686", + "geoLoc": { + "lat": 52.22744369506836, + "lon": 21.009017944335938 + }, + "tz": "Europe/Warsaw" + }, + "d": { + "type": "computer", + "device": "Macintosh", + "platform": "OS X", + "browser": "Chrome", + "robot": false + }, + "a": "browse", + "UID": "471af949fffe749c2ebfxxx950ea73c", + "sp": { + "bid": "cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e" + }, + "tzo": -7, + "rl": "6", + "time": "2024-07-24T07:52:39+0000", + "action": "browse", + "bmID": "", + "first": 0, + "properties": { + "url": "https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart", + "product_item_group_id": ["1094269"], + "product_category": ["allproducts"], + "product_name": ["wtp ab"], + "product_group": ["women"] + } + }, + "source": {} + }, + { + "contact": { + "_id": "633b2fd12312be027e0b0xxx", + "lang_locale": "EN-US", + "channels": { + "email": { + "address": "johndoe1@example.com", + "subscribeStatus": "none" + } + }, + "createdAt": "2022-10-03T18:54:15+0000", + "email_sha256_hash": "f95912b883831eab11612eb9xxxx1e0c9481780ad45770xxx862155531bf61df", + "first_name": "john", + "last_name": "doe", + "lastUpdateSource": "cordial", + "lastModified": "2024-07-24T07:52:46+0000", + "cID": "633b2fd12312be027e0b0xxx" + }, + "event": { + "_id": "66aku0b2ce527b55fx1xc5a64", + "cID": "633b2fd12312be027e0b0xxx", + "ts": "2024-07-24T07:52:46+00:00", + "ats": "2024-07-24T07:52:39+0000", + "g": { + "countryISO": "PL", + "country": "Poland", + "state": "MZ", + "city": "Warszawa", + "postalCode": "00-686", + "geoLoc": { + "lat": 52.22744369506836, + "lon": 21.009017944335938 + }, + "tz": "Europe/Warsaw" + }, + "d": { + "type": "computer", + "device": "Macintosh", + "platform": "OS X", + "browser": "Chrome", + "robot": false + }, + "a": "browse", + "UID": "471af949fffe74sdh382ebfxxx950ea73c", + "sp": { + "bid": "cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e" + }, + "tzo": -7, + "rl": "6", + "time": "2024-07-24T07:52:39+0000", + "action": "browse", + "bmID": "", + "first": 0, + "properties": { + "url": "https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart", + "product_item_group_id": ["1094269"], + "product_category": ["allproducts"], + "product_name": ["wtp ab"], + "product_group": ["women"] + } + }, + "source": {} + } + ], + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Cordial" + }, + "traits": { + "userId": "633b2fd70a12be027e0b0xxx", + "email": "johndoe@example.com", + "_id": "633b2fd70a12be027e0b0xxx", + "lang_locale": "EN-US", + "channels": { + "email": { + "address": "johndoe@example.com", + "subscribeStatus": "none" + } + }, + "createdAt": "2022-10-03T18:54:15+0000", + "email_sha256_hash": "f959bdf883831ebb96612eb9xxxx1e0c9481780adf5f70xxx862155531bf61df", + "first_name": "john", + "last_name": "doe", + "lastUpdateSource": "cordial", + "lastModified": "2024-07-24T07:52:46+0000", + "cID": "633b2fd70a12be027e0b0xxx" + }, + "device": { + "type": "computer", + "device": "Macintosh", + "platform": "OS X", + "browser": "Chrome", + "robot": false + }, + "externalId": [ + { + "id": "633b2fd70a12be027e0b0xxx", + "type": "cordialContactId" + } + ] + }, + "integrations": { + "Cordial": false + }, + "type": "track", + "event": "browse", + "properties": { + "event_id": "66a0b2ce5344b55fxxxc5a64", + "url": "https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart", + "product_item_group_id": ["1094269"], + "product_category": ["allproducts"], + "product_name": ["wtp ab"], + "product_group": ["women"], + "cID": "633b2fd70a12be027e0b0xxx", + "ts": "2024-07-24T07:52:46+00:00", + "ats": "2024-07-24T07:52:39+0000", + "g": { + "countryISO": "PL", + "country": "Poland", + "state": "MZ", + "city": "Warszawa", + "postalCode": "00-686", + "geoLoc": { + "lat": 52.22744369506836, + "lon": 21.009017944335938 + }, + "tz": "Europe/Warsaw" + }, + "a": "browse", + "UID": "471af949fffe749c2ebfxxx950ea73c", + "sp": { + "bid": "cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e" + }, + "tzo": -7, + "rl": "6", + "time": "2024-07-24T07:52:39+0000", + "action": "browse", + "bmID": "", + "first": 0 + }, + "userId": "633b2fd70a12be027e0b0xxx", + "timestamp": "2024-07-24T07:52:46+00:00", + "sentAt": "2024-07-24T07:52:46+00:00", + "originalTimestamp": "2024-07-24T07:52:46+00:00", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + }, + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Cordial" + }, + "traits": { + "userId": "633b2fd12312be027e0b0xxx", + "email": "johndoe1@example.com", + "_id": "633b2fd12312be027e0b0xxx", + "lang_locale": "EN-US", + "channels": { + "email": { + "address": "johndoe1@example.com", + "subscribeStatus": "none" + } + }, + "createdAt": "2022-10-03T18:54:15+0000", + "email_sha256_hash": "f95912b883831eab11612eb9xxxx1e0c9481780ad45770xxx862155531bf61df", + "first_name": "john", + "last_name": "doe", + "lastUpdateSource": "cordial", + "lastModified": "2024-07-24T07:52:46+0000", + "cID": "633b2fd12312be027e0b0xxx" + }, + "device": { + "type": "computer", + "device": "Macintosh", + "platform": "OS X", + "browser": "Chrome", + "robot": false + }, + "externalId": [ + { + "id": "633b2fd12312be027e0b0xxx", + "type": "cordialContactId" + } + ] + }, + "integrations": { + "Cordial": false + }, + "type": "track", + "event": "browse", + "properties": { + "event_id": "66aku0b2ce527b55fx1xc5a64", + "url": "https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart", + "product_item_group_id": ["1094269"], + "product_category": ["allproducts"], + "product_name": ["wtp ab"], + "product_group": ["women"], + "cID": "633b2fd12312be027e0b0xxx", + "ts": "2024-07-24T07:52:46+00:00", + "ats": "2024-07-24T07:52:39+0000", + "g": { + "countryISO": "PL", + "country": "Poland", + "state": "MZ", + "city": "Warszawa", + "postalCode": "00-686", + "geoLoc": { + "lat": 52.22744369506836, + "lon": 21.009017944335938 + }, + "tz": "Europe/Warsaw" + }, + "a": "browse", + "UID": "471af949fffe74sdh382ebfxxx950ea73c", + "sp": { + "bid": "cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e" + }, + "tzo": -7, + "rl": "6", + "time": "2024-07-24T07:52:39+0000", + "action": "browse", + "bmID": "", + "first": 0 + }, + "userId": "633b2fd12312be027e0b0xxx", + "timestamp": "2024-07-24T07:52:46+00:00", + "sentAt": "2024-07-24T07:52:46+00:00", + "originalTimestamp": "2024-07-24T07:52:46+00:00", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_no_cid.json b/go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_no_cid.json new file mode 100644 index 0000000000..5b7f898cb3 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_no_cid.json @@ -0,0 +1,139 @@ +{ + "name": "cordial", + "description": "Simple Single object Input event with no CId", + "input": { + "request": { + "body": { + "contact": { + "_id": "6690fe3655e334xx028xx1", + "channels": { + "email": { + "address": "jondoe@example.com", + "subscribeStatus": "subscribed", + "subscribedAt": "2024-07-12T09:58:14+0000" + } + }, + "createdAt": "2024-07-12T09:58:14+0000", + "address": { + "city": "San Miego" + }, + "first_name": "John", + "last_name": "Doe", + "lastUpdateSource": "api", + "lastModified": "2024-07-12T13:00:49+0000" + }, + "event": { + "_id": "669141857b8cxxx1ba0da2x1", + "ts": "2024-07-12T14:45:25+00:00", + "ats": "2024-07-12T14:45:25+0000", + "d": { + "type": "computer", + "device": false, + "platform": false, + "browser": false, + "robot": true + }, + "a": "browse", + "tzo": -7, + "rl": "a", + "UID": "4934ee07197xx3f74d5xxxx7b0076", + "time": "2024-07-12T14:45:25+0000", + "action": "browse", + "bmID": "", + "first": 0, + "properties": { + "category": "Shirts", + "url": "http://example.com/shirts", + "description": "A really cool khaki shirt.", + "price": 9.99, + "title": "Khaki Shirt", + "test_key": "value" + } + }, + "source": {} + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Cordial" + }, + "traits": { + "userId": "6690fe3655e334xx028xx1", + "email": "jondoe@example.com", + "_id": "6690fe3655e334xx028xx1", + "channels": { + "email": { + "address": "jondoe@example.com", + "subscribeStatus": "subscribed", + "subscribedAt": "2024-07-12T09:58:14+0000" + } + }, + "createdAt": "2024-07-12T09:58:14+0000", + "address": { + "city": "San Miego" + }, + "first_name": "John", + "last_name": "Doe", + "lastUpdateSource": "api", + "lastModified": "2024-07-12T13:00:49+0000" + }, + "device": { + "type": "computer", + "device": false, + "platform": false, + "browser": false, + "robot": true + }, + "externalId": [] + }, + "integrations": { + "Cordial": false + }, + "type": "track", + "event": "browse", + "originalTimestamp": "2024-07-12T14:45:25+00:00", + "properties": { + "event_id": "669141857b8cxxx1ba0da2x1", + "category": "Shirts", + "url": "http://example.com/shirts", + "description": "A really cool khaki shirt.", + "price": 9.99, + "title": "Khaki Shirt", + "test_key": "value", + "ts": "2024-07-12T14:45:25+00:00", + "ats": "2024-07-12T14:45:25+0000", + "a": "browse", + "tzo": -7, + "rl": "a", + "UID": "4934ee07197xx3f74d5xxxx7b0076", + "time": "2024-07-12T14:45:25+0000", + "action": "browse", + "bmID": "", + "first": 0 + }, + "userId": "6690fe3655e334xx028xx1", + "timestamp": "2024-07-12T14:45:25+00:00", + "sentAt": "2024-07-12T14:45:25+00:00", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_normal_channel_and_action.json b/go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_normal_channel_and_action.json new file mode 100644 index 0000000000..72c76816ec --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/cordial/simple_single_object_input_event_with_normal_channel_and_action.json @@ -0,0 +1,134 @@ +{ + "name": "cordial", + "description": "Simple Single object Input event with normal channel and action", + "input": { + "request": { + "body": { + "contact": { + "_id": "6690fe3655e334xx028xxx", + "channels": { + "email": { + "address": "jondoe@example.com", + "subscribeStatus": "subscribed", + "subscribedAt": "2024-07-12T09:58:14+0000" + } + }, + "createdAt": "2024-07-12T09:58:14+0000", + "address": { + "city": "San Miego" + }, + "first_name": "John", + "last_name": "Doe", + "lastUpdateSource": "api", + "lastModified": "2024-07-12T13:00:49+0000", + "cID": "6690fe3655e334xx028xxx" + }, + "event": { + "_id": "669141857b8cxxx1ba0da2xx", + "cID": "6690fe3655e334xx028xxx", + "ts": "2024-07-12T14:45:25+00:00", + "ats": "2024-07-12T14:45:25+0000", + "a": "browse", + "tzo": -7, + "rl": "a", + "UID": "4934ee07118197xx3f74d5xxxx7b0076", + "time": "2024-07-12T14:45:25+0000", + "action": "browse", + "bmID": "", + "first": 0, + "properties": { + "category": "Shirts", + "url": "http://example.com/shirts", + "description": "A really cool khaki shirt.", + "price": 9.99, + "title": "Khaki Shirt", + "test_key": "value" + } + }, + "source": {} + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Cordial" + }, + "traits": { + "userId": "6690fe3655e334xx028xxx", + "email": "jondoe@example.com", + "_id": "6690fe3655e334xx028xxx", + "channels": { + "email": { + "address": "jondoe@example.com", + "subscribeStatus": "subscribed", + "subscribedAt": "2024-07-12T09:58:14+0000" + } + }, + "createdAt": "2024-07-12T09:58:14+0000", + "address": { + "city": "San Miego" + }, + "first_name": "John", + "last_name": "Doe", + "lastUpdateSource": "api", + "lastModified": "2024-07-12T13:00:49+0000", + "cID": "6690fe3655e334xx028xxx" + }, + "externalId": [ + { + "id": "6690fe3655e334xx028xxx", + "type": "cordialContactId" + } + ] + }, + "integrations": { + "Cordial": false + }, + "type": "track", + "event": "browse", + "originalTimestamp": "2024-07-12T14:45:25+00:00", + "properties": { + "event_id": "669141857b8cxxx1ba0da2xx", + "category": "Shirts", + "url": "http://example.com/shirts", + "description": "A really cool khaki shirt.", + "price": 9.99, + "title": "Khaki Shirt", + "test_key": "value", + "cID": "6690fe3655e334xx028xxx", + "ts": "2024-07-12T14:45:25+00:00", + "ats": "2024-07-12T14:45:25+0000", + "a": "browse", + "tzo": -7, + "rl": "a", + "UID": "4934ee07118197xx3f74d5xxxx7b0076", + "time": "2024-07-12T14:45:25+0000", + "action": "browse", + "bmID": "", + "first": 0 + }, + "userId": "6690fe3655e334xx028xxx", + "timestamp": "2024-07-12T14:45:25+00:00", + "sentAt": "2024-07-12T14:45:25+00:00", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_0.json b/go/webhook/testcases/testdata/testcases/customerio/test_0.json new file mode 100644 index 0000000000..3f308c34f0 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_0.json @@ -0,0 +1,59 @@ +{ + "name": "customerio", + "description": "test-0", + "input": { + "request": { + "body": { + "data": { + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "email_address": "test@example.com" + }, + "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ", + "object_type": "customer", + "metric": "subscribed", + "timestamp": "abc" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Customer Subscribed", + "properties": { + "eventId": "01E4C4CT6YDC7Y5M7FE1GWWPQJ" + }, + "userId": "0200102", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_1.json b/go/webhook/testcases/testdata/testcases/customerio/test_1.json new file mode 100644 index 0000000000..aef99f3dac --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_1.json @@ -0,0 +1,59 @@ +{ + "name": "customerio", + "description": "test-1", + "input": { + "request": { + "body": { + "data": { + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "email_address": "test@example.com" + }, + "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ", + "object_type": "customer", + "metric": "subscribed", + "timestamp": "1585250199" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Customer Subscribed", + "properties": { + "eventId": "01E4C4CT6YDC7Y5M7FE1GWWPQJ" + }, + "userId": "0200102", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_10.json b/go/webhook/testcases/testdata/testcases/customerio/test_10.json new file mode 100644 index 0000000000..4bcba90c80 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_10.json @@ -0,0 +1,75 @@ +{ + "name": "customerio", + "description": "test-10", + "input": { + "request": { + "body": { + "data": { + "action_id": 37, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", + "recipients": [ + { + "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof", + "device_platform": "android" + } + ] + }, + "event_id": "01E4C4HDQ7P1X9KTKF0ZX7PWHE", + "object_type": "push", + "metric": "sent", + "timestamp": 1585250350 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Push Sent", + "properties": { + "eventId": "01E4C4HDQ7P1X9KTKF0ZX7PWHE", + "deliveryId": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", + "actionId": 37, + "broadcastId": 9, + "recipients": [ + { + "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof", + "device_platform": "android" + } + ] + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:19:10.000Z", + "sentAt": "2020-03-26T19:19:10.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_11.json b/go/webhook/testcases/testdata/testcases/customerio/test_11.json new file mode 100644 index 0000000000..e6b025578d --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_11.json @@ -0,0 +1,79 @@ +{ + "name": "customerio", + "description": "test-11", + "input": { + "request": { + "body": { + "data": { + "action_id": 37, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", + "href": "ciosas://product/2", + "link_id": 1, + "recipients": [ + { + "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" + } + ] + }, + "event_id": "01E4V2SBHYK4TNTG8WKMP39G9R", + "object_type": "push", + "metric": "clicked", + "timestamp": 1585751829 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Push Link Clicked", + "properties": { + "eventId": "01E4V2SBHYK4TNTG8WKMP39G9R", + "deliveryId": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", + "actionId": 37, + "broadcastId": 9, + "link": { + "url": "ciosas://product/2", + "id": 1 + }, + "recipients": [ + { + "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" + } + ] + }, + "userId": "0200102", + "originalTimestamp": "2020-04-01T14:37:09.000Z", + "sentAt": "2020-04-01T14:37:09.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_12.json b/go/webhook/testcases/testdata/testcases/customerio/test_12.json new file mode 100644 index 0000000000..883df1feb9 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_12.json @@ -0,0 +1,65 @@ +{ + "name": "customerio", + "description": "test-12", + "input": { + "request": { + "body": { + "data": { + "action_id": 41, + "campaign_id": 7, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "ROk1AAIBcR4iT6mueuxiDtzO8HXv", + "failure_message": "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309." + }, + "event_id": "01E4F3DCS83P8HT7R3E6DWQN1X", + "object_type": "sms", + "metric": "attempted", + "timestamp": 1234567890 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "SMS Attempted", + "properties": { + "eventId": "01E4F3DCS83P8HT7R3E6DWQN1X", + "deliveryId": "ROk1AAIBcR4iT6mueuxiDtzO8HXv", + "actionId": 41, + "reason": "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309.", + "campaignId": 7 + }, + "userId": "0200102", + "originalTimestamp": "2009-02-13T23:31:30.000Z", + "sentAt": "2009-02-13T23:31:30.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_13.json b/go/webhook/testcases/testdata/testcases/customerio/test_13.json new file mode 100644 index 0000000000..f50ab7bb95 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_13.json @@ -0,0 +1,73 @@ +{ + "name": "customerio", + "description": "test-13", + "input": { + "request": { + "body": { + "data": { + "action_id": 38, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgIBcRh6qzHz-8gKvscP2UZa", + "href": "https://app.com/verify", + "link_id": 1, + "recipient": "+18008675309" + }, + "event_id": "01E4XXPN42JDF4B1ATQKTZ8WHV", + "object_type": "sms", + "metric": "clicked", + "timestamp": 1585847161 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "+18008675309" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "SMS Link Clicked", + "properties": { + "eventId": "01E4XXPN42JDF4B1ATQKTZ8WHV", + "deliveryId": "RPILAgIBcRh6qzHz-8gKvscP2UZa", + "actionId": 38, + "broadcastId": 9, + "link": { + "url": "https://app.com/verify", + "id": 1 + } + }, + "userId": "0200102", + "originalTimestamp": "2020-04-02T17:06:01.000Z", + "sentAt": "2020-04-02T17:06:01.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_14.json b/go/webhook/testcases/testdata/testcases/customerio/test_14.json new file mode 100644 index 0000000000..f123414e90 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_14.json @@ -0,0 +1,67 @@ +{ + "name": "customerio", + "description": "test-14", + "input": { + "request": { + "body": { + "data": { + "action_id": 39, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgQBcRhNAufb0s30bmz5HD7Y", + "recipient": "#signups" + }, + "event_id": "01E4C4TQKD6KJ274870J5DE2HB", + "object_type": "slack", + "metric": "sent", + "timestamp": 1585250655 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "#signups" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Slack Message Sent", + "properties": { + "eventId": "01E4C4TQKD6KJ274870J5DE2HB", + "deliveryId": "RPILAgQBcRhNAufb0s30bmz5HD7Y", + "actionId": 39, + "broadcastId": 9 + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:24:15.000Z", + "sentAt": "2020-03-26T19:24:15.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_15.json b/go/webhook/testcases/testdata/testcases/customerio/test_15.json new file mode 100644 index 0000000000..192cfe8f97 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_15.json @@ -0,0 +1,73 @@ +{ + "name": "customerio", + "description": "test-15", + "input": { + "request": { + "body": { + "data": { + "action_id": 39, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgQBcRhocpCJE3mFfwvRzNe6", + "href": "http://bing.com", + "link_id": 1, + "recipient": "#signups" + }, + "event_id": "01E4C6HJTBNDX18XC4B88M3Y2G", + "object_type": "slack", + "metric": "clicked", + "timestamp": 1585252451 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "#signups" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Slack Message Link Clicked", + "properties": { + "eventId": "01E4C6HJTBNDX18XC4B88M3Y2G", + "deliveryId": "RPILAgQBcRhocpCJE3mFfwvRzNe6", + "actionId": 39, + "broadcastId": 9, + "link": { + "url": "http://bing.com", + "id": 1 + } + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:54:11.000Z", + "sentAt": "2020-03-26T19:54:11.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_16.json b/go/webhook/testcases/testdata/testcases/customerio/test_16.json new file mode 100644 index 0000000000..c62604cab1 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_16.json @@ -0,0 +1,65 @@ +{ + "name": "customerio", + "description": "test-16", + "input": { + "request": { + "body": { + "data": { + "action_id": 39, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgQBcRhIBqRiZAc0fyQiLvkC", + "failure_message": "value passed for channel was invalid" + }, + "event_id": "01E4C4HDQ77BCN0X23Z3WBE764", + "object_type": "slack", + "metric": "failed", + "timestamp": 1585250350 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Slack Message Failed", + "properties": { + "eventId": "01E4C4HDQ77BCN0X23Z3WBE764", + "deliveryId": "RPILAgQBcRhIBqRiZAc0fyQiLvkC", + "actionId": 39, + "broadcastId": 9, + "reason": "value passed for channel was invalid" + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:19:10.000Z", + "sentAt": "2020-03-26T19:19:10.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_17.json b/go/webhook/testcases/testdata/testcases/customerio/test_17.json new file mode 100644 index 0000000000..3cad7de575 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_17.json @@ -0,0 +1,63 @@ +{ + "name": "customerio", + "description": "test-17", + "input": { + "request": { + "body": { + "data": { + "action_id": 40, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgEBcRhIBqSrYcXDr2ks6Pj9" + }, + "event_id": "01E4C4G1S04QCV1NASF4NWMQNR", + "object_type": "webhook", + "metric": "drafted", + "timestamp": 1585250305 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Webhook Message Drafted", + "properties": { + "eventId": "01E4C4G1S04QCV1NASF4NWMQNR", + "deliveryId": "RPILAgEBcRhIBqSrYcXDr2ks6Pj9", + "actionId": 40, + "broadcastId": 9 + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:18:25.000Z", + "sentAt": "2020-03-26T19:18:25.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_18.json b/go/webhook/testcases/testdata/testcases/customerio/test_18.json new file mode 100644 index 0000000000..b61e3ef31e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_18.json @@ -0,0 +1,65 @@ +{ + "name": "customerio", + "description": "test-18", + "input": { + "request": { + "body": { + "data": { + "action_id": 38, + "broadcast_id": 6, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RAECAQFxNeUBx6LqgjqrN1j-BJc=", + "failure_message": "Variable 'customer.test' is missing" + }, + "event_id": "01E4TYA2KA9T0XGHCRJ784B774", + "object_type": "webhook", + "metric": "attempted", + "timestamp": 1585747134 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Webhook Message Attempted", + "properties": { + "eventId": "01E4TYA2KA9T0XGHCRJ784B774", + "deliveryId": "RAECAQFxNeUBx6LqgjqrN1j-BJc=", + "actionId": 38, + "broadcastId": 6, + "reason": "Variable 'customer.test' is missing" + }, + "userId": "0200102", + "originalTimestamp": "2020-04-01T13:18:54.000Z", + "sentAt": "2020-04-01T13:18:54.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_19.json b/go/webhook/testcases/testdata/testcases/customerio/test_19.json new file mode 100644 index 0000000000..6a5dead233 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_19.json @@ -0,0 +1,67 @@ +{ + "name": "customerio", + "description": "test-19", + "input": { + "request": { + "body": { + "data": { + "action_id": 40, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgEBcRhNAufr2aU82jtDZEh6", + "recipient": "https://test.example.com/process" + }, + "event_id": "01E4C6EP0HCKRHKFARMZ5XEH7A", + "object_type": "webhook", + "metric": "sent", + "timestamp": 1585252357 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "https://test.example.com/process" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Webhook Message Sent", + "properties": { + "eventId": "01E4C6EP0HCKRHKFARMZ5XEH7A", + "deliveryId": "RPILAgEBcRhNAufr2aU82jtDZEh6", + "actionId": 40, + "broadcastId": 9 + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:52:37.000Z", + "sentAt": "2020-03-26T19:52:37.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_2.json b/go/webhook/testcases/testdata/testcases/customerio/test_2.json new file mode 100644 index 0000000000..16bfc11a86 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_2.json @@ -0,0 +1,61 @@ +{ + "name": "customerio", + "description": "test-2", + "input": { + "request": { + "body": { + "data": { + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "email_address": "test@example.com" + }, + "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ", + "object_type": "customer", + "metric": "subscribed", + "timestamp": 1585250199 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Customer Subscribed", + "properties": { + "eventId": "01E4C4CT6YDC7Y5M7FE1GWWPQJ" + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:16:39.000Z", + "sentAt": "2020-03-26T19:16:39.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_20.json b/go/webhook/testcases/testdata/testcases/customerio/test_20.json new file mode 100644 index 0000000000..45e346c553 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_20.json @@ -0,0 +1,73 @@ +{ + "name": "customerio", + "description": "test-20", + "input": { + "request": { + "body": { + "data": { + "action_id": 40, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgEBcRhNAufr2aU82jtDZEh6", + "href": "http://bing.com", + "link_id": 1, + "recipient": "https://test.example.com/process" + }, + "event_id": "01E4C6F5N1Y54TVGJTN64Y1ZS9", + "object_type": "webhook", + "metric": "clicked", + "timestamp": 1585252373 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "https://test.example.com/process" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Webhook Message Link Clicked", + "properties": { + "eventId": "01E4C6F5N1Y54TVGJTN64Y1ZS9", + "deliveryId": "RPILAgEBcRhNAufr2aU82jtDZEh6", + "actionId": 40, + "broadcastId": 9, + "link": { + "url": "http://bing.com", + "id": 1 + } + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:52:53.000Z", + "sentAt": "2020-03-26T19:52:53.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_21.json b/go/webhook/testcases/testdata/testcases/customerio/test_21.json new file mode 100644 index 0000000000..0d7ab767cf --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_21.json @@ -0,0 +1,65 @@ +{ + "name": "customerio", + "description": "test-21", + "input": { + "request": { + "body": { + "data": { + "action_id": 38, + "broadcast_id": 6, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RAECAQFxNeK3bC4SYqhQqFGBQrQ=", + "failure_message": "HTTP 404 Not Found []" + }, + "event_id": "01E4TY5FVB0ZQ4KVDKRME0XSYZ", + "object_type": "webhook", + "metric": "failed", + "timestamp": 1585746984 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Webhook Message Failed", + "properties": { + "eventId": "01E4TY5FVB0ZQ4KVDKRME0XSYZ", + "deliveryId": "RAECAQFxNeK3bC4SYqhQqFGBQrQ=", + "actionId": 38, + "broadcastId": 6, + "reason": "HTTP 404 Not Found []" + }, + "userId": "0200102", + "originalTimestamp": "2020-04-01T13:16:24.000Z", + "sentAt": "2020-04-01T13:16:24.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_22.json b/go/webhook/testcases/testdata/testcases/customerio/test_22.json new file mode 100644 index 0000000000..d68071ef4c --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_22.json @@ -0,0 +1,79 @@ +{ + "name": "customerio", + "description": "test-22", + "input": { + "request": { + "body": { + "data": { + "action_id": 37, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", + "href": "ciosas://product/2", + "link_id": 1, + "recipients": [ + { + "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" + } + ] + }, + "event_id": "01E4V2SBHYK4TNTG8WKMP39G9S", + "object_type": "push", + "metric": "delivered", + "timestamp": 1585751830 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Push Delivered", + "properties": { + "eventId": "01E4V2SBHYK4TNTG8WKMP39G9S", + "deliveryId": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", + "actionId": 37, + "broadcastId": 9, + "link": { + "url": "ciosas://product/2", + "id": 1 + }, + "recipients": [ + { + "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" + } + ] + }, + "userId": "0200102", + "originalTimestamp": "2020-04-01T14:37:10.000Z", + "sentAt": "2020-04-01T14:37:10.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_3.json b/go/webhook/testcases/testdata/testcases/customerio/test_3.json new file mode 100644 index 0000000000..680ab4e55e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_3.json @@ -0,0 +1,61 @@ +{ + "name": "customerio", + "description": "test-3", + "input": { + "request": { + "body": { + "data": { + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "email_address": "test@example.com" + }, + "event_id": "01E4C4C6P79C12J5A6KPE6XNFD", + "object_type": "customer", + "metric": "unsubscribed", + "timestamp": 1585250179 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Customer Unsubscribed", + "properties": { + "eventId": "01E4C4C6P79C12J5A6KPE6XNFD" + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:16:19.000Z", + "sentAt": "2020-03-26T19:16:19.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_4.json b/go/webhook/testcases/testdata/testcases/customerio/test_4.json new file mode 100644 index 0000000000..bc152b34fd --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_4.json @@ -0,0 +1,63 @@ +{ + "name": "customerio", + "description": "test-4", + "input": { + "request": { + "body": { + "data": { + "action_id": 36, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgABcRhIBqSp7kiPekGBIeVh" + }, + "event_id": "01E4C4G1S0AMNG0XVF2M7RPH5S", + "object_type": "email", + "metric": "drafted", + "timestamp": 1585250305 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Email Drafted", + "properties": { + "eventId": "01E4C4G1S0AMNG0XVF2M7RPH5S", + "deliveryId": "RPILAgABcRhIBqSp7kiPekGBIeVh", + "actionId": 36, + "broadcastId": 9 + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T19:18:25.000Z", + "sentAt": "2020-03-26T19:18:25.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_5.json b/go/webhook/testcases/testdata/testcases/customerio/test_5.json new file mode 100644 index 0000000000..c8a0aa084e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_5.json @@ -0,0 +1,71 @@ +{ + "name": "customerio", + "description": "test-5", + "input": { + "request": { + "body": { + "data": { + "content_id": 1146, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=", + "failure_message": "550 5.5.0 Requested action not taken: mailbox unavailable", + "newsletter_id": 736, + "recipient": "test@example.com", + "subject": "Thanks for joining!" + }, + "event_id": "12ASDG7S9P6MAZPTJ78DAND9GDC", + "object_type": "email", + "metric": "bounced", + "timestamp": 1234567890 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Email Bounced", + "properties": { + "eventId": "12ASDG7S9P6MAZPTJ78DAND9GDC", + "deliveryId": "RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=", + "contentId": 1146, + "emailSubject": "Thanks for joining!", + "reason": "550 5.5.0 Requested action not taken: mailbox unavailable", + "newsletterId": 736 + }, + "userId": "0200102", + "originalTimestamp": "2009-02-13T23:31:30.000Z", + "sentAt": "2009-02-13T23:31:30.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_6.json b/go/webhook/testcases/testdata/testcases/customerio/test_6.json new file mode 100644 index 0000000000..0d8ab9190b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_6.json @@ -0,0 +1,75 @@ +{ + "name": "customerio", + "description": "test-6", + "input": { + "request": { + "body": { + "data": { + "action_id": 36, + "broadcast_id": 9, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RPILAgABcRhIBqSp7kiPekGBIeVh", + "href": "http://google.com", + "link_id": 1, + "recipient": "test@example.com", + "subject": "hello" + }, + "event_id": "01E4C8BES5XT87ZWRJFTB35YJ3", + "object_type": "email", + "metric": "clicked", + "timestamp": 1585254348 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Email Link Clicked", + "properties": { + "eventId": "01E4C8BES5XT87ZWRJFTB35YJ3", + "deliveryId": "RPILAgABcRhIBqSp7kiPekGBIeVh", + "actionId": 36, + "broadcastId": 9, + "emailSubject": "hello", + "link": { + "url": "http://google.com", + "id": 1 + } + }, + "userId": "0200102", + "originalTimestamp": "2020-03-26T20:25:48.000Z", + "sentAt": "2020-03-26T20:25:48.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_7.json b/go/webhook/testcases/testdata/testcases/customerio/test_7.json new file mode 100644 index 0000000000..870810f187 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_7.json @@ -0,0 +1,74 @@ +{ + "name": "customerio", + "description": "test-7", + "input": { + "request": { + "body": { + "data": { + "action_id": 42, + "campaign_id": 23, + "content": "Welcome to the club, we are with you.", + "customer_id": "user-123", + "delivery_id": "RAECAAFwnUSneIa0ZXkmq8EdkAM==", + "headers": { + "Custom-Header": ["custom-value"] + }, + "identifiers": { + "id": "user-123" + }, + "recipient": "test@example.com", + "subject": "Thanks for signing up" + }, + "event_id": "01E2EMRMM6TZ12TF9WGZN0WJQT", + "metric": "sent", + "object_type": "email", + "timestamp": 1644227937 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Email Sent", + "properties": { + "eventId": "01E2EMRMM6TZ12TF9WGZN0WJQT", + "deliveryId": "RAECAAFwnUSneIa0ZXkmq8EdkAM==", + "actionId": 42, + "content": "Welcome to the club, we are with you.", + "emailSubject": "Thanks for signing up", + "campaignId": 23 + }, + "userId": "user-123", + "originalTimestamp": "2022-02-07T09:58:57.000Z", + "sentAt": "2022-02-07T09:58:57.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_8.json b/go/webhook/testcases/testdata/testcases/customerio/test_8.json new file mode 100644 index 0000000000..bad7038c6d --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_8.json @@ -0,0 +1,69 @@ +{ + "name": "customerio", + "description": "test-8", + "input": { + "request": { + "body": { + "data": { + "customer_id": "user-123", + "delivery_id": "REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==", + "identifiers": { + "cio_id": "7ef807109981", + "id": "user-123" + }, + "recipient": "test@example.com", + "subject": "Thanks for signing up", + "transactional_message_id": 2 + }, + "event_id": "01ER4R5WB62QWCNREKFB4DYXGR", + "metric": "delivered", + "object_type": "email", + "timestamp": 1675196819 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + }, + "traits": { + "cioId": "7ef807109981", + "email": "test@example.com" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Email Delivered", + "properties": { + "eventId": "01ER4R5WB62QWCNREKFB4DYXGR", + "deliveryId": "REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==", + "emailSubject": "Thanks for signing up", + "transactionalMessageId": 2 + }, + "userId": "user-123", + "originalTimestamp": "2023-01-31T20:26:59.000Z", + "sentAt": "2023-01-31T20:26:59.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/customerio/test_9.json b/go/webhook/testcases/testdata/testcases/customerio/test_9.json new file mode 100644 index 0000000000..0685f3fd3e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/customerio/test_9.json @@ -0,0 +1,65 @@ +{ + "name": "customerio", + "description": "test-9", + "input": { + "request": { + "body": { + "data": { + "action_id": 38, + "campaign_id": 6, + "customer_id": "0200102", + "identifiers": { + "id": "0200102" + }, + "delivery_id": "RAEABQFxN56fWzydfV4_EGvfobI=", + "failure_message": "NoDevicesSynced" + }, + "event_id": "01E4VSX8SZ0T9AQMH4Q16NRB89", + "object_type": "push", + "metric": "attempted", + "timestamp": 1585776075 + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Customer.io" + } + }, + "integrations": { + "Customer.io": false + }, + "type": "track", + "event": "Push Attempted", + "properties": { + "eventId": "01E4VSX8SZ0T9AQMH4Q16NRB89", + "deliveryId": "RAEABQFxN56fWzydfV4_EGvfobI=", + "actionId": 38, + "reason": "NoDevicesSynced", + "campaignId": 6 + }, + "userId": "0200102", + "originalTimestamp": "2020-04-01T21:21:15.000Z", + "sentAt": "2020-04-01T21:21:15.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_false.json b/go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_false.json new file mode 100644 index 0000000000..77a14c0b74 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_false.json @@ -0,0 +1,66 @@ +{ + "name": "formsort", + "description": "when we receive finalized as false", + "input": { + "request": { + "body": { + "answers": { + "yes": true, + "enter_email": "test@user.com", + "enter_name": "2022-11-17", + "yes_or_no": false + }, + "responder_uuid": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", + "flow_label": "new-flow-2022-11-25", + "variant_label": "main", + "variant_uuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea", + "finalized": false, + "created_at": "2022-11-25T14:41:22+00:00" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Formsort" + }, + "page": { + "title": "new-flow-2022-11-25" + }, + "variantLabel": "main", + "variantUuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea" + }, + "integrations": { + "Formsort": false + }, + "type": "track", + "userId": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", + "originalTimestamp": "2022-11-25T14:41:22+00:00", + "properties": { + "yes": true, + "enter_email": "test@user.com", + "enter_name": "2022-11-17", + "yes_or_no": false + }, + "event": "FlowLoaded", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_true.json b/go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_true.json new file mode 100644 index 0000000000..63fe193698 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/formsort/when_we_receive_finalized_as_true.json @@ -0,0 +1,66 @@ +{ + "name": "formsort", + "description": "when we receive finalized as true", + "input": { + "request": { + "body": { + "answers": { + "yes": true, + "enter_email": "test@user.com", + "enter_name": "2022-11-17", + "yes_or_no": false + }, + "responder_uuid": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", + "flow_label": "new-flow-2022-11-25", + "variant_label": "main", + "variant_uuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea", + "finalized": true, + "created_at": "2022-11-25T14:41:22+00:00" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Formsort" + }, + "page": { + "title": "new-flow-2022-11-25" + }, + "variantLabel": "main", + "variantUuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea" + }, + "integrations": { + "Formsort": false + }, + "type": "track", + "userId": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", + "originalTimestamp": "2022-11-25T14:41:22+00:00", + "properties": { + "yes": true, + "enter_email": "test@user.com", + "enter_name": "2022-11-17", + "yes_or_no": false + }, + "event": "FlowFinalized", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/custom_track_call_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/custom_track_call_.json new file mode 100644 index 0000000000..049e995900 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/custom_track_call_.json @@ -0,0 +1,182 @@ +{ + "name": "gainsightpx", + "description": "Custom Track Call ", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "CUSTOM", + "eventId": "df58cbd6-2736-4f8a-ad26-6049eac2e150", + "propertyKey": "AP-EOXPSEZGC5LA-2-1", + "date": 1665656881448, + "sessionId": "AP-EOXPSEZGC5LA-2-1665656622955-48127533", + "globalContext": {}, + "userType": "USER", + "eventName": "Product Clicked", + "attributes": { + "Audience Size": 5000, + "name": "TESTing TRACK CALL FIRST", + "Launched date": 1520532660000, + "Launched": true + }, + "url": "http://127.0.0.1:5501/GPXTEST2.html", + "referrer": "", + "remoteHost": "122.161.66.140" + }, + "configId": "32f07727-d231-4c9d-881e-fb50b80bad63" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "ip": "122.161.66.140", + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-EOXPSEZGC5LA-2-1", + "Audience Size": 5000, + "name": "TESTing TRACK CALL FIRST", + "Launched date": 1520532660000, + "Launched": true, + "ip": "122.161.66.140", + "url": "http://127.0.0.1:5501/GPXTEST2.html" + }, + "userId": "New!", + "category": "CUSTOM", + "event": "Product Clicked", + "sentAt": "2022-10-13T10:28:01.448Z", + "originalTimestamp": "2022-10-13T10:28:01.448Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/engagement_track_call_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/engagement_track_call_.json new file mode 100644 index 0000000000..986c261281 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/engagement_track_call_.json @@ -0,0 +1,186 @@ +{ + "name": "gainsightpx", + "description": "Engagement Track Call ", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "ENGAGEMENT", + "eventId": "6494e73a-976b-4ee5-b8a8-de9effff7e80", + "propertyKey": "AP-N6SV00EVMR1E-2-1", + "date": 1605262539389, + "sessionId": "AP-N6SV00EVMR1E-2-1605262502068-24197555", + "globalContext": { + "role": "Admin" + }, + "userType": "EMPTY_USER_TYPE", + "contentType": "IN_APP_DIALOG", + "engagementId": "83c30d4e-88c3-4054-a0fa-33451a6ea7fc", + "engagementType": "Dialog", + "engagementName": "Release Announcement", + "interaction": "VIEWED", + "stepNumber": 1, + "activation": "Auto", + "executionId": "b633945f-d4a5-404a-ae39-5ced5b542240", + "executionDate": 1605262539389 + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-N6SV00EVMR1E-2-1", + "engagementId": "83c30d4e-88c3-4054-a0fa-33451a6ea7fc", + "contentType": "IN_APP_DIALOG", + "engagementType": "Dialog", + "interaction": "VIEWED", + "globalContext": { + "role": "Admin" + }, + "engagement": { + "stepNumber": 1, + "activation": "Auto" + } + }, + "userId": "New!", + "category": "ENGAGEMENT", + "event": "Release Announcement", + "sentAt": "2020-11-13T10:15:39.389Z", + "originalTimestamp": "2020-11-13T10:15:39.389Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/feature_match_track_call_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/feature_match_track_call_.json new file mode 100644 index 0000000000..a0c5c0dac0 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/feature_match_track_call_.json @@ -0,0 +1,172 @@ +{ + "name": "gainsightpx", + "description": "Feature Match Track Call ", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "FEATURE_MATCH", + "eventId": "ae1e5538-1736-4088-86d1-e90a10ffe901-05951b40-944f-4052-9a4a-51c74683f658", + "propertyKey": "AP-8MF5LPSWUBFW-2-1", + "date": 1665582808376, + "sessionId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", + "globalContext": { + "role": "Admin" + }, + "userType": "USER", + "featureId": "05951b40-944f-4052-9a4a-51c74683f658", + "featureName": "Charts" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-8MF5LPSWUBFW-2-1", + "globalContext": { + "role": "Admin" + }, + "featureId": "05951b40-944f-4052-9a4a-51c74683f658" + }, + "userId": "New!", + "category": "FEATURE_MATCH", + "event": "Charts", + "sentAt": "2022-10-12T13:53:28.376Z", + "originalTimestamp": "2022-10-12T13:53:28.376Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/feedback_track_call_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/feedback_track_call_.json new file mode 100644 index 0000000000..e79d0da018 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/feedback_track_call_.json @@ -0,0 +1,179 @@ +{ + "name": "gainsightpx", + "description": "Feedback Track Call ", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "FEEDBACK", + "eventId": "d007bd76-decb-4a77-8456-d84fb15c6a83", + "propertyKey": "AP-E9VUBBLZ6BIS-2-1", + "date": 1665415753621, + "sessionId": "AP-E9VUBBLZ6BIS-2-1665415678379-45445457", + "globalContext": null, + "userType": "USER", + "subject": "feedback title", + "category": "Labels test", + "description": "feedback body", + "labels": ["492120f5-3573-11ec-bef0-42010a800545"], + "remoteHost": "122.161.66.140", + "source": "Knowledge Center Bot" + }, + "configId": "32f07727-d231-4c9d-881e-fb50b80bad63" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ], + "ip": "122.161.66.140" + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-E9VUBBLZ6BIS-2-1", + "feedback": { + "labels": ["492120f5-3573-11ec-bef0-42010a800545"], + "description": "feedback body", + "subject": "feedback title", + "source": "Knowledge Center Bot" + }, + "ip": "122.161.66.140" + }, + "userId": "New!", + "category": "FEEDBACK", + "event": "Labels test", + "sentAt": "2022-10-10T15:29:13.621Z", + "originalTimestamp": "2022-10-10T15:29:13.621Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/identify_call.json b/go/webhook/testcases/testdata/testcases/gainsightpx/identify_call.json new file mode 100644 index 0000000000..661ec98ba4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/identify_call.json @@ -0,0 +1,160 @@ +{ + "name": "gainsightpx", + "description": "Identify Call", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "SIGN_UP", + "eventId": "1283c08b-f290-4bc4-9deb-75c7867d69ee", + "propertyKey": "AP-EOXPSEZGC5LA-2-1", + "date": 1665582808376, + "sessionId": "AP-EOXPSEZGC5LA-2-1665582441084-16821368", + "globalContext": {}, + "userType": "USER" + }, + "configId": "32f07727-d231-4c9d-881e-fb50b80bad63" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "identify", + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "score": 0, + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "id": "New!", + "country": "India", + "account": { + "id": "IBM", + "name": "International Business Machine", + "numberOfEmployees": 0, + "numberOfUsers": 0 + } + }, + "userId": "New!", + "createdAt": "2022-10-12T13:53:11.753Z", + "originalTimestamp": "2022-10-12T13:53:11.753Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/no_match_track_call_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/no_match_track_call_.json new file mode 100644 index 0000000000..a86f4d886c --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/no_match_track_call_.json @@ -0,0 +1,50 @@ +{ + "name": "gainsightpx", + "description": "No Match Track Call ", + "input": { + "request": { + "body": { + "event": { + "eventType": "Unavailable", + "eventId": "ddb9ca94-beb1-449c-bdcd-b53190f8e784", + "propertyKey": "AP-8MF5LPSWUBFW-2-1", + "date": 1601303075964, + "sessionId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", + "globalContext": { + "role": "Admin" + }, + "userType": "USER", + "segmentId": "e3ab2e48-24f9-4602-ab92-b9f1f4343845", + "segmentName": "Linux User" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Event type Unavailable not supported\n" + }, + "queue": [], + "errQueue": [ + { + "event": { + "eventType": "Unavailable", + "eventId": "ddb9ca94-beb1-449c-bdcd-b53190f8e784", + "propertyKey": "AP-8MF5LPSWUBFW-2-1", + "date": 1601303075964, + "sessionId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", + "globalContext": { + "role": "Admin" + }, + "userType": "USER", + "segmentId": "e3ab2e48-24f9-4602-ab92-b9f1f4343845", + "segmentName": "Linux User" + } + } + ] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/segment_io_s2_s_track_call_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/segment_io_s2_s_track_call_.json new file mode 100644 index 0000000000..bc08b7ab52 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/segment_io_s2_s_track_call_.json @@ -0,0 +1,222 @@ +{ + "name": "gainsightpx", + "description": "SegmentIO S2S Track Call ", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "SEGMENT_IO", + "eventId": "ajs-next-69810a17571dc115ccead5281cc3fb7d", + "propertyKey": "AP-EOXPSEZGC5LA-2-1", + "date": 1666687235178, + "sessionId": "31a524fa-1490-48db-9600-adfb1fa95333", + "globalContext": {}, + "userType": "USER", + "segmentIOEvent": { + "pxPropertyKey": "AP-EOXPSEZGC5LA-2", + "type": "group", + "userId": "1001", + "anonymousId": "a4303a13-eb10-46d8-8935-d787daf1cfbd", + "context": { + "ip": "122.161.67.121", + "library": { + "name": "analytics.js", + "version": "next-1.45.0" + }, + "locale": "en-GB", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", + "page": { + "path": "/abc.html", + "title": "Engage Testing", + "url": "http://127.0.0.1:5501/abc.html" + } + }, + "messageId": "ajs-next-69810a17571dc115ccead5281cc3fb7d", + "receivedAt": "2022-10-25T08:40:35.184Z", + "sentAt": "2022-10-25T08:40:34.809Z", + "timestamp": "2022-10-25T08:40:35.178Z", + "traits": { + "name": "International Business Machine" + }, + "version": 2, + "channel": "client", + "groupId": "IBM" + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-EOXPSEZGC5LA-2-1", + "pxPropertyKey": "AP-EOXPSEZGC5LA-2", + "type": "group", + "userId": "1001", + "anonymousId": "a4303a13-eb10-46d8-8935-d787daf1cfbd", + "context": { + "ip": "122.161.67.121", + "library": { + "name": "analytics.js", + "version": "next-1.45.0" + }, + "locale": "en-GB", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", + "page": { + "path": "/abc.html", + "title": "Engage Testing", + "url": "http://127.0.0.1:5501/abc.html" + } + }, + "messageId": "ajs-next-69810a17571dc115ccead5281cc3fb7d", + "receivedAt": "2022-10-25T08:40:35.184Z", + "sentAt": "2022-10-25T08:40:34.809Z", + "timestamp": "2022-10-25T08:40:35.178Z", + "traits": { + "name": "International Business Machine" + }, + "version": 2, + "channel": "client", + "groupId": "IBM" + }, + "userId": "New!", + "category": "SEGMENT_IO", + "event": "SegmentIO Cloud Server", + "sentAt": "2022-10-25T08:40:35.178Z", + "originalTimestamp": "2022-10-25T08:40:35.178Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/segment_match_track_call_and_no_user_id_and_yes_anonymous_id_as_event_session_id.json b/go/webhook/testcases/testdata/testcases/gainsightpx/segment_match_track_call_and_no_user_id_and_yes_anonymous_id_as_event_session_id.json new file mode 100644 index 0000000000..ad2eb03584 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/segment_match_track_call_and_no_user_id_and_yes_anonymous_id_as_event_session_id.json @@ -0,0 +1,171 @@ +{ + "name": "gainsightpx", + "description": "Segment Match Track Call and no userId and yes anonymousId as event.sessionId", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "SEGMENT", + "eventId": "ddb9ca94-beb1-449c-bdcd-b53190f8e784", + "propertyKey": "AP-8MF5LPSWUBFW-2-1", + "date": 1665582808376, + "sessionId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", + "globalContext": { + "role": "Admin" + }, + "userType": "USER", + "segmentId": "e3ab2e48-24f9-4602-ab92-b9f1f4343845", + "segmentName": "Linux User" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-8MF5LPSWUBFW-2-1", + "globalContext": { + "role": "Admin" + }, + "segmentId": "e3ab2e48-24f9-4602-ab92-b9f1f4343845" + }, + "category": "SEGMENT", + "event": "Linux User", + "sentAt": "2022-10-12T13:53:28.376Z", + "originalTimestamp": "2022-10-12T13:53:28.376Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____multi_question_survey_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____multi_question_survey_.json new file mode 100644 index 0000000000..20612bd56f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____multi_question_survey_.json @@ -0,0 +1,208 @@ +{ + "name": "gainsightpx", + "description": "Survey Track Call -> Multi Question Survey ", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "SURVEY", + "eventId": "c9883e3b-05d4-4f96-8b9c-e2ce10430493", + "propertyKey": "AP-N6SV00EVMR1E-2-1", + "date": 1601303075964, + "sessionId": "AP-N6SV00EVMR1E-2-1605265939566-23853426", + "globalContext": { + "role": "Admin" + }, + "userType": "EMPTY_USER_TYPE", + "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", + "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", + "engagementName": "Quarterly Survey", + "surveyType": "Multi Question", + "interaction": "SINGLE_STEP_SURVEY_RESPONDED", + "score": 0, + "activation": "Auto", + "executionId": "1ad2d383-d1fa-425d-84f0-2a531e17a5d9", + "executionDate": 1605265939965, + "questionType": "Multi choice", + "questionId": "de9e6bf1-351c-46ec-907d-c985bd420c2b", + "questionHtml": "
Favorite travel destinations
", + "questionText": "Favorite travel destinations", + "answers": [ + { + "answerId": "563e2103-2906-4088-869f-bcccd185f288", + "answerHtml": "
Europe
", + "answerText": "Europe" + } + ] + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-N6SV00EVMR1E-2-1", + "globalContext": { + "role": "Admin" + }, + "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", + "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", + "surveyType": "Multi Question", + "interaction": "SINGLE_STEP_SURVEY_RESPONDED", + "survey": { + "activation": "Auto", + "questionType": "Multi choice", + "score": 0, + "questionId": "de9e6bf1-351c-46ec-907d-c985bd420c2b", + "questionHtml": "
Favorite travel destinations
", + "questionText": "Favorite travel destinations", + "answers": [ + { + "answerId": "563e2103-2906-4088-869f-bcccd185f288", + "answerHtml": "
Europe
", + "answerText": "Europe" + } + ] + } + }, + "userId": "New!", + "category": "SURVEY", + "event": "Quarterly Survey", + "sentAt": "2020-09-28T14:24:35.964Z", + "originalTimestamp": "2020-09-28T14:24:35.964Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____nps_.json b/go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____nps_.json new file mode 100644 index 0000000000..8482f26cdc --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/gainsightpx/survey_track_call____nps_.json @@ -0,0 +1,196 @@ +{ + "name": "gainsightpx", + "description": "Survey Track Call -> NPS ", + "input": { + "request": { + "body": { + "user": { + "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", + "identifyId": "New!", + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "lastSeenDate": 1665582808669, + "signUpDate": 1665582791753, + "firstVisitDate": 1665582791753, + "title": "Mr.", + "phone": "", + "score": 0, + "role": "", + "subscriptionId": "", + "accountId": "IBM", + "numberOfVisits": 1, + "location": { + "countryName": "India", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665582808376, + "lastModifiedDate": 1665582808717, + "customAttributes": null, + "globalUnsubscribe": false, + "sfdcContactId": "", + "lastVisitedUserAgentData": null, + "id": "New!", + "lastInferredLocation": null + }, + "account": { + "id": "IBM", + "name": "International Business Machine", + "trackedSubscriptionId": "", + "sfdcId": "", + "lastSeenDate": 1665582808669, + "dunsNumber": "", + "industry": "", + "numberOfEmployees": 0, + "sicCode": "", + "website": "", + "naicsCode": "", + "plan": "", + "location": { + "countryName": "", + "countryCode": "", + "stateName": "", + "stateCode": "", + "city": "", + "street": "", + "postalCode": "", + "continent": "", + "regionName": "", + "timeZone": "", + "coordinates": { + "latitude": 0, + "longitude": 0 + } + }, + "numberOfUsers": 0, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "createDate": 1665578567565, + "lastModifiedDate": 1665582808669, + "customAttributes": null, + "parentGroupId": "" + }, + "event": { + "eventType": "SURVEY", + "eventId": "c9883e3b-05d4-4f96-8b9c-e2ce10430493", + "propertyKey": "AP-N6SV00EVMR1E-2-1", + "date": 1601303075964, + "sessionId": "AP-N6SV00EVMR1E-2-1605265939566-23853426", + "globalContext": { + "role": "Admin" + }, + "userType": "EMPTY_USER_TYPE", + "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", + "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", + "engagementName": "Quarterly Survey", + "surveyType": "Multi Question", + "interaction": "SINGLE_STEP_SURVEY_RESPONDED", + "score": 0, + "scoreType": null, + "stepNumber": null, + "userInput": "I like new features", + "activation": "Auto", + "executionId": "1ad2d383-d1fa-425d-84f0-2a531e17a5d9", + "executionDate": 1605265939965, + "questionType": "Open text question", + "questionHtml": "
\n
\n How was your experience?\n
\n
\n", + "questionText": "How was your experience?" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "GAINSIGHTPX" + }, + "traits": { + "type": "USER", + "gender": "EMPTY_GENDER", + "email": "userEmail@address.com", + "firstName": "test", + "lastName": "rudderlabs", + "title": "Mr.", + "globalUnsubscribe": false, + "accountId": "IBM", + "numberOfVisits": 1, + "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], + "score": 0, + "id": "New!", + "country": "India", + "account": { + "numberOfEmployees": 0, + "numberOfUsers": 0, + "id": "IBM", + "name": "International Business Machine" + } + }, + "externalId": [ + { + "type": "gainsightpxAptrinsicId", + "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" + } + ] + }, + "integrations": { + "GAINSIGHTPX": false + }, + "type": "track", + "properties": { + "propertyKey": "AP-N6SV00EVMR1E-2-1", + "globalContext": { + "role": "Admin" + }, + "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", + "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", + "surveyType": "Multi Question", + "interaction": "SINGLE_STEP_SURVEY_RESPONDED", + "survey": { + "activation": "Auto", + "userInput": "I like new features", + "questionType": "Open text question", + "score": 0, + "questionHtml": "
\n
\n How was your experience?\n
\n
\n", + "questionText": "How was your experience?" + } + }, + "userId": "New!", + "category": "SURVEY", + "event": "Quarterly Survey", + "sentAt": "2020-09-28T14:24:35.964Z", + "originalTimestamp": "2020-09-28T14:24:35.964Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_0.json b/go/webhook/testcases/testdata/testcases/iterable/test_0.json new file mode 100644 index 0000000000..5d0f8813ed --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_0.json @@ -0,0 +1,68 @@ +{ + "name": "iterable", + "description": "test-0", + "input": { + "request": { + "body": { + "email": "test@rudderstack.com", + "eventName": "emailSubscribe", + "dataFields": { + "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", + "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", + "signupSource": "WebForm", + "email": "test@rudderstack.com", + "createdAt": "2022-04-19 03:33:50 +00:00", + "messageTypeIds": [], + "emailListIds": [1589748], + "channelIds": [] + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "test@rudderstack.com" + } + }, + "event": "emailSubscribe", + "integrations": { + "Iterable": false + }, + "properties": { + "channelIds": [], + "createdAt": "2022-04-19 03:33:50 +00:00", + "emailListIds": [1589748], + "messageTypeIds": [], + "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", + "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", + "signupSource": "WebForm" + }, + "receivedAt": "2022-04-19T03:33:50.000Z", + "timestamp": "2022-04-19T03:33:50.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_1.json b/go/webhook/testcases/testdata/testcases/iterable/test_1.json new file mode 100644 index 0000000000..64ad1c7bd4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_1.json @@ -0,0 +1,46 @@ +{ + "name": "iterable", + "description": "test-1", + "input": { + "request": { + "body": { + "eventName": "emailSubscribe", + "dataFields": { + "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", + "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", + "signupSource": "WebForm", + "email": "test@abcd.com", + "createdAt": "2022-04-19 03:33:50 +00:00", + "messageTypeIds": [], + "emailListIds": [1589748], + "channelIds": [] + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Unknwon event type from Iterable\n" + }, + "queue": [], + "errQueue": [ + { + "eventName": "emailSubscribe", + "dataFields": { + "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", + "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", + "signupSource": "WebForm", + "email": "test@abcd.com", + "createdAt": "2022-04-19 03:33:50 +00:00", + "messageTypeIds": [], + "emailListIds": [1589748], + "channelIds": [] + } + } + ] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_10.json b/go/webhook/testcases/testdata/testcases/iterable/test_10.json new file mode 100644 index 0000000000..fd5e4d68c8 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_10.json @@ -0,0 +1,68 @@ +{ + "name": "iterable", + "description": "test-10", + "input": { + "request": { + "body": { + "email": "test@rudderstack.com", + "eventName": "emailSubscribe", + "dataFields": { + "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", + "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", + "signupSource": "WebForm", + "email": "test@abcd.com", + "createdAt": "2022-04-19 03:33:50 +00:00", + "messageTypeIds": [], + "emailListIds": [1589748], + "channelIds": [] + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "test@rudderstack.com" + } + }, + "event": "emailSubscribe", + "integrations": { + "Iterable": false + }, + "properties": { + "channelIds": [], + "createdAt": "2022-04-19 03:33:50 +00:00", + "emailListIds": [1589748], + "messageTypeIds": [], + "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", + "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", + "signupSource": "WebForm" + }, + "receivedAt": "2022-04-19T03:33:50.000Z", + "timestamp": "2022-04-19T03:33:50.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_11.json b/go/webhook/testcases/testdata/testcases/iterable/test_11.json new file mode 100644 index 0000000000..7406688269 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_11.json @@ -0,0 +1,92 @@ +{ + "name": "iterable", + "description": "test-11", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "emailUnSubscribe", + "dataFields": { + "campaignId": 1089024, + "messageId": "bf008db8ab194b65816398c05bf30f99", + "emailId": "c1089024:t1526112:docs@iterable.com", + "workflowName": "My test workflow", + "messageTypeIds": [], + "locale": null, + "templateId": 1526112, + "emailSubject": "Upcoming events!", + "labels": [], + "unsubSource": "EmailLink", + "createdAt": "2020-03-20 23:34:15 +00:00", + "templateName": "My test template", + "emailListIds": [], + "messageTypeId": 31082, + "experimentId": null, + "channelIds": [27447], + "campaignName": "My test campaign", + "workflowId": 76786, + "email": "docs@iterable.com", + "channelId": 27447 + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "emailUnSubscribe", + "integrations": { + "Iterable": false + }, + "properties": { + "campaignId": 1089024, + "messageId": "bf008db8ab194b65816398c05bf30f99", + "emailId": "c1089024:t1526112:docs@iterable.com", + "workflowName": "My test workflow", + "messageTypeIds": [], + "locale": null, + "templateId": 1526112, + "emailSubject": "Upcoming events!", + "labels": [], + "unsubSource": "EmailLink", + "createdAt": "2020-03-20 23:34:15 +00:00", + "templateName": "My test template", + "emailListIds": [], + "messageTypeId": 31082, + "experimentId": null, + "channelIds": [27447], + "campaignName": "My test campaign", + "workflowId": 76786, + "channelId": 27447 + }, + "receivedAt": "2020-03-20T23:34:15.000Z", + "timestamp": "2020-03-20T23:34:15.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_12.json b/go/webhook/testcases/testdata/testcases/iterable/test_12.json new file mode 100644 index 0000000000..faf0aa1c2b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_12.json @@ -0,0 +1,99 @@ +{ + "name": "iterable", + "description": "test-12", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "userId": "1", + "eventName": "hostedUnsubscribeClick", + "dataFields": { + "country": "United States", + "city": "San Jose", + "campaignId": 1074721, + "ip": "192.168.0.1", + "userAgentDevice": "Mac", + "messageId": "ceb3d4d929fc406ca93b28a0ef1efff1", + "emailId": "c1074721:t1506266:docs@iterable.com", + "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", + "workflowName": "My workflow", + "locale": null, + "templateId": 1506266, + "emailSubject": "My email subject", + "url": "https://iterable.com", + "labels": [], + "createdAt": "2020-03-21 00:24:08 +00:00", + "templateName": "My email template", + "messageTypeId": 13406, + "experimentId": null, + "region": "CA", + "campaignName": "My email campaign", + "workflowId": 60102, + "email": "docs@iterable.com", + "channelId": 12466 + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "1", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "hostedUnsubscribeClick", + "integrations": { + "Iterable": false + }, + "properties": { + "country": "United States", + "city": "San Jose", + "campaignId": 1074721, + "ip": "192.168.0.1", + "userAgentDevice": "Mac", + "messageId": "ceb3d4d929fc406ca93b28a0ef1efff1", + "emailId": "c1074721:t1506266:docs@iterable.com", + "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", + "workflowName": "My workflow", + "locale": null, + "templateId": 1506266, + "emailSubject": "My email subject", + "url": "https://iterable.com", + "labels": [], + "createdAt": "2020-03-21 00:24:08 +00:00", + "templateName": "My email template", + "messageTypeId": 13406, + "experimentId": null, + "region": "CA", + "campaignName": "My email campaign", + "workflowId": 60102, + "channelId": 12466 + }, + "receivedAt": "2020-03-21T00:24:08.000Z", + "timestamp": "2020-03-21T00:24:08.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_13.json b/go/webhook/testcases/testdata/testcases/iterable/test_13.json new file mode 100644 index 0000000000..1ea97852e1 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_13.json @@ -0,0 +1,58 @@ +{ + "name": "iterable", + "description": "test-13", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "inAppClick", + "dataFields": { + "email": "docs@iterable.com", + "createdAt": "2018-03-27 00:44:40 +00:00", + "campaignId": 269450 + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "inAppClick", + "integrations": { + "Iterable": false + }, + "properties": { + "createdAt": "2018-03-27 00:44:40 +00:00", + "campaignId": 269450 + }, + "receivedAt": "2018-03-27T00:44:40.000Z", + "timestamp": "2018-03-27T00:44:40.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_14.json b/go/webhook/testcases/testdata/testcases/iterable/test_14.json new file mode 100644 index 0000000000..1cda4ea9e8 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_14.json @@ -0,0 +1,58 @@ +{ + "name": "iterable", + "description": "test-14", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "inAppOpen", + "dataFields": { + "email": "docs@iterable.com", + "createdAt": "2018-03-27 00:44:30 +00:00", + "campaignId": 269450 + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "inAppOpen", + "integrations": { + "Iterable": false + }, + "properties": { + "createdAt": "2018-03-27 00:44:30 +00:00", + "campaignId": 269450 + }, + "receivedAt": "2018-03-27T00:44:30.000Z", + "timestamp": "2018-03-27T00:44:30.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_15.json b/go/webhook/testcases/testdata/testcases/iterable/test_15.json new file mode 100644 index 0000000000..34ea6dcd74 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_15.json @@ -0,0 +1,96 @@ +{ + "name": "iterable", + "description": "test-15", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "inAppSend", + "dataFields": { + "messageContext": { + "saveToInbox": false, + "trigger": "immediate" + }, + "campaignId": 732678, + "contentId": 18997, + "messageId": "vA16d48VVi4LQ5hMuZuquKzL0BXTdQJJUMJRjKnL1", + "workflowName": null, + "emailId": "c732678:t1032729:docs@iterable.com", + "locale": null, + "templateId": 1032729, + "inAppBody": "", + "email": "docs@iterable.com", + "createdAt": "2016-12-10 01:00:38 +00:00", + "campaignId": 74768, + "templateId": 113554, + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2203, + "messageTypeId": 2439, + "experimentId": null, + "payload": { + "path": "yourpath/subpath" + }, + "sound": "", + "badge": null, + "contentAvailable": false, + "deeplink": null, + "locale": null + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "pushBounce", + "integrations": { + "Iterable": false + }, + "properties": { + "platformEndpoint": "", + "createdAt": "2016-12-10 01:00:38 +00:00", + "campaignId": 74768, + "templateId": 113554, + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2203, + "messageTypeId": 2439, + "experimentId": null, + "payload": { + "path": "yourpath/subpath" + }, + "sound": "", + "badge": null, + "contentAvailable": false, + "deeplink": null, + "locale": null + }, + "receivedAt": "2016-12-10T01:00:38.000Z", + "timestamp": "2016-12-10T01:00:38.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_18.json b/go/webhook/testcases/testdata/testcases/iterable/test_18.json new file mode 100644 index 0000000000..f407de768b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_18.json @@ -0,0 +1,94 @@ +{ + "name": "iterable", + "description": "test-18", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "pushOpen", + "dataFields": { + "appAlreadyRunning": false, + "email": "docs@iterable.com", + "createdAt": "2016-12-08 01:25:22 +00:00", + "campaignId": 74768, + "templateId": 113554, + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2203, + "messageTypeId": 2439, + "experimentId": null, + "payload": { + "path": "shop_home" + }, + "sound": null, + "badge": null, + "contentAvailable": false, + "deeplink": null, + "locale": null + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "pushOpen", + "integrations": { + "Iterable": false + }, + "properties": { + "appAlreadyRunning": false, + "createdAt": "2016-12-08 01:25:22 +00:00", + "campaignId": 74768, + "templateId": 113554, + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2203, + "messageTypeId": 2439, + "experimentId": null, + "payload": { + "path": "shop_home" + }, + "sound": null, + "badge": null, + "contentAvailable": false, + "deeplink": null, + "locale": null + }, + "receivedAt": "2016-12-08T01:25:22.000Z", + "timestamp": "2016-12-08T01:25:22.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_19.json b/go/webhook/testcases/testdata/testcases/iterable/test_19.json new file mode 100644 index 0000000000..f55268e5fc --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_19.json @@ -0,0 +1,98 @@ +{ + "name": "iterable", + "description": "test-19", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "pushSend", + "dataFields": { + "contentId": 6724, + "platformEndpoint": "", + "email": "docs@iterable.com", + "createdAt": "2016-12-08 00:53:11 +00:00", + "campaignId": 74758, + "templateId": 113541, + "messageId": "73f2d3f13cd04db0b56c6143b179adc5", + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 1744, + "messageTypeId": 1759, + "experimentId": null, + "payload": { + "a": "2" + }, + "sound": "", + "badge": "", + "contentAvailable": false, + "deeplink": null, + "locale": null + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "pushSend", + "integrations": { + "Iterable": false + }, + "properties": { + "contentId": 6724, + "platformEndpoint": "", + "createdAt": "2016-12-08 00:53:11 +00:00", + "campaignId": 74758, + "templateId": 113541, + "messageId": "73f2d3f13cd04db0b56c6143b179adc5", + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 1744, + "messageTypeId": 1759, + "experimentId": null, + "payload": { + "a": "2" + }, + "sound": "", + "badge": "", + "contentAvailable": false, + "deeplink": null, + "locale": null + }, + "receivedAt": "2016-12-08T00:53:11.000Z", + "timestamp": "2016-12-08T00:53:11.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_2.json b/go/webhook/testcases/testdata/testcases/iterable/test_2.json new file mode 100644 index 0000000000..55ab1f9abe --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_2.json @@ -0,0 +1,42 @@ +{ + "name": "iterable", + "description": "test-2", + "input": { + "request": { + "body": { + "email": "test@ruddstack.com", + "eventTitle": "smsReceived", + "dataFields": { + "fromPhoneNumber": "+16503926753", + "toPhoneNumber": "+14155824541", + "smsMessage": "Message text", + "email": "docs@iterable.com", + "createdAt": "2016-12-05 22:51:25 +00:00" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Unknwon event type from Iterable\n" + }, + "queue": [], + "errQueue": [ + { + "email": "test@ruddstack.com", + "eventTitle": "smsReceived", + "dataFields": { + "fromPhoneNumber": "+16503926753", + "toPhoneNumber": "+14155824541", + "smsMessage": "Message text", + "email": "docs@iterable.com", + "createdAt": "2016-12-05 22:51:25 +00:00" + } + } + ] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_20.json b/go/webhook/testcases/testdata/testcases/iterable/test_20.json new file mode 100644 index 0000000000..6b323852bc --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_20.json @@ -0,0 +1,62 @@ +{ + "name": "iterable", + "description": "test-20", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "pushSendSkip", + "dataFields": { + "createdAt": "2019-08-07 22:28:51 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 732667, + "messageId": "8306ae0c74324635b7554947c5ec0e56", + "email": "docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "pushSendSkip", + "integrations": { + "Iterable": false + }, + "properties": { + "createdAt": "2019-08-07 22:28:51 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 732667, + "messageId": "8306ae0c74324635b7554947c5ec0e56" + }, + "receivedAt": "2019-08-07T22:28:51.000Z", + "timestamp": "2019-08-07T22:28:51.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_21.json b/go/webhook/testcases/testdata/testcases/iterable/test_21.json new file mode 100644 index 0000000000..8dee1d695a --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_21.json @@ -0,0 +1,98 @@ +{ + "name": "iterable", + "description": "test-21", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "pushUninstall", + "dataFields": { + "isGhostPush": false, + "platformEndpoint": "", + "email": "docs@iterable.com", + "createdAt": "2016-12-09 20:50:54 +00:00", + "campaignId": 74768, + "templateId": 113554, + "messageId": "73f2d3f13cd04db0b56c6143b179adc5", + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2203, + "messageTypeId": 2439, + "experimentId": null, + "payload": { + "path": "your_folder/30" + }, + "sound": "", + "badge": null, + "contentAvailable": false, + "deeplink": null, + "locale": null + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "pushUninstall", + "integrations": { + "Iterable": false + }, + "properties": { + "isGhostPush": false, + "platformEndpoint": "", + "createdAt": "2016-12-09 20:50:54 +00:00", + "campaignId": 74768, + "templateId": 113554, + "messageId": "73f2d3f13cd04db0b56c6143b179adc5", + "pushMessage": "Push message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2203, + "messageTypeId": 2439, + "experimentId": null, + "payload": { + "path": "your_folder/30" + }, + "sound": "", + "badge": null, + "contentAvailable": false, + "deeplink": null, + "locale": null + }, + "receivedAt": "2016-12-09T20:50:54.000Z", + "timestamp": "2016-12-09T20:50:54.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_22.json b/go/webhook/testcases/testdata/testcases/iterable/test_22.json new file mode 100644 index 0000000000..7e517aadcb --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_22.json @@ -0,0 +1,96 @@ +{ + "name": "iterable", + "description": "test-22", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "smsBounce", + "dataFields": { + "smsProviderResponse": { + "status": 404, + "message": "The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found", + "code": 20404, + "more_info": "https://www.twilio.com/docs/errors/20404" + }, + "email": "docs@iterable.com", + "createdAt": "2016-12-05 22:43:24 +00:00", + "campaignId": 74003, + "templateId": 112561, + "smsMessage": "Here is example message, please respond with 'received'", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 4270, + "messageTypeId": 4769, + "experimentId": null, + "fromPhoneNumberId": 268, + "imageUrl": null, + "locale": null, + "emailId": "c74003:t112561:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "smsBounce", + "integrations": { + "Iterable": false + }, + "properties": { + "smsProviderResponse": { + "status": 404, + "message": "The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found", + "code": 20404, + "more_info": "https://www.twilio.com/docs/errors/20404" + }, + "createdAt": "2016-12-05 22:43:24 +00:00", + "campaignId": 74003, + "templateId": 112561, + "smsMessage": "Here is example message, please respond with 'received'", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 4270, + "messageTypeId": 4769, + "experimentId": null, + "fromPhoneNumberId": 268, + "imageUrl": null, + "locale": null, + "emailId": "c74003:t112561:docs@iterable.com" + }, + "receivedAt": "2016-12-05T22:43:24.000Z", + "timestamp": "2016-12-05T22:43:24.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_23.json b/go/webhook/testcases/testdata/testcases/iterable/test_23.json new file mode 100644 index 0000000000..760c3cb3e0 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_23.json @@ -0,0 +1,90 @@ +{ + "name": "iterable", + "description": "test-23", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "smsClick", + "dataFields": { + "campaignId": 1234567, + "campaignName": "My test campaign", + "workflowId": null, + "workflowName": null, + "templateName": "My template", + "locale": null, + "channelId": 98765, + "messageTypeId": 43210, + "experimentId": null, + "labels": [], + "smsMessage": "Test SMS! https://www.example.com", + "fromPhoneNumberId": 1234, + "imageUrl": null, + "clickedUrl": "https://www.example.com", + "email": "docs@iterable.com", + "createdAt": "2022-03-10 05:00:14 +00:00", + "templateId": 1112222, + "messageId": "ebd8f3cfc1f74353b423c5e0f3dd8b39", + "emailId": "c1234567:t9876543:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "smsClick", + "integrations": { + "Iterable": false + }, + "properties": { + "campaignId": 1234567, + "campaignName": "My test campaign", + "workflowId": null, + "workflowName": null, + "templateName": "My template", + "locale": null, + "channelId": 98765, + "messageTypeId": 43210, + "experimentId": null, + "labels": [], + "smsMessage": "Test SMS! https://www.example.com", + "fromPhoneNumberId": 1234, + "imageUrl": null, + "clickedUrl": "https://www.example.com", + "createdAt": "2022-03-10 05:00:14 +00:00", + "templateId": 1112222, + "messageId": "ebd8f3cfc1f74353b423c5e0f3dd8b39", + "emailId": "c1234567:t9876543:docs@iterable.com" + }, + "receivedAt": "2022-03-10T05:00:14.000Z", + "timestamp": "2022-03-10T05:00:14.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_24.json b/go/webhook/testcases/testdata/testcases/iterable/test_24.json new file mode 100644 index 0000000000..635ac0fd4f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_24.json @@ -0,0 +1,62 @@ +{ + "name": "iterable", + "description": "test-24", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "smsReceived", + "dataFields": { + "fromPhoneNumber": "+16503926753", + "toPhoneNumber": "+14155824541", + "smsMessage": "Message text", + "email": "docs@iterable.com", + "createdAt": "2016-12-05 22:51:25 +00:00" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "smsReceived", + "integrations": { + "Iterable": false + }, + "properties": { + "fromPhoneNumber": "+16503926753", + "toPhoneNumber": "+14155824541", + "smsMessage": "Message text", + "createdAt": "2016-12-05 22:51:25 +00:00" + }, + "receivedAt": "2016-12-05T22:51:25.000Z", + "timestamp": "2016-12-05T22:51:25.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_25.json b/go/webhook/testcases/testdata/testcases/iterable/test_25.json new file mode 100644 index 0000000000..ce7bec52e5 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_25.json @@ -0,0 +1,90 @@ +{ + "name": "iterable", + "description": "test-25", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "smsSend", + "dataFields": { + "toPhoneNumber": "+16503926753", + "fromSMSSenderId": 258, + "contentId": 2086, + "email": "docs@iterable.com", + "createdAt": "2016-12-05 21:50:32 +00:00", + "campaignId": 73974, + "templateId": 112523, + "smsMessage": "Message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 4270, + "messageTypeId": 4769, + "experimentId": null, + "fromPhoneNumberId": 258, + "imageUrl": null, + "locale": null, + "emailId": "c73974:t112523:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "smsSend", + "integrations": { + "Iterable": false + }, + "properties": { + "toPhoneNumber": "+16503926753", + "fromSMSSenderId": 258, + "contentId": 2086, + "createdAt": "2016-12-05 21:50:32 +00:00", + "campaignId": 73974, + "templateId": 112523, + "smsMessage": "Message text", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 4270, + "messageTypeId": 4769, + "experimentId": null, + "fromPhoneNumberId": 258, + "imageUrl": null, + "locale": null, + "emailId": "c73974:t112523:docs@iterable.com" + }, + "receivedAt": "2016-12-05T21:50:32.000Z", + "timestamp": "2016-12-05T21:50:32.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_26.json b/go/webhook/testcases/testdata/testcases/iterable/test_26.json new file mode 100644 index 0000000000..0089d3ecf2 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_26.json @@ -0,0 +1,62 @@ +{ + "name": "iterable", + "description": "test-26", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "smsSendSkip", + "dataFields": { + "createdAt": "2019-08-07 18:49:48 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 729390, + "messageId": "2c780bf42f26485db0fc6571d2e0f6a0", + "email": "docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "smsSendSkip", + "integrations": { + "Iterable": false + }, + "properties": { + "createdAt": "2019-08-07 18:49:48 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 729390, + "messageId": "2c780bf42f26485db0fc6571d2e0f6a0" + }, + "receivedAt": "2019-08-07T18:49:48.000Z", + "timestamp": "2019-08-07T18:49:48.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_27.json b/go/webhook/testcases/testdata/testcases/iterable/test_27.json new file mode 100644 index 0000000000..1b9b8b8d7f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_27.json @@ -0,0 +1,88 @@ +{ + "name": "iterable", + "description": "test-27", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "emailSend", + "dataFields": { + "contentId": 274222, + "email": "docs@iterable.com", + "createdAt": "2016-12-02 18:51:40 +00:00", + "campaignId": 49313, + "transactionalData": { + "__comment": "transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total." + }, + "templateId": 79190, + "messageId": "210badf49fe54f2591d64ad0d055f4fb", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c49313:t79190:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "emailSend", + "integrations": { + "Iterable": false + }, + "properties": { + "contentId": 274222, + "createdAt": "2016-12-02 18:51:40 +00:00", + "campaignId": 49313, + "transactionalData": { + "__comment": "transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total." + }, + "templateId": 79190, + "messageId": "210badf49fe54f2591d64ad0d055f4fb", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c49313:t79190:docs@iterable.com" + }, + "receivedAt": "2016-12-02T18:51:40.000Z", + "timestamp": "2016-12-02T18:51:40.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_28.json b/go/webhook/testcases/testdata/testcases/iterable/test_28.json new file mode 100644 index 0000000000..b66f76aec3 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_28.json @@ -0,0 +1,94 @@ +{ + "name": "iterable", + "description": "test-28", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "webPushSend", + "dataFields": { + "campaignId": 723636, + "browserToken": "cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b", + "contentId": 3681, + "messageId": "af4c726ae76b48c7871b6d0d7760d47c", + "workflowName": "My workflow name", + "emailId": "c723636:t1020396:docs@iterable.com", + "locale": null, + "webPushIcon": null, + "templateId": 1020396, + "labels": [], + "createdAt": "2019-08-07 23:43:02 +00:00", + "templateName": "My template name", + "webPushMessage": "", + "messageTypeId": 9106, + "webPushBody": null, + "experimentId": null, + "webPushClickAction": null, + "campaignName": "My campaign name", + "workflowId": 53505, + "channelId": 8539, + "email": "docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "webPushSend", + "integrations": { + "Iterable": false + }, + "properties": { + "campaignId": 723636, + "browserToken": "cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b", + "contentId": 3681, + "messageId": "af4c726ae76b48c7871b6d0d7760d47c", + "workflowName": "My workflow name", + "emailId": "c723636:t1020396:docs@iterable.com", + "locale": null, + "webPushIcon": null, + "templateId": 1020396, + "labels": [], + "createdAt": "2019-08-07 23:43:02 +00:00", + "templateName": "My template name", + "webPushMessage": "", + "messageTypeId": 9106, + "webPushBody": null, + "experimentId": null, + "webPushClickAction": null, + "campaignName": "My campaign name", + "workflowId": 53505, + "channelId": 8539 + }, + "receivedAt": "2019-08-07T23:43:02.000Z", + "timestamp": "2019-08-07T23:43:02.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_29.json b/go/webhook/testcases/testdata/testcases/iterable/test_29.json new file mode 100644 index 0000000000..e8f0b2498d --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_29.json @@ -0,0 +1,62 @@ +{ + "name": "iterable", + "description": "test-29", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "webPushSendSkip", + "dataFields": { + "createdAt": "2019-08-07 23:43:48 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 723636, + "messageId": "4238c918b20a41dfbe9a910275b76f12", + "email": "docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "webPushSendSkip", + "integrations": { + "Iterable": false + }, + "properties": { + "createdAt": "2019-08-07 23:43:48 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 723636, + "messageId": "4238c918b20a41dfbe9a910275b76f12" + }, + "receivedAt": "2019-08-07T23:43:48.000Z", + "timestamp": "2019-08-07T23:43:48.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_3.json b/go/webhook/testcases/testdata/testcases/iterable/test_3.json new file mode 100644 index 0000000000..b575206541 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_3.json @@ -0,0 +1,48 @@ +{ + "name": "iterable", + "description": "test-3", + "input": { + "request": { + "body": { + "email": "test@rudderstack.com", + "eventName": "inAppSendSkip" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "test@rudderstack.com" + } + }, + "event": "inAppSendSkip", + "integrations": { + "Iterable": false + }, + "type": "track", + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_4.json b/go/webhook/testcases/testdata/testcases/iterable/test_4.json new file mode 100644 index 0000000000..bf99d104d0 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_4.json @@ -0,0 +1,82 @@ +{ + "name": "iterable", + "description": "test-4", + "input": { + "request": { + "body": { + "email": "test@rudderstack.com", + "eventName": "emailSend", + "dataFields": { + "contentId": 331201, + "email": "test@rudderstack.com", + "createdAt": "2016-12-02 20:21:04 +00:00", + "campaignId": 59667, + "templateId": 93849, + "messageId": "d0aa7801f91f4824997a631f3ed583c3", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c59667:t93849:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "test@rudderstack.com" + } + }, + "event": "emailSend", + "integrations": { + "Iterable": false + }, + "properties": { + "contentId": 331201, + "createdAt": "2016-12-02 20:21:04 +00:00", + "campaignId": 59667, + "templateId": 93849, + "messageId": "d0aa7801f91f4824997a631f3ed583c3", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c59667:t93849:docs@iterable.com" + }, + "receivedAt": "2016-12-02T20:21:04.000Z", + "timestamp": "2016-12-02T20:21:04.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_5.json b/go/webhook/testcases/testdata/testcases/iterable/test_5.json new file mode 100644 index 0000000000..71396c46be --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_5.json @@ -0,0 +1,82 @@ +{ + "name": "iterable", + "description": "test-5", + "input": { + "request": { + "body": { + "email": "invalid_email@iterable.com", + "eventName": "emailBounce", + "dataFields": { + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2598, + "messageTypeId": 2870, + "experimentId": null, + "recipientState": "HardBounce", + "templateId": 167484, + "email": "invalid_email@iterable.com", + "createdAt": "2017-05-15 23:59:47 +00:00", + "campaignId": 114746, + "messageId": "d0aa7801f91f4824997a631f3ed583c3", + "emailId": "c114746:t167484:invalid_email@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "b053765f5d0d23b0d5e4dd960be9513f", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "invalid_email@iterable.com" + } + }, + "event": "emailBounce", + "integrations": { + "Iterable": false + }, + "properties": { + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 2598, + "messageTypeId": 2870, + "experimentId": null, + "recipientState": "HardBounce", + "templateId": 167484, + "createdAt": "2017-05-15 23:59:47 +00:00", + "campaignId": 114746, + "messageId": "d0aa7801f91f4824997a631f3ed583c3", + "emailId": "c114746:t167484:invalid_email@iterable.com" + }, + "receivedAt": "2017-05-15T23:59:47.000Z", + "timestamp": "2017-05-15T23:59:47.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_6.json b/go/webhook/testcases/testdata/testcases/iterable/test_6.json new file mode 100644 index 0000000000..a676b2c342 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_6.json @@ -0,0 +1,98 @@ +{ + "name": "iterable", + "description": "test-6", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "emailClick", + "dataFields": { + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36", + "ip": "162.245.22.184", + "templateId": 93849, + "userAgentDevice": "Mac", + "url": "https://www.iterable.com", + "canonicalUrlId": "3145668988", + "city": "San Francisco", + "region": "CA", + "email": "docs@iterable.com", + "createdAt": "2016-12-02 20:31:39 +00:00", + "campaignId": 59667, + "messageId": "d0aa7801f91f4824997a631f3ed583c3", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "linkUrl": "https://www.iterable.com", + "linkId": "3145668988", + "emailId": "c59667:t93849:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "emailClick", + "integrations": { + "Iterable": false + }, + "properties": { + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36", + "ip": "162.245.22.184", + "templateId": 93849, + "userAgentDevice": "Mac", + "url": "https://www.iterable.com", + "canonicalUrlId": "3145668988", + "city": "San Francisco", + "region": "CA", + "createdAt": "2016-12-02 20:31:39 +00:00", + "campaignId": 59667, + "messageId": "d0aa7801f91f4824997a631f3ed583c3", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "linkUrl": "https://www.iterable.com", + "linkId": "3145668988", + "emailId": "c59667:t93849:docs@iterable.com" + }, + "receivedAt": "2016-12-02T20:31:39.000Z", + "timestamp": "2016-12-02T20:31:39.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_7.json b/go/webhook/testcases/testdata/testcases/iterable/test_7.json new file mode 100644 index 0000000000..b07112dcee --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_7.json @@ -0,0 +1,82 @@ +{ + "name": "iterable", + "description": "test-7", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "emailComplaint", + "dataFields": { + "recipientState": "Complaint", + "templateId": 79190, + "email": "docs@iterable.com", + "createdAt": "2016-12-09 18:52:19 +00:00", + "campaignId": 49313, + "messageId": "d3c44d47b4994306b4db8d16a94db025", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "test template", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c49313:t79190:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "emailComplaint", + "integrations": { + "Iterable": false + }, + "properties": { + "recipientState": "Complaint", + "templateId": 79190, + "createdAt": "2016-12-09 18:52:19 +00:00", + "campaignId": 49313, + "messageId": "d3c44d47b4994306b4db8d16a94db025", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "test template", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c49313:t79190:docs@iterable.com" + }, + "receivedAt": "2016-12-09T18:52:19.000Z", + "timestamp": "2016-12-09T18:52:19.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_8.json b/go/webhook/testcases/testdata/testcases/iterable/test_8.json new file mode 100644 index 0000000000..11f700b740 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_8.json @@ -0,0 +1,88 @@ +{ + "name": "iterable", + "description": "test-8", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "emailOpen", + "dataFields": { + "userAgent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", + "proxySource": "Gmail", + "ip": "66.249.84.204", + "templateId": 79190, + "device": "Gmail", + "email": "docs@iterable.com", + "createdAt": "2016-12-02 18:51:45 +00:00", + "campaignId": 49313, + "messageId": "210badf49fe54f2591d64ad0d055f4fb", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c49313:t79190:docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "emailOpen", + "integrations": { + "Iterable": false + }, + "properties": { + "userAgent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", + "proxySource": "Gmail", + "ip": "66.249.84.204", + "templateId": 79190, + "device": "Gmail", + "createdAt": "2016-12-02 18:51:45 +00:00", + "campaignId": 49313, + "messageId": "210badf49fe54f2591d64ad0d055f4fb", + "emailSubject": "My subject", + "campaignName": "My campaign name", + "workflowId": null, + "workflowName": null, + "templateName": "My template name", + "channelId": 3420, + "messageTypeId": 3866, + "experimentId": null, + "emailId": "c49313:t79190:docs@iterable.com" + }, + "receivedAt": "2016-12-02T18:51:45.000Z", + "timestamp": "2016-12-02T18:51:45.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/iterable/test_9.json b/go/webhook/testcases/testdata/testcases/iterable/test_9.json new file mode 100644 index 0000000000..5a9331cbe7 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/iterable/test_9.json @@ -0,0 +1,62 @@ +{ + "name": "iterable", + "description": "test-9", + "input": { + "request": { + "body": { + "email": "docs@iterable.com", + "eventName": "emailSendSkip", + "dataFields": { + "createdAt": "2019-08-07 18:56:10 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 721398, + "messageId": "98430abe1b9842c991ce221010121553", + "email": "docs@iterable.com" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "0e13848b1c7e27eb5d88c5d35b70783e", + "context": { + "integration": { + "name": "Iterable", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "docs@iterable.com" + } + }, + "event": "emailSendSkip", + "integrations": { + "Iterable": false + }, + "properties": { + "createdAt": "2019-08-07 18:56:10 +00:00", + "reason": "DuplicateMarketingMessage", + "campaignId": 721398, + "messageId": "98430abe1b9842c991ce221010121553" + }, + "receivedAt": "2019-08-07T18:56:10.000Z", + "timestamp": "2019-08-07T18:56:10.000Z", + "type": "track", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event.json b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event.json new file mode 100644 index 0000000000..81c569e82b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event.json @@ -0,0 +1,68 @@ +{ + "name": "mailjet", + "description": "MailJet email bounce event", + "input": { + "request": { + "body": { + "event": "bounce", + "time": 1664444170, + "MessageID": 56013522696710744, + "Message_GUID": "dbe4f0a3-4a5a-4784-a724-a9794d3c0444", + "email": "test@rudderstack.com", + "mj_campaign_id": 108892, + "mj_contact_id": 373142182, + "customcampaign": "mj.nl=58486", + "blocked": false, + "hard_bounce": false, + "error_related_to": "system", + "error": "connection issue" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "MailJet" + }, + "traits": { + "email": "test@rudderstack.com" + }, + "externalId": [ + { + "type": "mailjetContactId", + "id": 373142182 + } + ] + }, + "integrations": { + "MailJet": false + }, + "type": "track", + "event": "bounce", + "properties": { + "customcampaign": "mj.nl=58486", + "mj_campaign_id": 108892 + }, + "originalTimestamp": "2022-09-29T09:36:10.000Z", + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event_where_input_event_is_of_type_.json b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event_where_input_event_is_of_type_.json new file mode 100644 index 0000000000..95e9781a8b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_bounce_event_where_input_event_is_of_type_.json @@ -0,0 +1,68 @@ +{ + "name": "mailjet", + "description": "MailJet email bounce event where input event is of type ", + "input": { + "request": { + "body": { + "event": "bounce", + "time": 1664444171, + "MessageID": 55169098999352350, + "Message_GUID": "447d7eab-3335-4aba-9a51-09454bc14b81", + "email": "test@rudderstack.com", + "mj_campaign_id": 108892, + "mj_contact_id": 373142816, + "customcampaign": "mj.nl=58486", + "blocked": false, + "hard_bounce": false, + "error_related_to": "system", + "error": "connection issue" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "MailJet" + }, + "traits": { + "email": "test@rudderstack.com" + }, + "externalId": [ + { + "type": "mailjetContactId", + "id": 373142816 + } + ] + }, + "integrations": { + "MailJet": false + }, + "type": "track", + "event": "bounce", + "properties": { + "customcampaign": "mj.nl=58486", + "mj_campaign_id": 108892 + }, + "originalTimestamp": "2022-09-29T09:36:11.000Z", + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_open_event.json b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_open_event.json new file mode 100644 index 0000000000..41a6e76edc --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_open_event.json @@ -0,0 +1,73 @@ +{ + "name": "mailjet", + "description": "MailJet email open event", + "input": { + "request": { + "body": { + "event": "open", + "time": 1664443614, + "MessageID": 94857068804950690, + "Message_GUID": "54d6cdec-f659-4547-8926-13d9c4126b82", + "email": "test@rudderstack.com", + "mj_campaign_id": 108760, + "mj_contact_id": 399962859, + "customcampaign": "mj.nl=58424", + "ip": "66.249.84.231", + "geo": "US", + "agent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", + "CustomID": "", + "Payload": "" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "MailJet" + }, + "traits": { + "email": "test@rudderstack.com" + }, + "ip": "66.249.84.231", + "userAgent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", + "externalId": [ + { + "type": "mailjetContactId", + "id": 399962859 + } + ] + }, + "integrations": { + "MailJet": false + }, + "type": "track", + "event": "open", + "properties": { + "ip": "66.249.84.231", + "customcampaign": "mj.nl=58424", + "mj_campaign_id": 108760, + "Payload": "" + }, + "originalTimestamp": "2022-09-29T09:26:54.000Z", + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_sent_event.json b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_sent_event.json new file mode 100644 index 0000000000..af2fc8dea1 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_email_sent_event.json @@ -0,0 +1,65 @@ +{ + "name": "mailjet", + "description": "MailJet email sent event", + "input": { + "request": { + "body": { + "event": "sent", + "time": 1664444171, + "MessageID": 92886743924596480, + "Message_GUID": "0230c73a-2b77-4aea-8ef2-ed15d0edc5fd", + "email": "test@rudderstack.com", + "mj_campaign_id": 108892, + "mj_contact_id": 372651182, + "customcampaign": "mj.nl=58486", + "smtp_reply": "250 2.0.0 OK DMARC:Quarantine 1664444171 u17-20020adfdd51000000b0022cc3f2bf13si3225188wrm.271 - gsmtp" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "MailJet" + }, + "traits": { + "email": "test@rudderstack.com" + }, + "externalId": [ + { + "type": "mailjetContactId", + "id": 372651182 + } + ] + }, + "integrations": { + "MailJet": false + }, + "type": "track", + "event": "sent", + "properties": { + "customcampaign": "mj.nl=58486", + "mj_campaign_id": 108892 + }, + "originalTimestamp": "2022-09-29T09:36:11.000Z", + "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_multiple_payloads_in_single_request.json b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_multiple_payloads_in_single_request.json new file mode 100644 index 0000000000..f7b8993e32 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_multiple_payloads_in_single_request.json @@ -0,0 +1,132 @@ +{ + "name": "mailjet", + "description": "MailJet Multiple payloads in single request", + "input": { + "request": { + "body": [ + { + "event": "open", + "time": 1704458040, + "MessageID": 987654, + "Message_GUID": "876r-oihugyf-7tfygh", + "email": "abc@r.com", + "mj_campaign_id": 321, + "mj_contact_id": 123, + "customcampaign": "test_campaign", + "url": "https://www.example.com/", + "ip": "ip_info", + "geo": "some geo info", + "agent": "mailjet api test" + }, + { + "event": "click", + "time": 1704458041, + "MessageID": 12345234567, + "Message_GUID": "12345-kjhgfd-2efv", + "email": "abc@r.com", + "mj_campaign_id": 12, + "mj_contact_id": 32532, + "customcampaign": "test_campaign", + "url": "https://www.example.com/", + "ip": "ip_info", + "geo": "some geo info", + "agent": "mailjet api test" + } + ], + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "ip": "ip_info", + "integration": { + "name": "MailJet" + }, + "traits": { + "email": "abc@r.com" + }, + "page": { + "url": "https://www.example.com/" + }, + "userAgent": "mailjet api test", + "externalId": [ + { + "type": "mailjetContactId", + "id": 123 + } + ] + }, + "integrations": { + "MailJet": false + }, + "type": "track", + "event": "open", + "properties": { + "customcampaign": "test_campaign", + "mj_campaign_id": 321, + "ip": "ip_info", + "url": "https://www.example.com/" + }, + "userId": "593a5aff0b445b3b77a6d9676b7ec86e", + "originalTimestamp": "2024-01-05T12:34:00.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + }, + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "page": { + "url": "https://www.example.com/" + }, + "integration": { + "name": "MailJet" + }, + "traits": { + "email": "abc@r.com" + }, + "userAgent": "mailjet api test", + "ip": "ip_info", + "externalId": [ + { + "type": "mailjetContactId", + "id": 32532 + } + ] + }, + "integrations": { + "MailJet": false + }, + "type": "track", + "event": "click", + "properties": { + "customcampaign": "test_campaign", + "mj_campaign_id": 12, + "ip": "ip_info", + "url": "https://www.example.com/" + }, + "userId": "593a5aff0b445b3b77a6d9676b7ec86e", + "originalTimestamp": "2024-01-05T12:34:01.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_when_no_email_is_present.json b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_when_no_email_is_present.json new file mode 100644 index 0000000000..67935f116f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailjet/mail_jet_when_no_email_is_present.json @@ -0,0 +1,64 @@ +{ + "name": "mailjet", + "description": "MailJet when no email is present", + "input": { + "request": { + "body": { + "event": "bounce", + "time": 1664444170, + "MessageID": 56013522696710744, + "Message_GUID": "dbe4f0a3-4a5a-4784-a724-a9794d3c0444", + "mj_campaign_id": 108892, + "mj_contact_id": 373142182, + "customcampaign": "mj.nl=58486", + "blocked": false, + "hard_bounce": false, + "error_related_to": "system", + "error": "connection issue" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "MailJet" + }, + "externalId": [ + { + "type": "mailjetContactId", + "id": 373142182 + } + ] + }, + "integrations": { + "MailJet": false + }, + "type": "track", + "event": "bounce", + "properties": { + "customcampaign": "mj.nl=58486", + "mj_campaign_id": 108892 + }, + "originalTimestamp": "2022-09-29T09:36:10.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + }, + "skip": "FIXME" +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_0.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_0.json new file mode 100644 index 0000000000..cfc80d1a59 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_0.json @@ -0,0 +1,66 @@ +{ + "name": "mailmodo", + "description": "test-0", + "input": { + "request": { + "body": { + "triggerData": { + "data": {}, + "triggerSource": "CsvList", + "email": "gouhgc@mailmodo.com", + "triggerDetails": "file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e", + "userId": "d3775892hvh4f2f-b9d5-e49810eb2cae", + "journeyId": "1a69df39hgvh4e0b-8b5c-73776157aa37", + "eventProperty": {} + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "f43848cce166e51b097cbed2851adc16ed9d4c341928f1c790215c50cefb59b0", + "context": { + "externalId": [ + { + "id": "d3775892hvh4f2f-b9d5-e49810eb2cae", + "type": "mailmodoUserId" + } + ], + "traits": { + "email": "gouhgc@mailmodo.com" + }, + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "CsvList", + "integrations": { + "Mailmodo": false + }, + "properties": { + "triggerData.triggerSource": "CsvList", + "triggerData.triggerDetails": "file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e", + "triggerData.journeyId": "1a69df39hgvh4e0b-8b5c-73776157aa37" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_1.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_1.json new file mode 100644 index 0000000000..969f657e54 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_1.json @@ -0,0 +1,87 @@ +{ + "name": "mailmodo", + "description": "test-1", + "input": { + "request": { + "body": { + "fuuid": "27905", + "next-step-id": "success", + "total-steps": "3", + "responseId": "b9a5d224-cc5a-4e64-9800-5a3db9515fdf", + "recipientEmail": "test.rudderlabs21997@gmail.com", + "formId": "formosztd5", + "recordedAt": { + "ts": 1662695704, + "date": "2022-09-09", + "hour": 9, + "minute": 25 + }, + "submissionSource": "amp", + "elementjbtz42": "Everything ", + "element8jzo13": ["Reliable", "High Quality", "Useful"], + "recipientData": { + "email": "test.rudderlabs21997@gmail.com" + }, + "recommend": "9", + "liking": "upvote", + "satisfaction": "4", + "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", + "campaignName": "Campaign-testing" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "a80b34ec43ca959c7b8e5116ac626c3cf8561f62616e000a01729a8a900cc0a0", + "context": { + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "test.rudderlabs21997@gmail.com" + } + }, + "event": "Form Submitted", + "integrations": { + "Mailmodo": false + }, + "originalTimestamp": "2022-09-09T03:55:04.000Z", + "properties": { + "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", + "campaignName": "Campaign-testing", + "element8jzo13[0]": "Reliable", + "element8jzo13[1]": "High Quality", + "element8jzo13[2]": "Useful", + "elementjbtz42": "Everything ", + "formId": "formosztd5", + "fuuid": "27905", + "liking": "upvote", + "next-step-id": "success", + "recommend": "9", + "responseId": "b9a5d224-cc5a-4e64-9800-5a3db9515fdf", + "satisfaction": "4", + "submissionSource": "amp", + "total-steps": "3" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_2.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_2.json new file mode 100644 index 0000000000..67a40cc4b4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_2.json @@ -0,0 +1,64 @@ +{ + "name": "mailmodo", + "description": "test-2", + "input": { + "request": { + "body": { + "triggerData": { + "data": {}, + "triggerSource": "Manual Add To List", + "email": "gou****@mailmodo.com", + "userId": "d3775892-****-4f2f-b9d5-e49810eb2cae", + "journeyId": "349e986e-f56c-****-bc3b-b5f13c3e34da", + "eventProperty": {} + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", + "context": { + "externalId": [ + { + "id": "d3775892-****-4f2f-b9d5-e49810eb2cae", + "type": "mailmodoUserId" + } + ], + "traits": { + "email": "gou****@mailmodo.com" + }, + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "Manual Add To List", + "integrations": { + "Mailmodo": false + }, + "properties": { + "triggerData.triggerSource": "Manual Add To List", + "triggerData.journeyId": "349e986e-f56c-****-bc3b-b5f13c3e34da" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_3.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_3.json new file mode 100644 index 0000000000..c8fc230de0 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_3.json @@ -0,0 +1,64 @@ +{ + "name": "mailmodo", + "description": "test-3", + "input": { + "request": { + "body": { + "triggerData": { + "data": {}, + "triggerSource": "Dashboard-change in property: first_name", + "email": "gou****@mailmodo.com", + "userId": "cc56708d-****-****-8c07-a4bfa5a7b79b", + "journeyId": "a78d7221-de34-47d8-81c6-5ad70cf4ee38", + "eventProperty": {} + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", + "context": { + "externalId": [ + { + "id": "cc56708d-****-****-8c07-a4bfa5a7b79b", + "type": "mailmodoUserId" + } + ], + "traits": { + "email": "gou****@mailmodo.com" + }, + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "Dashboard-change in property: first_name", + "integrations": { + "Mailmodo": false + }, + "properties": { + "triggerData.triggerSource": "Dashboard-change in property: first_name", + "triggerData.journeyId": "a78d7221-de34-47d8-81c6-5ad70cf4ee38" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_4.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_4.json new file mode 100644 index 0000000000..588e7c6da8 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_4.json @@ -0,0 +1,90 @@ +{ + "name": "mailmodo", + "description": "test-4", + "input": { + "request": { + "body": { + "triggerData": { + "data": {}, + "formSubmissionData": { + "element6ehxt3": "Te**", + "element6jkcy4": "Bang****", + "fuuid": "47949", + "next-step-id": "step7tr7n2", + "total-steps": "3", + "responseId": "4a8bfda7-****-4a8c-9cd1-a30d30a6dab9", + "recipientEmail": "gou****@mailmodo.com", + "formId": "formmqxnu2", + "recordedAt": { + "ts": 1657097786, + "date": "2022-07-06", + "hour": 14, + "minute": 26 + }, + "submissionSource": "amp" + }, + "email": "gou****@mailmodo.com", + "triggerSource": "form submission", + "userId": "11bff3e8-****-4e93-a533-fd8f9defc768", + "journeyId": "03664747-****-412e-8790-de9e9abe96a5", + "eventProperty": {} + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", + "context": { + "externalId": [ + { + "id": "11bff3e8-****-4e93-a533-fd8f9defc768", + "type": "mailmodoUserId" + } + ], + "traits": { + "email": "gou****@mailmodo.com" + }, + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "form submission", + "integrations": { + "Mailmodo": false + }, + "originalTimestamp": "2022-07-06T08:56:26.000Z", + "properties": { + "triggerData.triggerSource": "form submission", + "triggerData.formSubmissionData.element6ehxt3": "Te**", + "triggerData.formSubmissionData.element6jkcy4": "Bang****", + "triggerData.formSubmissionData.formId": "formmqxnu2", + "triggerData.formSubmissionData.fuuid": "47949", + "triggerData.formSubmissionData.next-step-id": "step7tr7n2", + "triggerData.formSubmissionData.responseId": "4a8bfda7-****-4a8c-9cd1-a30d30a6dab9", + "triggerData.formSubmissionData.submissionSource": "amp", + "triggerData.formSubmissionData.total-steps": "3", + "triggerData.journeyId": "03664747-****-412e-8790-de9e9abe96a5" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_5.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_5.json new file mode 100644 index 0000000000..8c4abcc945 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_5.json @@ -0,0 +1,75 @@ +{ + "name": "mailmodo", + "description": "test-5", + "input": { + "request": { + "body": { + "triggerData": { + "data": {}, + "eventProperty": { + "Name": "APPLE iPhone 13 (Blue, 128 GB)", + "Category": "Mobiles", + "Is Purchased": "false", + "Price": "829", + "Currency": "USD" + }, + "triggerSource": "New Custom Event Trigger - Product Viewed", + "email": "gou****@mailmodo.com", + "userId": "d3775892-****-4f2f-b9d5-e49810eb2cae", + "journeyId": "3f135bf7-****-4e31-b265-f61cfe1bd423" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", + "context": { + "externalId": [ + { + "id": "d3775892-****-4f2f-b9d5-e49810eb2cae", + "type": "mailmodoUserId" + } + ], + "traits": { + "email": "gou****@mailmodo.com" + }, + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "New Custom Event Trigger - Product Viewed", + "integrations": { + "Mailmodo": false + }, + "properties": { + "triggerData.eventProperty.Category": "Mobiles", + "triggerData.eventProperty.Currency": "USD", + "triggerData.eventProperty.Is Purchased": "false", + "triggerData.eventProperty.Name": "APPLE iPhone 13 (Blue, 128 GB)", + "triggerData.eventProperty.Price": "829", + "triggerData.journeyId": "3f135bf7-****-4e31-b265-f61cfe1bd423", + "triggerData.triggerSource": "New Custom Event Trigger - Product Viewed" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_6.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_6.json new file mode 100644 index 0000000000..e256cd683e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_6.json @@ -0,0 +1,64 @@ +{ + "name": "mailmodo", + "description": "test-6", + "input": { + "request": { + "body": { + "triggerData": { + "email": "gou****@mailmodo.com", + "data": {}, + "userId": "d3775892-****-4f2f-b9d5-e49810eb2cae", + "journeyId": "b1ee6bf6-****-4b5a-b7b5-0637853cd8c3", + "triggerSource": "Api", + "eventProperty": {} + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", + "context": { + "externalId": [ + { + "id": "d3775892-****-4f2f-b9d5-e49810eb2cae", + "type": "mailmodoUserId" + } + ], + "traits": { + "email": "gou****@mailmodo.com" + }, + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "Api", + "integrations": { + "Mailmodo": false + }, + "properties": { + "triggerData.triggerSource": "Api", + "triggerData.journeyId": "b1ee6bf6-****-4b5a-b7b5-0637853cd8c3" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_7.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_7.json new file mode 100644 index 0000000000..ccba1a0884 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_7.json @@ -0,0 +1,74 @@ +{ + "name": "mailmodo", + "description": "test-7", + "input": { + "request": { + "body": { + "eventData": { + "type": "html" + }, + "triggerData": { + "data": {}, + "triggerSource": "CsvList", + "email": "gou****@mailmodo.com", + "triggerDetails": "file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af", + "userId": "cc56708d-****-4fea-8c07-a4bfa5a7b79b", + "journeyId": "5d31c2b4-****-4a84-acd3-834cae80231b", + "eventProperty": {} + }, + "lastCampaignEmailRef": "064c76e7-****-4780-a001-226c066aaa12", + "lastCampaignId": "31422f76-****-4a72-a630-dd6f9f615bc3" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", + "context": { + "externalId": [ + { + "id": "cc56708d-****-4fea-8c07-a4bfa5a7b79b", + "type": "mailmodoUserId" + } + ], + "traits": { + "email": "gou****@mailmodo.com" + }, + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "event": "CsvList", + "integrations": { + "Mailmodo": false + }, + "properties": { + "eventData.type": "html", + "lastCampaignEmailRef": "064c76e7-****-4780-a001-226c066aaa12", + "lastCampaignId": "31422f76-****-4a72-a630-dd6f9f615bc3", + "triggerData.journeyId": "5d31c2b4-****-4a84-acd3-834cae80231b", + "triggerData.triggerDetails": "file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af", + "triggerData.triggerSource": "CsvList" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/mailmodo/test_8.json b/go/webhook/testcases/testdata/testcases/mailmodo/test_8.json new file mode 100644 index 0000000000..b71b22a708 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/mailmodo/test_8.json @@ -0,0 +1,87 @@ +{ + "name": "mailmodo", + "description": "test-8", + "input": { + "request": { + "body": { + "fuuid": "98255", + "next-step-id": "success", + "total-steps": "3", + "responseId": "ad20a980-4fce-44b6-887d-2236df514a76", + "recipientEmail": "test@rudderstack.com", + "formId": "formosztd5", + "recordedAt": { + "ts": 1662695887, + "date": "2022-09-09", + "hour": 9, + "minute": 28 + }, + "submissionSource": "amp", + "elementjbtz42": "peace", + "element8jzo13": ["Useful"], + "recipientData": { + "email": "test@rudderstack.com", + "first_name": "abcda" + }, + "recommend": "1", + "liking": "downvote", + "satisfaction": "1", + "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", + "campaignName": "Campaign-testing" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", + "context": { + "integration": { + "name": "Mailmodo", + "version": "1.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "email": "test@rudderstack.com", + "first_name": "abcda" + } + }, + "event": "Form Submitted", + "integrations": { + "Mailmodo": false + }, + "originalTimestamp": "2022-09-09T03:58:07.000Z", + "properties": { + "fuuid": "98255", + "next-step-id": "success", + "total-steps": "3", + "responseId": "ad20a980-4fce-44b6-887d-2236df514a76", + "formId": "formosztd5", + "submissionSource": "amp", + "elementjbtz42": "peace", + "element8jzo13[0]": "Useful", + "recommend": "1", + "liking": "downvote", + "satisfaction": "1", + "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", + "campaignName": "Campaign-testing" + }, + "type": "track", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/moengage/batch_of_events.json b/go/webhook/testcases/testdata/testcases/moengage/batch_of_events.json index 76f72961ca..58d4513db2 100644 --- a/go/webhook/testcases/testdata/testcases/moengage/batch_of_events.json +++ b/go/webhook/testcases/testdata/testcases/moengage/batch_of_events.json @@ -376,8 +376,8 @@ "shipping": 4, "value": 31.98 }, - "receivedAt": "2024-03-03T04:48:29.000Z", - "request_ip": "192.0.2.30", + "receivedAt": "2020-10-16T13:40:12.792+05:30", + "request_ip": "[::1]", "sentAt": "2020-10-16T08:10:12.783Z", "timestamp": "2020-10-16T13:40:12.791+05:30", "type": "track", diff --git a/go/webhook/testcases/testdata/testcases/monday/test_0.json b/go/webhook/testcases/testdata/testcases/monday/test_0.json new file mode 100644 index 0000000000..91087521ba --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/monday/test_0.json @@ -0,0 +1,82 @@ +{ + "name": "monday", + "description": "test-0", + "input": { + "request": { + "body": { + "event": { + "userId": 33556506, + "originalTriggerUuid": null, + "boardId": 3139815405, + "pulseId": 3160188786, + "pulseName": "New Sprint Item", + "groupId": "topics", + "groupName": "Group Title", + "groupColor": "#579bfc", + "isTopGroup": true, + "columnValues": {}, + "app": "monday", + "type": "create_pulse", + "triggerTime": "2022-08-30T09:02:39.191Z", + "subscriptionId": 150881106, + "triggerUuid": "049869226bf6711705c62e301a2c3eee" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Create Pulse", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "externalId": [ + { + "id": 33556506, + "type": "mondayUserId" + } + ], + "integration": { + "name": "MONDAY" + } + }, + "timestamp": "2022-08-30T09:02:39.191Z", + "properties": { + "app": "monday", + "type": "create_pulse", + "boardId": 3139815405, + "groupId": "topics", + "pulseId": 3160188786, + "groupName": "Group Title", + "pulseName": "New Sprint Item", + "groupColor": "#579bfc", + "isTopGroup": true, + "triggerUuid": "049869226bf6711705c62e301a2c3eee", + "columnValues": {}, + "subscriptionId": 150881106, + "originalTriggerUuid": null + }, + "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", + "integrations": { + "MONDAY": false + }, + "originalTimestamp": "2022-08-30T09:02:39.191Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/monday/test_1.json b/go/webhook/testcases/testdata/testcases/monday/test_1.json new file mode 100644 index 0000000000..6ecba956cf --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/monday/test_1.json @@ -0,0 +1,72 @@ +{ + "name": "monday", + "description": "test-1", + "input": { + "request": { + "body": { + "event": { + "userId": 33556506, + "originalTriggerUuid": null, + "boardId": 3139815405, + "itemId": 3160188786, + "itemName": "New Sprint Item", + "app": "monday", + "type": "delete_pulse", + "triggerTime": "2022-08-30T09:06:09.176Z", + "subscriptionId": 150882006, + "triggerUuid": "4e4f87c8255c4ba4ba2f5e9934cb6d40" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Delete Pulse", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "externalId": [ + { + "id": 33556506, + "type": "mondayUserId" + } + ], + "integration": { + "name": "MONDAY" + } + }, + "timestamp": "2022-08-30T09:06:09.176Z", + "properties": { + "app": "monday", + "type": "delete_pulse", + "itemId": 3160188786, + "boardId": 3139815405, + "itemName": "New Sprint Item", + "triggerUuid": "4e4f87c8255c4ba4ba2f5e9934cb6d40", + "subscriptionId": 150882006, + "originalTriggerUuid": null + }, + "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", + "integrations": { + "MONDAY": false + }, + "originalTimestamp": "2022-08-30T09:06:09.176Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/monday/test_2.json b/go/webhook/testcases/testdata/testcases/monday/test_2.json new file mode 100644 index 0000000000..fbd8618b3c --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/monday/test_2.json @@ -0,0 +1,112 @@ +{ + "name": "monday", + "description": "test-2", + "input": { + "request": { + "body": { + "event": { + "userId": 33556506, + "originalTriggerUuid": null, + "boardId": 3139815405, + "groupId": "topics", + "pulseId": 3160181387, + "pulseName": "New Sprint Item", + "columnId": "status", + "columnType": "color", + "columnTitle": "Status", + "value": { + "label": { + "index": 1, + "text": "Done", + "style": { + "color": "#00c875", + "border": "#00B461", + "var_name": "green-shadow" + }, + "is_done": true + }, + "post_id": null + }, + "previousValue": null, + "changedAt": 1661859406.8970098, + "isTopGroup": true, + "app": "monday", + "type": "update_column_value", + "triggerTime": "2022-08-30T11:36:47.406Z", + "subscriptionId": 150894742, + "triggerUuid": "51730730740a9d00ec45203bd392a9bd" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Update Column Value", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "externalId": [ + { + "id": 33556506, + "type": "mondayUserId" + } + ], + "integration": { + "name": "MONDAY" + } + }, + "timestamp": "2022-08-30T11:36:47.406Z", + "properties": { + "app": "monday", + "type": "update_column_value", + "value": { + "label": { + "text": "Done", + "index": 1, + "style": { + "color": "#00c875", + "border": "#00B461", + "var_name": "green-shadow" + }, + "is_done": true + }, + "post_id": null + }, + "boardId": 3139815405, + "groupId": "topics", + "pulseId": 3160181387, + "columnId": "status", + "changedAt": 1661859406.8970098, + "pulseName": "New Sprint Item", + "columnType": "color", + "isTopGroup": true, + "columnTitle": "Status", + "triggerUuid": "51730730740a9d00ec45203bd392a9bd", + "previousValue": null, + "subscriptionId": 150894742, + "originalTriggerUuid": null + }, + "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", + "integrations": { + "MONDAY": false + }, + "originalTimestamp": "2022-08-30T11:36:47.406Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/monday/test_3.json b/go/webhook/testcases/testdata/testcases/monday/test_3.json new file mode 100644 index 0000000000..b73fbf0ca4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/monday/test_3.json @@ -0,0 +1,84 @@ +{ + "name": "monday", + "description": "test-3", + "input": { + "request": { + "body": { + "event": { + "userId": 33556506, + "originalTriggerUuid": null, + "boardId": 3139815405, + "groupId": "topics", + "pulseId": 3160181387, + "value": { + "name": "New Sprint Item renamed" + }, + "previousValue": { + "name": "New Sprint Item" + }, + "app": "monday", + "type": "update_name", + "triggerTime": "2022-08-30T11:40:17.351Z", + "subscriptionId": 150910867, + "triggerUuid": "05ce13d32d0256c4fb7dd5de25b1a1ba" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Update Name", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "externalId": [ + { + "id": 33556506, + "type": "mondayUserId" + } + ], + "integration": { + "name": "MONDAY" + } + }, + "timestamp": "2022-08-30T11:40:17.351Z", + "properties": { + "app": "monday", + "type": "update_name", + "value": { + "name": "New Sprint Item renamed" + }, + "boardId": 3139815405, + "groupId": "topics", + "pulseId": 3160181387, + "triggerUuid": "05ce13d32d0256c4fb7dd5de25b1a1ba", + "previousValue": { + "name": "New Sprint Item" + }, + "subscriptionId": 150910867, + "originalTriggerUuid": null + }, + "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", + "integrations": { + "MONDAY": false + }, + "originalTimestamp": "2022-08-30T11:40:17.351Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/monday/test_4.json b/go/webhook/testcases/testdata/testcases/monday/test_4.json new file mode 100644 index 0000000000..6e0c11ca26 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/monday/test_4.json @@ -0,0 +1,88 @@ +{ + "name": "monday", + "description": "test-4", + "input": { + "request": { + "body": { + "event": { + "userId": 33556506, + "originalTriggerUuid": null, + "boardId": 3160805239, + "pulseId": 3161163765, + "pulseName": "new subitem", + "groupId": "topics", + "groupName": "Subitems", + "groupColor": "#579bfc", + "isTopGroup": true, + "columnValues": {}, + "app": "monday", + "type": "create_pulse", + "triggerTime": "2022-08-30T12:56:27.281Z", + "subscriptionId": 150911592, + "triggerUuid": "70a2219427804e47a508a91b5c244543", + "parentItemId": "3160181387", + "parentItemBoardId": "3139815405", + "itemId": 3161163765 + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Create Pulse", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "externalId": [ + { + "id": 33556506, + "type": "mondayUserId" + } + ], + "integration": { + "name": "MONDAY" + } + }, + "timestamp": "2022-08-30T12:56:27.281Z", + "properties": { + "app": "monday", + "type": "create_pulse", + "itemId": 3161163765, + "boardId": 3160805239, + "groupId": "topics", + "pulseId": 3161163765, + "groupName": "Subitems", + "pulseName": "new subitem", + "groupColor": "#579bfc", + "isTopGroup": true, + "triggerUuid": "70a2219427804e47a508a91b5c244543", + "columnValues": {}, + "parentItemId": "3160181387", + "subscriptionId": 150911592, + "parentItemBoardId": "3139815405", + "originalTriggerUuid": null + }, + "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", + "integrations": { + "MONDAY": false + }, + "originalTimestamp": "2022-08-30T12:56:27.281Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/monday/test_5.json b/go/webhook/testcases/testdata/testcases/monday/test_5.json new file mode 100644 index 0000000000..0c41c845dd --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/monday/test_5.json @@ -0,0 +1,72 @@ +{ + "name": "monday", + "description": "test-5", + "input": { + "request": { + "body": { + "event": { + "userId": 33556506, + "originalTriggerUuid": null, + "boardId": 3139815405, + "itemId": 3160181387, + "itemName": "New Sprint Item renamed", + "app": "monday", + "type": "archive_pulse", + "triggerTime": "2022-08-30T12:58:15.844Z", + "subscriptionId": 150925947, + "triggerUuid": "aa8bd5dbb6fd592aedd57322dd776379" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Archive Pulse", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "externalId": [ + { + "id": 33556506, + "type": "mondayUserId" + } + ], + "integration": { + "name": "MONDAY" + } + }, + "timestamp": "2022-08-30T12:58:15.844Z", + "properties": { + "app": "monday", + "type": "archive_pulse", + "itemId": 3160181387, + "boardId": 3139815405, + "itemName": "New Sprint Item renamed", + "triggerUuid": "aa8bd5dbb6fd592aedd57322dd776379", + "subscriptionId": 150925947, + "originalTriggerUuid": null + }, + "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", + "integrations": { + "MONDAY": false + }, + "originalTimestamp": "2022-08-30T12:58:15.844Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/olark/olark_webhook_response.json b/go/webhook/testcases/testdata/testcases/olark/olark_webhook_response.json new file mode 100644 index 0000000000..031940996c --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/olark/olark_webhook_response.json @@ -0,0 +1,122 @@ +{ + "name": "olark", + "description": "Olark webhook response", + "input": { + "request": { + "body": { + "kind": "Conversation", + "id": "ho6HrHxoabmm6q0G103JU0JFaor0BobA", + "manuallySubmitted": false, + "items": [ + { + "kind": "OfflineMessage", + "timestamp": "1669288532.567071", + "body": "name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv" + } + ], + "tags": [], + "groups": [ + { + "kind": "Group", + "id": "ca77f4296fb7568909ad864aebf48201", + "name": "Group 1" + } + ], + "visitor": { + "kind": "Visitor", + "id": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", + "fullName": "test rudderstack", + "emailAddress": "rudder14@gmail.com", + "ip": "", + "country": "India", + "countryCode": "IN", + "browser": "Chrome 105.0.0.0", + "operatingSystem": "Macintosh", + "conversationBeginPage": "http://localhost:5503/" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Conversation", + "traits": {}, + "userId": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", + "context": { + "os": { + "name": "Macintosh" + }, + "page": { + "url": "http://localhost:5503/" + }, + "traits": { + "name": "test rudderstack", + "email": "rudder14@gmail.com", + "country": "India" + }, + "browser": { + "name": "Chrome", + "version": "105.0.0.0" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Olark" + } + }, + "properties": { + "tags": [], + "items": [ + { + "body": "name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv", + "kind": "OfflineMessage", + "timestamp": "1669288532.567071" + } + ] + }, + "integrations": { + "Olark": false + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + }, + { + "name": "Group 1", + "type": "group", + "traits": { + "kind": "Group" + }, + "userId": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Olark" + } + }, + "groupId": "ca77f4296fb7568909ad864aebf48201", + "integrations": { + "Olark": false + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pagerduty/incident_escalated.json b/go/webhook/testcases/testdata/testcases/pagerduty/incident_escalated.json new file mode 100644 index 0000000000..eb7c31251b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pagerduty/incident_escalated.json @@ -0,0 +1,157 @@ +{ + "name": "pagerduty", + "description": "Incident Escalated", + "input": { + "request": { + "body": { + "event": { + "id": "01DFU77KTKK9UUYX779UX0N1ZP", + "event_type": "incident.escalated", + "resource_type": "incident", + "occurred_at": "2022-12-20T11:49:35.385Z", + "agent": { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + }, + "client": null, + "data": { + "id": "Q1KRTY75EUMGM0", + "type": "incident", + "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "number": 7, + "status": "triggered", + "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", + "created_at": "2022-12-20T11:37:19Z", + "title": "Event Stream Failure", + "service": { + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "summary": "Database", + "type": "service_reference" + }, + "assignees": [ + { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + } + ], + "escalation_policy": { + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "summary": "Default", + "type": "escalation_policy_reference" + }, + "teams": [], + "priority": { + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", + "id": "PPMNDVQ", + "self": "https://api.pagerduty.com/priorities/PPMNDVQ", + "summary": "P1", + "type": "priority_reference" + }, + "urgency": "high", + "conference_bridge": null, + "resolve_reason": null + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Incident Escalated", + "userId": "PXZZD2E", + "context": { + "traits": { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "PagerDuty" + } + }, + "messageId": "01DFU77KTKK9UUYX779UX0N1ZP", + "properties": { + "data": { + "id": "Q1KRTY75EUMGM0", + "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "type": "incident", + "teams": [], + "title": "Event Stream Failure", + "number": 7, + "status": "triggered", + "service": { + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "type": "service_reference", + "summary": "Database", + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" + }, + "urgency": "high", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "priority": { + "id": "PPMNDVQ", + "self": "https://api.pagerduty.com/priorities/PPMNDVQ", + "type": "priority_reference", + "summary": "P1", + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" + }, + "assignees": [ + { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + } + ], + "created_at": "2022-12-20T11:37:19Z", + "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", + "resolve_reason": null, + "conference_bridge": null, + "escalation_policy": { + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "type": "escalation_policy_reference", + "summary": "Default", + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" + } + }, + "resourceType": "incident" + }, + "integrations": { + "PagerDuty": false + }, + "originalTimestamp": "2022-12-20T11:49:35.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pagerduty/incident_priority_updated.json b/go/webhook/testcases/testdata/testcases/pagerduty/incident_priority_updated.json new file mode 100644 index 0000000000..846efe5749 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pagerduty/incident_priority_updated.json @@ -0,0 +1,157 @@ +{ + "name": "pagerduty", + "description": "Incident Priority Updated", + "input": { + "request": { + "body": { + "event": { + "id": "01DFU6P4VDDZCIHVQ5Q0ME99OE", + "event_type": "incident.priority_updated", + "resource_type": "incident", + "occurred_at": "2022-12-20T11:43:24.342Z", + "agent": { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + }, + "client": null, + "data": { + "id": "Q1KRTY75EUMGM0", + "type": "incident", + "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "number": 7, + "status": "acknowledged", + "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", + "created_at": "2022-12-20T11:37:19Z", + "title": "Event Stream Failure", + "service": { + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "summary": "Database", + "type": "service_reference" + }, + "assignees": [ + { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + } + ], + "escalation_policy": { + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "summary": "Default", + "type": "escalation_policy_reference" + }, + "teams": [], + "priority": { + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", + "id": "PPMNDVQ", + "self": "https://api.pagerduty.com/priorities/PPMNDVQ", + "summary": "P1", + "type": "priority_reference" + }, + "urgency": "high", + "conference_bridge": null, + "resolve_reason": null + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Incident Priority Updated", + "userId": "PXZZD2E", + "context": { + "traits": { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "PagerDuty" + } + }, + "messageId": "01DFU6P4VDDZCIHVQ5Q0ME99OE", + "properties": { + "data": { + "id": "Q1KRTY75EUMGM0", + "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "type": "incident", + "teams": [], + "title": "Event Stream Failure", + "number": 7, + "status": "acknowledged", + "service": { + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "type": "service_reference", + "summary": "Database", + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" + }, + "urgency": "high", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "priority": { + "id": "PPMNDVQ", + "self": "https://api.pagerduty.com/priorities/PPMNDVQ", + "type": "priority_reference", + "summary": "P1", + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" + }, + "assignees": [ + { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + } + ], + "created_at": "2022-12-20T11:37:19Z", + "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", + "resolve_reason": null, + "conference_bridge": null, + "escalation_policy": { + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "type": "escalation_policy_reference", + "summary": "Default", + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" + } + }, + "resourceType": "incident" + }, + "integrations": { + "PagerDuty": false + }, + "originalTimestamp": "2022-12-20T11:43:24.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pagerduty/incident_resolved.json b/go/webhook/testcases/testdata/testcases/pagerduty/incident_resolved.json new file mode 100644 index 0000000000..c4766e3722 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pagerduty/incident_resolved.json @@ -0,0 +1,147 @@ +{ + "name": "pagerduty", + "description": "Incident Resolved", + "input": { + "request": { + "body": { + "event": { + "id": "01DEN1HNLBC1VITK192ETJ1MPJ", + "event_type": "incident.resolved", + "resource_type": "incident", + "occurred_at": "2022-12-07T11:04:27.459Z", + "agent": { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + }, + "client": null, + "data": { + "id": "Q3S7IX2U5KTCOY", + "type": "incident", + "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "number": 2, + "status": "resolved", + "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", + "created_at": "2022-12-07T10:56:52Z", + "title": "Server Crashed", + "service": { + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "summary": "Database", + "type": "service_reference" + }, + "assignees": [], + "escalation_policy": { + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "summary": "Default", + "type": "escalation_policy_reference" + }, + "teams": [], + "priority": { + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", + "id": "P5DBC3A", + "self": "https://api.pagerduty.com/priorities/P5DBC3A", + "summary": "P3", + "type": "priority_reference" + }, + "urgency": "high", + "conference_bridge": { + "conference_number": "", + "conference_url": "" + }, + "resolve_reason": null + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Incident Resolved", + "userId": "PXZZD2E", + "context": { + "traits": { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "PagerDuty" + } + }, + "messageId": "01DEN1HNLBC1VITK192ETJ1MPJ", + "properties": { + "data": { + "id": "Q3S7IX2U5KTCOY", + "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "type": "incident", + "teams": [], + "title": "Server Crashed", + "number": 2, + "status": "resolved", + "service": { + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "type": "service_reference", + "summary": "Database", + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" + }, + "urgency": "high", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "priority": { + "id": "P5DBC3A", + "self": "https://api.pagerduty.com/priorities/P5DBC3A", + "type": "priority_reference", + "summary": "P3", + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" + }, + "assignees": [], + "created_at": "2022-12-07T10:56:52Z", + "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", + "resolve_reason": null, + "conference_bridge": { + "conference_url": "", + "conference_number": "" + }, + "escalation_policy": { + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "type": "escalation_policy_reference", + "summary": "Default", + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" + } + }, + "resourceType": "incident" + }, + "integrations": { + "PagerDuty": false + }, + "originalTimestamp": "2022-12-07T11:04:27.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pagerduty/incident_responder_added.json b/go/webhook/testcases/testdata/testcases/pagerduty/incident_responder_added.json new file mode 100644 index 0000000000..b78369162b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pagerduty/incident_responder_added.json @@ -0,0 +1,107 @@ +{ + "name": "pagerduty", + "description": "Incident Responder Added", + "input": { + "request": { + "body": { + "event": { + "id": "01DFU6Z1ZCLMV9SEK3X5JZ5WLW", + "event_type": "incident.responder.added", + "resource_type": "incident", + "occurred_at": "2022-12-20T11:46:44.213Z", + "agent": { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + }, + "client": null, + "data": { + "incident": { + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "id": "Q1KRTY75EUMGM0", + "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "summary": "Event Stream Failure", + "type": "incident_reference" + }, + "user": { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + }, + "escalation_policy": null, + "message": "Please help with \"Event Stream Failure\"", + "state": "pending", + "type": "incident_responder" + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Incident Responder Added", + "userId": "PXZZD2E", + "context": { + "traits": { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "PagerDuty" + } + }, + "messageId": "01DFU6Z1ZCLMV9SEK3X5JZ5WLW", + "properties": { + "data": { + "type": "incident_responder", + "user": { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + }, + "state": "pending", + "message": "Please help with \"Event Stream Failure\"", + "incident": { + "id": "Q1KRTY75EUMGM0", + "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", + "type": "incident_reference", + "summary": "Event Stream Failure", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0" + }, + "escalation_policy": null + }, + "resourceType": "incident" + }, + "integrations": { + "PagerDuty": false + }, + "originalTimestamp": "2022-12-20T11:46:44.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pagerduty/incident_triggered.json b/go/webhook/testcases/testdata/testcases/pagerduty/incident_triggered.json new file mode 100644 index 0000000000..bfb4c1e86f --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pagerduty/incident_triggered.json @@ -0,0 +1,164 @@ +{ + "name": "pagerduty", + "description": "Incident Triggered", + "input": { + "request": { + "body": { + "event": { + "id": "01DEN0V2VIFEN5871PQGX72URP", + "event_type": "incident.triggered", + "resource_type": "incident", + "occurred_at": "2022-12-07T10:56:52.337Z", + "agent": { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + }, + "client": { + "name": "Monitoring Service", + "url": "https://monitoring.service.com" + }, + "data": { + "id": "Q3S7IX2U5KTCOY", + "type": "incident", + "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "number": 2, + "status": "triggered", + "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", + "created_at": "2022-12-07T10:56:52Z", + "title": "Server Crashed", + "service": { + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "summary": "Database", + "type": "service_reference" + }, + "assignees": [ + { + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "summary": "rudder test", + "type": "user_reference" + } + ], + "escalation_policy": { + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "summary": "Default", + "type": "escalation_policy_reference" + }, + "teams": [], + "priority": { + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", + "id": "PPMNDVQ", + "self": "https://api.pagerduty.com/priorities/PPMNDVQ", + "summary": "P1", + "type": "priority_reference" + }, + "urgency": "high", + "conference_bridge": null, + "resolve_reason": null + } + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "track", + "event": "Incident Triggered", + "userId": "PXZZD2E", + "context": { + "traits": { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "PagerDuty" + } + }, + "messageId": "01DEN0V2VIFEN5871PQGX72URP", + "properties": { + "data": { + "id": "Q3S7IX2U5KTCOY", + "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "type": "incident", + "teams": [], + "title": "Server Crashed", + "number": 2, + "status": "triggered", + "service": { + "id": "PAJBUTT", + "self": "https://api.pagerduty.com/services/PAJBUTT", + "type": "service_reference", + "summary": "Database", + "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" + }, + "urgency": "high", + "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", + "priority": { + "id": "PPMNDVQ", + "self": "https://api.pagerduty.com/priorities/PPMNDVQ", + "type": "priority_reference", + "summary": "P1", + "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" + }, + "assignees": [ + { + "id": "PXZZD2E", + "self": "https://api.pagerduty.com/users/user@1", + "type": "user_reference", + "summary": "rudder test", + "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" + } + ], + "created_at": "2022-12-07T10:56:52Z", + "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", + "resolve_reason": null, + "conference_bridge": null, + "escalation_policy": { + "id": "PB7HKU4", + "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", + "type": "escalation_policy_reference", + "summary": "Default", + "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" + } + }, + "client": { + "url": "https://monitoring.service.com", + "name": "Monitoring Service" + }, + "resourceType": "incident" + }, + "integrations": { + "PagerDuty": false + }, + "originalTimestamp": "2022-12-07T10:56:52.000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pipedream/alias_type____type_and_user_id_is_given.json b/go/webhook/testcases/testdata/testcases/pipedream/alias_type____type_and_user_id_is_given.json new file mode 100644 index 0000000000..d28c468cb7 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pipedream/alias_type____type_and_user_id_is_given.json @@ -0,0 +1,33 @@ +{ + "name": "pipedream", + "description": "Alias type -> type and userId is given", + "input": { + "request": { + "body": { + "type": "alias", + "previousId": "name@surname.com", + "userId": "12345" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "alias", + "previousId": "name@surname.com", + "userId": "12345", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pipedream/group_type____type_and_user_id_is_given.json b/go/webhook/testcases/testdata/testcases/pipedream/group_type____type_and_user_id_is_given.json new file mode 100644 index 0000000000..9f65d0a516 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pipedream/group_type____type_and_user_id_is_given.json @@ -0,0 +1,41 @@ +{ + "name": "pipedream", + "description": "Group type -> type and userId is given", + "input": { + "request": { + "body": { + "userId": "user123", + "groupId": "17", + "context": {}, + "traits": { + "operation": "add" + }, + "type": "group" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "user123", + "groupId": "17", + "context": {}, + "traits": { + "operation": "add" + }, + "type": "group", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pipedream/identify_type____type_and_user_id_is_given.json b/go/webhook/testcases/testdata/testcases/pipedream/identify_type____type_and_user_id_is_given.json new file mode 100644 index 0000000000..a8ddaecf11 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pipedream/identify_type____type_and_user_id_is_given.json @@ -0,0 +1,67 @@ +{ + "name": "pipedream", + "description": "Identify type -> type and userId is given", + "input": { + "request": { + "body": { + "userId": "1", + "originalTimestamp": "2020-09-28T19:53:31.900Z", + "traits": { + "firstName": "John", + "lastName": "doe", + "email": "John@r.com", + "hasPurchased": "yes", + "address": { + "Home": { + "city": "iudcb" + }, + "Office": { + "abc": "jbc" + } + }, + "state": "Delhi", + "title": "Mr" + }, + "timestamp": "2020-09-29T14:50:29.907+05:30", + "type": "identify" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "userId": "1", + "originalTimestamp": "2020-09-28T19:53:31.900Z", + "traits": { + "firstName": "John", + "lastName": "doe", + "email": "John@r.com", + "hasPurchased": "yes", + "address": { + "Home": { + "city": "iudcb" + }, + "Office": { + "abc": "jbc" + } + }, + "state": "Delhi", + "title": "Mr" + }, + "timestamp": "2020-09-29T14:50:29.907+05:30", + "type": "identify", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pipedream/no_type_or_anonymous_id_is_given.json b/go/webhook/testcases/testdata/testcases/pipedream/no_type_or_anonymous_id_is_given.json new file mode 100644 index 0000000000..2933fe5d0a --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pipedream/no_type_or_anonymous_id_is_given.json @@ -0,0 +1,52 @@ +{ + "name": "pipedream", + "description": "No type or anonymousId is given", + "input": { + "request": { + "body": { + "userId": "12", + "artist": "Gautam", + "genre": "Jazz", + "song": "Take Five" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "event": "pipedream_source_event", + "anonymousId": "12", + "context": { + "integration": { + "name": "PIPEDREAM" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "integrations": { + "PIPEDREAM": false + }, + "type": "track", + "properties": { + "userId": "12", + "artist": "Gautam", + "genre": "Jazz", + "song": "Take Five" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pipedream/no_type_or_user_id_is_given.json b/go/webhook/testcases/testdata/testcases/pipedream/no_type_or_user_id_is_given.json new file mode 100644 index 0000000000..1c66c40795 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pipedream/no_type_or_user_id_is_given.json @@ -0,0 +1,52 @@ +{ + "name": "pipedream", + "description": "No type or userId is given", + "input": { + "request": { + "body": { + "anonymousId": "63767499ca6fb1b7c988d5bb", + "artist": "Gautam", + "genre": "Jazz", + "song": "Take Five" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "event": "pipedream_source_event", + "anonymousId": "63767499ca6fb1b7c988d5bb", + "context": { + "integration": { + "name": "PIPEDREAM" + }, + "library": { + "name": "unknown", + "version": "unknown" + } + }, + "integrations": { + "PIPEDREAM": false + }, + "type": "track", + "properties": { + "anonymousId": "63767499ca6fb1b7c988d5bb", + "artist": "Gautam", + "genre": "Jazz", + "song": "Take Five" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pipedream/page_type____type_and_user_id_is_given.json b/go/webhook/testcases/testdata/testcases/pipedream/page_type____type_and_user_id_is_given.json new file mode 100644 index 0000000000..62cf4d27a2 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pipedream/page_type____type_and_user_id_is_given.json @@ -0,0 +1,65 @@ +{ + "name": "pipedream", + "description": "Page type -> type and userId is given", + "input": { + "request": { + "body": { + "anonymousId": "21e13f4bc7ceddad", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "9" + }, + "timezone": "Asia/Kolkata", + "traits": { + "customProp": "customValue" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "name": "Home", + "properties": { + "title": "Home | RudderStack", + "url": "http://www.rudderstack.com" + }, + "type": "page" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "anonymousId": "21e13f4bc7ceddad", + "channel": "mobile", + "context": { + "os": { + "name": "Android", + "version": "9" + }, + "timezone": "Asia/Kolkata", + "traits": { + "customProp": "customValue" + }, + "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" + }, + "name": "Home", + "properties": { + "title": "Home | RudderStack", + "url": "http://www.rudderstack.com" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "type": "page", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/pipedream/track_call____type_and_user_id_is_given.json b/go/webhook/testcases/testdata/testcases/pipedream/track_call____type_and_user_id_is_given.json new file mode 100644 index 0000000000..7da284c456 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/pipedream/track_call____type_and_user_id_is_given.json @@ -0,0 +1,101 @@ +{ + "name": "pipedream", + "description": "Track Call -> type and userId is given", + "input": { + "request": { + "body": { + "event": "Song Played", + "userId": "R1234", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe", + "userDeleted": false + }, + "locale": "en", + "location": { + "country": "IN", + "countryName": "India", + "short": "India", + "long": "India" + }, + "device": { + "os": "macOS", + "type": "desktop" + }, + "page": { + "referrer": "http://127.0.0.1:5500/testSm.html" + } + }, + "type": "track", + "properties": { + "artist": "John", + "Album": "ABCD" + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "event": "Song Played", + "userId": "R1234", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe", + "userDeleted": false + }, + "locale": "en", + "location": { + "country": "IN", + "countryName": "India", + "short": "India", + "long": "India" + }, + "device": { + "os": "macOS", + "type": "desktop" + }, + "page": { + "referrer": "http://127.0.0.1:5500/testSm.html" + } + }, + "type": "track", + "properties": { + "artist": "John", + "Album": "ABCD" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/refiner/refiner_webhook_response.json b/go/webhook/testcases/testdata/testcases/refiner/refiner_webhook_response.json new file mode 100644 index 0000000000..e6d72fa7c4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/refiner/refiner_webhook_response.json @@ -0,0 +1,211 @@ +{ + "name": "refiner", + "description": "Refiner webhook response", + "input": { + "request": { + "body": { + "uuid": "69b83e20-4ea2-11ed-941c-e1cb6c7a3870", + "cookie_uuid": "2f9b7e6a-9ba8-1c68-d474-48d719d92a60", + "project_uuid": "0d8759d0-401c-11ed-8ded-9757c4929b55", + "remote_id": "sdk@30", + "email": "sdk30@gmail.com", + "display_name": "", + "first_seen_at": "2022-10-18T05:04:58.000000Z", + "last_seen_at": "2022-10-18T05:04:58.000000Z", + "attributes": { + "address": null, + "address_city": null, + "address_state": null, + "age": null, + "another_attribute": null, + "city": null, + "country": null, + "created_at": null, + "email": "sdk30@gmail.com", + "event": null, + "first_name": null, + "first_seen_at": "2022-10-18T05:04:58.000000Z", + "form_submissions_count": "1", + "form_views_count": "1", + "gender": null, + "last_form_submission_at": "2022-10-18T05:05:45.000000Z", + "last_form_view_at": "2022-10-18T05:05:29.000000Z", + "last_name": null, + "last_seen_at": "2022-10-18T05:04:58.000000Z", + "name": null, + "phone": null, + "some_attribute": null, + "status": null, + "student": null, + "tag": null, + "trait1": null, + "trait2": null, + "trait3": null, + "url": null, + "user_address_city": null, + "user_address_state": null, + "user_country": null, + "user_id": null, + "username": null, + "useroccupation": null, + "why_did_you_cancel_your_subscription": "Missing features" + }, + "segments": [ + { + "uuid": "0d91d7a0-401c-11ed-8898-bb1ee0c23ae5", + "name": "All Users", + "created_at": "2022-10-18T05:04:58.000000Z", + "updated_at": "2022-10-18T05:04:58.000000Z" + }, + { + "uuid": "f71ad940-455c-11ed-85e0-bf25f168b224", + "name": "test-segment", + "created_at": "2022-10-18T05:04:58.000000Z", + "updated_at": "2022-10-18T05:04:58.000000Z" + } + ], + "account": { + "uuid": "69ba2030-4ea2-11ed-adfc-595e70c7ab07", + "remote_id": null, + "domain": null, + "display_name": "", + "first_seen_at": "2022-10-18T05:04:58.000000Z", + "last_seen_at": "2022-10-18T05:04:58.000000Z", + "attributes": { + "1": null, + "2": null, + "3": null, + "4": null, + "a_date_at": null, + "business_email": null, + "company": null, + "email": null, + "isfunded": null, + "location": null, + "name": null, + "revenue": null, + "some_account_data": null, + "trait1": null, + "trait2": null, + "trait3": null, + "user_id": null + } + }, + "triggered_event": "Completed Survey", + "form": { + "uuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", + "name": "Customer Churn Survey" + }, + "response": { + "uuid": "7c508c60-4ea2-11ed-9302-57708fe11d26", + "first_shown_at": "2022-10-18T05:05:29.000000Z", + "last_shown_at": "2022-10-18T05:05:29.000000Z", + "show_counter": null, + "first_data_reception_at": "2022-10-18T05:05:45.000000Z", + "last_data_reception_at": "2022-10-18T05:05:45.000000Z", + "completed_at": "2022-10-18T05:05:45.000000Z", + "dismissed_at": null, + "received_at": "2022-10-18T05:05:45.000000Z", + "data": { + "why_did_you_cancel_your_subscription": "Missing features" + }, + "tags": [] + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "type": "identify", + "traits": { + "why_did_you_cancel_your_subscription": "Missing features" + }, + "userId": "sdk@30", + "context": { + "traits": { + "email": "sdk30@gmail.com", + "segments": [ + { + "name": "All Users", + "uuid": "0d91d7a0-401c-11ed-8898-bb1ee0c23ae5", + "created_at": "2022-10-18T05:04:58.000000Z", + "updated_at": "2022-10-18T05:04:58.000000Z" + }, + { + "name": "test-segment", + "uuid": "f71ad940-455c-11ed-85e0-bf25f168b224", + "created_at": "2022-10-18T05:04:58.000000Z", + "updated_at": "2022-10-18T05:04:58.000000Z" + } + ] + }, + "library": { + "name": "unknown", + "version": "unknown" + }, + "formName": "Customer Churn Survey", + "formUuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", + "integration": { + "name": "Refiner" + } + }, + "integrations": { + "Refiner": false + }, + "originalTimestamp": "2022-10-18T05:05:45.000000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + }, + { + "type": "track", + "event": "Completed Survey", + "userId": "sdk@30", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "formName": "Customer Churn Survey", + "formUuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", + "integration": { + "name": "Refiner" + } + }, + "properties": { + "response": { + "data": { + "why_did_you_cancel_your_subscription": "Missing features" + }, + "tags": [], + "uuid": "7c508c60-4ea2-11ed-9302-57708fe11d26", + "received_at": "2022-10-18T05:05:45.000000Z", + "completed_at": "2022-10-18T05:05:45.000000Z", + "last_shown_at": "2022-10-18T05:05:29.000000Z", + "first_shown_at": "2022-10-18T05:05:29.000000Z", + "last_data_reception_at": "2022-10-18T05:05:45.000000Z", + "first_data_reception_at": "2022-10-18T05:05:45.000000Z" + }, + "refiner_form_name": "Customer Churn Survey", + "refiner_form_uuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae" + }, + "integrations": { + "Refiner": false + }, + "originalTimestamp": "2022-10-18T05:05:45.000000Z", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/satismeter/all_fields_check_with_event_as_completed.json b/go/webhook/testcases/testdata/testcases/satismeter/all_fields_check_with_event_as_completed.json new file mode 100644 index 0000000000..ed8ad4e0da --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/satismeter/all_fields_check_with_event_as_completed.json @@ -0,0 +1,244 @@ +{ + "name": "satismeter", + "description": " All fields Check with event as completed", + "input": { + "request": { + "body": { + "response": { + "id": "63767499ca6fb1b7c988d5bb", + "created": "2022-11-17T17:51:21.764Z", + "rating": 5, + "feedback": "Many things to imporve\n", + "dismissed": false, + "pending": false, + "answers": [ + { + "label": "How likely are you to recommend us to your friends and colleagues?", + "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", + "value": 5, + "name": "SM_rating", + "type": "scale", + "metric": "nps" + }, + { + "label": "What could we do to improve?", + "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", + "value": "Many things to imporve\n", + "name": "SM_comment", + "type": "long-text" + }, + { + "label": "The company made it easy for me to handle my issue.", + "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "scale", + "metric": "ces" + }, + { + "label": "How satisfied were you with the service you received?", + "id": "24c5b290-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "smiley", + "metric": "csat" + }, + { + "label": "How you like to rate the surevy?", + "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", + "value": 4, + "type": "scale" + }, + { + "label": "Your Name (Single Answer)", + "id": "37a8c000-66a0-11ed-856c-6f39711bf041", + "value": "a", + "type": "single-choice" + }, + { + "label": "Your Name (Multiple Answer)", + "id": "4b435da0-66a0-11ed-856c-6f39711bf041", + "value": ["a1", "b1"], + "type": "multiple-choice" + } + ], + "category": "detractor", + "score": -100, + "user": { + "id": "63766fbb7ac7b72676145338", + "name": "John Doe", + "email": "john@doe.com", + "userId": "No response", + "deleted": false, + "groups": { + "group1": "grooupId" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe" + } + }, + "device": { + "os": "macOS", + "type": "desktop" + }, + "location": { + "country": "IN", + "countryName": "India", + "region": "", + "city": "", + "short": "India", + "long": "India" + }, + "referrer": "http://127.0.0.1:5500/testSm.html", + "method": "In-app", + "language": "en", + "project": "6372247a764986ebee62bf66", + "campaign": "6373271b764986ebee62bfca" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe" + }, + "campaign": { + "id": "6373271b764986ebee62bfca", + "name": "NPS Survey" + }, + "event": "completed" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "event": "Survey completed", + "anonymousId": "63766fbb7ac7b72676145338", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe", + "userDeleted": false + }, + "locale": "en", + "campaign": { + "id": "6373271b764986ebee62bfca", + "name": "NPS Survey" + }, + "integration": { + "name": "SATISMETER" + }, + "location": { + "country": "IN", + "countryName": "India", + "short": "India", + "long": "India" + }, + "device": { + "os": "macOS", + "type": "desktop" + }, + "page": { + "referrer": "http://127.0.0.1:5500/testSm.html" + } + }, + "integrations": { + "SATISMETER": false + }, + "type": "track", + "traits": { + "groups": { + "group1": "grooupId" + } + }, + "userId": "No response", + "properties": { + "category": "detractor", + "answers": [ + { + "label": "How likely are you to recommend us to your friends and colleagues?", + "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", + "value": 5, + "name": "SM_rating", + "type": "scale", + "metric": "nps" + }, + { + "label": "What could we do to improve?", + "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", + "value": "Many things to imporve\n", + "name": "SM_comment", + "type": "long-text" + }, + { + "label": "The company made it easy for me to handle my issue.", + "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "scale", + "metric": "ces" + }, + { + "label": "How satisfied were you with the service you received?", + "id": "24c5b290-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "smiley", + "metric": "csat" + }, + { + "label": "How you like to rate the surevy?", + "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", + "value": 4, + "type": "scale" + }, + { + "label": "Your Name (Single Answer)", + "id": "37a8c000-66a0-11ed-856c-6f39711bf041", + "value": "a", + "type": "single-choice" + }, + { + "label": "Your Name (Multiple Answer)", + "id": "4b435da0-66a0-11ed-856c-6f39711bf041", + "value": ["a1", "b1"], + "type": "multiple-choice" + } + ], + "surveyDismissed": false, + "surveyPending": false, + "receivedAt": "2022-11-17T17:51:21.764Z" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/satismeter/neither_reponse_user_id_or_response_user_user_id_is_provided_in_payload_then_mapping_response_id_to_anonymous_id.json b/go/webhook/testcases/testdata/testcases/satismeter/neither_reponse_user_id_or_response_user_user_id_is_provided_in_payload_then_mapping_response_id_to_anonymous_id.json new file mode 100644 index 0000000000..9906523298 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/satismeter/neither_reponse_user_id_or_response_user_user_id_is_provided_in_payload_then_mapping_response_id_to_anonymous_id.json @@ -0,0 +1,241 @@ +{ + "name": "satismeter", + "description": " Neither reponse.user.id or response.user.userId is provided in payload then mapping response.id to anonymousId", + "input": { + "request": { + "body": { + "response": { + "id": "63767499ca6fb1b7c988d5bb", + "created": "2022-11-17T17:51:21.764Z", + "rating": 5, + "feedback": "Many things to imporve\n", + "dismissed": false, + "pending": false, + "answers": [ + { + "label": "How likely are you to recommend us to your friends and colleagues?", + "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", + "value": 5, + "name": "SM_rating", + "type": "scale", + "metric": "nps" + }, + { + "label": "What could we do to improve?", + "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", + "value": "Many things to imporve\n", + "name": "SM_comment", + "type": "long-text" + }, + { + "label": "The company made it easy for me to handle my issue.", + "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "scale", + "metric": "ces" + }, + { + "label": "How satisfied were you with the service you received?", + "id": "24c5b290-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "smiley", + "metric": "csat" + }, + { + "label": "How you like to rate the surevy?", + "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", + "value": 4, + "type": "scale" + }, + { + "label": "Your Name (Single Answer)", + "id": "37a8c000-66a0-11ed-856c-6f39711bf041", + "value": "a", + "type": "single-choice" + }, + { + "label": "Your Name (Multiple Answer)", + "id": "4b435da0-66a0-11ed-856c-6f39711bf041", + "value": ["a1", "b1"], + "type": "multiple-choice" + } + ], + "category": "detractor", + "score": -100, + "user": { + "name": "John Doe", + "email": "john@doe.com", + "deleted": false, + "groups": { + "group1": "grooupId" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe" + } + }, + "device": { + "os": "macOS", + "type": "desktop" + }, + "location": { + "country": "IN", + "countryName": "India", + "region": "", + "city": "", + "short": "India", + "long": "India" + }, + "referrer": "http://127.0.0.1:5500/testSm.html", + "method": "In-app", + "language": "en", + "project": "6372247a764986ebee62bf66", + "campaign": "6373271b764986ebee62bfca" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe" + }, + "campaign": { + "id": "6373271b764986ebee62bfca", + "name": "NPS Survey" + }, + "event": "completed" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "event": "Survey completed", + "anonymousId": "63767499ca6fb1b7c988d5bb", + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "traits": { + "createdAt": "2022-10-15T05:41:06.016Z", + "custom": { + "key1": "v1", + "key2": "V2" + }, + "email": "john@doe.com", + "name": "John Doe", + "userDeleted": false + }, + "locale": "en", + "campaign": { + "id": "6373271b764986ebee62bfca", + "name": "NPS Survey" + }, + "integration": { + "name": "SATISMETER" + }, + "location": { + "country": "IN", + "countryName": "India", + "short": "India", + "long": "India" + }, + "device": { + "os": "macOS", + "type": "desktop" + }, + "page": { + "referrer": "http://127.0.0.1:5500/testSm.html" + } + }, + "integrations": { + "SATISMETER": false + }, + "type": "track", + "traits": { + "groups": { + "group1": "grooupId" + } + }, + "properties": { + "category": "detractor", + "answers": [ + { + "label": "How likely are you to recommend us to your friends and colleagues?", + "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", + "value": 5, + "name": "SM_rating", + "type": "scale", + "metric": "nps" + }, + { + "label": "What could we do to improve?", + "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", + "value": "Many things to imporve\n", + "name": "SM_comment", + "type": "long-text" + }, + { + "label": "The company made it easy for me to handle my issue.", + "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "scale", + "metric": "ces" + }, + { + "label": "How satisfied were you with the service you received?", + "id": "24c5b290-66a0-11ed-856c-6f39711bf041", + "value": 4, + "name": null, + "type": "smiley", + "metric": "csat" + }, + { + "label": "How you like to rate the surevy?", + "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", + "value": 4, + "type": "scale" + }, + { + "label": "Your Name (Single Answer)", + "id": "37a8c000-66a0-11ed-856c-6f39711bf041", + "value": "a", + "type": "single-choice" + }, + { + "label": "Your Name (Multiple Answer)", + "id": "4b435da0-66a0-11ed-856c-6f39711bf041", + "value": ["a1", "b1"], + "type": "multiple-choice" + } + ], + "surveyDismissed": false, + "surveyPending": false, + "receivedAt": "2022-11-17T17:51:21.764Z" + }, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/segment/test_0.json b/go/webhook/testcases/testdata/testcases/segment/test_0.json new file mode 100644 index 0000000000..868300e20e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/segment/test_0.json @@ -0,0 +1,251 @@ +{ + "name": "segment", + "description": "test-0", + "input": { + "request": { + "body": [ + { + "date": "2020-07-10T07:43:07.766Z", + "type": "s", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", + "details": { + "prompts": [], + "completedAt": 1594366987765, + "elapsedTime": null, + "session_id": "**************_***************" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": true + }, + { + "date": "2020-07-10T07:43:09.620Z", + "type": "seacft", + "description": "", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "okhttp 2.7.5 / Other 0.0.0", + "details": { + "code": "*************Xst" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": false + }, + { + "date": "2020-07-10T07:43:07.766Z", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", + "details": { + "prompts": [], + "completedAt": 1594366987765, + "elapsedTime": null, + "session_id": "**************_***************" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": true + }, + { + "type": "s", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", + "details": { + "prompts": [], + "completedAt": 1594366987765, + "elapsedTime": null, + "session_id": "**************_***************" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": true + } + ], + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "date": "2020-07-10T07:43:07.766Z", + "type": "s", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", + "details": { + "prompts": [], + "completedAt": 1594366987765, + "elapsedTime": null, + "session_id": "**************_***************" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": true, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + }, + { + "date": "2020-07-10T07:43:09.620Z", + "type": "seacft", + "description": "", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "okhttp 2.7.5 / Other 0.0.0", + "details": { + "code": "*************Xst" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": false, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + }, + { + "date": "2020-07-10T07:43:07.766Z", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", + "details": { + "prompts": [], + "completedAt": 1594366987765, + "elapsedTime": null, + "session_id": "**************_***************" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": true, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + }, + { + "type": "s", + "connection_id": "", + "client_id": "********************************", + "client_name": "My App", + "ip": "47.15.6.58", + "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", + "details": { + "prompts": [], + "completedAt": 1594366987765, + "elapsedTime": null, + "session_id": "**************_***************" + }, + "hostname": "************.us.auth0.com", + "user_id": "auth0|************************", + "user_name": "example@test.com", + "auth0_client": { + "name": "Auth0.Android", + "env": { + "android": "28" + }, + "version": "1.23.0" + }, + "log_id": "********************************************************", + "_id": "********************************************************", + "isMobile": true, + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30", + "messageId": "00000000-0000-0000-0000-000000000000" + } + ], + "errQueue": [] + }, + "skip": "NoAnonID error" +} diff --git a/go/webhook/testcases/testdata/testcases/shopify/carts_create.json b/go/webhook/testcases/testdata/testcases/shopify/carts_create.json deleted file mode 100644 index 6c37baa443..0000000000 --- a/go/webhook/testcases/testdata/testcases/shopify/carts_create.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "shopify", - "description": "Track Call -> carts_create ", - "input": { - "request": { - "query": "topic=carts_create" - } - }, - "output": { - "response": { - "status": 200, - "contentType": "text/plain", - "body": "OK" - } - } -} diff --git a/go/webhook/testcases/testdata/testcases/shopify/identify_call.json b/go/webhook/testcases/testdata/testcases/shopify/identify_call_for_customers_create_event.json similarity index 95% rename from go/webhook/testcases/testdata/testcases/shopify/identify_call.json rename to go/webhook/testcases/testdata/testcases/shopify/identify_call_for_customers_create_event.json index 90c741862a..821748094e 100644 --- a/go/webhook/testcases/testdata/testcases/shopify/identify_call.json +++ b/go/webhook/testcases/testdata/testcases/shopify/identify_call_for_customers_create_event.json @@ -3,8 +3,12 @@ "description": "Identify Call for customers create event", "input": { "request": { - "query": "topic=customers_create&signature=rudderstack", "body": { + "query_parameters": { + "topic": ["customers_create"], + "signature": ["rudderstack"], + "writeKey": ["sample-write-key"] + }, "id": 5747017285820, "email": "anuraj@rudderstack.com", "accepts_marketing": false, @@ -74,6 +78,9 @@ "country_name": "India", "default": true } + }, + "headers": { + "Content-Type": "application/json" } } }, @@ -166,9 +173,9 @@ "timestamp": "2021-12-29T09:45:20.000Z", "receivedAt": "2024-03-03T04:48:29.000Z", "request_ip": "192.0.2.30", - "rudderId": "56ad0483-e7e8-438d-958f-676fcbf3ed49", "messageId": "00000000-0000-0000-0000-000000000000" } - ] + ], + "errQueue": [] } } diff --git a/go/webhook/testcases/testdata/testcases/shopify/invalid_topic.json b/go/webhook/testcases/testdata/testcases/shopify/invalid_topic.json index f4048a0783..8439ce36e0 100644 --- a/go/webhook/testcases/testdata/testcases/shopify/invalid_topic.json +++ b/go/webhook/testcases/testdata/testcases/shopify/invalid_topic.json @@ -3,20 +3,28 @@ "description": "Invalid topic", "input": { "request": { - "query": "signature=rudderstack" + "body": { + "query_parameters": { + "signature": ["rudderstack"], + "writeKey": ["sample-write-key"] + } + }, + "headers": { + "Content-Type": "application/json" + } } }, "output": { "response": { "status": 400, - "contentType": "text/plain", "body": "Invalid topic in query_parameters\n" }, - "err_queue": [ + "queue": [], + "errQueue": [ { "query_parameters": { - "writeKey": ["{{.WriteKey}}"], - "signature": ["rudderstack"] + "signature": ["rudderstack"], + "writeKey": ["sample-write-key"] } } ] diff --git a/go/webhook/testcases/testdata/testcases/shopify/no_query_parameters.json b/go/webhook/testcases/testdata/testcases/shopify/no_query_parameters.json new file mode 100644 index 0000000000..1c69d854fd --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/shopify/no_query_parameters.json @@ -0,0 +1,21 @@ +{ + "name": "shopify", + "description": "No Query Parameters", + "input": { + "request": { + "body": {}, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Query_parameters is missing\n" + }, + "queue": [], + "errQueue": [{}] + }, + "skip": "not possible" +} diff --git a/go/webhook/testcases/testdata/testcases/shopify/no_query_params.json b/go/webhook/testcases/testdata/testcases/shopify/no_query_params.json deleted file mode 100644 index c9eda9924f..0000000000 --- a/go/webhook/testcases/testdata/testcases/shopify/no_query_params.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "shopify", - "description": "No Query Parameters", - "input": {}, - "output": { - "response": { - "status": 400, - "contentType": "text/plain", - "body": "Invalid topic in query_parameters\n" - }, - "err_queue": [ - { - "query_parameters": { - "writeKey": ["{{.WriteKey}}"] - } - } - ] - } -} diff --git a/go/webhook/testcases/testdata/testcases/shopify/topic_not_found.json b/go/webhook/testcases/testdata/testcases/shopify/topic_not_found.json new file mode 100644 index 0000000000..5b97996d17 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/shopify/topic_not_found.json @@ -0,0 +1,35 @@ +{ + "name": "shopify", + "description": "Topic Not found", + "input": { + "request": { + "body": { + "query_parameters": { + "topic": [], + "signature": ["rudderstack"], + "writeKey": ["sample-write-key"] + } + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 400, + "body": "Topic not found\n" + }, + "queue": [], + "errQueue": [ + { + "query_parameters": { + "topic": [], + "signature": ["rudderstack"], + "writeKey": ["sample-write-key"] + } + } + ] + }, + "skip": "not possible" +} diff --git a/go/webhook/testcases/testdata/testcases/shopify/track_call____carts_create_.json b/go/webhook/testcases/testdata/testcases/shopify/track_call____carts_create_.json new file mode 100644 index 0000000000..4c7237db1b --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/shopify/track_call____carts_create_.json @@ -0,0 +1,30 @@ +{ + "name": "shopify", + "description": "Track Call -> carts_create ", + "input": { + "request": { + "body": { + "id": "shopify_test3", + "query_parameters": { + "topic": ["carts_create"] + }, + "token": "shopify_test3", + "line_items": [], + "note": null, + "updated_at": "2023-02-10T12:16:07.251Z", + "created_at": "2023-02-10T12:05:04.402Z" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/shopify/fullfillments_updated_event.json b/go/webhook/testcases/testdata/testcases/shopify/track_call____fullfillments_updated_event.json similarity index 96% rename from go/webhook/testcases/testdata/testcases/shopify/fullfillments_updated_event.json rename to go/webhook/testcases/testdata/testcases/shopify/track_call____fullfillments_updated_event.json index a7d9717c3d..81fb98322e 100644 --- a/go/webhook/testcases/testdata/testcases/shopify/fullfillments_updated_event.json +++ b/go/webhook/testcases/testdata/testcases/shopify/track_call____fullfillments_updated_event.json @@ -1,10 +1,14 @@ { "name": "shopify", - "description": "Fulfillment updated event", + "description": "Track Call -> Fullfillments updated event", "input": { "request": { - "query": "signature=rudderstack&topic=fulfillments_update", "body": { + "query_parameters": { + "topic": ["fulfillments_update"], + "writeKey": ["sample-write-key"], + "signature": ["rudderstack"] + }, "shipping_address": { "address1": "11 Rani Sankari Lane Patuapara Bhowanipore" }, @@ -108,13 +112,15 @@ "https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530" ], "updated_at": "2022-01-05T18:16:48+05:30" + }, + "headers": { + "Content-Type": "application/json" } } }, "output": { "response": { "status": 200, - "contentType": "text/plain", "body": "OK" }, "queue": [ @@ -243,9 +249,9 @@ }, "receivedAt": "2024-03-03T04:48:29.000Z", "request_ip": "192.0.2.30", - "rudderId": "f4ff065d-11d0-4411-b6be-1d0540687f04", "messageId": "00000000-0000-0000-0000-000000000000" } - ] + ], + "errQueue": [] } } diff --git a/go/webhook/testcases/testdata/testcases/shopify/unsupported_checkout_event.json b/go/webhook/testcases/testdata/testcases/shopify/unsupported_checkout_event.json index 2a6f6c6642..37ec9c03dc 100644 --- a/go/webhook/testcases/testdata/testcases/shopify/unsupported_checkout_event.json +++ b/go/webhook/testcases/testdata/testcases/shopify/unsupported_checkout_event.json @@ -3,8 +3,12 @@ "description": "Unsupported checkout event", "input": { "request": { - "query": "signature=rudderstack&topic=checkout_delete", "body": { + "query_parameters": { + "topic": ["checkout_delete"], + "writeKey": ["sample-write-key"], + "signature": ["rudderstack"] + }, "admin_graphql_api_id": "gid://shopify/Fulfillment/4124667937024", "created_at": "2022-01-05T18:13:02+05:30", "destination": null, @@ -37,14 +41,18 @@ "https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530" ], "updated_at": "2022-01-05T18:16:48+05:30" + }, + "headers": { + "Content-Type": "application/json" } } }, "output": { "response": { "status": 200, - "contentType": "text/plain", "body": "OK" - } + }, + "queue": [], + "errQueue": [] } } diff --git a/go/webhook/testcases/testdata/testcases/shopify/unsupported_event_type.json b/go/webhook/testcases/testdata/testcases/shopify/unsupported_event_type.json index 26c08e9c4f..c2dfe7f584 100644 --- a/go/webhook/testcases/testdata/testcases/shopify/unsupported_event_type.json +++ b/go/webhook/testcases/testdata/testcases/shopify/unsupported_event_type.json @@ -1,16 +1,26 @@ { "name": "shopify", - "description": "Unsupported event type", + "description": "Unsupported Event Type", "input": { "request": { - "query": "signature=rudderstack&topic=random_event" + "body": { + "query_parameters": { + "topic": ["random_event"], + "signature": ["rudderstack"], + "writeKey": ["sample-write-key"] + } + }, + "headers": { + "Content-Type": "application/json" + } } }, "output": { "response": { "status": 200, - "contentType": "text/plain", "body": "OK" - } + }, + "queue": [], + "errQueue": [] } } diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_0.json b/go/webhook/testcases/testdata/testcases/signl4/test_0.json new file mode 100644 index 0000000000..aedf7026d3 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_0.json @@ -0,0 +1,63 @@ +{ + "name": "signl4", + "description": "test-0", + "input": { + "request": { + "body": { + "eventType": 200, + "eventRaisedUtc": "2017-09-01T08:11:37.4815663Z", + "subscription": { + "id": "0acf8014-22f2-4503-88d7-f7d05b46744f" + }, + "alert": { + "statusCode": 1, + "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "externalEventId": "INC091210", + "id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" + }, + "id": "dd209a2d-e037-41ee-b37d-f605cc0a39fb" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + } + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "dd209a2d-e037-41ee-b37d-f605cc0a39fb", + "originalTimestamp": "2017-09-01T08:11:37.000Z", + "event": "New Alert Created", + "properties": { + "eventType": 200, + "subscription.id": "0acf8014-22f2-4503-88d7-f7d05b46744f", + "alert.statusCode": 1, + "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "alert.externalEventId": "INC091210", + "alert.id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_1.json b/go/webhook/testcases/testdata/testcases/signl4/test_1.json new file mode 100644 index 0000000000..5959deb4e1 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_1.json @@ -0,0 +1,80 @@ +{ + "name": "signl4", + "description": "test-1", + "input": { + "request": { + "body": { + "eventType": 201, + "eventRaisedUtc": "2017-09-01T08:11:37.4815663Z", + "subscription": { + "id": "0acf8014-22f2-4503-88d7-f7d05b46744f" + }, + "user": { + "username": "Rene", + "mailaddress": "rene@signl4.com", + "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" + }, + "alert": { + "statusCode": 2, + "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "externalEventId": "Content you passed in the X-S4-ExternalID parameter", + "acknowledgedUserIds": ["f0bd5063-9588-51cf-b3d9-94e5647dedc5"], + "id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" + }, + "id": "dd209a2d-e037-41ee-b37d-f605cc0a39fb" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + }, + "externalId": [ + { + "type": "signl4UserId", + "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" + } + ], + "traits": { + "email": "rene@signl4.com", + "name": "Rene" + } + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "dd209a2d-e037-41ee-b37d-f605cc0a39fb", + "originalTimestamp": "2017-09-01T08:11:37.000Z", + "event": "Alert Confirmed", + "properties": { + "eventType": 201, + "subscription.id": "0acf8014-22f2-4503-88d7-f7d05b46744f", + "alert.statusCode": 2, + "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "alert.externalEventId": "Content you passed in the X-S4-ExternalID parameter", + "alert.acknowledgedUserIds[0]": "f0bd5063-9588-51cf-b3d9-94e5647dedc5", + "alert.id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_2.json b/go/webhook/testcases/testdata/testcases/signl4/test_2.json new file mode 100644 index 0000000000..ac16f256e7 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_2.json @@ -0,0 +1,80 @@ +{ + "name": "signl4", + "description": "test-2", + "input": { + "request": { + "body": { + "eventType": 201, + "eventRaisedUtc": "2017-09-01T08:11:37.4815663Z", + "subscription": { + "id": "0acf8014-22f2-4503-88d7-f7d05b46744f" + }, + "user": { + "username": "Rene", + "mailaddress": "rene@signl4.com", + "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" + }, + "alert": { + "statusCode": 4, + "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "externalEventId": "Content you passed in the X-S4-ExternalID parameter", + "acknowledgedUserIds": ["f0bd5063-9588-51cf-b3d9-94e5647dedc5"], + "id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" + }, + "id": "dd209a2d-e037-41ee-b37d-f605cc0a39fb" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + }, + "externalId": [ + { + "type": "signl4UserId", + "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" + } + ], + "traits": { + "email": "rene@signl4.com", + "name": "Rene" + } + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "dd209a2d-e037-41ee-b37d-f605cc0a39fb", + "originalTimestamp": "2017-09-01T08:11:37.000Z", + "event": "Alert Resolved", + "properties": { + "eventType": 201, + "subscription.id": "0acf8014-22f2-4503-88d7-f7d05b46744f", + "alert.statusCode": 4, + "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "alert.externalEventId": "Content you passed in the X-S4-ExternalID parameter", + "alert.acknowledgedUserIds[0]": "f0bd5063-9588-51cf-b3d9-94e5647dedc5", + "alert.id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_3.json b/go/webhook/testcases/testdata/testcases/signl4/test_3.json new file mode 100644 index 0000000000..e77d3ecf67 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_3.json @@ -0,0 +1,69 @@ +{ + "name": "signl4", + "description": "test-3", + "input": { + "request": { + "body": { + "eventType": 202, + "eventRaisedUtc": "2020-01-10T12:27:19Z", + "subscription": { + "id": "b8fdd850-e2ad-45ff-924d-9c332a063200" + }, + "team": { + "id": "0e8979f7-0c6a-472d-8918-ecfd339252f8" + }, + "alert": { + "statusCode": 1, + "eventId": "2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9", + "externalEventId": "INC091210", + "acknowledgedUserIds": [], + "id": "2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2" + }, + "id": "27283793-47c8-4da2-9767-d37be224338d" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + } + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "27283793-47c8-4da2-9767-d37be224338d", + "originalTimestamp": "2020-01-10T12:27:19.000Z", + "event": "Alert Escalated", + "properties": { + "eventType": 202, + "subscription.id": "b8fdd850-e2ad-45ff-924d-9c332a063200", + "team.id": "0e8979f7-0c6a-472d-8918-ecfd339252f8", + "alert.statusCode": 1, + "alert.eventId": "2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9", + "alert.externalEventId": "INC091210", + "alert.id": "2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2", + "alert.acknowledgedUserIds": [] + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_4.json b/go/webhook/testcases/testdata/testcases/signl4/test_4.json new file mode 100644 index 0000000000..47cde8a6e6 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_4.json @@ -0,0 +1,84 @@ +{ + "name": "signl4", + "description": "test-4", + "input": { + "request": { + "body": { + "eventType": 203, + "eventRaisedUtc": "2018-04-17T15:00:32Z", + "subscription": { + "id": "1578ebd9-0a27-44ab-bc8e-52cd7d32e81d" + }, + "user": { + "username": "Rene", + "mailaddress": "rene@signl4.com", + "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" + }, + "alert": { + "statusCode": 0, + "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "externalEventId": "Content you passed in the X-S4-ExternalID parameter", + "id": "2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2" + }, + "annotation": { + "message": "OK, I'll take care about it.", + "id": "2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761" + }, + "id": "141c0f88-7831-4d5e-b055-f6e83c269770" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + }, + "externalId": [ + { + "type": "signl4UserId", + "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" + } + ], + "traits": { + "email": "rene@signl4.com", + "name": "Rene" + } + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "141c0f88-7831-4d5e-b055-f6e83c269770", + "originalTimestamp": "2018-04-17T15:00:32.000Z", + "event": "Alert Annotated", + "properties": { + "eventType": 203, + "subscription.id": "1578ebd9-0a27-44ab-bc8e-52cd7d32e81d", + "alert.statusCode": 0, + "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", + "alert.externalEventId": "Content you passed in the X-S4-ExternalID parameter", + "alert.id": "2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2", + "annotation.message": "OK, I'll take care about it.", + "annotation.id": "2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_5.json b/go/webhook/testcases/testdata/testcases/signl4/test_5.json new file mode 100644 index 0000000000..af7bbd19b1 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_5.json @@ -0,0 +1,53 @@ +{ + "name": "signl4", + "description": "test-5", + "input": { + "request": { + "body": { + "eventType": 300, + "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", + "team": { + "id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + } + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", + "originalTimestamp": "2017-09-01T09:16:17.000Z", + "event": "Duty Period Started", + "properties": { + "eventType": 300, + "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_6.json b/go/webhook/testcases/testdata/testcases/signl4/test_6.json new file mode 100644 index 0000000000..21bf9c94e4 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_6.json @@ -0,0 +1,53 @@ +{ + "name": "signl4", + "description": "test-6", + "input": { + "request": { + "body": { + "eventType": 301, + "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", + "team": { + "id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + } + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", + "originalTimestamp": "2017-09-01T09:16:17.000Z", + "event": "Duty Period Ended", + "properties": { + "eventType": 301, + "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_7.json b/go/webhook/testcases/testdata/testcases/signl4/test_7.json new file mode 100644 index 0000000000..942da4b48e --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_7.json @@ -0,0 +1,62 @@ +{ + "name": "signl4", + "description": "test-7", + "input": { + "request": { + "body": { + "eventType": 302, + "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", + "team": { + "id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "user": { + "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" + }, + "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + }, + "externalId": [ + { + "type": "signl4UserId", + "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" + } + ] + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", + "originalTimestamp": "2017-09-01T09:16:17.000Z", + "event": "Somebody Punched-In", + "properties": { + "eventType": 302, + "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/signl4/test_8.json b/go/webhook/testcases/testdata/testcases/signl4/test_8.json new file mode 100644 index 0000000000..a746a28862 --- /dev/null +++ b/go/webhook/testcases/testdata/testcases/signl4/test_8.json @@ -0,0 +1,62 @@ +{ + "name": "signl4", + "description": "test-8", + "input": { + "request": { + "body": { + "eventType": 303, + "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", + "team": { + "id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "user": { + "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" + }, + "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" + }, + "headers": { + "Content-Type": "application/json" + } + } + }, + "output": { + "response": { + "status": 200, + "body": "OK" + }, + "queue": [ + { + "context": { + "library": { + "name": "unknown", + "version": "unknown" + }, + "integration": { + "name": "Signl4" + }, + "externalId": [ + { + "type": "signl4UserId", + "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" + } + ] + }, + "integrations": { + "Signl4": false + }, + "type": "track", + "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", + "originalTimestamp": "2017-09-01T09:16:17.000Z", + "event": "Somebody Punched-Out", + "properties": { + "eventType": 303, + "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" + }, + "anonymousId": "97fcd7b2-cc24-47d7-b776-057b7b199513", + "receivedAt": "2024-03-03T04:48:29.000Z", + "request_ip": "192.0.2.30" + } + ], + "errQueue": [] + } +} diff --git a/go/webhook/testcases/testdata/testcases/slack/msg_event.json b/go/webhook/testcases/testdata/testcases/slack/msg_event.json deleted file mode 100644 index 9ca194858c..0000000000 --- a/go/webhook/testcases/testdata/testcases/slack/msg_event.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "name": "slack", - "description": "Message event", - "module": "source", - "version": "v0", - "input": { - "request": { - "body": { - "event": { - "user": "U04G7H550", - "type": "message", - "ts": "1709441309.308399", - "client_msg_id": "834r664e-ec75-445d-t5c6-b873a07y9c81", - "text": "What is the pricing of product X", - "team": "T0GFJL5J7", - "thread_ts": "1709407304.839329", - "parent_user_id": "U06P6LQTPV", - "blocks": [ - { - "type": "rich_text", - "block_id": "xGKJl", - "elements": [ - { - "type": "rich_text_section", - "elements": [ - { - "type": "text", - "text": "What is the pricing of product X" - }, - { - "type": "channel", - "channel_id": "C03CDQTPI65" - }, - { - "type": "text", - "text": " to do this" - } - ] - } - ] - } - ], - "channel": "C03CDQTPI65", - "event_ts": "1709441309.308399", - "channel_type": "channel" - }, - "type": "event_callback", - "event_id": "EvY5JTJ0NG5", - "event_time": 1709441309, - "token": "REm2987dqtpi72Lq", - "team_id": "T0GFJL5J7", - "context_team_id": "T01gqtPIL5J7", - "context_enterprise_id": null, - "api_app_id": "A04QTPIHRR", - "authorizations": [ - { - "enterprise_id": null, - "team_id": "T0GFJL5J7", - "user_id": "W012CDE", - "is_bot": true, - "is_enterprise_install": false - } - ], - "is_ext_shared_channel": false, - "event_context": "4-wd6joiQfdgTRQTpIzdfifQ" - }, - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - }, - "pathSuffix": "" - }, - "output": { - "response": { - "status": 200, - "body": "OK" - }, - "queue": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "SLACK" - }, - "externalId": [ - { - "type": "slackUserId", - "id": "U04G7H550" - } - ] - }, - "integrations": { - "SLACK": false - }, - "type": "track", - "event": "Message", - "anonymousId": "7509c04f547b05afb6838aa742f4910263d6", - "originalTimestamp": "2024-03-03T04:48:29.308Z", - "sentAt": "2024-03-03T04:48:29.000Z", - "properties": { - "user": "U04G7H550", - "type": "message", - "ts": "1709441309.308399", - "client_msg_id": "834r664e-ec75-445d-t5c6-b873a07y9c81", - "text": "What is the pricing of product X", - "team": "T0GFJL5J7", - "thread_ts": "1709407304.839329", - "parent_user_id": "U06P6LQTPV", - "blocks": [ - { - "type": "rich_text", - "block_id": "xGKJl", - "elements": [ - { - "type": "rich_text_section", - "elements": [ - { - "type": "text", - "text": "What is the pricing of product X" - }, - { - "type": "channel", - "channel_id": "C03CDQTPI65" - }, - { - "type": "text", - "text": " to do this" - } - ] - } - ] - } - ], - "channel": "C03CDQTPI65", - "event_ts": "1709441309.308399", - "channel_type": "channel" - }, - "request_ip": "192.0.2.30", - "receivedAt": "2024-03-03T04:48:29.000Z", - "rudderId": "5540ba39-3df8-4970-8b50-b329182c9bd5", - "messageId": "00000000-0000-0000-0000-000000000000" - } - ] - } -} diff --git a/go/webhook/testcases/testdata/testcases/slack/team_joined.json b/go/webhook/testcases/testdata/testcases/slack/team_joined.json deleted file mode 100644 index 114872a76a..0000000000 --- a/go/webhook/testcases/testdata/testcases/slack/team_joined.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "slack", - "description": "Team joined event", - "module": "source", - "version": "v0", - "input": { - "request": { - "body": { - "event": { - "type": "team_join", - "user": { - "id": "W012CDE", - "name": "johnd", - "real_name": "John Doe" - } - }, - "type": "event_callback", - "event_id": "Ev06TJ0NG5", - "event_time": 1709441309, - "token": "REm276ggfh72Lq", - "team_id": "T0GFJL5J7", - "context_team_id": "T0GFJL5J7", - "context_enterprise_id": null, - "api_app_id": "B02SJMHRR", - "authorizations": [ - { - "enterprise_id": null, - "team_id": "T0GFJL5J7", - "user_id": "U04G7H550", - "is_bot": true, - "is_enterprise_install": false - } - ], - "is_ext_shared_channel": false, - "event_context": "eJldCI65436EUEpMSFhgfhg76joiQzAxRTRQTEIxMzUifQ" - }, - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - }, - "pathSuffix": "" - }, - "output": { - "response": { - "status": 200, - "body": "OK" - }, - "queue": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "SLACK" - }, - "externalId": [ - { - "type": "slackUserId", - "id": "W012CDE" - } - ] - }, - "integrations": { - "SLACK": false - }, - "type": "identify", - "event": "Team Join", - "anonymousId": "2bc5ae2825a712d3d154cbdacb86ac16c278", - "originalTimestamp": "2024-03-03T04:48:29.000Z", - "sentAt": "2024-03-03T04:48:29.000Z", - "properties": { - "type": "team_join", - "user": { - "id": "W012CDE", - "name": "johnd", - "real_name": "John Doe" - } - }, - "request_ip": "192.0.2.30", - "receivedAt": "2024-03-03T04:48:29.000Z", - "rudderId": "669b7c62-3e8b-475c-8f0a-356b2a9518e2", - "messageId": "00000000-0000-0000-0000-000000000000" - } - ] - } -} diff --git a/go/webhook/testcases/testdata/testcases/slack/verification.json b/go/webhook/testcases/testdata/testcases/slack/verification.json deleted file mode 100644 index 94e072dd8f..0000000000 --- a/go/webhook/testcases/testdata/testcases/slack/verification.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "slack", - "description": "Webhook url verification event", - "module": "source", - "version": "v0", - "input": { - "request": { - "body": { - "token": "Jhj5dZrVaK7ZwHHjRyZWjbDl", - "challenge": "3eZbrw1aB10FEMAGAZd4FyFQ", - "type": "url_verification" - }, - "method": "POST", - "headers": { - "Content-Type": "application/json" - } - }, - "pathSuffix": "" - }, - "output": { - "response": { - "status": 200, - "contentType": "application/json", - "body": { - "challenge": "3eZbrw1aB10FEMAGAZd4FyFQ" - } - }, - "queue": [], - "proc_err": [] - } -} diff --git a/package-lock.json b/package-lock.json index ea01d532e0..76ae6c9621 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.72.3", + "version": "1.74.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.72.3", + "version": "1.74.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", @@ -63,7 +63,6 @@ "prom-client": "^14.2.0", "qs": "^6.11.1", "rs-jsonpath": "^1.1.2", - "rudder-transformer-cdk": "^1.4.11", "set-value": "^4.1.0", "sha256": "^0.2.0", "sqlstring": "^2.3.3", @@ -105,7 +104,7 @@ "eslint-plugin-unicorn": "^46.0.1", "glob": "^10.3.3", "http-terminator": "^3.2.0", - "husky": "^8.0.3", + "husky": "^9.1.1", "jest": "^29.5.0", "jest-sonar": "^0.2.16", "jest-when": "^3.5.2", @@ -4417,19 +4416,6 @@ "heap": ">= 0.2.0" } }, - "node_modules/@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" - }, - "node_modules/@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", @@ -5649,24 +5635,6 @@ "node": "^14.17.0 || >=16.0.0" } }, - "node_modules/@sideway/address": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", - "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" - }, - "node_modules/@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -12927,15 +12895,15 @@ } }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.1.tgz", + "integrity": "sha512-fCqlqLXcBnXa/TJXmT93/A36tJsjdJkibQ1MuIiFyCCYUlpYpIaj2mv1w+3KR6Rzu1IC3slFTje5f6DUp2A2rg==", "dev": true, "bin": { - "husky": "lib/bin.js" + "husky": "bin.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -15510,18 +15478,6 @@ "jiti": "bin/jiti.js" } }, - "node_modules/joi": { - "version": "17.11.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", - "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", - "dependencies": { - "@hapi/hoek": "^9.0.0", - "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.3", - "@sideway/formula": "^3.0.1", - "@sideway/pinpoint": "^2.0.0" - } - }, "node_modules/js-sha1": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz", @@ -19774,23 +19730,6 @@ "node": ">=0.4.0" } }, - "node_modules/rudder-transformer-cdk": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/rudder-transformer-cdk/-/rudder-transformer-cdk-1.4.11.tgz", - "integrity": "sha512-u2t/L47tNe9wyzSpQptLkiECT0/P5Xx8BLmZisfuXQx3lXco57oaDX/Ii1ZhEiHM2zht+NiyrGkvhBKMt1IAyA==", - "dependencies": { - "get-value": "^3.0.1", - "handlebars": "^4.7.7", - "joi": "^17.9.2", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "moment-timezone": "^0.5.43", - "set-value": "^4.1.0", - "sha256": "^0.2.0", - "unset-value": "^2.0.1", - "winston": "^3.8.1" - } - }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", diff --git a/package.json b/package.json index 6f904d8226..f9039d1368 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.72.3", + "version": "1.74.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { @@ -108,7 +108,6 @@ "prom-client": "^14.2.0", "qs": "^6.11.1", "rs-jsonpath": "^1.1.2", - "rudder-transformer-cdk": "^1.4.11", "set-value": "^4.1.0", "sha256": "^0.2.0", "sqlstring": "^2.3.3", @@ -150,7 +149,7 @@ "eslint-plugin-unicorn": "^46.0.1", "glob": "^10.3.3", "http-terminator": "^3.2.0", - "husky": "^8.0.3", + "husky": "^9.1.1", "jest": "^29.5.0", "jest-sonar": "^0.2.16", "jest-when": "^3.5.2", diff --git a/src/cdk/v1/autopilot/config.yaml b/src/cdk/v1/autopilot/config.yaml deleted file mode 100644 index c6cccd59d6..0000000000 --- a/src/cdk/v1/autopilot/config.yaml +++ /dev/null @@ -1,33 +0,0 @@ -message: - supportedMessageTypes: - - identify - - track - identify: - transformation: - mapperPath: ./mapping/identify.yaml - postMapper: - name: 'identifyPostMapper' - response: - endpoint: 'https://api2.autopilothq.com/v1/contact' - method: POST - format: JSON - headers: - Accept: 'application/json' - autopilotapikey: '{{ destConfig.apiKey }}' - Content-Type: 'application/json' - userId: '{{ message.anonymousId }}' - - track: - transformation: - mapperPath: ./mapping/track.yaml - postMapper: - name: 'trackPostMapper' - response: - endpoint: '{{ rudderContext.endpoint }}' - method: POST - format: JSON - headers: - Accept: 'application/json' - autopilotapikey: '{{ destConfig.apiKey }}' - Content-Type: 'application/json' - userId: '{{ message.anonymousId }}' diff --git a/src/cdk/v1/autopilot/mapping/identify.yaml b/src/cdk/v1/autopilot/mapping/identify.yaml deleted file mode 100644 index a460907b7e..0000000000 --- a/src/cdk/v1/autopilot/mapping/identify.yaml +++ /dev/null @@ -1,38 +0,0 @@ -- destKey: Email - sourceKeys: - - traits.email - - context.traits.email - -- destKey: FirstName - sourceKeys: - - traits.firstName - - context.traits.firstName - - traits.firstname - - context.traits.firstname - -- destKey: LastName - sourceKeys: - - traits.lastName - - context.traits.lastName - - traits.lastname - - context.traits.lastname - -- destKey: Phone - sourceKeys: - - traits.phone - - context.traits.phone - -- destKey: Company - sourceKeys: - - traits.company.name - - context.traits.company.name - -- destKey: Status - sourceKeys: - - traits.status - - context.traits.status - -- destKey: LeadSource - sourceKeys: - - traits.LeadSource - - context.traits.LeadSource diff --git a/src/cdk/v1/autopilot/mapping/track.yaml b/src/cdk/v1/autopilot/mapping/track.yaml deleted file mode 100644 index 0315d2bcda..0000000000 --- a/src/cdk/v1/autopilot/mapping/track.yaml +++ /dev/null @@ -1,2 +0,0 @@ -- destKey: property - sourceKeys: properties diff --git a/src/cdk/v1/autopilot/transform.js b/src/cdk/v1/autopilot/transform.js deleted file mode 100644 index b27e50f096..0000000000 --- a/src/cdk/v1/autopilot/transform.js +++ /dev/null @@ -1,55 +0,0 @@ -const { Utils } = require('rudder-transformer-cdk'); -const { InstrumentationError } = require('@rudderstack/integrations-lib'); - -function identifyPostMapper(event, mappedPayload) { - const { message } = event; - const payload = mappedPayload; - - // better to outsource constants like this in a separate file - const identifyFields = [ - 'email', - 'firstname', - 'firstName', - 'lastname', - 'lastName', - 'phone', - 'company', - 'status', - 'LeadSource', - ]; - - let responseBody; - const customPayload = message.traits || message.context.traits || {}; - identifyFields.forEach((value) => { - delete customPayload[value]; - }); - if (Object.keys(customPayload).length > 0) { - responseBody = { - contact: { ...payload, custom: customPayload }, - }; - } else { - responseBody = { - contact: { ...payload }, - }; - } - return responseBody; // this flows onto the next stage in the yaml -} - -function trackPostMapper(event, mappedPayload, rudderContext) { - const { message, destination } = event; - - const contactIdOrEmail = Utils.getFieldValueFromMessage(message, 'email'); - if (contactIdOrEmail) { - // eslint-disable-next-line no-param-reassign - rudderContext.endpoint = `https://api2.autopilothq.com/v1/trigger/${destination.Config.triggerId}/contact/${contactIdOrEmail}`; - } else { - throw new InstrumentationError('Email is required for track calls'); - } - // The plan is to delete the rudderResponse property from the mappedPayload finally - // While removing the rudderResponse property, we'd need to do a deep-clone of rudderProperty first - // And then go ahead with `rudderResponse` property - // This `rudderResponse` property has to be combined with transformation mentioned `response` tag in config.yaml - return mappedPayload; // this flows onto the next stage in the yaml -} - -module.exports = { identifyPostMapper, trackPostMapper }; diff --git a/src/cdk/v1/dcm_floodlight/config.js b/src/cdk/v1/dcm_floodlight/config.js deleted file mode 100644 index ce7ab69902..0000000000 --- a/src/cdk/v1/dcm_floodlight/config.js +++ /dev/null @@ -1,5 +0,0 @@ -const BASE_URL = 'https://ad.doubleclick.net/ddm/activity/'; - -const BLACKLISTED_CHARACTERS = ['"', '<', '>', '#']; - -module.exports = { BASE_URL, BLACKLISTED_CHARACTERS }; diff --git a/src/cdk/v1/dcm_floodlight/config.yaml b/src/cdk/v1/dcm_floodlight/config.yaml deleted file mode 100644 index cac23f66d3..0000000000 --- a/src/cdk/v1/dcm_floodlight/config.yaml +++ /dev/null @@ -1,26 +0,0 @@ -message: - supportedMessageTypes: - - track - - page - track: - transformation: - mapperPath: ./mapping/DCMFloodlightConfig.yaml - postMapper: - name: 'postMapper' - response: - endpoint: '{{ rudderContext.endpoint }}' - method: GET - format: JSON - headers: - User-Agent: '{{ rudderContext.userAgent }}' - page: - transformation: - mapperPath: ./mapping/DCMFloodlightConfig.yaml - postMapper: - name: 'postMapper' - response: - endpoint: '{{ rudderContext.endpoint }}' - method: GET - format: JSON - headers: - User-Agent: '{{ rudderContext.userAgent }}' diff --git a/src/cdk/v1/dcm_floodlight/mapping/DCMFloodlightConfig.yaml b/src/cdk/v1/dcm_floodlight/mapping/DCMFloodlightConfig.yaml deleted file mode 100644 index 6126dac5c7..0000000000 --- a/src/cdk/v1/dcm_floodlight/mapping/DCMFloodlightConfig.yaml +++ /dev/null @@ -1,21 +0,0 @@ -- destKey: dc_rdid - sourceKeys: context.device.advertisingId - required: true - -- destKey: ord - sourceKeys: - - properties.orderId - - properties.order_id - required: false - -- destKey: qty - sourceKeys: properties.quantity - required: false - -- destKey: cost - sourceKeys: properties.revenue - required: false - -- destKey: dc_lat - sourceKeys: context.device.adTrackingEnabled - required: false diff --git a/src/cdk/v1/dcm_floodlight/transform.js b/src/cdk/v1/dcm_floodlight/transform.js deleted file mode 100644 index bb93333745..0000000000 --- a/src/cdk/v1/dcm_floodlight/transform.js +++ /dev/null @@ -1,211 +0,0 @@ -/* eslint-disable no-param-reassign */ -const get = require('get-value'); -const lodash = require('lodash'); -const { - removeUndefinedAndNullValues, - isDefinedAndNotNull, -} = require('rudder-transformer-cdk/build/utils'); -const { ConfigurationError, InstrumentationError } = require('@rudderstack/integrations-lib'); -const { - getIntegrationsObj, - isEmpty, - isEmptyObject, - getValueFromPropertiesOrTraits, - getHashFromArray, -} = require('../../../v0/util'); -const { GENERIC_TRUE_VALUES, GENERIC_FALSE_VALUES } = require('../../../constants'); -const { BASE_URL, BLACKLISTED_CHARACTERS } = require('./config'); - -// append properties to endpoint -// eg: ${BASE_URL}key1=value1;key2=value2;.... -const appendProperties = (payload) => { - let endpoint = ''; - endpoint += Object.keys(payload) - .map((key) => `${key}=${payload[key]}`) - .join(';'); - - return endpoint; -}; - -// transform webapp dynamicForm custom floodlight variable -// into {property1: u1, property2: u2, ...} -// Ref - https://support.google.com/campaignmanager/answer/2823222?hl=en -const transformCustomVariable = (customFloodlightVariable, message) => { - const customVariable = {}; - const customMapping = getHashFromArray(customFloodlightVariable, 'from', 'to', false); - - Object.keys(customMapping).forEach((key) => { - // it takes care of getting the value in the order. - // returns null if not present - const itemValue = getValueFromPropertiesOrTraits({ - message, - key, - }); - - if ( - // the value is not null - !lodash.isNil(itemValue) && - // the value is string and doesn't have any blacklisted characters - !( - typeof itemValue === 'string' && BLACKLISTED_CHARACTERS.some((k) => itemValue.includes(k)) - ) && - // boolean values are not supported - typeof itemValue !== 'boolean' - ) { - customVariable[`u${customMapping[key].replace(/u/g, '')}`] = encodeURIComponent(itemValue); - } - }); - - return customVariable; -}; - -// valid flag should be provided [1|true] or [0|false] -const mapFlagValue = (key, value) => { - if (GENERIC_TRUE_VALUES.includes(value.toString())) { - return 1; - } - if (GENERIC_FALSE_VALUES.includes(value.toString())) { - return 0; - } - - throw new InstrumentationError(`${key}: valid parameters are [1|true] or [0|false]`); -}; - -/** - * postMapper does the processing after we do the initial mapping - * defined in mapping/*.yaml - * @param {*} input - * @param {*} mappedPayload - * @param {*} rudderContext - * @returns - */ -const postMapper = (input, mappedPayload, rudderContext) => { - const { message, destination } = input; - const { advertiserId, conversionEvents } = destination.Config; - let { activityTag, groupTag } = destination.Config; - let customFloodlightVariable; - let salesTag; - - let event; - // for page() take event from name and category - if (message.type.toLowerCase() === 'page') { - const { category } = message.properties; - const { name } = message || message.properties; - - if (category && name) { - message.event = `Viewed ${category} ${name} Page`; - } else if (category) { - // categorized pages - message.event = `Viewed ${category} Page`; - } else if (name) { - // named pages - message.event = `Viewed ${name} Page`; - } else { - message.event = 'Viewed Page'; - } - } - - event = message.event; - - if (!event) { - throw new InstrumentationError(`${message.type}:: event is required`); - } - - const userAgent = get(message, 'context.userAgent'); - if (!userAgent) { - throw new InstrumentationError(`${message.type}:: userAgent is required`); - } - rudderContext.userAgent = userAgent; - - // find conversion event - // some() stops execution if at least one condition is passed and returns bool - event = event.trim().toLowerCase(); - const conversionEventFound = conversionEvents.some((conversionEvent) => { - if ( - conversionEvent && - conversionEvent.eventName && - conversionEvent.eventName.trim().toLowerCase() === event - ) { - if ( - !isEmpty(conversionEvent.floodlightActivityTag) && - !isEmpty(conversionEvent.floodlightGroupTag) - ) { - activityTag = conversionEvent.floodlightActivityTag.trim(); - groupTag = conversionEvent.floodlightGroupTag.trim(); - } - salesTag = conversionEvent.salesTag; - customFloodlightVariable = conversionEvent.customVariables || []; - return true; - } - return false; - }); - - if (!conversionEventFound) { - throw new ConfigurationError(`${message.type}:: Conversion event not found`); - } - - // Ref - https://support.google.com/displayvideo/answer/6040012?hl=en - customFloodlightVariable = transformCustomVariable(customFloodlightVariable, message); - mappedPayload = { - src: advertiserId, - cat: activityTag, - type: groupTag, - ...mappedPayload, - }; - - if (salesTag) { - // sums quantity from products array or fallback to properties.quantity - const products = get(message, 'properties.products'); - if (!isEmpty(products) && Array.isArray(products)) { - const quantities = products.reduce((accumulator, product) => { - if (product.quantity) { - return accumulator + product.quantity; - } - return accumulator; - }, 0); - if (quantities) { - mappedPayload.qty = quantities; - } - } - } else { - // for counter tag - mappedPayload.ord = get(message, 'messageId'); - delete mappedPayload.qty; - delete mappedPayload.cost; - } - - // COPPA, GDPR, npa must be provided inside integration object ("DCM FLoodlight") - // Ref - https://support.google.com/displayvideo/answer/6040012?hl=en - const integrationsObj = getIntegrationsObj(message, 'dcm_floodlight'); - if (integrationsObj) { - if (isDefinedAndNotNull(integrationsObj.COPPA)) { - mappedPayload.tag_for_child_directed_treatment = mapFlagValue('COPPA', integrationsObj.COPPA); - } - - if (isDefinedAndNotNull(integrationsObj.GDPR)) { - mappedPayload.tfua = mapFlagValue('GDPR', integrationsObj.GDPR); - } - - if (isDefinedAndNotNull(integrationsObj.npa)) { - mappedPayload.npa = mapFlagValue('npa', integrationsObj.npa); - } - } - - if (isDefinedAndNotNull(mappedPayload.dc_lat)) { - mappedPayload.dc_lat = mapFlagValue('dc_lat', mappedPayload.dc_lat); - } - - mappedPayload = removeUndefinedAndNullValues(mappedPayload); - customFloodlightVariable = removeUndefinedAndNullValues(customFloodlightVariable); - - let dcmEndpoint = `${BASE_URL}${appendProperties(mappedPayload)}`; - if (!isEmptyObject(customFloodlightVariable)) { - dcmEndpoint = `${dcmEndpoint};${appendProperties(customFloodlightVariable)}`; - } - - rudderContext.endpoint = dcmEndpoint; - - return {}; -}; - -module.exports = { postMapper }; diff --git a/src/cdk/v1/handler.js b/src/cdk/v1/handler.js deleted file mode 100644 index 0af0859f49..0000000000 --- a/src/cdk/v1/handler.js +++ /dev/null @@ -1,85 +0,0 @@ -const { ConfigFactory, Executor } = require('rudder-transformer-cdk'); -const { CustomError } = require('rudder-transformer-cdk/build/error'); -const { TRANSFORMER_METRIC } = require('rudder-transformer-cdk/build/constants'); -const path = require('path'); - -const basePath = path.resolve(__dirname); -ConfigFactory.init({ basePath, loggingMode: 'production' }); - -const { - InstrumentationError, - TransformationError, - ConfigurationError, -} = require('@rudderstack/integrations-lib'); -const tags = require('../../v0/util/tags'); -const { generateErrorObject } = require('../../v0/util'); - -const defTags = { - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.CDK_V1, -}; - -/** - * Translates CDK errors into transformer errors - * @param {} err The error object - * @returns An error type which the transformer recognizes - */ -function getErrorInfo(err) { - if (err instanceof CustomError) { - let errInstance = ''; - switch (err.statTags?.meta) { - case TRANSFORMER_METRIC.MEASUREMENT_TYPE.CDK.META.BAD_CONFIG: - errInstance = new TransformationError( - `Bad transformer configuration file. Original error: ${err.message}`, - ); - break; - - case TRANSFORMER_METRIC.MEASUREMENT_TYPE.CDK.META.CONFIGURATION: - errInstance = new ConfigurationError(`Bad configuration. Original error: ${err.message}`); - break; - - case TRANSFORMER_METRIC.MEASUREMENT_TYPE.CDK.META.TF_FUNC: - errInstance = new TransformationError( - `Bad pre/post transformation function. Original error: ${err.message}`, - ); - break; - - case TRANSFORMER_METRIC.MEASUREMENT_TYPE.CDK.META.BAD_EVENT: - case TRANSFORMER_METRIC.MEASUREMENT_TYPE.CDK.META.INSTRUMENTATION: - errInstance = new InstrumentationError(`Bad event. Original error: ${err.message}`); - break; - - case TRANSFORMER_METRIC.MEASUREMENT_TYPE.CDK.META.EXCEPTION: - errInstance = new TransformationError( - `Unknown error occurred. Original error: ${err.message}`, - ); - break; - default: - break; - } - if (err.statTags.scope === TRANSFORMER_METRIC.MEASUREMENT_TYPE.EXCEPTION.SCOPE) { - errInstance = new TransformationError( - `Unknown error occurred. Original error: ${err.message}`, - ); - } - if (errInstance) { - return generateErrorObject(errInstance, defTags); - } - } - - return generateErrorObject(err, defTags); -} - -async function processCdkV1(destType, parsedEvent) { - try { - const tfConfig = await ConfigFactory.getConfig(destType); - const respEvents = await Executor.execute(parsedEvent, tfConfig); - return respEvents; - } catch (error) { - throw getErrorInfo(error); - } -} - -module.exports = { - processCdkV1, - getErrorInfo, -}; diff --git a/src/cdk/v1/heap/config.yaml b/src/cdk/v1/heap/config.yaml deleted file mode 100644 index da6a2dfe28..0000000000 --- a/src/cdk/v1/heap/config.yaml +++ /dev/null @@ -1,28 +0,0 @@ -message: - identify: - transformation: - mapperPath: ./mapping/identify.yaml - postMapper: - name: 'commonPostMapper' - response: - method: POST - format: JSON - endpoint: 'https://heapanalytics.com/api/add_user_properties' - userId: '{{ message.anonymousId }}' - headers: - Accept: 'application/json' - Content-Type: 'application/json' - - track: - transformation: - mapperPath: ./mapping/track.yaml - postMapper: - name: 'commonPostMapper' - response: - method: POST - format: JSON - endpoint: 'https://heapanalytics.com/api/track' - userId: '{{ message.anonymousId }}' - headers: - Accept: 'application/json' - Content-Type: 'application/json' diff --git a/src/cdk/v1/heap/mapping/identify.yaml b/src/cdk/v1/heap/mapping/identify.yaml deleted file mode 100644 index 6b9a237943..0000000000 --- a/src/cdk/v1/heap/mapping/identify.yaml +++ /dev/null @@ -1,17 +0,0 @@ -- destKey: identity - sourceKeys: - - userId - - traits.userId - - traits.id - - context.traits.userId - - context.traits.id - - anonymousId - required: true - -- destKey: properties - sourceKeys: - - traits - - context.traits - metadata: - type: flatJson - required: true diff --git a/src/cdk/v1/heap/mapping/track.yaml b/src/cdk/v1/heap/mapping/track.yaml deleted file mode 100644 index e0ffa2b9a5..0000000000 --- a/src/cdk/v1/heap/mapping/track.yaml +++ /dev/null @@ -1,28 +0,0 @@ -- destKey: identity - sourceKeys: - - userId - - traits.userId - - traits.id - - context.traits.userId - - context.traits.id - - anonymousId - required: true - -- destKey: event - sourceKeys: event - required: true - -- destKey: properties - sourceKeys: properties - metadata: - type: flatJson - -- destKey: timestamp - sourceKeys: - - timestamp - - originalTimestamp - required: false - -- destKey: idempotency_key - sourceKeys: properties.idempotencyKey - required: false diff --git a/src/cdk/v1/heap/transform.js b/src/cdk/v1/heap/transform.js deleted file mode 100644 index 120af3ef90..0000000000 --- a/src/cdk/v1/heap/transform.js +++ /dev/null @@ -1,15 +0,0 @@ -async function commonPostMapper(event, mappedPayload) { - const { destination } = event; - const payload = mappedPayload; - if (payload.properties && payload.properties.idempotencyKey) { - delete payload.properties.idempotencyKey; - } - const responseBody = { - ...payload, - app_id: destination.Config.appId, - }; - - return responseBody; // this flows onto the next stage in the yaml -} - -module.exports = { commonPostMapper }; diff --git a/src/cdk/v1/kochava/config.yaml b/src/cdk/v1/kochava/config.yaml deleted file mode 100644 index 90ae837fae..0000000000 --- a/src/cdk/v1/kochava/config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -message: - supportedMessageTypes: - - screen - - track - default: - transformation: - mapperPath: ./mappings/default.yaml - postMapper: - name: processExtraPayloadParams - response: - endpoint: https://control.kochava.com/track/json - userId: '{{ message.anonymousId }}' - format: JSON - method: POST - headers: {} diff --git a/src/cdk/v1/kochava/mappings/default.yaml b/src/cdk/v1/kochava/mappings/default.yaml deleted file mode 100644 index c17292d40f..0000000000 --- a/src/cdk/v1/kochava/mappings/default.yaml +++ /dev/null @@ -1,49 +0,0 @@ -- destKey: data.event_data - sourceKeys: - - properties - metadata: - defaultValue: {} - -- destKey: kochava_app_id - sourceKeys: apiKey - context: destConfig - -- destKey: kochava_device_id - sourceKeys: - - context.device.id - - anonymousId - -- destKey: data.usertime - sourceKeys: - - timestamp - - originalTimestamp - metadata: - type: timestamp - -- destKey: data.app_version - sourceKeys: context.app.build - -- destKey: data.origination_ip - sourceKeys: - - context.ip - - request_ip - -- destKey: data.app_name - sourceKeys: context.app.name - -- destKey: data.app_short_string - sourceKeys: context.app.version - -- destKey: data.locale - sourceKeys: context.locale - -- destKey: data.os_version - sourceKeys: context.os.version - -- destKey: data.screen_dpi - sourceKeys: context.screen.density - -- destKey: action - sourceKeys: rudderAction # This will not be available - metadata: - defaultValue: 'event' diff --git a/src/cdk/v1/kochava/transform.js b/src/cdk/v1/kochava/transform.js deleted file mode 100644 index 504981aa6a..0000000000 --- a/src/cdk/v1/kochava/transform.js +++ /dev/null @@ -1,78 +0,0 @@ -const { Utils } = require('rudder-transformer-cdk'); - -const eventNameMapping = { - 'product added': 'Add to Cart', - 'product added to wishlist': 'Add to Wishlist', - 'checkout started': 'Checkout Start', - 'order completed': 'Purchase', - 'product reviewed': 'Rating', - 'products searched': 'Search', -}; - -function processExtraPayloadParams(event, mappedPayload) { - const clonedMappedPayload = { ...mappedPayload }; - const { message } = event; - let eventName = message.event; - const eventData = message.properties || {}; - switch (message.type.toLowerCase()) { - case 'screen': - eventName = 'screen view'; - if (message.properties && message.properties.name) { - eventName += ` ${message.properties.name}`; - } - break; - case 'track': - if (eventName) { - const evName = eventName.toLowerCase(); - if (eventNameMapping[evName] !== undefined) { - eventName = eventNameMapping[evName]; - } - } - break; - default: - break; - } - - const extraParams = { - // This kind of formatting multiple fields into a single one - // is currently not supported in cdk - app_tracking_transparency: { - att: message.context?.device?.attTrackingStatus === 3 || false, - }, - device_ver: - message.context?.device?.model && message.context?.os?.version - ? `${message.context?.device?.model}-${message.context?.os?.name}-${message.context?.os?.version}` - : '', - device_ids: { - idfa: - message.context?.os?.name && Utils.isAppleFamily(message.context?.os?.name) - ? message.context?.device?.advertisingId || '' - : '', - idfv: - message.context?.os?.name && Utils.isAppleFamily(message.context?.os?.name) - ? message.context?.device?.id || message.anonymousId || '' - : '', - adid: - message.context?.os?.name && message.context.os.name.toLowerCase() === 'android' - ? message.context?.device?.advertisingId || '' - : '', - android_id: - message.context?.os?.name && message.context.os.name.toLowerCase() === 'android' - ? message.context?.device?.id || message.anonymousId || '' - : '', - }, - event_name: eventName, - device_ua: message.context?.userAgent || '', - currency: eventData?.currency || 'USD', - }; - clonedMappedPayload.data = { ...clonedMappedPayload.data, ...extraParams }; - // Note: "defaultValue" cannot be empty string hence had to manually set it here since kochava requires it - if (Utils.getValueFromMessage(message, 'context.os.version') === '') { - clonedMappedPayload.data.os_version = ''; - } - return clonedMappedPayload; -} - -module.exports = { - processExtraPayloadParams, -}; diff --git a/src/cdk/v1/lytics/config.yaml b/src/cdk/v1/lytics/config.yaml deleted file mode 100644 index 14f2f79ddb..0000000000 --- a/src/cdk/v1/lytics/config.yaml +++ /dev/null @@ -1,53 +0,0 @@ -message: - supportedMessageTypes: - - identify - - page - - screen - - track - identify: - transformation: - mapperPath: ./mappings/identify.yaml - postMapper: - name: cleanResponse - response: - endpoint: 'https://api.lytics.io/collect/json/{{destConfig.stream}}?access_token={{destConfig.apiKey}}' - method: POST - format: JSON - headers: - Content-Type: application/json - - page: - transformation: - mapperPath: ./mappings/page-screen.yaml - postMapper: - name: cleanResponse - response: - endpoint: 'https://api.lytics.io/collect/json/{{destConfig.stream}}?access_token={{destConfig.apiKey}}' - method: POST - format: JSON - headers: - Content-Type: application/json - - screen: - transformation: - mapperPath: ./mappings/page-screen.yaml - postMapper: - name: cleanResponse - response: - endpoint: 'https://api.lytics.io/collect/json/{{destConfig.stream}}?access_token={{destConfig.apiKey}}' - method: POST - format: JSON - headers: - Content-Type: application/json - - track: - transformation: - mapperPath: ./mappings/track.yaml - postMapper: - name: cleanResponse - response: - endpoint: 'https://api.lytics.io/collect/json/{{destConfig.stream}}?access_token={{destConfig.apiKey}}' - method: POST - format: JSON - headers: - Content-Type: application/json diff --git a/src/cdk/v1/lytics/mappings/identify.yaml b/src/cdk/v1/lytics/mappings/identify.yaml deleted file mode 100644 index 388660c3c4..0000000000 --- a/src/cdk/v1/lytics/mappings/identify.yaml +++ /dev/null @@ -1,29 +0,0 @@ -- destKey: user_id - sourceKeys: - - 'userId' - - 'traits.userId' - - 'traits.id' - - 'context.traits.userId' - - 'context.traits.id' - - 'anonymousId' - -- destKey: '...' - sourceKeys: - - 'traits' - - 'context.traits' - metadata: - type: flatJson - -- destKey: first_name - sourceKeys: - - traits.firstName - - traits.firstname - - context.traits.firstName - - context.traits.firstname - -- destKey: last_name - sourceKeys: - - traits.lastName - - traits.lastname - - context.traits.lastName - - context.traits.lastname diff --git a/src/cdk/v1/lytics/mappings/page-screen.yaml b/src/cdk/v1/lytics/mappings/page-screen.yaml deleted file mode 100644 index 78fada65f0..0000000000 --- a/src/cdk/v1/lytics/mappings/page-screen.yaml +++ /dev/null @@ -1,17 +0,0 @@ -- destKey: event - sourceKeys: name - -- destKey: '...' - sourceKeys: properties - metadata: - type: flatJson - -- destKey: first_name - sourceKeys: - - properties.firstName - - properties.firstname - -- destKey: last_name - sourceKeys: - - properties.lastName - - properties.lastname diff --git a/src/cdk/v1/lytics/mappings/track.yaml b/src/cdk/v1/lytics/mappings/track.yaml deleted file mode 100644 index fdc24f16fc..0000000000 --- a/src/cdk/v1/lytics/mappings/track.yaml +++ /dev/null @@ -1,17 +0,0 @@ -- destKey: _e - sourceKeys: event - -- destKey: '...' - sourceKeys: properties - metadata: - type: flatJson - -- destKey: first_name - sourceKeys: - - properties.firstName - - properties.firstname - -- destKey: last_name - sourceKeys: - - properties.lastName - - properties.lastname diff --git a/src/cdk/v1/lytics/transform.js b/src/cdk/v1/lytics/transform.js deleted file mode 100644 index e31d0733c6..0000000000 --- a/src/cdk/v1/lytics/transform.js +++ /dev/null @@ -1,23 +0,0 @@ -const { Utils } = require('rudder-transformer-cdk'); - -const forFirstName = ['firstname', 'firstName']; -const forLastName = ['lastname', 'lastName']; - -function cleanResponse(event, mappedPayload) { - // Here basically we have a requirement wherein - // we have to remove certain properties from the final payload - const flattenedPayload = Utils.removeUndefinedAndNullValues(mappedPayload); - forFirstName.forEach((key) => { - if (flattenedPayload[key]) { - delete flattenedPayload[key]; - } - }); - forLastName.forEach((key) => { - if (flattenedPayload[key]) { - delete flattenedPayload[key]; - } - }); - return flattenedPayload; -} - -module.exports = { cleanResponse }; diff --git a/src/cdk/v1/new_relic/config.yaml b/src/cdk/v1/new_relic/config.yaml deleted file mode 100644 index d6f04b989f..0000000000 --- a/src/cdk/v1/new_relic/config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -message: - supportedMessageTypes: - - track - track: - transformation: - mapperPath: ./mapping/track.yaml - postMapper: - name: 'commonPostMapper' - response: - endpoint: '{{ rudderContext.endpoint }}' - method: POST - format: JSON - headers: - Api-Key: '{{ rudderContext.insertKey }}' - Content-Type: 'application/json' diff --git a/src/cdk/v1/new_relic/mapping/track.yaml b/src/cdk/v1/new_relic/mapping/track.yaml deleted file mode 100644 index 6a4a9f04f3..0000000000 --- a/src/cdk/v1/new_relic/mapping/track.yaml +++ /dev/null @@ -1,14 +0,0 @@ -- destKey: 'event' - sourceKeys: event - -- destKey: '...' - sourceKeys: properties - metadata: - type: flatJson - -- destKey: 'timestamp' - sourceKeys: - - 'timestamp' - - 'originalTimestamp' - metadata: - type: 'secondTimestamp' diff --git a/src/cdk/v1/new_relic/transform.js b/src/cdk/v1/new_relic/transform.js deleted file mode 100644 index 43cebd548f..0000000000 --- a/src/cdk/v1/new_relic/transform.js +++ /dev/null @@ -1,112 +0,0 @@ -/* eslint-disable no-param-reassign */ -const { isBoolean } = require('lodash'); -const { Utils } = require('rudder-transformer-cdk'); - -function commonPostMapper(event, mappedPayload, rudderContext) { - const { message, destination } = event; - const payload = mappedPayload; - const destConfig = destination.Config; - const reservedNrqlWords = [ - 'ago', - 'and', - 'as', - 'auto', - 'begin', - 'begintime', - 'compare', - 'day', - 'days', - 'end', - 'endtime', - 'explain', - 'facet', - 'from', - 'hour', - 'hours', - 'in', - 'is', - 'like', - 'limit', - 'minute', - 'minutes', - 'month', - 'months', - 'not', - 'null', - 'offset', - 'or', - 'raw', - 'second', - 'seconds', - 'select', - 'since', - 'timeseries', - 'until', - 'week', - 'weeks', - 'where', - 'with', - ]; - const reservedWords = ['accountId', 'appId', 'eventType']; - - Object.keys(payload).forEach((item) => { - if (reservedNrqlWords.includes(item) && isBoolean(payload[item])) { - const str = `'${item}'`; - payload[str] = payload[item].toString(); - delete payload[item]; - } else if (reservedNrqlWords.includes(item)) { - const str = `'${item}'`; - payload[str] = payload[item]; - delete payload[item]; - } else if (reservedWords.includes(item)) { - delete payload[item]; - } else if (isBoolean(payload[item])) { - payload[item] = payload[item].toString(); - } - }); - - // If user provided a eventType name, then we will include it in the payload directly - if (destConfig.customEventType) { - payload.eventType = destConfig.customEventType; - } else { - // If eventType is not provided by the user, by default it is 'rudderstack' - payload.eventType = 'rudderstack'; - } - - // If user enables 'sendUserIdanonymousId', then we include userId and anonymousId into the payload - if (destConfig.sendUserIdanonymousId) { - if (message.userId || message.context.userId || message.context.id) { - payload.userId = message.userId; - } - if (message.anonymousId) { - payload.anonymousId = message.anonymousId; - } - } - - // Upon users choice for data center, we are updating the endpoint accordingly - rudderContext.endpoint = - destConfig.dataCenter === 'eu' - ? `https://insights-collector.eu01.nr-data.net/v1/accounts/${destConfig.accountId}/events` - : `https://insights-collector.newrelic.com/v1/accounts/${destConfig.accountId}/events`; - - rudderContext.insertKey = destConfig.insertKey; - - // If user enables 'sendDeviceContext', then we are delimiting context fields and include them in responseBody - let flattenedContext = {}; - let responseBody; - if (destConfig.sendDeviceContext) { - flattenedContext = Utils.flattenJson(message.context); - responseBody = { - ...payload, - ...flattenedContext, - }; - } else { - responseBody = { - ...payload, - }; - } - - return responseBody; // this flows onto the next stage in the yaml -} - -module.exports = { commonPostMapper }; diff --git a/src/cdk/v1/statsig/config.yaml b/src/cdk/v1/statsig/config.yaml deleted file mode 100644 index 467629faa1..0000000000 --- a/src/cdk/v1/statsig/config.yaml +++ /dev/null @@ -1,19 +0,0 @@ -message: - supportedMessageTypes: - - identify - - page - - screen - - alias - - track - - group - default: - transformation: - spreadMessage: true - response: - endpoint: 'https://api.statsig.com/v1/webhooks/rudderstack' - method: POST - # based on the format set, we can formulate - format: JSON - headers: - STATSIG-API-KEY: '{{ destConfig.secretKey }}' - content-type: 'application/json' diff --git a/src/cdk/v1/userlist/config.yaml b/src/cdk/v1/userlist/config.yaml deleted file mode 100644 index 19df913fef..0000000000 --- a/src/cdk/v1/userlist/config.yaml +++ /dev/null @@ -1,19 +0,0 @@ -message: - supportedMessageTypes: - - identify - - track - - group - default: - transformation: - # If the mapping mentioned in this yaml doesn't work - # we can make use of postMapper tag and apply the required transformation - mapperPath: ./mapping/userlist_default.yaml - spreadMessage: true - response: - endpoint: 'https://incoming.userlist.com/rudderstack/events' - method: POST - format: JSON - statusCode: 200 # probably this can be removed also. - headers: - Authorization: 'Push {{destConfig.pushKey}}' - Content-Type: 'application/json' diff --git a/src/cdk/v1/userlist/mapping/userlist_default.yaml b/src/cdk/v1/userlist/mapping/userlist_default.yaml deleted file mode 100644 index 0d9b4acade..0000000000 --- a/src/cdk/v1/userlist/mapping/userlist_default.yaml +++ /dev/null @@ -1,8 +0,0 @@ -- destKey: type - sourceKeys: type - metadata: - type: toLowerCase -- destKey: userId - sourceKeys: userIdOnly - sourceFromGenericMap: true - required: true diff --git a/src/cdk/v1/variance/config.yaml b/src/cdk/v1/variance/config.yaml deleted file mode 100644 index 9a38723206..0000000000 --- a/src/cdk/v1/variance/config.yaml +++ /dev/null @@ -1,13 +0,0 @@ -message: - default: - transformation: - spreadMessage: true - mapperPath: ./mappings/default.yaml - response: - format: JSON - method: POST - endpoint: '{{ destConfig.webhookUrl }}' - headers: - authorization: '{{ destConfig.authHeader }}' - content-type: 'application/json' - userId: '{{ message.anonymousId }}' diff --git a/src/cdk/v1/variance/mappings/default.yaml b/src/cdk/v1/variance/mappings/default.yaml deleted file mode 100644 index 5a23b4a931..0000000000 --- a/src/cdk/v1/variance/mappings/default.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- destKey: context.ip - sourceKeys: - - 'context.ip' - - 'request_ip' diff --git a/src/cdk/v1/vitally/config.yaml b/src/cdk/v1/vitally/config.yaml deleted file mode 100644 index c7edbacca2..0000000000 --- a/src/cdk/v1/vitally/config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -message: - supportedMessageTypes: - - track - - identify - - group - default: - transformation: - spreadMessage: true - response: - format: JSON - method: POST - endpoint: 'https://api.vitally.io/rudderstack' - headers: - authorization: 'Basic {{ destConfig.apiKeyVitally }}' - content-type: 'application/json' diff --git a/src/cdk/v1/zapier/config.yaml b/src/cdk/v1/zapier/config.yaml deleted file mode 100644 index 52f9317587..0000000000 --- a/src/cdk/v1/zapier/config.yaml +++ /dev/null @@ -1,16 +0,0 @@ -message: - supportedMessageTypes: - - track - - page - - screen - default: - transformation: - spreadMessage: true - postMapper: - name: 'commonPostMapper' - response: - format: JSON - method: POST - endpoint: '{{ rudderContext.zapUrl }}' - headers: - content-type: 'application/json' diff --git a/src/cdk/v1/zapier/transform.js b/src/cdk/v1/zapier/transform.js deleted file mode 100644 index d99c3af315..0000000000 --- a/src/cdk/v1/zapier/transform.js +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable no-param-reassign */ -const { getHashFromArray } = require('../../../v0/util'); - -function commonPostMapper(event, mappedPayload, rudderContext) { - const { message, destination } = event; - const destConfig = destination.Config; - - const { trackEventsToZap, pageScreenEventsToZap, zapUrl } = destConfig; - - const trackEventsMap = getHashFromArray(trackEventsToZap); - const pageScreenEventsMap = getHashFromArray(pageScreenEventsToZap); - - // default Zap URL - rudderContext.zapUrl = zapUrl; - - // track event - if (message?.type === 'track') { - const eventName = message?.event; - // checking if the event is present track events mapping - if (trackEventsMap[eventName]) { - // if present, we are updating the zapUrl(with one specified in the mapping) - rudderContext.zapUrl = trackEventsMap[eventName]; - } - } - - // page/screen event - if (message?.type === 'page' || message?.type === 'screen') { - const pageScreenName = message?.name; - // checking if the event is present page/screen events mapping - if (pageScreenEventsMap[pageScreenName]) { - // if present, we are updating the zapUrl(with the one specified in the mapping) - rudderContext.zapUrl = pageScreenEventsMap[pageScreenName]; - } - } - - const responseBody = { - ...mappedPayload, - }; - - return responseBody; // this flows onto the next stage in the yaml -} - -module.exports = { commonPostMapper }; diff --git a/src/cdk/v2/destinations/emarsys/utils.test.js b/src/cdk/v2/destinations/emarsys/utils.test.js index 3802567ecb..72a86a1529 100644 --- a/src/cdk/v2/destinations/emarsys/utils.test.js +++ b/src/cdk/v2/destinations/emarsys/utils.test.js @@ -1,4 +1,3 @@ -const { EVENT_TYPE } = require('rudder-transformer-cdk/build/constants'); const { buildIdentifyPayload, buildGroupPayload, @@ -92,7 +91,7 @@ describe('Emarsys utils', () => { const result = buildIdentifyPayload(message, destination); - expect(result.eventType).toBe(EVENT_TYPE.IDENTIFY); + expect(result.eventType).toBe('identify'); expect(result.destinationPayload).toEqual(expectedPayload); }); @@ -185,7 +184,7 @@ describe('Emarsys utils', () => { const result = buildIdentifyPayload(message, destination); - expect(result.eventType).toBe(EVENT_TYPE.IDENTIFY); + expect(result.eventType).toBe('identify'); expect(result.destinationPayload).toEqual(expectedPayload); }); }); diff --git a/src/cdk/v2/destinations/intercom/config.js b/src/cdk/v2/destinations/intercom/config.js index c3b806f9f9..12bcf8ed5f 100644 --- a/src/cdk/v2/destinations/intercom/config.js +++ b/src/cdk/v2/destinations/intercom/config.js @@ -66,7 +66,7 @@ const ReservedAttributes = { ], }; -const ReservedCompanyProperties = ['id', 'name', 'industry']; +const ReservedCompanyProperties = ['id', 'name', 'industry', 'remove']; const MetadataTypes = { richLink: ['url', 'value'], monetaryAmount: ['amount', 'currency'] }; diff --git a/src/cdk/v2/destinations/intercom/procWorkflow.yaml b/src/cdk/v2/destinations/intercom/procWorkflow.yaml index d826716b43..0f2ac18fbc 100644 --- a/src/cdk/v2/destinations/intercom/procWorkflow.yaml +++ b/src/cdk/v2/destinations/intercom/procWorkflow.yaml @@ -84,6 +84,9 @@ steps: $.assert($.context.payload.external_id || $.context.payload.email, "Either email or userId is required for Identify call"); const endpoint = $.getBaseEndpoint(.destination) + "/" + "contacts"; $.context.requestMethod = $.outputs.searchContact ? 'PUT' : 'POST'; + const company = .message.traits.company || .message.context.traits.company; + const shouldDetachUserAndCompany = $.outputs.searchContact && company.remove; + shouldDetachUserAndCompany ? await $.detachContactAndCompany($.outputs.searchContact, company, .destination); $.context.endpoint = $.outputs.searchContact ? endpoint + "/" + $.outputs.searchContact : endpoint; $.context.payload = $.removeUndefinedAndNullValues($.context.payload); diff --git a/src/cdk/v2/destinations/intercom/utils.js b/src/cdk/v2/destinations/intercom/utils.js index e2d8a36874..dc483e040b 100644 --- a/src/cdk/v2/destinations/intercom/utils.js +++ b/src/cdk/v2/destinations/intercom/utils.js @@ -6,7 +6,7 @@ const { InstrumentationError, } = require('@rudderstack/integrations-lib'); const tags = require('../../../../v0/util/tags'); -const { httpPOST } = require('../../../../adapters/network'); +const { httpPOST, handleHttpRequest } = require('../../../../adapters/network'); const { processAxiosResponse, getDynamicErrorType, @@ -164,6 +164,7 @@ const getCompaniesList = (payload) => { custom_attributes: removeUndefinedAndNullValues(customAttributes), name: company.name, industry: company.industry, + remove: company.remove, }); } return companiesList; @@ -507,6 +508,85 @@ const addOrUpdateTagsToCompany = async ({ message, destination, metadata }, id) ); }; +/** + * Api call to get company id provided by intercom + * Ref doc v1: https://developers.intercom.com/docs/references/1.4/rest-api/companies/view-a-company + * Ref doc v2: https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/companies/retrievecompany + * @param {*} company + * @param {*} destination + * @returns + */ +const getCompanyId = async (company, destination) => { + if (!company.id && !company.name) return undefined; + const { apiVersion } = destination.Config; + const headers = getHeaders(destination, apiVersion); + const baseEndPoint = getBaseEndpoint(destination); + + const queryParam = company.id ? `company_id=${company.id}` : `name=${company.name}`; + const endpoint = `${baseEndPoint}/companies?${queryParam}`; + + const statTags = { + destType: 'intercom', + feature: 'transformation', + endpointPath: '/companies', + requestMethod: 'GET', + module: 'router', + }; + + const { processedResponse: response } = await handleHttpRequest( + 'GET', + endpoint, + { + headers, + }, + statTags, + ); + + if (isHttpStatusSuccess(response.status)) { + return response.response.id; + } + intercomErrorHandler('Unable to get company id due to', response); + return undefined; +}; + +/** + * Api call to detach contact and company for intercom api version v2 (version 2.10) + * Ref doc: https://developers.intercom.com/docs/references/2.10/rest-api/api.intercom.io/contacts/detachcontactfromacompany + * @param {*} contactId + * @param {*} company + * @param {*} destination + * @returns + */ +const detachContactAndCompany = async (contactId, company, destination) => { + const companyId = await getCompanyId(company, destination); + if (!companyId) return; + + const headers = getHeaders(destination); + const baseEndPoint = getBaseEndpoint(destination); + const endpoint = `${baseEndPoint}/contacts/${contactId}/companies/${companyId}`; + + const statTags = { + destType: 'intercom', + feature: 'transformation', + endpointPath: 'contacts/companies', + requestMethod: 'DELETE', + module: 'router', + }; + + const { processedResponse: response } = await handleHttpRequest( + 'DELETE', + endpoint, + { + headers, + }, + statTags, + ); + + if (!isHttpStatusSuccess(response.status)) { + intercomErrorHandler('Unable to detach contact and company due to', response); + } +}; + module.exports = { getName, getHeaders, @@ -522,4 +602,5 @@ module.exports = { separateReservedAndRestMetadata, attachContactToCompany, addOrUpdateTagsToCompany, + detachContactAndCompany, }; diff --git a/src/cdk/v2/destinations/rakuten/utils.js b/src/cdk/v2/destinations/rakuten/utils.js index ef6b197db7..2dd628a250 100644 --- a/src/cdk/v2/destinations/rakuten/utils.js +++ b/src/cdk/v2/destinations/rakuten/utils.js @@ -1,5 +1,4 @@ -const { InstrumentationError } = require('@rudderstack/integrations-lib'); -const { isDefinedAndNotNull } = require('rudder-transformer-cdk/build/utils'); +const { InstrumentationError, isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); const { mappingConfig, ConfigCategories, @@ -57,11 +56,7 @@ const constructLineItems = (properties) => { if (!product?.amount && !product?.price) { throw new InstrumentationError('Either amount or price is required for every product'); } - - if (product.price) { - return product.quantity * product.price * 100; - } - return product.amount * 100; + return product.amount * 100 || (product.quantity || 1) * 100 * product.price; }); productList.amtlist = amountList.join('|'); return productList; diff --git a/src/constants/destinationCanonicalNames.js b/src/constants/destinationCanonicalNames.js index 58bf35539a..f99c735e45 100644 --- a/src/constants/destinationCanonicalNames.js +++ b/src/constants/destinationCanonicalNames.js @@ -101,6 +101,14 @@ const DestCanonicalNames = { awin: ['awin', 'Awin', 'AWIN'], sendinblue: ['sendinblue', 'SENDINBLUE', 'Sendinblue', 'SendinBlue'], ga4: ['GA4', 'ga4', 'Ga4', 'Google Analytics 4', 'googleAnalytics4', 'Google Analytics 4 (GA4)'], + ga4_v2: [ + 'GA4_V2', + 'ga4_v2', + 'Ga4_v2', + 'Google Analytics 4 V2', + 'googleAnalytics4V2', + 'Google Analytics 4 (GA4) V2', + ], pipedream: ['Pipedream', 'PipeDream', 'pipedream', 'PIPEDREAM'], pagerduty: ['pagerduty', 'PAGERDUTY', 'PagerDuty', 'Pagerduty', 'pagerDuty'], adobe_analytics: [ @@ -173,9 +181,11 @@ const DestCanonicalNames = { 'Klaviyo Bulk Upload', 'klaviyobulkupload', ], + Klaviyo: ['KLAVIYO', 'Klaviyo', 'klaviyo'], emarsys: ['EMARSYS', 'Emarsys', 'emarsys'], wunderkind: ['wunderkind', 'Wunderkind', 'WUNDERKIND'], cordial: ['cordial', 'Cordial', 'CORDIAL'], + clevertap: ['clevertap', 'Clevertap', 'CleverTap', 'CLEVERTAP'], }; module.exports = { DestHandlerMap, DestCanonicalNames }; diff --git a/src/helpers/__tests__/serviceSelector.test.ts b/src/helpers/__tests__/serviceSelector.test.ts index c48d6bbe8b..0dab906f7a 100644 --- a/src/helpers/__tests__/serviceSelector.test.ts +++ b/src/helpers/__tests__/serviceSelector.test.ts @@ -1,9 +1,8 @@ -import { ServiceSelector } from '../serviceSelector'; import { INTEGRATION_SERVICE } from '../../routes/utils/constants'; -import { ProcessorTransformationRequest } from '../../types/index'; -import { CDKV1DestinationService } from '../../services/destination/cdkV1Integration'; import { CDKV2DestinationService } from '../../services/destination/cdkV2Integration'; import { NativeIntegrationDestinationService } from '../../services/destination/nativeIntegration'; +import { ProcessorTransformationRequest } from '../../types/index'; +import { ServiceSelector } from '../serviceSelector'; afterEach(() => { jest.clearAllMocks(); @@ -27,20 +26,6 @@ describe('ServiceSelector Service', () => { ); }); - test('isCdkDestination should return true', async () => { - const destinationDefinitionConfig = { - cdkEnabled: true, - }; - expect(ServiceSelector['isCdkDestination'](destinationDefinitionConfig)).toBe(true); - }); - - test('isCdkDestination should return false', async () => { - const destinationDefinitionConfig = { - cdkEnabledXYZ: true, - }; - expect(ServiceSelector['isCdkDestination'](destinationDefinitionConfig)).toBe(false); - }); - test('isCdkV2Destination should return true', async () => { const destinationDefinitionConfig = { cdkV2Enabled: true, @@ -55,23 +40,6 @@ describe('ServiceSelector Service', () => { expect(ServiceSelector['isCdkV2Destination'](destinationDefinitionConfig)).toBe(false); }); - test('getPrimaryDestinationService should return cdk v1 dest service', async () => { - const events = [ - { - destination: { - DestinationDefinition: { - Config: { - cdkEnabled: true, - }, - }, - }, - }, - ] as ProcessorTransformationRequest[]; - expect(ServiceSelector['getPrimaryDestinationService'](events)).toBeInstanceOf( - CDKV1DestinationService, - ); - }); - test('getPrimaryDestinationService should return cdk v2 dest service', async () => { const events = [ { diff --git a/src/helpers/serviceSelector.ts b/src/helpers/serviceSelector.ts index faa1c58240..a1f6a43349 100644 --- a/src/helpers/serviceSelector.ts +++ b/src/helpers/serviceSelector.ts @@ -1,29 +1,23 @@ import { PlatformError } from '@rudderstack/integrations-lib'; -import { ProcessorTransformationRequest, RouterTransformationRequestData } from '../types/index'; +import { DestinationService } from '../interfaces/DestinationService'; +import { SourceService } from '../interfaces/SourceService'; import { INTEGRATION_SERVICE } from '../routes/utils/constants'; -import { CDKV1DestinationService } from '../services/destination/cdkV1Integration'; +import { ComparatorService } from '../services/comparator'; import { CDKV2DestinationService } from '../services/destination/cdkV2Integration'; -import { DestinationService } from '../interfaces/DestinationService'; import { NativeIntegrationDestinationService } from '../services/destination/nativeIntegration'; -import { SourceService } from '../interfaces/SourceService'; import { NativeIntegrationSourceService } from '../services/source/nativeIntegration'; -import { ComparatorService } from '../services/comparator'; +import { ProcessorTransformationRequest, RouterTransformationRequestData } from '../types/index'; import { FixMe } from '../util/types'; export class ServiceSelector { private static serviceMap: Map = new Map(); private static services = { - [INTEGRATION_SERVICE.CDK_V1_DEST]: CDKV1DestinationService, [INTEGRATION_SERVICE.CDK_V2_DEST]: CDKV2DestinationService, [INTEGRATION_SERVICE.NATIVE_DEST]: NativeIntegrationDestinationService, [INTEGRATION_SERVICE.NATIVE_SOURCE]: NativeIntegrationSourceService, }; - private static isCdkDestination(destinationDefinitionConfig: FixMe) { - return !!destinationDefinitionConfig?.cdkEnabled; - } - private static isCdkV2Destination(destinationDefinitionConfig: FixMe) { return Boolean(destinationDefinitionConfig?.cdkV2Enabled); } @@ -68,9 +62,6 @@ export class ServiceSelector { ): DestinationService { const destinationDefinitionConfig: FixMe = events[0]?.destination?.DestinationDefinition?.Config; - if (this.isCdkDestination(destinationDefinitionConfig)) { - return this.fetchCachedService(INTEGRATION_SERVICE.CDK_V1_DEST); - } if (this.isCdkV2Destination(destinationDefinitionConfig)) { return this.fetchCachedService(INTEGRATION_SERVICE.CDK_V2_DEST); } diff --git a/src/legacy/router.js b/src/legacy/router.js index 6cf035350c..60f786e225 100644 --- a/src/legacy/router.js +++ b/src/legacy/router.js @@ -18,7 +18,6 @@ const { isNonFuncObject, getMetadata, generateErrorObject, - isCdkDestination, checkAndCorrectUserId, } = require('../v0/util'); const { processDynamicConfig } = require('../util/dynamicConfig'); @@ -35,12 +34,9 @@ const { sendViolationMetrics, constructValidationErrors, } = require('../util/utils'); -const { processCdkV1 } = require('../cdk/v1/handler'); const { extractLibraries } = require('../util/customTransformer'); const { getCompatibleStatusCode } = require('../adapters/utils/networkUtils'); -const CDK_V1_DEST_PATH = 'cdk/v1'; - const transformerMode = process.env.TRANSFORMER_MODE; const startDestTransformer = transformerMode === 'destination' || !transformerMode; @@ -157,14 +153,11 @@ async function handleDest(ctx, version, destination) { parsedEvent.request = { query: reqParams }; parsedEvent = processDynamicConfig(parsedEvent); let respEvents; - if (isCdkDestination(parsedEvent)) { - respEvents = await processCdkV1(destination, parsedEvent); - } else { - if (destHandler === null) { - destHandler = getDestHandler(version, destination); - } - respEvents = await handleV0Destination(destHandler.process, [parsedEvent]); + if (destHandler === null) { + destHandler = getDestHandler(version, destination); } + respEvents = await handleV0Destination(destHandler.process, [parsedEvent]); + if (respEvents) { if (!Array.isArray(respEvents)) { respEvents = [respEvents]; @@ -185,12 +178,8 @@ async function handleDest(ctx, version, destination) { } catch (error) { logger.error(error); - let implementation = tags.IMPLEMENTATIONS.NATIVE; - let errCtx = 'Processor Transformation'; - if (isCdkDestination(event)) { - errCtx = `CDK - ${errCtx}`; - implementation = tags.IMPLEMENTATIONS.CDK_V1; - } + const implementation = tags.IMPLEMENTATIONS.NATIVE; + const errCtx = 'Processor Transformation'; const errObj = generateErrorObject(error, { [tags.TAG_NAMES.DEST_TYPE]: destination.toUpperCase(), @@ -432,7 +421,6 @@ async function routerHandleDest(ctx) { if (startDestTransformer) { SUPPORTED_VERSIONS.forEach((version) => { const destinations = getIntegrations(path.resolve(__dirname, `../${version}/destinations`)); - destinations.push(...getIntegrations(path.resolve(__dirname, `../${CDK_V1_DEST_PATH}`))); destinations.forEach((destination) => { // eg. v0/destinations/ga router.post(`/${version}/destinations/${destination}`, async (ctx) => { diff --git a/src/services/destination/cdkV1Integration.ts b/src/services/destination/cdkV1Integration.ts deleted file mode 100644 index c6e60f5857..0000000000 --- a/src/services/destination/cdkV1Integration.ts +++ /dev/null @@ -1,134 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { ConfigFactory, Executor, RudderBaseConfig } from 'rudder-transformer-cdk'; -import path from 'path'; -import { TransformationError } from '@rudderstack/integrations-lib'; -import { DestinationService } from '../../interfaces/DestinationService'; -import { - DeliveryV0Response, - ErrorDetailer, - MetaTransferObject, - ProcessorTransformationRequest, - ProcessorTransformationResponse, - RouterTransformationRequestData, - RouterTransformationResponse, - UserDeletionRequest, - UserDeletionResponse, - ProxyRequest, - DeliveryV1Response, -} from '../../types/index'; -import { DestinationPostTransformationService } from './postTransformation'; -import tags from '../../v0/util/tags'; -import { getErrorInfo } from '../../cdk/v1/handler'; -import { CatchErr } from '../../util/types'; - -export class CDKV1DestinationService implements DestinationService { - public init() { - ConfigFactory.init({ - basePath: path.resolve(__dirname, '../../cdk/v1'), - loggingMode: 'production', - }); - } - - public getName(): string { - return 'CDK_V1'; - } - - public getTags( - destType: string, - destinationId: string, - workspaceId: string, - feature: string, - ): MetaTransferObject { - const metaTO = { - errorDetails: { - destType: destType.toUpperCase(), - module: tags.MODULES.DESTINATION, - implementation: tags.IMPLEMENTATIONS.CDK_V1, - feature, - destinationId, - workspaceId, - } as ErrorDetailer, - errorContext: '[CDKV1 Integration Service] Failure During Proc Transform', - } as MetaTransferObject; - return metaTO; - } - - private async processCDKV1(event: any, tfConfig: RudderBaseConfig): Promise { - try { - const respEvents = await Executor.execute(event, tfConfig); - return respEvents; - } catch (error) { - throw getErrorInfo(error); - } - } - - public async doProcessorTransformation( - events: ProcessorTransformationRequest[], - destinationType: string, - _version: string, - _requestMetadata: NonNullable, - ): Promise { - const tfConfig = await ConfigFactory.getConfig(destinationType); - const respList: ProcessorTransformationResponse[][] = await Promise.all( - events.map(async (event) => { - try { - const transformedPayloads: any = await this.processCDKV1(event as any, tfConfig); - // We are not passing destinationHandler to post processor as we don't have post processing in CDK flows - return DestinationPostTransformationService.handleProcessorTransformSucessEvents( - event, - transformedPayloads, - undefined, - ); - } catch (error: CatchErr) { - const metaTO = this.getTags( - destinationType, - event.metadata.destinationId, - event.metadata.workspaceId, - tags.FEATURES.PROCESSOR, - ); - metaTO.metadata = event.metadata; - const erroredResp = - DestinationPostTransformationService.handleProcessorTransformFailureEvents( - error, - metaTO, - ); - return [erroredResp]; - } - }), - ); - return respList.flat(); - } - - public doRouterTransformation( - _events: RouterTransformationRequestData[], - _destinationType: string, - _version: string, - _requestMetadata: NonNullable, - ): Promise { - throw new TransformationError('CDKV1 Does not Implement Router Transform Routine'); - } - - public doBatchTransformation( - _events: RouterTransformationRequestData[], - _destinationType: string, - _version: any, - _requestMetadata: NonNullable, - ): RouterTransformationResponse[] { - throw new TransformationError('CDKV1 Does not Implement Batch Transform Routine'); - } - - public deliver( - _event: ProxyRequest, - _destinationType: string, - _requestMetadata: NonNullable, - ): Promise { - throw new TransformationError('CDV1 Does not Implement Delivery Routine'); - } - - public processUserDeletion( - requests: UserDeletionRequest[], - rudderDestInfo: string, - ): Promise { - throw new TransformationError('CDV1 Does not Implement Deletion Routine'); - } -} diff --git a/src/util/errorNotifier/bugsnag.js b/src/util/errorNotifier/bugsnag.js index a6a22655ad..f9f37e8234 100644 --- a/src/util/errorNotifier/bugsnag.js +++ b/src/util/errorNotifier/bugsnag.js @@ -1,9 +1,5 @@ /* eslint-disable no-param-reassign */ const Bugsnag = require('@bugsnag/js'); -const { - CustomError: CDKCustomError, - DataValidationError, -} = require('rudder-transformer-cdk/build/error/index'); const stackTraceParser = require('stacktrace-parser'); const { BaseError, @@ -46,8 +42,6 @@ const errorTypesDenyList = [ UnhandledStatusCodeError, UnauthorizedError, NetworkInstrumentationError, - CDKCustomError, - DataValidationError, FilteredEventsError, ]; diff --git a/src/util/prometheus.js b/src/util/prometheus.js index cddeb80f31..27747faf4b 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -431,7 +431,7 @@ class Prometheus { name: 'shopify_redis_no_val', help: 'shopify_redis_no_val', type: 'counter', - labelNames: ['writeKey', 'source'], + labelNames: ['writeKey', 'source', 'event'], }, { name: 'invalid_shopify_event', diff --git a/src/util/redis/testData/shopify_source.json b/src/util/redis/testData/shopify_source.json index 2120475baf..9c09de4643 100644 --- a/src/util/redis/testData/shopify_source.json +++ b/src/util/redis/testData/shopify_source.json @@ -53,7 +53,7 @@ "input": { "event": "rudderSessionIdentifier", "sessionId": "session_id", - "cartToken": "shopify_test_set_map_fail", + "cartToken": "shopify_test_set_map_fail?key=abcd13234", "query_parameters": { "writeKey": ["Shopify Write Key"] }, @@ -1298,7 +1298,7 @@ "input": { "event": "rudderIdentifier", "anonymousId": "b9993cc5-9e60-4e69-be0e-4e38c228314b", - "cartToken": "shopify_test1", + "cartToken": "shopify_test1?key=abcd1234", "query_parameters": { "writeKey": ["Shopify Write Key"] }, diff --git a/src/util/types.ts b/src/util/types.ts index bd2836d710..549003f79a 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -7,7 +7,6 @@ export type ContextBodySimple = { destType: string; }; export interface Config { - cdkEnabled?: boolean; cdkV2Enabled?: boolean; comparisonTestEnabeld?: boolean; comparisonService?: string; diff --git a/src/v0/destinations/af/deleteUsers.js b/src/v0/destinations/af/deleteUsers.js index ab515642aa..e0da3699ed 100644 --- a/src/v0/destinations/af/deleteUsers.js +++ b/src/v0/destinations/af/deleteUsers.js @@ -10,7 +10,7 @@ const { processAxiosResponse, getDynamicErrorType, } = require('../../../adapters/utils/networkUtils'); -const { generateUUID, isHttpStatusSuccess } = require('../../util'); +const utils = require('../../util'); const tags = require('../../util/tags'); const { executeCommonValidations } = require('../../util/regulation-api'); @@ -23,7 +23,7 @@ const { executeCommonValidations } = require('../../util/regulation-api'); * @returns */ const deleteUser = async (config, endpoint, body, identityType, identityValue) => { - body.subject_request_id = generateUUID(); + body.subject_request_id = utils.generateUUID(); body.submitted_time = new Date().toISOString(); body.subject_identities[0].identity_type = identityType; body.subject_identities[0].identity_value = identityValue; @@ -44,7 +44,7 @@ const deleteUser = async (config, endpoint, body, identityType, identityValue) = }, ); const handledDelResponse = processAxiosResponse(response); - if (!isHttpStatusSuccess(handledDelResponse.status)) { + if (!utils.isHttpStatusSuccess(handledDelResponse.status)) { throw new NetworkError( 'User deletion request failed', handledDelResponse.status, diff --git a/src/v0/destinations/braze/braze.util.test.js b/src/v0/destinations/braze/braze.util.test.js index f2726c3283..84171e0cba 100644 --- a/src/v0/destinations/braze/braze.util.test.js +++ b/src/v0/destinations/braze/braze.util.test.js @@ -1,6 +1,12 @@ const _ = require('lodash'); const { handleHttpRequest } = require('../../../adapters/network'); -const { BrazeDedupUtility, addAppId, getPurchaseObjs, setAliasObject } = require('./util'); +const { + BrazeDedupUtility, + addAppId, + getPurchaseObjs, + setAliasObject, + handleReservedProperties, +} = require('./util'); const { processBatch } = require('./util'); const { removeUndefinedAndNullValues, @@ -1540,3 +1546,64 @@ describe('setAliasObject function', () => { }); }); }); + +describe('handleReservedProperties', () => { + // Removes 'time' and 'event_name' keys from the input object + it('should remove "time" and "event_name" keys when they are present in the input object', () => { + const props = { time: '2023-10-01T00:00:00Z', event_name: 'test_event', other_key: 'value' }; + const result = handleReservedProperties(props); + expect(result).toEqual({ other_key: 'value' }); + }); + + // Input object is empty + it('should return an empty object when the input object is empty', () => { + const props = {}; + const result = handleReservedProperties(props); + expect(result).toEqual({}); + }); + + // Works correctly with an object that has no reserved keys + it('should remove reserved keys when present in the input object', () => { + const props = { time_stamp: '2023-10-01T00:00:00Z', event: 'test_event', other_key: 'value' }; + const result = handleReservedProperties(props); + expect(result).toEqual({ + time_stamp: '2023-10-01T00:00:00Z', + event: 'test_event', + other_key: 'value', + }); + }); + + // Input object is null or undefined + it('should return an empty object when input object is null', () => { + const props = null; + const result = handleReservedProperties(props); + expect(result).toEqual({}); + }); + + // Handles non-object inputs gracefully + it('should return an empty object when a non-object input is provided', () => { + const props = 'not an object'; + try { + handleReservedProperties(props); + } catch (e) { + expect(e.message).toBe('Invalid event properties'); + } + }); + + // Input object has only reserved keys + it('should remove "time" and "event_name" keys when they are present in the input object', () => { + const props = { time: '2023-10-01T00:00:00Z', event_name: 'test_event', other_key: 'value' }; + const result = handleReservedProperties(props); + expect(result).toEqual({ other_key: 'value' }); + }); + + // Works with objects having special characters in keys + it('should not remove special characters keys when they are present in the input object', () => { + const props = { 'special!@#$%^&*()_+-={}[]|\\;:\'",.<>?/`~': 'value', other_key: 'value' }; + const result = handleReservedProperties(props); + expect(result).toEqual({ + other_key: 'value', + 'special!@#$%^&*()_+-={}[]|\\;:\'",.<>?/`~': 'value', + }); + }); +}); diff --git a/src/v0/destinations/braze/transform.js b/src/v0/destinations/braze/transform.js index 155f32c145..09fb0205c5 100644 --- a/src/v0/destinations/braze/transform.js +++ b/src/v0/destinations/braze/transform.js @@ -15,6 +15,7 @@ const { setAliasObject, collectStatsForAliasFailure, collectStatsForAliasMissConfigurations, + handleReservedProperties, } = require('./util'); const tags = require('../../util/tags'); const { EventType, MappedToDestinationKey } = require('../../../constants'); @@ -29,6 +30,7 @@ const { simpleProcessRouterDest, isNewStatusCodesAccepted, getDestinationExternalID, + getIntegrationsObj, } = require('../../util'); const { ConfigCategory, @@ -280,17 +282,6 @@ function processTrackWithUserAttributes( throw new InstrumentationError('No attributes found to update the user profile'); } -function handleReservedProperties(props) { - // remove reserved keys from custom event properties - // https://www.appboy.com/documentation/Platform_Wide/#reserved-keys - const reserved = ['time', 'product_id', 'quantity', 'event_name', 'price', 'currency']; - - reserved.forEach((element) => { - delete props[element]; - }); - return props; -} - function addMandatoryEventProperties(payload, message) { payload.name = message.event; payload.time = message.timestamp; @@ -332,13 +323,6 @@ function processTrackEvent(messageType, message, destination, mappingJson, proce eventName.toLowerCase() === 'order completed' ) { const purchaseObjs = getPurchaseObjs(message, destination.Config); - - // del used properties - delete properties.products; - delete properties.currency; - - const payload = { properties }; - setExternalIdOrAliasObject(payload, message); return buildResponse( message, destination, @@ -515,10 +499,14 @@ async function process(event, processParams = { userStore: new Map() }, reqMetad if (mappedToDestination) { adduserIdFromExternalId(message); } + + const integrationsObj = getIntegrationsObj(message, 'BRAZE'); + const isAliasPresent = isDefinedAndNotNull(integrationsObj?.alias); + const brazeExternalID = getDestinationExternalID(message, 'brazeExternalId') || message.userId; - if (message.anonymousId && brazeExternalID) { - await processIdentify(event); + if ((message.anonymousId || isAliasPresent) && brazeExternalID) { + await processIdentify({ message, destination }); } else { collectStatsForAliasMissConfigurations(destination.ID); } diff --git a/src/v0/destinations/braze/util.js b/src/v0/destinations/braze/util.js index 00ef308fe9..dc7ed69a16 100644 --- a/src/v0/destinations/braze/util.js +++ b/src/v0/destinations/braze/util.js @@ -707,6 +707,16 @@ const collectStatsForAliasMissConfigurations = (destinationId) => { stats.increment('braze_alias_missconfigured_count', { destination_id: destinationId }); }; +function handleReservedProperties(props) { + if (typeof props !== 'object') { + throw new InstrumentationError('Invalid event properties'); + } + // remove reserved keys from custom event properties + const reserved = ['time', 'event_name']; + + return _.omit(props, reserved); +} + module.exports = { BrazeDedupUtility, CustomAttributeOperationUtil, @@ -721,4 +731,5 @@ module.exports = { addMandatoryPurchaseProperties, collectStatsForAliasFailure, collectStatsForAliasMissConfigurations, + handleReservedProperties, }; diff --git a/src/v0/destinations/clevertap/config.js b/src/v0/destinations/clevertap/config.js index 25ece35537..a8ae1b506d 100644 --- a/src/v0/destinations/clevertap/config.js +++ b/src/v0/destinations/clevertap/config.js @@ -42,6 +42,7 @@ const CLEVERTAP_DEFAULT_EXCLUSION = [ 'ts', 'overrideFields', ]; +const ALLOWED_DEVICE_TOKEN_TYPES = ['chrome', 'fcm', 'gcm', 'apns', 'wns', 'mpns']; // ref : https://developer.clevertap.com/docs/disassociate-api const DEL_MAX_BATCH_SIZE = 100; @@ -54,4 +55,5 @@ module.exports = { CONFIG_CATEGORIES, CLEVERTAP_DEFAULT_EXCLUSION, DESTINATION: 'CLEVERTAP', + ALLOWED_DEVICE_TOKEN_TYPES, }; diff --git a/src/v0/destinations/clevertap/transform.js b/src/v0/destinations/clevertap/transform.js index 51ed5c851e..214f9e6409 100644 --- a/src/v0/destinations/clevertap/transform.js +++ b/src/v0/destinations/clevertap/transform.js @@ -1,7 +1,11 @@ /* eslint-disable no-param-reassign */ /* eslint-disable no-nested-ternary */ const get = require('get-value'); -const { InstrumentationError, TransformationError } = require('@rudderstack/integrations-lib'); +const { + InstrumentationError, + TransformationError, + isDefinedAndNotNull, +} = require('@rudderstack/integrations-lib'); const { EventType } = require('../../../constants'); const { getEndpoint, @@ -22,8 +26,10 @@ const { handleRtTfSingleEventError, batchMultiplexedEvents, getSuccessRespEvents, + getIntegrationsObj, + removeUndefinedNullValuesAndEmptyObjectArray, } = require('../../util'); -const { generateClevertapBatchedPayload } = require('./utils'); +const { generateClevertapBatchedPayload, deduceTokenType } = require('./utils'); const { JSON_MIME_TYPE } = require('../../util/constant'); @@ -268,7 +274,9 @@ const responseBuilderSimple = (message, category, destination) => { deviceToken && (deviceOS === 'android' || isAppleFamily(deviceOS)) ) { - const tokenType = deviceOS === 'android' ? 'fcm' : 'apns'; + const tokenType = deduceTokenType(message, deviceOS); + const integObject = getIntegrationsObj(message, 'clevertap'); + const chromeKeys = integObject?.chromeKeys; const payloadForDeviceToken = { d: [ { @@ -276,6 +284,7 @@ const responseBuilderSimple = (message, category, destination) => { tokenData: { id: deviceToken, type: tokenType, + keys: isDefinedAndNotNull(chromeKeys) ? chromeKeys : null, }, objectId: get(message, 'anonymousId'), }, @@ -283,7 +292,12 @@ const responseBuilderSimple = (message, category, destination) => { }; const respArr = []; respArr.push(responseWrapper(payload, destination)); // identify - respArr.push(responseWrapper(payloadForDeviceToken, destination)); // device token + respArr.push( + responseWrapper( + removeUndefinedNullValuesAndEmptyObjectArray(payloadForDeviceToken), + destination, + ), + ); // device token return respArr; } } else { diff --git a/src/v0/destinations/clevertap/utils.js b/src/v0/destinations/clevertap/utils.js index f2dba13ca3..bdc7f63fbd 100644 --- a/src/v0/destinations/clevertap/utils.js +++ b/src/v0/destinations/clevertap/utils.js @@ -1,6 +1,6 @@ -const { defaultBatchRequestConfig } = require('../../util'); +const { defaultBatchRequestConfig, getIntegrationsObj } = require('../../util'); -const { getEndpoint } = require('./config'); +const { getEndpoint, ALLOWED_DEVICE_TOKEN_TYPES } = require('./config'); const { JSON_MIME_TYPE } = require('../../util/constant'); function generateClevertapBatchedPayload(events, destination) { @@ -28,7 +28,25 @@ function generateClevertapBatchedPayload(events, destination) { return batchedRequest; } +/** + * Deduces the device token type based on the integration object and device operating system. + * Ref : https://developer.clevertap.com/docs/upload-device-tokens-api + * @param {Object} message - The message object containing integration details. + * @param {string} deviceOS - The device operating system ('android' or 'ios'). + * @returns {string} The deduced device token type ('fcm' for Android or 'apns' for iOS). + */ +const deduceTokenType = (message, deviceOS) => { + const integrationObj = getIntegrationsObj(message, 'clevertap'); + if ( + integrationObj?.deviceTokenType && + ALLOWED_DEVICE_TOKEN_TYPES.includes(integrationObj?.deviceTokenType) + ) { + return integrationObj?.deviceTokenType; + } + return deviceOS === 'android' ? 'fcm' : 'apns'; +}; module.exports = { generateClevertapBatchedPayload, + deduceTokenType, }; diff --git a/src/v0/destinations/clevertap/utils.test.js b/src/v0/destinations/clevertap/utils.test.js new file mode 100644 index 0000000000..0b0e0d34c5 --- /dev/null +++ b/src/v0/destinations/clevertap/utils.test.js @@ -0,0 +1,87 @@ +const { deduceTokenType } = require('./utils'); + +describe('deduceTokenType', () => { + // deduces token type from integration object when valid token type is present + it('should return the token type from integration object when it is valid', () => { + const message = { + integrations: { + clevertap: { + deviceTokenType: 'fcm', + }, + }, + }; + const deviceOS = 'android'; + const result = deduceTokenType(message, deviceOS); + expect(result).toBe('fcm'); + }); + + // handles null or undefined message input gracefully + it('should return default token type based on deviceOS when message is null', () => { + const message = null; + const deviceOS = 'android'; + const result = deduceTokenType(message, deviceOS); + expect(result).toBe('fcm'); + }); + + // returns 'fcm' when deviceOS is 'android' and no valid token type is present + it("should return 'fcm' when deviceOS is 'android' and no valid token type is present", () => { + const message = { integrations: { clevertap: { deviceTokenType: null } } }; + const result = deduceTokenType(message, 'android'); + expect(result).toBe('fcm'); + }); + + // returns 'apns' when deviceOS is not 'android' and no valid token type is present + it("should return 'apns' when deviceOS is not 'android' and no valid token type is present", () => { + const message = { integrations: { clevertap: { deviceTokenType: null } } }; + const result = deduceTokenType(message, 'ios'); + expect(result).toBe('apns'); + }); + + // handles null or undefined deviceOS input gracefully + it('should return default token type when deviceOS is null', () => { + const message = {}; + const deviceOS = null; + const result = deduceTokenType(message, deviceOS); + expect(result).toEqual('apns'); + }); + + // handles empty integration object in message + it('should return default token type when integration object is empty', () => { + const message = { integrations: {} }; + const deviceOS = 'ios'; + const result = deduceTokenType(message, deviceOS); + expect(result).toEqual('apns'); + }); + + // handles integration object with invalid token type + it('should return default token type when integration object has an invalid token type', () => { + const message = { integrations: { clevertap: { deviceTokenType: 'invalidType' } } }; + const deviceOS = 'ios'; + const result = deduceTokenType(message, deviceOS); + expect(result).toEqual('apns'); + }); + + // handles integration object with no token type + it('should return default token type when integration object has no token type', () => { + const message = { integrations: { clevertap: {} } }; + const deviceOS = 'android'; + const result = deduceTokenType(message, deviceOS); + expect(result).toEqual('fcm'); + }); + + // verifies integration object retrieval with 'clevertap' as destination name + it('should retrieve correct device token type for CleverTap destination', () => { + const message = { integrations: { clevertap: { deviceTokenType: 'fcm' } } }; + const deviceOS = 'ios'; + const result = deduceTokenType(message, deviceOS); + expect(result).toBe('fcm'); + }); + + // checks for case sensitivity in deviceOS values + it('should handle case sensitivity in deviceOS values', () => { + const message = { integrations: { clevertap: { deviceTokenType: 'fcm' } } }; + const deviceOS = 'Android'; + const result = deduceTokenType(message, deviceOS); + expect(result).toBe('fcm'); + }); +}); diff --git a/src/v0/destinations/customerio/util.js b/src/v0/destinations/customerio/util.js index ef983748a5..cadad5620c 100644 --- a/src/v0/destinations/customerio/util.js +++ b/src/v0/destinations/customerio/util.js @@ -286,6 +286,9 @@ const defaultResponseBuilder = (message, evName, userId, evType, destination, me // 100 - len(`Viewed Screen`) = 86 trimmedEvName = `Viewed ${truncate(message.event || message.properties.name, 86)} Screen`; } else { + if (typeof evName !== 'string') { + throw new InstrumentationError('Event Name type should be a string'); + } // validating evName here as well as message.name could be undefined as well trimmedEvName = truncate(evName, 100); } // anonymous_id needs to be sent for anon track calls to provide information on which anon user is being tracked diff --git a/src/v0/destinations/facebook_conversions/config.js b/src/v0/destinations/facebook_conversions/config.js index 0c1fc12e15..2bbe9ab017 100644 --- a/src/v0/destinations/facebook_conversions/config.js +++ b/src/v0/destinations/facebook_conversions/config.js @@ -1,7 +1,7 @@ const { getMappingConfig } = require('../../util'); const ENDPOINT = (datasetId, accessToken) => - `https://graph.facebook.com/v18.0/${datasetId}/events?access_token=${accessToken}`; + `https://graph.facebook.com/v20.0/${datasetId}/events?access_token=${accessToken}`; const CONFIG_CATEGORIES = { USERDATA: { diff --git a/src/v0/destinations/facebook_pixel/config.js b/src/v0/destinations/facebook_pixel/config.js index 17d5887e1b..f259892165 100644 --- a/src/v0/destinations/facebook_pixel/config.js +++ b/src/v0/destinations/facebook_pixel/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const VERSION = 'v18.0'; +const VERSION = 'v20.0'; const CONFIG_CATEGORIES = { USERDATA: { diff --git a/src/v0/destinations/fb/config.js b/src/v0/destinations/fb/config.js index 0e52b42416..d84fa7d672 100644 --- a/src/v0/destinations/fb/config.js +++ b/src/v0/destinations/fb/config.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); -const VERSION = 'v18.0'; +const VERSION = 'v20.0'; const getPath = (file) => path.resolve(__dirname, file); diff --git a/src/v0/destinations/fb_custom_audience/config.js b/src/v0/destinations/fb_custom_audience/config.js index 284ab0d4a4..39ca2d04c4 100644 --- a/src/v0/destinations/fb_custom_audience/config.js +++ b/src/v0/destinations/fb_custom_audience/config.js @@ -1,4 +1,4 @@ -const BASE_URL = 'https://graph.facebook.com/v18.0'; +const BASE_URL = 'https://graph.facebook.com/v20.0'; function getEndPoint(audienceId) { return `${BASE_URL}/${audienceId}/users`; diff --git a/src/v0/destinations/fb_custom_audience/util.test.js b/src/v0/destinations/fb_custom_audience/util.test.js index 60e0aff464..5c8eb15b71 100644 --- a/src/v0/destinations/fb_custom_audience/util.test.js +++ b/src/v0/destinations/fb_custom_audience/util.test.js @@ -18,7 +18,7 @@ const basePayload = { const baseResponse = { version: '1', type: 'REST', - endpoint: 'https://graph.facebook.com/v18.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', diff --git a/src/v0/destinations/ga4/transform.js b/src/v0/destinations/ga4/transform.js index e4dad80564..feafc4c45f 100644 --- a/src/v0/destinations/ga4/transform.js +++ b/src/v0/destinations/ga4/transform.js @@ -39,7 +39,7 @@ require('../../util/constant'); * @param {*} Config * @returns */ -const responseBuilder = (message, { Config }) => { +const responseBuilder = (message, { Config }, destType) => { let event = get(message, 'event'); basicValidation(event); @@ -54,7 +54,7 @@ const responseBuilder = (message, { Config }) => { // get common top level rawPayload let rawPayload = constructPayload(message, trackCommonConfig); - rawPayload = addClientDetails(rawPayload, message, Config); + rawPayload = addClientDetails(rawPayload, message, Config, destType); let payload = {}; const eventConfig = ConfigCategory[`${event.toUpperCase()}`]; @@ -162,7 +162,7 @@ const responseBuilder = (message, { Config }) => { } removeReservedParameterPrefixNames(payload.params); - const integrationsObj = getIntegrationsObj(message, 'ga4'); + const integrationsObj = getIntegrationsObj(message, destType); if (isHybridModeEnabled(Config) && integrationsObj && integrationsObj.sessionId) { payload.params.session_id = integrationsObj.sessionId; } @@ -186,7 +186,7 @@ const responseBuilder = (message, { Config }) => { } // Prepare GA4 consents - const consents = prepareUserConsents(message); + const consents = prepareUserConsents(message, destType); if (!isEmptyObject(consents)) { rawPayload.consent = consents; } @@ -197,7 +197,7 @@ const responseBuilder = (message, { Config }) => { return buildDeliverablePayload(rawPayload, Config); }; -const process = (event) => { +const processEvents = ({ event, destType = 'ga4' }) => { const { message, destination } = event; const { Config } = destination; @@ -212,13 +212,13 @@ const process = (event) => { let response; switch (messageType) { case EventType.TRACK: - response = responseBuilder(message, destination); + response = responseBuilder(message, destination, destType); break; case EventType.PAGE: // GA4 custom event 'page_view' is fired for page if (!isHybridModeEnabled(Config)) { message.event = 'page_view'; - response = responseBuilder(message, destination); + response = responseBuilder(message, destination, destType); } else { throw new UnsupportedEventError( 'GA4 Hybrid mode is enabled, page calls will be sent through device mode', @@ -228,7 +228,7 @@ const process = (event) => { case EventType.GROUP: // GA4 standard event 'join_group' is fired for group message.event = 'join_group'; - response = responseBuilder(message, destination); + response = responseBuilder(message, destination, destType); break; default: throw new InstrumentationError(`Message type ${messageType} not supported`); @@ -236,4 +236,7 @@ const process = (event) => { return response; }; -module.exports = { process }; +// Keeping this for other params which comes as part of process args +const process = (event) => processEvents({ event }); + +module.exports = { process, processEvents }; diff --git a/src/v0/destinations/ga4/utils.js b/src/v0/destinations/ga4/utils.js index 18994efd7f..7b9528143c 100644 --- a/src/v0/destinations/ga4/utils.js +++ b/src/v0/destinations/ga4/utils.js @@ -448,8 +448,8 @@ const prepareUserProperties = (message, piiPropertiesToIgnore = []) => { * @param {*} message * @returns */ -const prepareUserConsents = (message) => { - const integrationObj = getIntegrationsObj(message, 'ga4') || {}; +const prepareUserConsents = (message, destType = 'ga4') => { + const integrationObj = getIntegrationsObj(message, destType) || {}; const eventLevelConsentsData = integrationObj?.consents || {}; const consentConfigMap = { analyticsPersonalizationConsent: 'ad_user_data', @@ -474,11 +474,11 @@ const basicValidation = (event) => { * @param {*} message * @returns */ -const getGA4ClientId = (message, Config) => { +const getGA4ClientId = (message, Config, destType) => { let clientId; if (isHybridModeEnabled(Config)) { - const integrationsObj = getIntegrationsObj(message, 'ga4'); + const integrationsObj = getIntegrationsObj(message, destType); if (integrationsObj?.clientId) { clientId = integrationsObj.clientId; } @@ -494,14 +494,14 @@ const getGA4ClientId = (message, Config) => { return clientId; }; -const addClientDetails = (payload, message, Config) => { +const addClientDetails = (payload, message, Config, destType = 'ga4') => { const { typesOfClient } = Config; const rawPayload = cloneDeep(payload); switch (typesOfClient) { case 'gtag': // gtag.js uses client_id // GA4 uses it as an identifier to distinguish site visitors. - rawPayload.client_id = getGA4ClientId(message, Config); + rawPayload.client_id = getGA4ClientId(message, Config, destType); if (!isDefinedAndNotNull(rawPayload.client_id)) { throw new ConfigurationError('ga4ClientId, anonymousId or messageId must be provided'); } @@ -581,6 +581,16 @@ const basicConfigvalidaiton = (Config) => { } }; +const addSessionDetailsForHybridMode = (ga4Payload, message, Config, destType = 'ga4') => { + const integrationsObj = getIntegrationsObj(message, destType); + if (isHybridModeEnabled(Config) && integrationsObj?.sessionId) { + ga4Payload.events[0].params.session_id = `${integrationsObj.sessionId}`; + } + if (integrationsObj?.sessionNumber) { + ga4Payload.events[0].params.session_number = integrationsObj.sessionNumber; + } +}; + module.exports = { addClientDetails, basicValidation, @@ -603,4 +613,5 @@ module.exports = { GA4_RESERVED_PARAMETER_EXCLUSION, removeReservedParameterPrefixNames, GA4_RESERVED_USER_PROPERTY_EXCLUSION, + addSessionDetailsForHybridMode, }; diff --git a/src/v0/destinations/ga4_v2/customMappingsHandler.js b/src/v0/destinations/ga4_v2/customMappingsHandler.js index 9e82788150..b5818d6fff 100644 --- a/src/v0/destinations/ga4_v2/customMappingsHandler.js +++ b/src/v0/destinations/ga4_v2/customMappingsHandler.js @@ -13,6 +13,7 @@ const { GA4_PARAMETERS_EXCLUSION, prepareUserProperties, sanitizeUserProperties, + addSessionDetailsForHybridMode, } = require('../ga4/utils'); const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); const { @@ -71,6 +72,7 @@ const handleCustomMappings = (message, Config) => { // Default mapping let rawPayload = constructPayload(message, trackCommonConfig); + rawPayload = addClientDetails(rawPayload, message, Config, 'ga4_v2'); const ga4EventPayload = {}; @@ -113,7 +115,7 @@ const handleCustomMappings = (message, Config) => { // Add common top level payload let ga4BasicPayload = constructPayload(message, trackCommonConfig); - ga4BasicPayload = addClientDetails(ga4BasicPayload, message, Config); + ga4BasicPayload = addClientDetails(ga4BasicPayload, message, Config, 'ga4_v2'); const eventPropertiesMappings = mapping.eventProperties || []; @@ -143,11 +145,7 @@ const handleCustomMappings = (message, Config) => { const boilerplateOperations = (ga4Payload, message, Config, eventName) => { removeReservedParameterPrefixNames(ga4Payload.events[0].params); ga4Payload.events[0].name = eventName; - const integrationsObj = getIntegrationsObj(message, 'ga4'); - - if (isHybridModeEnabled(Config) && integrationsObj?.sessionId) { - ga4Payload.events[0].params.session_id = integrationsObj.sessionId; - } + const integrationsObj = getIntegrationsObj(message, 'ga4_v2'); if (ga4Payload.events[0].params) { ga4Payload.events[0].params = removeInvalidParams( @@ -160,7 +158,7 @@ const boilerplateOperations = (ga4Payload, message, Config, eventName) => { } // Prepare GA4 consents - const consents = prepareUserConsents(message); + const consents = prepareUserConsents(message, 'ga4_v2'); if (!isEmptyObject(consents)) { ga4Payload.consent = consents; } @@ -169,6 +167,8 @@ const boilerplateOperations = (ga4Payload, message, Config, eventName) => { if (isDefinedAndNotNull(ga4Payload.user_properties)) { ga4Payload.user_properties = sanitizeUserProperties(ga4Payload.user_properties); } + + addSessionDetailsForHybridMode(ga4Payload, message, Config, 'ga4_v2'); }; module.exports = { diff --git a/src/v0/destinations/ga4_v2/transform.ts b/src/v0/destinations/ga4_v2/transform.ts index 79892d791e..06d4bd9023 100644 --- a/src/v0/destinations/ga4_v2/transform.ts +++ b/src/v0/destinations/ga4_v2/transform.ts @@ -5,7 +5,7 @@ import { } from '@rudderstack/integrations-lib'; import { ProcessorTransformationRequest } from '../../../types'; import { handleCustomMappings } from './customMappingsHandler'; -import { process as ga4Process } from '../ga4/transform'; +import { processEvents as ga4Process } from '../ga4/transform'; import { basicConfigvalidaiton } from '../ga4/utils'; export function process(event: ProcessorTransformationRequest) { @@ -30,7 +30,7 @@ export function process(event: ProcessorTransformationRequest) { } if (eventPayload.type !== 'track') { - return ga4Process(event); + return ga4Process({ event, destType: 'ga4_v2' }); } basicConfigvalidaiton(Config); diff --git a/src/v0/destinations/gainsight_px/transform.js b/src/v0/destinations/gainsight_px/transform.js index a63be08c80..0911b76b6c 100644 --- a/src/v0/destinations/gainsight_px/transform.js +++ b/src/v0/destinations/gainsight_px/transform.js @@ -39,7 +39,7 @@ const { JSON_MIME_TYPE } = require('../../util/constant'); /** * Create/Update a User with user attributes */ -const identifyResponseBuilder = async (message, { Config }) => { +const identifyResponseBuilder = async (message, { Config }, metadata) => { const userId = getFieldValueFromMessage(message, 'userId'); if (!userId) { throw new InstrumentationError('userId or anonymousId is required for identify'); @@ -51,7 +51,7 @@ const identifyResponseBuilder = async (message, { Config }) => { 'Content-Type': JSON_MIME_TYPE, }; - const { success: isUserPresent } = await objectExists(userId, Config, 'user'); + const { success: isUserPresent } = await objectExists(userId, Config, 'user', metadata); let payload = constructPayload(message, identifyMapping); const name = getValueFromMessage(message, ['traits.name', 'context.traits.name']); @@ -110,7 +110,7 @@ const identifyResponseBuilder = async (message, { Config }) => { * Pros: Will make atleast 2 API call and at most 3 API calls * Cons: There might be some unwanted accounts */ -const newGroupResponseBuilder = async (message, { Config }) => { +const newGroupResponseBuilder = async (message, { Config }, metadata) => { const userId = getFieldValueFromMessage(message, 'userId'); if (!userId) { throw new InstrumentationError('userId or anonymousId is required for group'); @@ -140,12 +140,12 @@ const newGroupResponseBuilder = async (message, { Config }) => { payload = removeUndefinedAndNullValues(payload); // update account - const { success: updateSuccess, err } = await updateAccount(groupId, payload, Config); + const { success: updateSuccess, err } = await updateAccount(groupId, payload, Config, metadata); // will not throw error if it is due to unavailable accounts if (!updateSuccess && err === null) { // create account payload.id = groupId; - const { success: createSuccess, error } = await createAccount(payload, Config); + const { success: createSuccess, error } = await createAccount(payload, Config, metadata); if (!createSuccess) { throw new ConfigurationError(`failed to create account for group: ${error}`); } @@ -172,13 +172,13 @@ const newGroupResponseBuilder = async (message, { Config }) => { /** * Associates a User with an Account. */ -const groupResponseBuilder = async (message, { Config }) => { +const groupResponseBuilder = async (message, { Config }, metadata) => { const userId = getFieldValueFromMessage(message, 'userId'); if (!userId) { throw new InstrumentationError('userId or anonymousId is required for group'); } - const { success: isPresent, err: e } = await objectExists(userId, Config, 'user'); + const { success: isPresent, err: e } = await objectExists(userId, Config, 'user', metadata); if (!isPresent) { throw new InstrumentationError(`aborting group call: ${e}`); } @@ -188,7 +188,7 @@ const groupResponseBuilder = async (message, { Config }) => { throw new InstrumentationError('groupId is required for group'); } - const { success: accountIsPresent } = await objectExists(groupId, Config, 'account'); + const { success: accountIsPresent } = await objectExists(groupId, Config, 'account', metadata); let payload = constructPayload(message, groupMapping); let customAttributes = {}; @@ -210,14 +210,14 @@ const groupResponseBuilder = async (message, { Config }) => { if (accountIsPresent) { // update account - const { success: updateSuccess, err } = await updateAccount(groupId, payload, Config); + const { success: updateSuccess, err } = await updateAccount(groupId, payload, Config, metadata); if (!updateSuccess) { throw new ConfigurationError(`failed to update account for group: ${err}`); } } else { // create account payload.id = groupId; - const { success: createSuccess, err } = await createAccount(payload, Config); + const { success: createSuccess, err } = await createAccount(payload, Config, metadata); if (!createSuccess) { throw new ConfigurationError(`failed to create account for group: ${err}`); } @@ -279,7 +279,7 @@ const trackResponseBuilder = (message, { Config }) => { * Processing Single event */ const process = async (event) => { - const { message, destination } = event; + const { message, destination, metadata } = event; if (!message.type) { throw new InstrumentationError('Message Type is not present. Aborting message.'); } @@ -301,16 +301,16 @@ const process = async (event) => { let response; switch (messageType) { case EventType.IDENTIFY: - response = await identifyResponseBuilder(message, destination); + response = await identifyResponseBuilder(message, destination, metadata); break; case EventType.TRACK: response = trackResponseBuilder(message, destination); break; case EventType.GROUP: if (limitAPIForGroup) { - response = await newGroupResponseBuilder(message, destination); + response = await newGroupResponseBuilder(message, destination, metadata); } else { - response = await groupResponseBuilder(message, destination); + response = await groupResponseBuilder(message, destination, metadata); } break; default: diff --git a/src/v0/destinations/gainsight_px/util.js b/src/v0/destinations/gainsight_px/util.js index 83d23566dd..7300189297 100644 --- a/src/v0/destinations/gainsight_px/util.js +++ b/src/v0/destinations/gainsight_px/util.js @@ -1,9 +1,9 @@ const { NetworkError } = require('@rudderstack/integrations-lib'); -const myAxios = require('../../../util/myAxios'); const { ENDPOINTS } = require('./config'); const tags = require('../../util/tags'); const { getDynamicErrorType } = require('../../../adapters/utils/networkUtils'); const { JSON_MIME_TYPE } = require('../../util/constant'); +const { handleHttpRequest } = require('../../../adapters/network'); const handleErrorResponse = (error, customErrMessage, expectedErrStatus, defaultStatus = 400) => { let destResp; @@ -37,133 +37,86 @@ const handleErrorResponse = (error, customErrMessage, expectedErrStatus, default * @param {*} objectType * @returns */ -const objectExists = async (id, Config, objectType) => { +const objectExists = async (id, Config, objectType, metadata) => { let url = `${ENDPOINTS.USERS_ENDPOINT}/${id}`; - let err = 'invalid response while searching user'; if (objectType === 'account') { url = `${ENDPOINTS.ACCOUNTS_ENDPOINT}/${id}`; - err = 'invalid response while searching account'; } - - let response; - try { - response = await myAxios.get( - url, - { - headers: { - 'X-APTRINSIC-API-KEY': Config.apiKey, - 'Content-Type': JSON_MIME_TYPE, - }, - }, - { - destType: 'gainsight_px', - feature: 'transformation', - requestMethod: 'GET', - endpointPath: '/accounts/accountId', - module: 'router', - }, - ); - if (response && response.status === 200) { - return { success: true, err: null }; - } - const defStatus = 400; - const status = response ? response.status || defStatus : defStatus; - throw new NetworkError( - err, - status, - { - [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status), + const { httpResponse: res } = await handleHttpRequest( + 'get', + url, + { + headers: { + 'X-APTRINSIC-API-KEY': Config.apiKey, + 'Content-Type': JSON_MIME_TYPE, }, - response, - ); - } catch (error) { - return handleErrorResponse(error, `error while fetching ${objectType}`, 404); + }, + { + metadata, + destType: 'gainsight_px', + feature: 'transformation', + requestMethod: 'GET', + endpointPath: '/accounts/accountId', + module: 'router', + }, + ); + if (res.success && res.response && res.response.status === 200) { + return { success: true, err: null }; } + return handleErrorResponse(res.response, `error while fetching ${objectType}`, 404); }; -const createAccount = async (payload, Config) => { - let response; - try { - response = await myAxios.post( - ENDPOINTS.ACCOUNTS_ENDPOINT, - payload, - { - headers: { - 'X-APTRINSIC-API-KEY': Config.apiKey, - 'Content-Type': JSON_MIME_TYPE, - }, - }, - { - destType: 'gainsight_px', - feature: 'transformation', - requestMethod: 'POST', - endpointPath: '/accounts', - module: 'router', - }, - ); - if (response && response.status === 201) { - return { success: true, err: null }; - } - - const defStatus = 400; - const status = response ? response.status || defStatus : defStatus; - throw new NetworkError( - 'invalid response while creating account', - status, - { - [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status), +const createAccount = async (payload, Config, metadata) => { + const { httpResponse: res } = await handleHttpRequest( + 'post', + ENDPOINTS.ACCOUNTS_ENDPOINT, + payload, + { + headers: { + 'X-APTRINSIC-API-KEY': Config.apiKey, + 'Content-Type': JSON_MIME_TYPE, }, - response, - ); - } catch (error) { - return handleErrorResponse(error, 'error while creating account', 400); + }, + { + metadata, + destType: 'gainsight_px', + feature: 'transformation', + requestMethod: 'POST', + endpointPath: '/accounts', + module: 'router', + }, + ); + if (res.success && res.response.status === 201) { + return { success: true, err: null }; } + return handleErrorResponse(res.response, 'error while creating account', 400); }; -const updateAccount = async (accountId, payload, Config) => { - let response; - try { - response = await myAxios.put( - `${ENDPOINTS.ACCOUNTS_ENDPOINT}/${accountId}`, - payload, - { - headers: { - 'X-APTRINSIC-API-KEY': Config.apiKey, - 'Content-Type': JSON_MIME_TYPE, - }, - }, - { - destType: 'gainsight_px', - feature: 'transformation', - requestMethod: 'PUT', - endpointPath: '/accounts/accountId', - module: 'router', - }, - ); - if (response && response.status === 204) { - return { success: true, err: null }; - } - const defStatus = 400; - const status = response ? response.status || defStatus : defStatus; - throw new NetworkError( - 'invalid response while updating account', - status, - { - [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status), +const updateAccount = async (accountId, payload, Config, metadata) => { + const { httpResponse: res } = await handleHttpRequest( + 'put', + `${ENDPOINTS.ACCOUNTS_ENDPOINT}/${accountId}`, + payload, + { + headers: { + 'X-APTRINSIC-API-KEY': Config.apiKey, + 'Content-Type': JSON_MIME_TYPE, }, - response, - ); - } catch (error) { - // it will only occur if the user does not exist - if ( - error.response?.status === 404 && - error.response?.data?.externalapierror?.status === 'NOT_FOUND' - ) { - return { success: false, err: null }; - } - return handleErrorResponse(error, 'error while updating account', 400); + }, + { + metadata, + destType: 'gainsight_px', + feature: 'transformation', + requestMethod: 'PUT', + endpointPath: '/accounts/accountId', + module: 'router', + }, + ); + if (res.success && res.response.status === 204) { + return { success: true, err: null }; } + return handleErrorResponse(res.response, 'error while updating account', 400); }; /** diff --git a/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js b/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js index 98659fdf88..6491215a93 100644 --- a/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js +++ b/src/v0/destinations/google_adwords_remarketing_lists/networkHandler.js @@ -153,7 +153,7 @@ const gaAudienceRespHandler = (destResponse, stageMsg) => { // const { stat, err_code: errorCode } = respAttributes; throw new NetworkError( - `${response?.error?.message} ${stageMsg}`, + `${JSON.stringify(response)} ${stageMsg}`, status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status), diff --git a/src/v0/destinations/klaviyo/batchUtil.js b/src/v0/destinations/klaviyo/batchUtil.js new file mode 100644 index 0000000000..3e99e03deb --- /dev/null +++ b/src/v0/destinations/klaviyo/batchUtil.js @@ -0,0 +1,201 @@ +const lodash = require('lodash'); +const { defaultRequestConfig, getSuccessRespEvents, isDefinedAndNotNull } = require('../../util'); +const { JSON_MIME_TYPE } = require('../../util/constant'); +const { BASE_ENDPOINT, CONFIG_CATEGORIES, MAX_BATCH_SIZE, revision } = require('./config'); +const { buildRequest, getSubscriptionPayload } = require('./util'); + +/** + * This function groups the subscription responses on list id + * @param {*} subscribeResponseList + * @returns + * Example subsribeResponseList = + * [ + * { payload: {id:'list_id', profile: {}}, metadata:{} }, + * { payload: {id:'list_id', profile: {}}, metadata:{} } + * ] + */ +const groupSubscribeResponsesUsingListIdV2 = (subscribeResponseList) => { + const subscribeEventGroups = lodash.groupBy( + subscribeResponseList, + (event) => event.payload.listId, + ); + return subscribeEventGroups; +}; + +/** + * This function takes susbscription as input and batches them into a single request body + * @param {subscription} + * subscription= {listId, subscriptionProfileList} + */ +const generateBatchedSubscriptionRequest = (subscription, destination) => { + const subscriptionPayloadResponse = defaultRequestConfig(); + // fetching listId from first event as listId is same for all the events + const profiles = []; // list of profiles to be subscribed + const { listId, subscriptionProfileList } = subscription; + subscriptionProfileList.forEach((profileList) => profiles.push(...profileList)); + subscriptionPayloadResponse.body.JSON = getSubscriptionPayload(listId, profiles); + subscriptionPayloadResponse.endpoint = `${BASE_ENDPOINT}/api/profile-subscription-bulk-create-jobs`; + subscriptionPayloadResponse.headers = { + Authorization: `Klaviyo-API-Key ${destination.Config.privateApiKey}`, + 'Content-Type': JSON_MIME_TYPE, + Accept: JSON_MIME_TYPE, + revision, + }; + return subscriptionPayloadResponse; +}; + +/** + * This function generates requests using profiles array and returns an array of all these requests + * @param {*} profiles + * @param {*} destination + */ +const getProfileRequests = (profiles, destination) => { + const profilePayloadResponses = profiles.map((profile) => + buildRequest(profile, destination, CONFIG_CATEGORIES.IDENTIFYV2), + ); + return profilePayloadResponses; +}; + +/** + * this function populates profileSubscriptionAndMetadataArr with respective profiles based upon common metadata + * @param {*} profileSubscriptionAndMetadataArr + * @param {*} metaDataIndexMap + * @param {*} profiles + * @returns updated profileSubscriptionAndMetadataArr obj + */ +const populateArrWithRespectiveProfileData = ( + profileSubscriptionAndMetadataArr, + metaDataIndexMap, + profiles, +) => { + const updatedPSMArr = lodash.cloneDeep(profileSubscriptionAndMetadataArr); + profiles.forEach((profile) => { + const index = metaDataIndexMap.get(profile.metadata.jobId); + if (isDefinedAndNotNull(index)) { + // using isDefinedAndNotNull as index can be 0 + updatedPSMArr[index].profiles.push(profile.payload); + } else { + // in case there is no subscription for a given profile + updatedPSMArr.push({ + profiles: [profile.payload], + metadataList: [profile.metadata], + }); + } + }); + return updatedPSMArr; +}; + +/** + * This function generates the final output batched payload for each object in profileSubscriptionAndMetadataArr + * ex: + * profileSubscriptionAndMetadataArr = [ + { + subscription: { subscriptionProfileList, listId1 }, + metadataList1, + profiles: [respectiveProfiles for above metadata] + }, + { + subscription: { subscriptionProfile List With No Profiles, listId2 }, + metadataList2, + }, + { + metadataList3, + profiles: [respectiveProfiles for above metadata with no subscription] + } + ] + * @param {*} profileSubscriptionAndMetadataArr + * @param {*} destination + * @returns + */ +const buildRequestsForProfileSubscriptionAndMetadataArr = ( + profileSubscriptionAndMetadataArr, + destination, +) => { + const finalResponseList = []; + profileSubscriptionAndMetadataArr.forEach((profileSubscriptionData) => { + const batchedRequest = []; + // we are keeping profiles request prior to subscription ones as first profile creation and then subscription should happen + if (profileSubscriptionData.profiles?.length > 0) { + batchedRequest.push(...getProfileRequests(profileSubscriptionData.profiles, destination)); + } + + if (profileSubscriptionData.subscription?.subscriptionProfileList?.length > 0) { + batchedRequest.push( + generateBatchedSubscriptionRequest(profileSubscriptionData.subscription, destination), + ); + } + + finalResponseList.push( + getSuccessRespEvents(batchedRequest, profileSubscriptionData.metadataList, destination, true), + ); + }); + return finalResponseList; +}; + +const batchRequestV2 = (subscribeRespList, profileRespList, destination) => { + const subscribeEventGroups = groupSubscribeResponsesUsingListIdV2(subscribeRespList); + let profileSubscriptionAndMetadataArr = []; + const metaDataIndexMap = new Map(); + Object.keys(subscribeEventGroups).forEach((listId) => { + // eventChunks = [[e1,e2,e3,..batchSize],[e1,e2,e3,..batchSize]..] + const eventChunks = lodash.chunk(subscribeEventGroups[listId], MAX_BATCH_SIZE); + eventChunks.forEach((chunk, index) => { + // get subscriptionProfiles for the chunk + const subscriptionProfileList = chunk.map((event) => event.payload?.profile); + // get metadata for this chunk + const metadataList = chunk.map((event) => event.metadata); + // get list of jobIds from the above metdadata + const jobIdList = metadataList.map((metadata) => metadata.jobId); + // push the jobId: index to metadataIndex mapping which let us know the metadata respective payload index position in batched request + jobIdList.forEach((jobId) => { + metaDataIndexMap.set(jobId, index); + }); + profileSubscriptionAndMetadataArr.push({ + subscription: { subscriptionProfileList, listId }, + metadataList, + profiles: [], + }); + }); + }); + profileSubscriptionAndMetadataArr = populateArrWithRespectiveProfileData( + profileSubscriptionAndMetadataArr, + metaDataIndexMap, + profileRespList, + ); + /* Till this point I have a profileSubscriptionAndMetadataArr + containing the the events in one object for which batching has to happen in following format + [ + { + subscription: { subscriptionProfileList, listId1 }, + metadataList1, + profiles: [respectiveProfiles for above metadata] + }, + { + subscription: { subscriptionProfile List With No Profiles, listId2 }, + metadataList2, + }, + { + metadataList3, + profiles: [respectiveProfiles for above metadata with no subscription] + } + ] + */ + return buildRequestsForProfileSubscriptionAndMetadataArr( + profileSubscriptionAndMetadataArr, + destination, + ); + /* for identify calls with batching batched with identify with no batching + we will sonctruct O/P as: + [ + [2 calls for identifywith batching], + [1 call identify calls with batching] + ] + */ +}; + +module.exports = { + groupSubscribeResponsesUsingListIdV2, + populateArrWithRespectiveProfileData, + generateBatchedSubscriptionRequest, + batchRequestV2, +}; diff --git a/src/v0/destinations/klaviyo/batchUtil.test.js b/src/v0/destinations/klaviyo/batchUtil.test.js new file mode 100644 index 0000000000..af1afd8670 --- /dev/null +++ b/src/v0/destinations/klaviyo/batchUtil.test.js @@ -0,0 +1,189 @@ +const { + groupSubscribeResponsesUsingListIdV2, + populateArrWithRespectiveProfileData, + generateBatchedSubscriptionRequest, +} = require('./batchUtil'); +const { revision } = require('./config'); + +describe('groupSubscribeResponsesUsingListIdV2', () => { + // Groups subscription responses by listId correctly + it('should group subscription responses by listId correctly when given a valid list', () => { + const subscribeResponseList = [ + { payload: { listId: 'list_1', profile: {} }, metadata: {} }, + { payload: { listId: 'list_1', profile: {} }, metadata: {} }, + { payload: { listId: 'list_2', profile: {} }, metadata: {} }, + ]; + + const expectedOutput = { + list_1: [ + { payload: { listId: 'list_1', profile: {} }, metadata: {} }, + { payload: { listId: 'list_1', profile: {} }, metadata: {} }, + ], + list_2: [{ payload: { listId: 'list_2', profile: {} }, metadata: {} }], + }; + + const result = groupSubscribeResponsesUsingListIdV2(subscribeResponseList); + + expect(result).toEqual(expectedOutput); + }); + + // Handles empty subscription response list + it('should return an empty object when given an empty subscription response list', () => { + const subscribeResponseList = []; + + const expectedOutput = {}; + + const result = groupSubscribeResponsesUsingListIdV2(subscribeResponseList); + + expect(result).toEqual(expectedOutput); + }); +}); + +describe('populateArrWithRespectiveProfileData', () => { + // Correctly populates array when all profiles have corresponding metadata + it('should correctly populate array when all profiles have corresponding metadata', () => { + const profileSubscriptionAndMetadataArr = [ + { profiles: [], metadataList: [{ jobId: '1' }], subscriptions: [] }, + { profiles: [], metadataList: [{ jobId: '2' }], subscriptions: [] }, + ]; + const metadataIndexMap = new Map([ + ['1', 0], + ['2', 1], + ]); + const profiles = [ + { payload: { name: 'John' }, metadata: { jobId: '1' } }, + { payload: { name: 'Doe' }, metadata: { jobId: '2' } }, + ]; + + const result = populateArrWithRespectiveProfileData( + profileSubscriptionAndMetadataArr, + metadataIndexMap, + profiles, + ); + + expect(result[0].profiles).toEqual([{ name: 'John' }]); + expect(result[1].profiles).toEqual([{ name: 'Doe' }]); + }); + + // Handles empty profileSubscriptionAndMetadataArr input + it('should handle empty profileSubscriptionAndMetadataArr input', () => { + const profileSubscriptionAndMetadataArr = []; + const metadataIndexMap = new Map(); + const profiles = [{ payload: { name: 'John' }, metadata: { jobId: '1' } }]; + + const result = populateArrWithRespectiveProfileData( + profileSubscriptionAndMetadataArr, + metadataIndexMap, + profiles, + ); + + expect(result).toEqual([ + { + profiles: [{ name: 'John' }], + metadataList: [{ jobId: '1' }], + }, + ]); + }); +}); + +// Generated by CodiumAI + +describe('generateBatchedSubscriptionRequest', () => { + // Generates a batched subscription request with valid subscription and destination inputs + it('should generate a valid batched subscription request when given valid subscription and destination inputs', () => { + const subscription = { + listId: 'test-list-id', + subscriptionProfileList: [[{ id: 'profile1' }, { id: 'profile2' }], [{ id: 'profile3' }]], + }; + const destination = { + Config: { + privateApiKey: 'test-api-key', + }, + }; + const expectedRequest = { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers: { + Authorization: 'Klaviyo-API-Key test-api-key', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision, + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { + profiles: { data: [{ id: 'profile1' }, { id: 'profile2' }, { id: 'profile3' }] }, + }, + relationships: { + list: { + data: { + type: 'list', + id: 'test-list-id', + }, + }, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }; + const result = generateBatchedSubscriptionRequest(subscription, destination); + expect(result).toEqual(expectedRequest); + }); + + // Handles empty subscriptionProfileList gracefully + it('should handle empty subscriptionProfileList gracefully', () => { + const subscription = { + listId: 'test-list-id', + subscriptionProfileList: [], + }; + const destination = { + Config: { + privateApiKey: 'test-api-key', + }, + }; + const expectedRequest = { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers: { + Authorization: 'Klaviyo-API-Key test-api-key', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision, + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { profiles: { data: [] } }, + relationships: { + list: { + data: { + type: 'list', + id: 'test-list-id', + }, + }, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }; + const result = generateBatchedSubscriptionRequest(subscription, destination); + expect(result).toEqual(expectedRequest); + }); +}); diff --git a/src/v0/destinations/klaviyo/config.js b/src/v0/destinations/klaviyo/config.js index d8583ab9cb..54216852f7 100644 --- a/src/v0/destinations/klaviyo/config.js +++ b/src/v0/destinations/klaviyo/config.js @@ -9,10 +9,12 @@ const MAX_BATCH_SIZE = 100; const CONFIG_CATEGORIES = { IDENTIFY: { name: 'KlaviyoIdentify', apiUrl: '/api/profiles' }, - SCREEN: { name: 'KlaviyoTrack', apiUrl: '/api/events' }, + IDENTIFYV2: { name: 'KlaviyoProfileV2', apiUrl: '/api/profile-import' }, TRACK: { name: 'KlaviyoTrack', apiUrl: '/api/events' }, + TRACKV2: { name: 'KlaviyoTrackV2', apiUrl: '/api/events' }, GROUP: { name: 'KlaviyoGroup' }, PROFILE: { name: 'KlaviyoProfile' }, + PROFILEV2: { name: 'KlaviyoProfileV2' }, STARTED_CHECKOUT: { name: 'StartedCheckout' }, VIEWED_PRODUCT: { name: 'ViewedProduct' }, ADDED_TO_CART: { name: 'AddedToCart' }, @@ -55,10 +57,37 @@ const LIST_CONF = { SUBSCRIBE: 'subscribe_with_consentInfo', ADD_TO_LIST: 'subscribe_without_consentInfo', }; - +const useUpdatedKlaviyoAPI = process.env.USE_UPDATED_KLAVIYO_API === 'true' || false; const MAPPING_CONFIG = getMappingConfig(CONFIG_CATEGORIES, __dirname); -const destType = 'klaviyo'; +const WhiteListedTraitsV2 = [ + 'email', + 'firstName', + 'firstname', + 'first_name', + 'lastName', + 'lastname', + 'last_name', + 'phone', + 'title', + 'organization', + 'city', + 'region', + 'country', + 'zip', + 'image', + 'timezone', + 'anonymousId', + 'userId', + 'properties', + 'location', + '_kx', + 'street', + 'address', +]; +const destType = 'klaviyo'; +// api version used +const revision = '2024-06-15'; module.exports = { BASE_ENDPOINT, MAX_BATCH_SIZE, @@ -70,4 +99,7 @@ module.exports = { eventNameMapping, jsonNameMapping, destType, + revision, + WhiteListedTraitsV2, + useUpdatedKlaviyoAPI, }; diff --git a/src/v0/destinations/klaviyo/data/AddedToCart.json b/src/v0/destinations/klaviyo/data/AddedToCart.json index 302cc79804..13ba9e7d47 100644 --- a/src/v0/destinations/klaviyo/data/AddedToCart.json +++ b/src/v0/destinations/klaviyo/data/AddedToCart.json @@ -2,6 +2,7 @@ { "destKey": "$value", "sourceKeys": "value", + "metadata": { "type": "isFloat" }, "required": false }, { diff --git a/src/v0/destinations/klaviyo/data/KlaviyoProfileV2.json b/src/v0/destinations/klaviyo/data/KlaviyoProfileV2.json new file mode 100644 index 0000000000..310f3eba38 --- /dev/null +++ b/src/v0/destinations/klaviyo/data/KlaviyoProfileV2.json @@ -0,0 +1,128 @@ +[ + { + "destKey": "external_id", + "sourceKeys": "userIdOnly", + "sourceFromGenericMap": true + }, + { + "destKey": "anonymous_id", + "sourceKeys": "anonymousId" + }, + { + "destKey": "email", + "sourceKeys": "emailOnly", + "sourceFromGenericMap": true + }, + { + "destKey": "first_name", + "sourceKeys": "firstName", + "sourceFromGenericMap": true + }, + { + "destKey": "last_name", + "sourceKeys": "lastName", + "sourceFromGenericMap": true + }, + { + "destKey": "phone_number", + "sourceKeys": "phone", + "sourceFromGenericMap": true + }, + { + "destKey": "title", + "sourceKeys": ["traits.title", "context.traits.title", "properties.title"] + }, + { + "destKey": "organization", + "sourceKeys": ["traits.organization", "context.traits.organization", "properties.organization"] + }, + { + "destKey": "location.city", + "sourceKeys": [ + "traits.city", + "traits.address.city", + "context.traits.city", + "context.traits.address.city", + "properties.city" + ] + }, + { + "destKey": "location.region", + "sourceKeys": [ + "traits.region", + "traits.address.region", + "context.traits.region", + "context.traits.address.region", + "properties.region", + "traits.state", + "traits.address.state", + "context.traits.address.state", + "context.traits.state", + "properties.state" + ] + }, + { + "destKey": "location.country", + "sourceKeys": [ + "traits.country", + "traits.address.country", + "context.traits.country", + "context.traits.address.country", + "properties.country" + ] + }, + { + "destKey": "location.zip", + "sourceKeys": [ + "traits.zip", + "traits.postalcode", + "traits.postalCode", + "traits.address.zip", + "traits.address.postalcode", + "traits.address.postalCode", + "context.traits.zip", + "context.traits.postalcode", + "context.traits.postalCode", + "context.traits.address.zip", + "context.traits.address.postalcode", + "context.traits.address.postalCode", + "properties.zip", + "properties.postalcode", + "properties.postalCode" + ] + }, + { + "destKey": "location.ip", + "sourceKeys": ["context.ip", "request_ip"] + }, + { + "destKey": "_kx", + "sourceKeys": ["traits._kx", "context.traits._kx"] + }, + { + "destKey": "image", + "sourceKeys": ["traits.image", "context.traits.image", "properties.image"] + }, + { + "destKey": "location.timezone", + "sourceKeys": ["traits.timezone", "context.traits.timezone", "properties.timezone"] + }, + { + "destKey": "location.latitude", + "sourceKeys": ["latitude", "context.address.latitude", "context.location.latitude"] + }, + { + "destKey": "location.longitude", + "sourceKeys": ["longitude", "context.address.longitude", "context.location.longitude"] + }, + { + "destKey": "location.address1", + "sourceKeys": [ + "traits.street", + "traits.address.street", + "context.traits.street", + "context.traits.address.street", + "properties.street" + ] + } +] diff --git a/src/v0/destinations/klaviyo/data/KlaviyoTrackV2.json b/src/v0/destinations/klaviyo/data/KlaviyoTrackV2.json new file mode 100644 index 0000000000..a92472d215 --- /dev/null +++ b/src/v0/destinations/klaviyo/data/KlaviyoTrackV2.json @@ -0,0 +1,44 @@ +[ + { + "destKey": "value", + "sourceKeys": ["properties.revenue", "properties.total", "properties.value"], + "metadata": { + "excludes": [ + "event", + "email", + "phone", + "revenue", + "total", + "value", + "value_currency", + "currency" + ], + "type": "isFloat" + } + }, + { + "destKey": "value_currency", + "sourceKeys": "properties.currency" + }, + { + "destKey": "time", + "sourceKeys": "timestamp", + "sourceFromGenericMap": true + }, + { + "destKey": "properties", + "sourceKeys": "properties", + "metadata": { + "excludes": [ + "event", + "email", + "phone", + "revenue", + "total", + "value", + "value_currency", + "currency" + ] + } + } +] diff --git a/src/v0/destinations/klaviyo/data/StartedCheckout.json b/src/v0/destinations/klaviyo/data/StartedCheckout.json index 1a4691709d..10441cb277 100644 --- a/src/v0/destinations/klaviyo/data/StartedCheckout.json +++ b/src/v0/destinations/klaviyo/data/StartedCheckout.json @@ -7,7 +7,8 @@ { "destKey": "$value", "sourceKeys": "value", - "required": false + "required": false, + "metadata": { "type": "isFloat" } }, { "destKey": "Categories", diff --git a/src/v0/destinations/klaviyo/klaviyoUtil.test.js b/src/v0/destinations/klaviyo/klaviyoUtil.test.js index f64ea8335a..051a6c3599 100644 --- a/src/v0/destinations/klaviyo/klaviyoUtil.test.js +++ b/src/v0/destinations/klaviyo/klaviyoUtil.test.js @@ -154,3 +154,74 @@ describe('addSubscribeFlagToTraits', () => { expect(result.properties.subscribe).toBe(true); }); }); + +const { getProfileMetadataAndMetadataFields } = require('./util'); + +describe('getProfileMetadataAndMetadataFields', () => { + // Correctly generates metadata with fields to unset, append, and unappend when all fields are provided + it('should generate metadata with fields to unset, append, and unappend when all fields are provided', () => { + const message = { + integrations: { + Klaviyo: { + fieldsToUnset: ['Unset1', 'Unset2'], + fieldsToAppend: ['appendList1', 'appendList2'], + fieldsToUnappend: ['unappendList1', 'unappendList2'], + }, + All: true, + }, + traits: { + appendList1: 'New Value 1', + appendList2: 'New Value 2', + unappendList1: 'Old Value 1', + unappendList2: 'Old Value 2', + }, + }; + + jest.mock('../../util', () => ({ + getIntegrationsObj: jest.fn(() => message.integrations.Klaviyo), + getFieldValueFromMessage: jest.fn(() => message.traits), + isDefinedAndNotNull: jest.fn((value) => value !== null && value !== undefined), + })); + + const result = getProfileMetadataAndMetadataFields(message); + + expect(result).toEqual({ + meta: { + patch_properties: { + append: { + appendList1: 'New Value 1', + appendList2: 'New Value 2', + }, + unappend: { + unappendList1: 'Old Value 1', + unappendList2: 'Old Value 2', + }, + unset: ['Unset1', 'Unset2'], + }, + }, + metadataFields: [ + 'Unset1', + 'Unset2', + 'appendList1', + 'appendList2', + 'unappendList1', + 'unappendList2', + ], + }); + }); + + // Handles null or undefined message input gracefully + it('should return empty metadata and metadataFields when message is null or undefined', () => { + jest.mock('../../util', () => ({ + getIntegrationsObj: jest.fn(() => null), + getFieldValueFromMessage: jest.fn(() => ({})), + isDefinedAndNotNull: jest.fn((value) => value !== null && value !== undefined), + })); + + let result = getProfileMetadataAndMetadataFields(null); + expect(result).toEqual({ meta: { patch_properties: {} }, metadataFields: [] }); + + result = getProfileMetadataAndMetadataFields(undefined); + expect(result).toEqual({ meta: { patch_properties: {} }, metadataFields: [] }); + }); +}); diff --git a/src/v0/destinations/klaviyo/transform.js b/src/v0/destinations/klaviyo/transform.js index eac9dda8a0..d5047a4220 100644 --- a/src/v0/destinations/klaviyo/transform.js +++ b/src/v0/destinations/klaviyo/transform.js @@ -13,6 +13,7 @@ const { eventNameMapping, jsonNameMapping, } = require('./config'); +const { processRouterDestV2, processV2 } = require('./transformV2'); const { createCustomerProperties, subscribeUserToList, @@ -280,6 +281,9 @@ const groupRequestHandler = (message, category, destination) => { // Main event processor using specific handler funcs const processEvent = async (event, reqMetadata) => { const { message, destination, metadata } = event; + if (destination.Config?.apiVersion === 'v2') { + return processV2(event, reqMetadata); + } if (!message.type) { throw new InstrumentationError('Event type is required'); } @@ -330,11 +334,15 @@ const getEventChunks = (event, subscribeRespList, nonSubscribeRespList) => { }; const processRouterDest = async (inputs, reqMetadata) => { + const { destination } = inputs[0]; + // This is used to switch to latest API version + if (destination.Config?.apiVersion === 'v2') { + return processRouterDestV2(inputs, reqMetadata); + } let batchResponseList = []; const batchErrorRespList = []; const subscribeRespList = []; const nonSubscribeRespList = []; - const { destination } = inputs[0]; await Promise.all( inputs.map(async (event) => { try { diff --git a/src/v0/destinations/klaviyo/transformV2.js b/src/v0/destinations/klaviyo/transformV2.js new file mode 100644 index 0000000000..ad98d2f559 --- /dev/null +++ b/src/v0/destinations/klaviyo/transformV2.js @@ -0,0 +1,234 @@ +/* eslint-disable no-nested-ternary */ +/* eslint-disable no-underscore-dangle */ +/* eslint-disable array-callback-return */ +const get = require('get-value'); +const { ConfigurationError, InstrumentationError } = require('@rudderstack/integrations-lib'); +const { EventType, MappedToDestinationKey } = require('../../../constants'); +const { CONFIG_CATEGORIES, MAPPING_CONFIG } = require('./config'); +const { + constructProfile, + subscribeUserToListV2, + buildRequest, + buildSubscriptionRequest, + getTrackRequests, + fetchTransformedEvents, + addSubscribeFlagToTraits, +} = require('./util'); +const { batchRequestV2 } = require('./batchUtil'); +const { + constructPayload, + getFieldValueFromMessage, + removeUndefinedAndNullValues, + handleRtTfSingleEventError, + addExternalIdToTraits, + adduserIdFromExternalId, + groupEventsByType, + flattenJson, +} = require('../../util'); + +/** + * Main Identify request handler func + * The function is used to create/update new users and also for subscribing + * users to the list. + * DOCS: 1. https://developers.klaviyo.com/en/reference/create_or_update_profile + * 2. https://developers.klaviyo.com/en/reference/subscribe_profiles + * @param {*} message + * @param {*} category + * @param {*} destination + * @returns one object with keys profile and subscription(conditional) and values as objects + */ +const identifyRequestHandler = (message, category, destination) => { + // If listId property is present try to subscribe/member user in list + const { listId } = destination.Config; + let traitsInfo = getFieldValueFromMessage(message, 'traits'); + const mappedToDestination = get(message, MappedToDestinationKey); + if (mappedToDestination) { + addExternalIdToTraits(message); + adduserIdFromExternalId(message); + traitsInfo = addSubscribeFlagToTraits(traitsInfo); + } + const payload = removeUndefinedAndNullValues(constructProfile(message, destination, true)); + const response = { profile: payload }; + // check if user wants to subscribe profile or not and listId is present or not + if (traitsInfo?.properties?.subscribe && (traitsInfo.properties?.listId || listId)) { + response.subscription = subscribeUserToListV2(message, traitsInfo, destination); + } + return response; +}; + +/** + * Main handler func for track/screen request + * User info needs to be mapped to a track event (mandatory) + * DOCS: https://developers.klaviyo.com/en/reference/create_event + * @param {*} message + * @param {*} category + * @param {*} destination + * @returns event request + */ +const trackOrScreenRequestHandler = (message, category, destination) => { + const { flattenProperties } = destination.Config; + // event for track and name for screen call + const event = get(message, 'event') || get(message, 'name'); + if (event && typeof event !== 'string') { + throw new InstrumentationError('Event type should be a string'); + } + const attributes = constructPayload(message, MAPPING_CONFIG[category.name]); + + // if flattenProperties is enabled from UI, flatten the event properties + attributes.properties = flattenProperties + ? flattenJson(attributes.properties, '.', 'normal', false) + : attributes.properties; + + // get profile object + attributes.profile = removeUndefinedAndNullValues(constructProfile(message, destination, false)); + attributes.metric = { + data: { + type: 'metric', + attributes: { + name: event, + }, + }, + }; + return { event: { data: { type: 'event', attributes } } }; +}; + +/** + * Main handlerfunc for group request add/subscribe users to the list based on property sent + * DOCS:https://developers.klaviyo.com/en/reference/subscribe_profiles + * @param {*} message + * @param {*} category + * @param {*} destination + * @returns subscription object + */ +const groupRequestHandler = (message, category, destination) => { + if (!message.groupId) { + throw new InstrumentationError('groupId is a required field for group events'); + } + const traitsInfo = getFieldValueFromMessage(message, 'traits'); + if (!traitsInfo?.subscribe) { + throw new InstrumentationError('Subscribe flag should be true for group call'); + } + // throwing error for subscribe flag + return { subscription: subscribeUserToListV2(message, traitsInfo, destination) }; +}; + +const processEvent = (event) => { + const { message, destination } = event; + if (!message.type) { + throw new InstrumentationError('Event type is required'); + } + if (!destination.Config.privateApiKey) { + throw new ConfigurationError(`Private API Key is a required field for ${message.type} events`); + } + const messageType = message.type.toLowerCase(); + + let category; + let response; + switch (messageType) { + case EventType.IDENTIFY: + category = CONFIG_CATEGORIES.IDENTIFYV2; + response = identifyRequestHandler(message, category, destination); + break; + case EventType.SCREEN: + case EventType.TRACK: + category = CONFIG_CATEGORIES.TRACKV2; + response = trackOrScreenRequestHandler(message, category, destination); + break; + case EventType.GROUP: + category = CONFIG_CATEGORIES.GROUP; + response = groupRequestHandler(message, category, destination); + break; + default: + throw new InstrumentationError(`Event type ${messageType} is not supported`); + } + return response; +}; +// {subscription:{}, event:{}, profile:{}} +const processV2 = (event) => { + const response = processEvent(event); + const { destination } = event; + const respList = []; + if (response.profile) { + respList.push(buildRequest(response.profile, destination, CONFIG_CATEGORIES.IDENTIFYV2)); + } + if (response.subscription) { + respList.push( + buildSubscriptionRequest(response.subscription, destination, CONFIG_CATEGORIES.TRACKV2), + ); + } + if (response.event) { + respList.push(buildRequest(response.event, destination, CONFIG_CATEGORIES.TRACKV2)); + } + return respList; +}; + +// This function separates subscribe, proifle and event responses from process () and other responses in chunks +const getEventChunks = (input, subscribeRespList, profileRespList, eventRespList) => { + if (input.payload.subscription) { + subscribeRespList.push({ payload: input.payload.subscription, metadata: input.metadata }); + } + if (input.payload.profile) { + profileRespList.push({ payload: input.payload.profile, metadata: input.metadata }); + } + if (input.payload.event) { + eventRespList.push({ payload: input.payload.event, metadata: input.metadata }); + } +}; + +const processRouter = (inputs, reqMetadata) => { + const batchResponseList = []; + const batchErrorRespList = []; + const subscribeRespList = []; + const profileRespList = []; + const eventRespList = []; + const { destination } = inputs[0]; + inputs.map((event) => { + try { + if (event.message.statusCode) { + // already transformed event + batchResponseList.push(fetchTransformedEvents(event)); + } else { + // if not transformed + getEventChunks( + { + payload: processEvent(event), + metadata: event.metadata, + }, + subscribeRespList, + profileRespList, + eventRespList, + ); + } + } catch (error) { + const errRespEvent = handleRtTfSingleEventError(event, error, reqMetadata); + batchErrorRespList.push(errRespEvent); + } + }); + const batchedResponseList = batchRequestV2(subscribeRespList, profileRespList, destination); + const trackRespList = getTrackRequests(eventRespList, destination); + + batchResponseList.push(...trackRespList, ...batchedResponseList); + + return { successEvents: batchResponseList, errorEvents: batchErrorRespList }; +}; + +const processRouterDestV2 = (inputs, reqMetadata) => { + /** + We are doing this to maintain the order of events not only fo transformation but for delivery as well + Job Id: 1 2 3 4 5 6 + Input : ['user1 track1', 'user1 identify 1', 'user1 track 2', 'user2 identify 1', 'user2 track 1', 'user1 track 3'] + Output after batching : [['user1 track1'],['user1 identify 1', 'user2 identify 1'], [ 'user1 track 2', 'user2 track 1', 'user1 track 3']] + Output after transformation: [1, [2,4], [3,5,6]] + */ + const inputsGroupedByType = groupEventsByType(inputs); + const respList = []; + const errList = []; + inputsGroupedByType.forEach((typedEventList) => { + const { successEvents, errorEvents } = processRouter(typedEventList, reqMetadata); + respList.push(...successEvents); + errList.push(...errorEvents); + }); + return [...respList, ...errList]; +}; + +module.exports = { processV2, processRouterDestV2 }; diff --git a/src/v0/destinations/klaviyo/util.js b/src/v0/destinations/klaviyo/util.js index 53d82158c5..7b2b011d43 100644 --- a/src/v0/destinations/klaviyo/util.js +++ b/src/v0/destinations/klaviyo/util.js @@ -1,12 +1,7 @@ -const { defaultRequestConfig } = require('rudder-transformer-cdk/build/utils'); +const set = require('set-value'); const lodash = require('lodash'); -const { - NetworkError, - InstrumentationError, - isDefinedAndNotNull, -} = require('@rudderstack/integrations-lib'); +const { NetworkError, InstrumentationError } = require('@rudderstack/integrations-lib'); const { WhiteListedTraits } = require('../../../constants'); - const { constructPayload, getFieldValueFromMessage, @@ -15,13 +10,25 @@ const { removeUndefinedAndNullValues, defaultBatchRequestConfig, getSuccessRespEvents, + flattenJson, defaultPatchRequestConfig, + isDefinedAndNotNull, + getDestinationExternalID, + getIntegrationsObj, + defaultRequestConfig, } = require('../../util'); const tags = require('../../util/tags'); const { handleHttpRequest } = require('../../../adapters/network'); const { JSON_MIME_TYPE, HTTP_STATUS_CODES } = require('../../util/constant'); const { getDynamicErrorType } = require('../../../adapters/utils/networkUtils'); -const { BASE_ENDPOINT, MAPPING_CONFIG, CONFIG_CATEGORIES, MAX_BATCH_SIZE } = require('./config'); +const { + BASE_ENDPOINT, + MAPPING_CONFIG, + CONFIG_CATEGORIES, + MAX_BATCH_SIZE, + WhiteListedTraitsV2, + revision, +} = require('./config'); const REVISION_CONSTANT = '2023-02-22'; @@ -278,13 +285,11 @@ const getBatchedResponseList = (subscribeEventGroups, identifyResponseList) => { }); batchedResponseList = [...batchedResponseList, ...batchedResponse]; }); - if (identifyResponseList.length > 0) { identifyResponseList.forEach((response) => { batchedResponseList[0].batchedRequest.push(response); }); } - return batchedResponseList; }; @@ -309,6 +314,262 @@ const batchSubscribeEvents = (subscribeRespList) => { return batchedResponseList; }; +const buildRequest = (payload, destination, category) => { + const { privateApiKey } = destination.Config; + const response = defaultRequestConfig(); + response.endpoint = `${BASE_ENDPOINT}${category.apiUrl}`; + response.method = defaultPostRequestConfig.requestMethod; + response.headers = { + Authorization: `Klaviyo-API-Key ${privateApiKey}`, + Accept: JSON_MIME_TYPE, + 'Content-Type': JSON_MIME_TYPE, + revision, + }; + response.body.JSON = removeUndefinedAndNullValues(payload); + return response; +}; + +/** + * This function generates the metadat object used for updating a list attribute and unset properties + * message = { + integrations: { + Klaviyo: { fieldsToUnset: ['Unset1', 'Unset2'], + fieldsToAppend: ['appendList1', 'appendList2'], + fieldsToUnappend: ['unappendList1', 'unappendList2'] + }, + All: true, + }, + }; + Output metadata = { + "meta": { + "patch_properties": { + "append": { + "appendList1": "New Value 1", + "appendList2": "New Value 2" + }, + "unappend": { + "unappendList1": "Old Value 1", + "unappendList2": "Old Value 2" + }, + "unset": ['Unset1', 'Unset2'] + } + } + } + * @param {*} message + */ +const getProfileMetadataAndMetadataFields = (message) => { + const intgObj = getIntegrationsObj(message, 'Klaviyo'); + const meta = { patch_properties: {} }; + let metadataFields = []; + const traitsInfo = getFieldValueFromMessage(message, 'traits'); + // fetch and set fields to unset + const fieldsToUnset = intgObj?.fieldsToUnset; + if (Array.isArray(fieldsToUnset)) { + meta.patch_properties.unset = fieldsToUnset; + metadataFields = fieldsToUnset; + } + + // fetch list of fields to append , their value and append these fields in metadataFields + const fieldsToAppend = intgObj?.fieldsToAppend; + if (Array.isArray(fieldsToAppend)) { + const append = {}; + fieldsToAppend.forEach((key) => { + if (isDefinedAndNotNull(traitsInfo[key])) { + append[key] = traitsInfo[key]; + } + }); + meta.patch_properties.append = append; + metadataFields = metadataFields.concat(fieldsToAppend); + } + + // fetch list of fields to unappend , their value and append these fields in metadataFields + const fieldsToUnappend = intgObj?.fieldsToUnappend; + if (Array.isArray(fieldsToUnappend)) { + const unappend = {}; + fieldsToUnappend.forEach((key) => { + if (isDefinedAndNotNull(traitsInfo[key])) { + unappend[key] = traitsInfo[key]; + } + }); + meta.patch_properties.unappend = unappend; + metadataFields = metadataFields.concat(fieldsToUnappend); + } + + return { meta, metadataFields }; +}; + +/** + * Following function is used to construct profile object for version 15-06-2024 + * If we have isIdentifyCall as true then there are two extra scenarios + * 1. `enforceEmailAsPrimary` config kicks in and if email or phone is not present we throw an error + * 2. Place of Metadata object in payload for klaviyo is a little but different + * @param {*} message input to build output from + * @param {*} destination dest object with config + * @param {*} isIdentifyCall let us know if processing is done for identify call + * @returns profile object + * https://developers.klaviyo.com/en/reference/create_or_update_profile + */ +const constructProfile = (message, destination, isIdentifyCall) => { + const profileAttributes = constructPayload( + message, + MAPPING_CONFIG[CONFIG_CATEGORIES.PROFILEV2.name], + ); + const { enforceEmailAsPrimary, flattenProperties } = destination.Config; + let customPropertyPayload = {}; + const { meta, metadataFields } = getProfileMetadataAndMetadataFields(message); + customPropertyPayload = extractCustomFields( + message, + customPropertyPayload, + ['traits', 'context.traits'], + // omitting whitelistedTraitsV2 and metadatafields from constructing custom properties as these are already used + [...WhiteListedTraitsV2, ...metadataFields], + ); + const profileId = getDestinationExternalID(message, 'klaviyo-profileId'); + // if flattenProperties is enabled from UI, flatten the user properties + customPropertyPayload = flattenProperties + ? flattenJson(customPropertyPayload, '.', 'normal', false) + : customPropertyPayload; + if (enforceEmailAsPrimary) { + delete profileAttributes.external_id; // so that multiple profiles are not found, one w.r.t email and one for external_id + customPropertyPayload = { + ...customPropertyPayload, + _id: getFieldValueFromMessage(message, 'userIdOnly'), // custom attribute + }; + } + const data = removeUndefinedAndNullValues({ + type: 'profile', + id: profileId, + attributes: { + ...profileAttributes, + properties: removeUndefinedAndNullValues(customPropertyPayload), + meta, + }, + }); + if (isIdentifyCall) { + // For identify call meta object comes inside + data.meta = meta; + delete data.attributes.meta; + } + + return { data }; +}; + +/** + * This function is used for creating profile response for subscribing users to a particular list for V2 + * DOCS: https://developers.klaviyo.com/en/reference/subscribe_profiles + */ +const subscribeUserToListV2 = (message, traitsInfo, destination) => { + // listId from message properties are preferred over Config listId + const { consent } = destination.Config; + let { listId } = destination.Config; + let subscribeConsent = traitsInfo.consent || traitsInfo.properties?.consent || consent; + const email = getFieldValueFromMessage(message, 'email'); + const phone = getFieldValueFromMessage(message, 'phone'); + const profileAttributes = { + email, + phone_number: phone, + }; + if (subscribeConsent) { + if (!Array.isArray(subscribeConsent)) { + subscribeConsent = [subscribeConsent]; + } + if (subscribeConsent.includes('email') && email) { + set(profileAttributes, 'subscriptions.email.marketing.consent', 'SUBSCRIBED'); + } + if (subscribeConsent.includes('sms') && phone) { + set(profileAttributes, 'subscriptions.sms.marketing.consent', 'SUBSCRIBED'); + } + } + + const profile = removeUndefinedAndNullValues({ + type: 'profile', + id: getDestinationExternalID(message, 'klaviyo-profileId'), + attributes: removeUndefinedAndNullValues(profileAttributes), + }); + if (!email && !phone && profile.id) { + throw new InstrumentationError( + 'Profile Id, Email or/and Phone are required to subscribe to a list', + ); + } + // fetch list id from message + if (traitsInfo?.properties?.listId) { + // for identify call + listId = traitsInfo.properties.listId; + } + if (message.type === 'group') { + listId = message.groupId; + } + + return { listId, profile: [profile] }; +}; +/** + * This Create a subscription payload to subscribe profile(s) to list listId + * @param {*} listId + * @param {*} profiles + */ +const getSubscriptionPayload = (listId, profiles) => ({ + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { profiles: { data: profiles } }, + relationships: { + list: { + data: { + type: 'list', + id: listId, + }, + }, + }, + }, +}); + +/** + * This function accepts subscriptions object and builds a request for it + * @param {*} subscription + * @param {*} destination + * @returns defaultRequestConfig + */ +const buildSubscriptionRequest = (subscription, destination) => { + const response = defaultRequestConfig(); + response.endpoint = `${BASE_ENDPOINT}/api/profile-subscription-bulk-create-jobs`; + response.method = defaultPostRequestConfig.requestMethod; + response.headers = { + Authorization: `Klaviyo-API-Key ${destination.Config.privateApiKey}`, + Accept: JSON_MIME_TYPE, + 'Content-Type': JSON_MIME_TYPE, + revision, + }; + response.body.JSON = getSubscriptionPayload(subscription.listId, subscription.profile); + return response; +}; + +const getTrackRequests = (eventRespList, destination) => { + // building and pushing all the event requests + const respList = []; + eventRespList.forEach((resp) => + respList.push( + getSuccessRespEvents( + buildRequest(resp.payload, destination, CONFIG_CATEGORIES.TRACKV2), + [resp.metadata], + destination, + ), + ), + ); + return respList; +}; + +/** + * This function checks for the transformed event structure and accordingly send back the batched responses + * @param {*} event + */ +const fetchTransformedEvents = (event) => { + const { message, destination, metadata } = event; + // checking if we have any output field if yes then we return message.output + return getSuccessRespEvents( + message.output || message, + Array.isArray(metadata) ? metadata : [metadata], + destination, + ); +}; const addSubscribeFlagToTraits = (traitsInfo) => { let traits = traitsInfo; @@ -340,5 +601,13 @@ module.exports = { batchSubscribeEvents, profileUpdateResponseBuilder, getIdFromNewOrExistingProfile, + constructProfile, + subscribeUserToListV2, + getProfileMetadataAndMetadataFields, + buildRequest, + buildSubscriptionRequest, + getTrackRequests, + fetchTransformedEvents, addSubscribeFlagToTraits, + getSubscriptionPayload, }; diff --git a/src/v0/destinations/mailchimp/transform.js b/src/v0/destinations/mailchimp/transform.js index 87f547c124..1f708b4f64 100644 --- a/src/v0/destinations/mailchimp/transform.js +++ b/src/v0/destinations/mailchimp/transform.js @@ -78,7 +78,7 @@ const trackResponseBuilder = (message, { Config }) => { return responseBuilderSimple(processedPayload, endpoint, Config, audienceId); }; -const identifyResponseBuilder = async (message, { Config }) => { +const identifyResponseBuilder = async (message, { Config }, metadata) => { const { datacenterId } = Config; const email = getFieldValueFromMessage(message, 'email'); if (!email) { @@ -86,13 +86,13 @@ const identifyResponseBuilder = async (message, { Config }) => { } const audienceId = getAudienceId(message, Config); const endpoint = mailChimpSubscriptionEndpoint(datacenterId, audienceId, email); - const processedPayload = await processPayload(message, Config, audienceId); + const processedPayload = await processPayload(message, Config, audienceId, metadata); return responseBuilderSimple(processedPayload, endpoint, Config, audienceId); }; const process = async (event) => { let response; - const { message, destination } = event; + const { message, destination, metadata } = event; const messageType = message.type.toLowerCase(); const destConfig = destination.Config; @@ -114,7 +114,7 @@ const process = async (event) => { switch (messageType) { case EventType.IDENTIFY: - response = await identifyResponseBuilder(message, destination); + response = await identifyResponseBuilder(message, destination, metadata); break; case EventType.TRACK: response = trackResponseBuilder(message, destination); diff --git a/src/v0/destinations/mailchimp/utils.js b/src/v0/destinations/mailchimp/utils.js index f678742f2d..58f6a29445 100644 --- a/src/v0/destinations/mailchimp/utils.js +++ b/src/v0/destinations/mailchimp/utils.js @@ -1,7 +1,6 @@ const get = require('get-value'); const md5 = require('md5'); const { InstrumentationError, NetworkError } = require('@rudderstack/integrations-lib'); -const myAxios = require('../../../util/myAxios'); const { MappedToDestinationKey } = require('../../../constants'); const { isDefinedAndNotNull, @@ -20,6 +19,7 @@ const { MERGE_CONFIG, MERGE_ADDRESS, SUBSCRIPTION_STATUS, VALID_STATUSES } = req const { getDynamicErrorType } = require('../../../adapters/utils/networkUtils'); const tags = require('../../util/tags'); const { JSON_MIME_TYPE } = require('../../util/constant'); +const { handleHttpRequest } = require('../../../adapters/network'); const ADDRESS_MANDATORY_FIELDS = ['addr1', 'city', 'state', 'zip']; @@ -145,7 +145,7 @@ const filterTagValue = (tag) => { * @param {*} email * @returns */ -const checkIfMailExists = async (apiKey, datacenterId, audienceId, email) => { +const checkIfMailExists = async (apiKey, datacenterId, audienceId, email, metadata) => { if (!email) { return false; } @@ -155,28 +155,31 @@ const checkIfMailExists = async (apiKey, datacenterId, audienceId, email) => { }; const url = `${mailChimpSubscriptionEndpoint(datacenterId, audienceId, email)}`; const basicAuth = Buffer.from(`apiKey:${apiKey}`).toString('base64'); - try { - const response = await myAxios.get( - url, - { - headers: { - Authorization: `Basic ${basicAuth}`, - }, - }, - { - destType: 'mailchimp', - feature: 'transformation', - endpointPath: '/lists/audienceId/members/email', - requestMethod: 'GET', - module: 'router', + + const { processedResponse, httpResponse } = await handleHttpRequest( + 'get', + url, + { + headers: { + Authorization: `Basic ${basicAuth}`, }, - ); - if (response?.data?.contact_id) { - userStatus.exists = true; - userStatus.subscriptionStatus = response.data.status; - } - } catch (error) { - logger.info(`[Mailchimp] :: Email does not exists, Error: ${error.message}`); + }, + { + metadata, + destType: 'mailchimp', + feature: 'transformation', + endpointPath: '/lists/audienceId/members/email', + requestMethod: 'GET', + module: 'router', + }, + ); + if (!httpResponse.success) { + logger.info(`[Mailchimp] :: Email does not exists, Error: ${httpResponse.response?.message}`); + return userStatus; + } + if (processedResponse.response.contact_id) { + userStatus.exists = true; + userStatus.subscriptionStatus = processedResponse.response.status; } return userStatus; }; @@ -188,33 +191,35 @@ const checkIfMailExists = async (apiKey, datacenterId, audienceId, email) => { * @param {*} audienceId * @returns */ -const checkIfDoubleOptIn = async (apiKey, datacenterId, audienceId) => { - let response; +const checkIfDoubleOptIn = async (apiKey, datacenterId, audienceId, metadata) => { const url = `${getMailChimpBaseEndpoint(datacenterId, audienceId)}`; const basicAuth = Buffer.from(`apiKey:${apiKey}`).toString('base64'); - try { - response = await myAxios.get( - url, - { - headers: { - Authorization: `Basic ${basicAuth}`, - }, - }, - { - destType: 'mailchimp', - feature: 'transformation', - endpointPath: '/lists/audienceId', - requestMethod: 'GET', - module: 'router', + const { httpResponse, processedResponse } = await handleHttpRequest( + 'get', + url, + { + headers: { + Authorization: `Basic ${basicAuth}`, }, - ); - } catch (error) { + }, + { + metadata, + destType: 'mailchimp', + feature: 'transformation', + endpointPath: '/lists/audienceId', + requestMethod: 'GET', + module: 'router', + }, + ); + if (!httpResponse.success) { + const error = httpResponse.response?.response; const status = error.status || 400; throw new NetworkError('User does not have access to the requested operation', status, { [tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status), }); } - return !!response.data.double_optin; + + return !!processedResponse.response?.double_optin; }; /** @@ -313,7 +318,7 @@ const overrideSubscriptionStatus = (message, primaryPayload, userStatus) => { * @param {*} audienceId * @returns */ -const processPayload = async (message, Config, audienceId) => { +const processPayload = async (message, Config, audienceId, metadata) => { let primaryPayload; let email; const { apiKey, datacenterId, enableMergeFields } = Config; @@ -351,10 +356,10 @@ const processPayload = async (message, Config, audienceId) => { merge_fields: mergeAdditionalTraitsFields(traits, mergedFieldPayload), }; } - const userStatus = await checkIfMailExists(apiKey, datacenterId, audienceId, email); + const userStatus = await checkIfMailExists(apiKey, datacenterId, audienceId, email, metadata); if (!userStatus.exists) { - const isDoubleOptin = await checkIfDoubleOptIn(apiKey, datacenterId, audienceId); + const isDoubleOptin = await checkIfDoubleOptIn(apiKey, datacenterId, audienceId, metadata); primaryPayload.status = isDoubleOptin ? SUBSCRIPTION_STATUS.pending : SUBSCRIPTION_STATUS.subscribed; diff --git a/src/v0/destinations/revenue_cat/transform.js b/src/v0/destinations/revenue_cat/transform.js index 407cb91608..1fc054e578 100644 --- a/src/v0/destinations/revenue_cat/transform.js +++ b/src/v0/destinations/revenue_cat/transform.js @@ -1,5 +1,4 @@ const set = require('set-value'); -const { defaultRequestConfig } = require('rudder-transformer-cdk/build/utils'); const { ConfigurationError, TransformationError, @@ -13,6 +12,7 @@ const { extractCustomFields, defaultGetRequestConfig, getFieldValueFromMessage, + defaultRequestConfig, } = require('../../util'); const { CONFIG_CATEGORIES, diff --git a/src/v0/destinations/sendgrid/util.js b/src/v0/destinations/sendgrid/util.js index 1edb480516..28c9aae6d2 100644 --- a/src/v0/destinations/sendgrid/util.js +++ b/src/v0/destinations/sendgrid/util.js @@ -478,7 +478,7 @@ const fetchCustomFields = async ({ destination, metadata }) => { */ const getCustomFields = async ({ message, destination, metadata }) => { const customFields = {}; - const payload = get(message, 'context.traits'); + const payload = get(message, 'context.traits') || get(message, 'traits'); const { customFieldsMapping } = destination.Config; const fieldsMapping = getHashFromArray(customFieldsMapping, 'from', 'to', false); const fields = Object.keys(fieldsMapping); diff --git a/src/v0/sources/appcenter/transform.js b/src/v0/sources/appcenter/transform.js index 40399d92e2..35d15f697e 100644 --- a/src/v0/sources/appcenter/transform.js +++ b/src/v0/sources/appcenter/transform.js @@ -1,7 +1,7 @@ const path = require('path'); const fs = require('fs'); const { TransformationError } = require('@rudderstack/integrations-lib'); -const { generateUUID } = require('../../util'); +const utils = require('../../util'); const Message = require('../message'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -37,7 +37,7 @@ const processNormalEvent = (event) => { message.setPropertiesV2(event, mappingJson); // app center does not has the concept of user but we need to set some random anonymousId in order to make the server accept the message - message.anonymousId = generateUUID(); + message.anonymousId = utils.generateUUID(); return message; }; diff --git a/src/v0/sources/shopify/transform.js b/src/v0/sources/shopify/transform.js index bc2135d215..b55fc61327 100644 --- a/src/v0/sources/shopify/transform.js +++ b/src/v0/sources/shopify/transform.js @@ -144,8 +144,13 @@ const processEvent = async (inputEvent, metricMetadata) => { break; case 'carts_update': if (useRedisDatabase) { - redisData = await getDataFromRedis(event.id || event.token, metricMetadata); - const isValidEvent = await checkAndUpdateCartItems(inputEvent, redisData, metricMetadata); + redisData = await getDataFromRedis(event.id || event.token, metricMetadata, 'Cart Update'); + const isValidEvent = await checkAndUpdateCartItems( + inputEvent, + redisData, + metricMetadata, + shopifyTopic, + ); if (!isValidEvent) { return NO_OPERATION_SUCCESS; } @@ -208,11 +213,20 @@ const isIdentifierEvent = (event) => ['rudderIdentifier', 'rudderSessionIdentifier'].includes(event?.event); const processIdentifierEvent = async (event, metricMetadata) => { if (useRedisDatabase) { + const cartToken = + typeof event.cartToken === 'string' ? event.cartToken.split('?')[0] : event.cartToken; + logger.info(`{{SHOPIFY::}} writeKey: ${metricMetadata.writeKey}, cartToken: ${cartToken}`, { + type: 'set', + source: metricMetadata.source, + writeKey: metricMetadata.writeKey, + }); let value; let field; if (event.event === 'rudderIdentifier') { field = 'anonymousId'; + // eslint-disable-next-line unicorn/consistent-destructuring const lineItemshash = getHashLineItems(event.cart); + // eslint-disable-next-line unicorn/consistent-destructuring value = ['anonymousId', event.anonymousId, 'itemsHash', lineItemshash]; stats.increment('shopify_redis_calls', { type: 'set', @@ -227,6 +241,7 @@ const processIdentifierEvent = async (event, metricMetadata) => { */ } else { field = 'sessionId'; + // eslint-disable-next-line unicorn/consistent-destructuring value = ['sessionId', event.sessionId]; /* cart_token: { anonymousId:'anon_id1', @@ -242,7 +257,7 @@ const processIdentifierEvent = async (event, metricMetadata) => { source: metricMetadata.source, writeKey: metricMetadata.writeKey, }); - await RedisDB.setVal(`${event.cartToken}`, value); + await RedisDB.setVal(`${cartToken}`, value); } catch (e) { logger.debug(`{{SHOPIFY::}} cartToken map set call Failed due redis error ${e}`, { type: 'set', diff --git a/src/v0/sources/shopify/util.js b/src/v0/sources/shopify/util.js index 6aea0d19bd..6d13d13bdf 100644 --- a/src/v0/sources/shopify/util.js +++ b/src/v0/sources/shopify/util.js @@ -24,7 +24,7 @@ const { } = require('./config'); const logger = require('../../../logger'); -const getDataFromRedis = async (key, metricMetadata) => { +const getDataFromRedis = async (key, metricMetadata, event) => { try { stats.increment('shopify_redis_calls', { type: 'get', @@ -40,6 +40,7 @@ const getDataFromRedis = async (key, metricMetadata) => { stats.increment('shopify_redis_no_val', { writeKey: metricMetadata.writeKey, source: metricMetadata.source, + event, }); } return redisData; @@ -187,8 +188,9 @@ const getAnonymousIdAndSessionId = async (message, metricMetadata, redisData = n } if (useRedisDatabase) { if (!isDefinedAndNotNull(redisData)) { + const { event } = message; // eslint-disable-next-line no-param-reassign - redisData = await getDataFromRedis(cartToken, metricMetadata); + redisData = await getDataFromRedis(cartToken, metricMetadata, event); } anonymousId = redisData?.anonymousId; sessionId = redisData?.sessionId; @@ -243,11 +245,11 @@ const updateCartItemsInRedis = async (cartToken, newCartItemsHash, metricMetadat * @param {*} metricMetadata * @returns boolean */ -const checkAndUpdateCartItems = async (inputEvent, redisData, metricMetadata) => { +const checkAndUpdateCartItems = async (inputEvent, redisData, metricMetadata, shopifyTopic) => { const cartToken = inputEvent.token || inputEvent.id; if (!isDefinedAndNotNull(redisData)) { // eslint-disable-next-line no-param-reassign - redisData = await getDataFromRedis(cartToken, metricMetadata); + redisData = await getDataFromRedis(cartToken, metricMetadata, SHOPIFY_TRACK_MAP[shopifyTopic]); } const itemsHash = redisData?.itemsHash; if (isDefinedAndNotNull(itemsHash)) { diff --git a/src/v0/util/googleUtils/index.js b/src/v0/util/googleUtils/index.js index 406afa1a49..124f63eda5 100644 --- a/src/v0/util/googleUtils/index.js +++ b/src/v0/util/googleUtils/index.js @@ -121,8 +121,12 @@ const getAuthErrCategory = ({ response, status }) => { const authenticationError = respArr.map((resp) => get(resp, 'error.details.0.errors.0.errorCode.authenticationError'), ); - if (authenticationError.includes('TWO_STEP_VERIFICATION_NOT_ENROLLED')) { + if ( // https://developers.google.com/google-ads/api/docs/oauth/2sv + authenticationError.includes('TWO_STEP_VERIFICATION_NOT_ENROLLED') || + // https://developers.google.com/google-ads/api/docs/common-errors#:~:text=this%20for%20you.-,CUSTOMER_NOT_FOUND,-Summary + authenticationError.includes('CUSTOMER_NOT_FOUND') + ) { return AUTH_STATUS_INACTIVE; } return REFRESH_TOKEN; diff --git a/src/v0/util/index.js b/src/v0/util/index.js index fa6cc34b70..7e9b4f0c3e 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -858,6 +858,14 @@ function formatValues(formattedVal, formattingType, typeFormat, integrationsObj) curFormattedVal = formattedVal.trim(); } }, + isFloat: () => { + if (isDefinedAndNotNull(formattedVal)) { + curFormattedVal = parseFloat(formattedVal); + if (Number.isNaN(curFormattedVal)) { + throw new InstrumentationError('Invalid float value'); + } + } + }, removeSpacesAndDashes: () => { if (typeof formattedVal === 'string') { curFormattedVal = formattedVal.replace(/ /g, '').replace(/-/g, ''); @@ -1160,7 +1168,7 @@ const getDestinationExternalIDInfoForRetl = (message, destination) => { if (externalIdArray) { externalIdArray.forEach((extIdObj) => { const { type, id } = extIdObj; - if (type.includes(`${destination}-`)) { + if (type && type.includes(`${destination}-`)) { destinationExternalId = id; objectType = type.replace(`${destination}-`, ''); identifierType = extIdObj.identifierType; @@ -1187,7 +1195,7 @@ const getDestinationExternalIDObjectForRetl = (message, destination) => { // some stops the execution when the element is found externalIdArray.some((extIdObj) => { const { type } = extIdObj; - if (type.includes(`${destination}-`)) { + if (type && type.includes(`${destination}-`)) { obj = extIdObj; return true; } @@ -1625,16 +1633,6 @@ function removeHyphens(str) { return str.replace(/-/g, ''); } -function isCdkDestination(event) { - // TODO: maybe dont need all these checks in place - return ( - event.destination && - event.destination.DestinationDefinition && - event.destination.DestinationDefinition.Config && - event.destination.DestinationDefinition.Config.cdkEnabled - ); -} - /** * This function helps to remove any invalid object values from the config generated by dynamicForm, * dynamicCustomForm, and dynamicSelectForm web app form elements. @@ -2348,7 +2346,6 @@ module.exports = { hashToSha256, isAppleFamily, isBlank, - isCdkDestination, isDefined, isDefinedAndNotNull, isDefinedAndNotNullAndNotEmpty, diff --git a/src/v0/util/tags.js b/src/v0/util/tags.js index dce8c0a338..1fdb5ddef2 100644 --- a/src/v0/util/tags.js +++ b/src/v0/util/tags.js @@ -24,7 +24,6 @@ const MODULES = { const IMPLEMENTATIONS = { NATIVE: 'native', - CDK_V1: 'cdkV1', CDK_V2: 'cdkV2', }; diff --git a/src/v1/sources/cordial/config.js b/src/v1/sources/cordial/config.js new file mode 100644 index 0000000000..764c734870 --- /dev/null +++ b/src/v1/sources/cordial/config.js @@ -0,0 +1,6 @@ +const eventsMapping = { + crdl_app_install: 'Application Installed', + crdl_app_open: 'Application Opened', +}; + +module.exports = { eventsMapping }; diff --git a/src/v1/sources/cordial/mapping.json b/src/v1/sources/cordial/mapping.json new file mode 100644 index 0000000000..1ce066e07c --- /dev/null +++ b/src/v1/sources/cordial/mapping.json @@ -0,0 +1,22 @@ +[ + { + "sourceKeys": "event._id", + "destKeys": "properties.event_id" + }, + { + "sourceKeys": "contact._id", + "destKeys": ["context.traits.userId", "userId"] + }, + { + "sourceKeys": ["event.ts", "event.ats"], + "destKeys": ["timestamp", "sentAt", "originalTimestamp"] + }, + { + "sourceKeys": "event.d", + "destKeys": "context.device" + }, + { + "sourceKeys": "contact.channels.email.address", + "destKeys": ["context.traits.email"] + } +] diff --git a/src/v1/sources/cordial/transform.js b/src/v1/sources/cordial/transform.js new file mode 100644 index 0000000000..5548efee70 --- /dev/null +++ b/src/v1/sources/cordial/transform.js @@ -0,0 +1,51 @@ +const Message = require('../../../v0/sources/message'); +const { CommonUtils } = require('../../../util/common'); +const { generateUUID, isDefinedAndNotNull } = require('../../../v0/util'); +const { eventsMapping } = require('./config'); + +const mapping = require('./mapping.json'); + +const processEvent = (inputPaylaod) => { + const message = new Message(`Cordial`); + let eventName = inputPaylaod.event?.a || inputPaylaod.event?.action; + if (eventName in eventsMapping) { + eventName = eventsMapping[eventName]; + } + message.setEventType('track'); + message.setEventName(eventName); + message.setPropertiesV2(inputPaylaod, mapping); + + const externalId = []; + // setting up cordial contact_id to externalId + if (inputPaylaod.contact.cID) { + externalId.push({ + type: 'cordialContactId', + id: inputPaylaod.contact.cID, + }); + } + message.context.externalId = externalId; + + if (!isDefinedAndNotNull(message.userId)) { + message.anonymousId = generateUUID(); + } + // Due to multiple mappings to the same destination path object some are not showing up due to which we are doing the following + message.context.traits = { ...message.context.traits, ...inputPaylaod.contact }; + message.properties = { + ...message.properties, + ...inputPaylaod.event.properties, + ...inputPaylaod.event, + }; + delete message.properties.properties; + delete message.properties.d; + // eslint-disable-next-line no-underscore-dangle + delete message.properties._id; + return message; +}; + +const process = (inputEvent) => { + const { event: events } = inputEvent; + const eventsArray = CommonUtils.toArray(events); + return eventsArray.map(processEvent); +}; + +exports.process = process; diff --git a/swagger/components/examples/processor/failure.yaml b/swagger/components/examples/processor/failure.yaml index 3c7f8c13a8..cddfd1cd21 100644 --- a/swagger/components/examples/processor/failure.yaml +++ b/swagger/components/examples/processor/failure.yaml @@ -1,40 +1,26 @@ metadata: - sourceId: '27O0bmEEx3GgfmEhZHUcPwJQVWC' - workspaceId: '27O0bhB6p5ehfOWeeZlOSsSDTLg' - namespace: '' - instanceId: '1' - sourceType: 'HTTP' - sourceCategory: '' - trackingPlanId: '' - trackingPlanVersion: 0 - sourceTpConfig: null - mergedTpConfig: null - destinationId: '2JIqVoWNvSOHa9ppKOqSo4hPuc0' - jobRunId: '' + destinationId: '2JIqVoWNvSOHa9ppKOqSoxxx' jobId: 1 - sourceBatchId: '' - sourceJobId: '' - sourceJobRunId: '' - sourceTaskId: '' - sourceTaskRunId: '' - recordId: null - destinationType: 'PINTEREST_TAG' - messageId: 'cededd59-671c-4a2e-a89a-6461ed662ab9' - oauthAccessToken: '' - messageIds: null - rudderId: '<<>>anon-id<<>>testUser' - receivedAt: '2023-01-01T14:15:41.731+05:30' eventName: 'Product Viewed' eventType: 'track' - sourceDefinitionId: '1b6gJdqOPOCadT3cddw8eidV591' - destinationDefinitionId: '' + sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx' + sourceCategory: '' + attemptNum: 0 + receivedAt: '2024-07-17T16:45:40.114+05:30' + createdAt: '2024-07-17T11:15:41.140Z' + firstAttemptedAt: '' + transformAt: 'router' + workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx' + secret: null + workerAssignedTime: '2024-07-17T16:45:41.264239+05:30' + dontBatch: false + traceparent: '' statusCode: 400 -error: Random is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting +error: Missing required value from 'userIdOnly' statTags: - errorCategory: 'platform' - implementation: 'cdkV2' - destType: 'PINTEREST_TAG' + errorCategory: 'dataValidation' + implementation: 'native' + destType: 'JUNE' module: 'destination' feature: 'processor' - destinationId: '2JIqVoWNvSOHa9ppKOqSo4hPuc0' - workspaceId: '27O0bhB6p5ehfOWeeZlOSsSDTLg' + destinationId: '2JIqVoWNvSOHa9ppKOqSoxxx' diff --git a/swagger/components/examples/processor/success.yaml b/swagger/components/examples/processor/success.yaml index 08924c8813..7d5325ccf5 100644 --- a/swagger/components/examples/processor/success.yaml +++ b/swagger/components/examples/processor/success.yaml @@ -1,72 +1,37 @@ output: body: JSON: - event_time: 1672564081 - event_source_url: https://www.website.com/product/path - action_source: offline - event_id: 6ee69cf1-ce37-4287-9a0f-8b8453219082 - app_id: '' - advertiser_id: 'advertiserId123' - user_data: - em: - - b9ecbd1d999a0f17d442a08971caeea92d770dba89ac900688ecede233d652df - ph: - - 92b5072176e723878b5e06ff3ca61898e4eb74e8c46642a0f2db800b17364ab0 - ge: - - 62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a - ln: - - dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251 - fn: - - 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 - client_ip_address: '[::1]' - custom_data: - num_items: 11 - content_ids: - - '123' - contents: - - quantity: 11 - item_price: '13.49' - event_name: add_to_cart + anonymousId: 'abc123' + userId: '123' + timestamp: '2022-01-20T13:39:21.032Z' JSON_ARRAY: {} XML: {} FORM: {} version: '1' type: REST method: POST - endpoint: https://ct.pinterest.com/events/v3 + endpoint: https://api.june.so/api/identify headers: Content-Type: application/json params: {} files: {} userId: '' -metadata: - sourceId: 27O0bmEEx3GgfmEhZHUcPwJQVWC - workspaceId: 27O0bhB6p5ehfOWeeZlOSsSDTLg - namespace: '' - instanceId: '1' - sourceType: HTTP - sourceCategory: '' - trackingPlanId: '' - trackingPlanVersion: 0 - sourceTpConfig: - mergedTpConfig: - destinationId: 2JIqVoWNvSOHa9ppKOqSo4hPuc0 - jobRunId: '' - jobId: 1 - sourceBatchId: '' - sourceJobId: '' - sourceJobRunId: '' - sourceTaskId: '' - sourceTaskRunId: '' - recordId: - destinationType: PINTEREST_TAG - messageId: 6ee69cf1-ce37-4287-9a0f-8b8453219082 - oauthAccessToken: '' - messageIds: - rudderId: '<<>>anon-id<<>>testUser' - receivedAt: '2023-01-01T14:38:01.482+05:30' - eventName: Product Added - eventType: track - sourceDefinitionId: 1b6gJdqOPOCadT3cddw8eidV591 - destinationDefinitionId: '' + metadata: + userId: '<<>>12345<<>>12345' + jobId: 1 + sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx' + sourceCategory: '' + destinationId: '2JIqVoWNvSOHa9ppKOqSxxx' + attemptNum: 0 + receivedAt: '2024-07-17T16:45:40.114+05:30' + createdAt: '2024-07-17T11:15:41.140Z' + firstAttemptedAt: '' + transformAt: 'router' + workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx' + secret: null + workerAssignedTime: '2024-07-17T16:45:41.264239+05:30' + dontBatch: false + traceparent: '' + eventName: 'Product Added' + eventType: 'track' statusCode: 200 diff --git a/swagger/components/examples/router/failure.yaml b/swagger/components/examples/router/failure.yaml index c592bb47cd..4f14d66701 100644 --- a/swagger/components/examples/router/failure.yaml +++ b/swagger/components/examples/router/failure.yaml @@ -1,130 +1,33 @@ metadata: - - sourceId: '27O0bmEEx3GgfmEhZHUcPwJQVWC' - workspaceId: '27O0bhB6p5ehfOWeeZlOSsSDTLg' - namespace: '' - instanceId: '1' - sourceType: 'HTTP' + - jobId: 2 + destinationId: '2JIqVoWNvSOHa9ppKOqSoxxx' + sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx' sourceCategory: '' - trackingPlanId: '' - trackingPlanVersion: 0 - sourceTpConfig: null - mergedTpConfig: null - destinationId: '2JIqVoWNvSOHa9ppKOqSo4hPuc0' - jobRunId: '' - jobId: 1 - sourceBatchId: '' - sourceJobId: '' - sourceJobRunId: '' - sourceTaskId: '' - sourceTaskRunId: '' - recordId: null - destinationType: 'PINTEREST_TAG' - messageId: 'cededd59-671c-4a2e-a89a-6461ed662ab9' - oauthAccessToken: '' - messageIds: null - rudderId: '<<>>anon-id<<>>testUser' - receivedAt: '2023-01-01T14:15:41.731+05:30' - eventName: 'Product Viewed' - eventType: 'track' - sourceDefinitionId: '1b6gJdqOPOCadT3cddw8eidV591' - destinationDefinitionId: '' + attemptNum: 0 + receivedAt: '2024-07-17T16:45:40.114+05:30' + createdAt: '2024-07-17T11:15:41.140Z' + firstAttemptedAt: '' + transformAt: 'router' + workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx' + secret: null + workerAssignedTime: '2024-07-17T16:45:41.264239+05:30' + dontBatch: false + traceparent: '' destination: - ID: '2JIqVoWNvSOHa9ppKOqSo4hPuc0' - Name: 'Pinterest-test' DestinationDefinition: - ID: '1s0w2bMAleYngscZRgH1ExynlpT' - Name: 'PINTEREST_TAG' - DisplayName: 'Pinterest Tag' - Config: - cdkV2TestThreshold: 1 - cdkV2Enabled: true - destConfig: - defaultConfig: - - 'tagId' - - 'appId' - - 'advertiserId' - - 'sendingUnHashedData' - - 'enableDeduplication' - - 'deduplicationKey' - - 'customProperties' - - 'eventsMapping' - - 'enhancedMatch' - - 'blacklistedEvents' - - 'whitelistedEvents' - - 'eventFilteringOption' - web: - - 'useNativeSDK' - - 'oneTrustCookieCategories' - excludeKeys: [] - includeKeys: - - 'tagId' - - 'advertiserId' - - 'appId' - - 'customProperties' - - 'eventsMapping' - - 'enhancedMatch' - - 'enableDeduplication' - - 'deduplicationKey' - - 'blacklistedEvents' - - 'whitelistedEvents' - - 'oneTrustCookieCategories' - - 'eventFilteringOption' - saveDestinationResponse: false - secretKeys: [] - supportedSourceTypes: - - 'android' - - 'ios' - - 'web' - - 'unity' - - 'amp' - - 'cloud' - - 'warehouse' - - 'reactnative' - - 'flutter' - - 'cordova' - transformAt: 'router' - transformAtV1: 'router' - ResponseRules: {} + ID: '1s0w2bMAleYngscZRgH1Exx' + Name: 'abc_tag' Config: - advertiserId: 'advertiserId123' - appId: '' - apiVersion: 'newApi' - adAccountId: 'accountId123' - conversionToken: 'conversionToken123' - sendAsCustomEvent: false - blacklistedEvents: - - eventName: '' - customProperties: - - properties: '' - deduplicationKey: '' - enableDeduplication: false - enhancedMatch: false - eventFilteringOption: 'disable' - eventsMapping: - - from: 'Product Added' - to: 'AddToCart' - - from: 'Product Viewed' - to: 'ViewCategory' - - from: 'Product Seen' - to: 'PageVisit' - sendingUnHashedData: true - tagId: 'Techno@2020' - whitelistedEvents: - - eventName: '' - Enabled: true - WorkspaceID: '27O0bhB6p5ehfOWeeZlOSsSDTLg' - Transformations: [] - IsProcessorEnabled: true - RevisionID: '2JgW8QPyFsDvodPYShZ29XH3sKB' + apiKey: '93AEyDLvfpbRxx12' + ID: 'june123' batched: false statusCode: 400 -error: "Random is not mapped in UI. Make sure to map the event in UI or enable the 'send as custom event' setting" +error: 'Missing required value from "userIdOnly"' statTags: + destType: 'JUNE' errorCategory: 'dataValidation' - errorType: 'configuration' - destType: 'PINTEREST_TAG' - module: 'destination' - implementation: 'cdkV2' + errorType: 'instrumentation' feature: 'router' - destinationId: '2JIqVoWNvSOHa9ppKOqSo4hPuc0' - workspaceId: '27O0bhB6p5ehfOWeeZlOSsSDTLg' + implementation: 'native' + module: 'destination' + destinationId: '2JIqVoWNvSOHa9ppKOqSoxxx' diff --git a/swagger/components/examples/router/success.yaml b/swagger/components/examples/router/success.yaml index 9d0f80807d..6eeefbf595 100644 --- a/swagger/components/examples/router/success.yaml +++ b/swagger/components/examples/router/success.yaml @@ -1,71 +1,42 @@ body: JSON: - event_time: 1672564081 - event_source_url: 'https://www.website.com/product/path' - action_source: offline - event_id: '6ee69cf1-ce37-4287-9a0f-8b8453219082' - app_id: '' - advertiser_id: 'advertiserId123' - user_data: - em: - - 'b9ecbd1d999a0f17d442a08971caeea92d770dba89ac900688ecede233d652df' - ph: - - '92b5072176e723878b5e06ff3ca61898e4eb74e8c46642a0f2db800b17364ab0' - ge: - - '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a' - ln: - - 'dcf000c2386fb76d22cefc0d118a8511bb75999019cd373df52044bccd1bd251' - fn: - - '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' - client_ip_address: '[::1]' - custom_data: - num_items: 11 - content_ids: - - '123' - contents: - - quantity: 11 - item_price: '13.49' - event_name: add_to_cart + anonymousId: 'ab12' + timestamp: '2022-01-20T13:39:21.032Z' + traits: + age: 25 + email: 'johndoe@gmail.com' + name: 'John Doe' + userId: '12' JSON_ARRAY: {} XML: {} FORM: {} version: '1' type: REST method: POST -endpoint: 'https://ct.pinterest.com/events/v3' +endpoint: 'https://api.june.so/api/identify' headers: Content-Type: 'application/json' params: {} files: {} userId: '' +destination: + Config: + apiKey: '93AEyDLvfpbRxxx' + ID: 'june123' metadata: - sourceId: '27O0bmEEx3GgfmEhZHUcPwJQVWC' - workspaceId: '27O0bhB6p5ehfOWeeZlOSsSDTLg' - namespace: '' - instanceId: '1' - sourceType: HTTP - sourceCategory: '' - trackingPlanId: '' - trackingPlanVersion: 0 - sourceTpConfig: null - mergedTpConfig: null - destinationId: '2JIqVoWNvSOHa9ppKOqSo4hPuc0' - jobRunId: '' + userId: '<<>>123456<<>>123456' jobId: 1 - sourceBatchId: '' - sourceJobId: '' - sourceJobRunId: '' - sourceTaskId: '' - sourceTaskRunId: '' - recordId: null - destinationType: PINTEREST_TAG - messageId: '6ee69cf1-ce37-4287-9a0f-8b8453219082' - oauthAccessToken: '' - messageIds: null - rudderId: '<<>>anon-id<<>>testUser' - receivedAt: '2023-01-01T14:38:01.482+05:30' - eventName: Product Added - eventType: track - sourceDefinitionId: '1b6gJdqOPOCadT3cddw8eidV591' - destinationDefinitionId: '' + sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx' + sourceCategory: '' + destinationId: '2JIqVoWNvSOHa9ppKOqSoxxx' + attemptNum: 0 + receivedAt: '2024-07-17T16:45:40.114+05:30' + createdAt: '2024-07-17T11:15:41.140Z' + firstAttemptedAt: '' + transformAt: 'router' + workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx' + secret: null + workerAssignedTime: '2024-07-17T16:45:41.264239+05:30' + dontBatch: false + traceparent: '' statusCode: 200 diff --git a/swagger/components/schemas/request.yaml b/swagger/components/schemas/request.yaml new file mode 100644 index 0000000000..c0f9117bf8 --- /dev/null +++ b/swagger/components/schemas/request.yaml @@ -0,0 +1,5 @@ +title: request +type: object +parameters: + query: + type: string diff --git a/swagger/components/schemas/routerTransformationRequest.yaml b/swagger/components/schemas/routerTransformationRequest.yaml index 90d29997cc..2ae2380c51 100644 --- a/swagger/components/schemas/routerTransformationRequest.yaml +++ b/swagger/components/schemas/routerTransformationRequest.yaml @@ -7,7 +7,7 @@ properties: type: object properties: request: - type: object + $ref: './request.yaml' message: type: object metadata: diff --git a/test/__tests__/appcenter_source.test.js b/test/__tests__/appcenter_source.test.js deleted file mode 100644 index a3745f881e..0000000000 --- a/test/__tests__/appcenter_source.test.js +++ /dev/null @@ -1,33 +0,0 @@ -const integration = "appcenter"; -const name = "Appcenter"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -/* Source Code has randomm ID generation logic. - For Some of the test cases deleting this random ID won't work as it getting hashed -*/ - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { -// try { - const output = await transformer.process(input); -// expect(output).toEqual(expectedData[index]); -// } catch (error) { -// expect(error.message).toEqual(expectedData[index].message); -// } - }); -}); diff --git a/test/__tests__/appsflyer_source.test.js b/test/__tests__/appsflyer_source.test.js deleted file mode 100644 index de9c6d61e3..0000000000 --- a/test/__tests__/appsflyer_source.test.js +++ /dev/null @@ -1,31 +0,0 @@ -const integration = "appsflyer"; -const name = "Appsflyer"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - delete output.anonymousId; - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].message); - } - }); -}); diff --git a/test/__tests__/canny_source.test.js b/test/__tests__/canny_source.test.js deleted file mode 100644 index efd664ab4b..0000000000 --- a/test/__tests__/canny_source.test.js +++ /dev/null @@ -1,30 +0,0 @@ -const integration = "canny"; -const name = "Canny"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].message); - } - }); -}); diff --git a/test/__tests__/cdk_postMapper/autopilot.test.js b/test/__tests__/cdk_postMapper/autopilot.test.js deleted file mode 100644 index 0dde490017..0000000000 --- a/test/__tests__/cdk_postMapper/autopilot.test.js +++ /dev/null @@ -1,60 +0,0 @@ -const { - trackPostMapper, - identifyPostMapper -} = require("../../../src/cdk/v1/autopilot/transform"); - -describe("Unit Test for track postMapper", () => { - it("should update the rudderContext with correct endpoint", () => { - const message = { traits: { email: "test@email.com" } }; - const destination = { Config: { triggerId: "sample-trigger-id" } }; - const event = { message, destination }; - const expectedRudderContext = { - endpoint: `https://api2.autopilothq.com/v1/trigger/sample-trigger-id/contact/test@email.com` - }; - const rudderContext = {}; - trackPostMapper(event, {}, rudderContext); - expect(rudderContext).toEqual(expectedRudderContext); - }); -}); - -describe("Unit Test for identify postMapper", () => { - it("should delete fields from traits", () => { - const message = { - traits: { email: "test@email.com", firstName: "firstName" } - }; - const destination = {}; - const event = { message, destination }; - const payload = { someKey: "here" }; - const expected = { contact: { someKey: "here" } }; - const resp = identifyPostMapper(event, payload, {}); - expect(resp).toEqual(expected); - }); - - it("should delete fields from traits and keep custom values", () => { - const message = { - traits: { - email: "test@email.com", - firstName: "firstName", - something: "custom" - } - }; - const destination = {}; - const event = { message, destination }; - const payload = { someKey: "here" }; - const expected = { - contact: { someKey: "here", custom: { something: "custom" } } - }; - const resp = identifyPostMapper(event, payload, {}); - expect(resp).toEqual(expected); - }); - - it("should not throw error on empty traits", () => { - const message = { traits: {} }; - const destination = {}; - const event = { message, destination }; - const payload = { someKey: "here" }; - const expected = { contact: { someKey: "here" } }; - const resp = identifyPostMapper(event, payload, {}); - expect(resp).toEqual(expected); - }); -}); diff --git a/test/__tests__/cdk_postMapper/dcm_floodlight.test.js b/test/__tests__/cdk_postMapper/dcm_floodlight.test.js deleted file mode 100644 index 9bf7563a8d..0000000000 --- a/test/__tests__/cdk_postMapper/dcm_floodlight.test.js +++ /dev/null @@ -1,106 +0,0 @@ -const { postMapper } = require("../../../src/cdk/v1/dcm_floodlight/transform"); - -describe("Unit Test for postMapper", () => { - it("should update the rudderContext with userAgent and valid endpoint", () => { - const message = { - event: "Checkout Started", - type: "track", - properties: { - orderId: 1234, - quantity: 45, - revenue: 800 - }, - context: { - device: { - advertisingId: "2a3e36d172-5e28-45a1-9eda-ce22a3e36d1a" - }, - 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" - } - }; - const destination = { - Config: { - advertiserId: "12649566", - activityTag: "", - groupTag: "", - conversionEvents: [ - { - customVariables: [ - { - from: "", - to: "" - } - ], - eventName: "Sign up Completed", - floodlightActivityTag: "signu0", - floodlightGroupTag: "conv01", - salesTag: false - }, - { - customVariables: [ - { - from: "1", - to: "rudder1" - }, - { - from: "2", - to: "akash1" - } - ], - eventName: "Order Complete", - floodlightActivityTag: "order0", - floodlightGroupTag: "conv000", - salesTag: false - }, - { - eventName: "Checkout Started", - floodlightActivityTag: "check0", - floodlightGroupTag: "conv0000", - salesTag: true - }, - { - customVariables: [ - { - from: "1", - to: "rudder2" - }, - { - from: "2", - to: "akash2" - }, - { - from: "3", - to: "friendlyName2" - }, - { - from: "4", - to: "name2" - } - ], - eventName: "Purchase", - floodlightActivityTag: "Pur0", - floodlightGroupTag: "conv111", - salesTag: false - } - ] - } - }; - const event = { message, destination }; - const payload = { - dc_rdid: "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a", - ord: 111, - qty: 999999, - cost: 800, - dc_lat: "true" - }; - const expectedRudderContext = { - 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", - endpoint: - "https://ad.doubleclick.net/ddm/activity/src=12649566;cat=check0;type=conv0000;dc_rdid=T0T0T072-5e28-45a1-9eda-ce22a3e36d1a;ord=111;qty=999999;cost=800;dc_lat=1" - }; - const rudderContext = {}; - postMapper(event, payload, rudderContext); - expect(rudderContext).toEqual(expectedRudderContext); - }); -}); diff --git a/test/__tests__/cdk_postMapper/heap.test.js b/test/__tests__/cdk_postMapper/heap.test.js deleted file mode 100644 index 440cdb2f6b..0000000000 --- a/test/__tests__/cdk_postMapper/heap.test.js +++ /dev/null @@ -1,27 +0,0 @@ -const { commonPostMapper } = require("../../../src/cdk/v1/heap/transform"); - -describe("Unit test cases for heap common post mapper", () => { - let payload, event, rudderContext; - beforeEach(() => { - payload = { should: "remain", properties: { idempotencyKey: "someKey" } }; - event = { message: {}, destination: { Config: { appId: "app_id" } } }; - rudderContext = {}; - }); - - it("should delete idempotency key from mappedPayload", async () => { - const expectedOutput = { - should: "remain", - app_id: "app_id", - properties: {} - }; - await expect( - commonPostMapper(event, payload, rudderContext) - ).resolves.toMatchObject(expectedOutput); - }); - - it("should mutate the mappedPayload on calling postMapper", async () => { - await expect( - commonPostMapper(event, payload, rudderContext) - ).resolves.toMatchObject({ should: "remain", properties: {} }); - }); -}); diff --git a/test/__tests__/cdk_postMapper/kochava.test.js b/test/__tests__/cdk_postMapper/kochava.test.js deleted file mode 100644 index 67f09faff3..0000000000 --- a/test/__tests__/cdk_postMapper/kochava.test.js +++ /dev/null @@ -1,110 +0,0 @@ -const { - processExtraPayloadParams -} = require("../../../src/cdk/v1/kochava/transform"); - -describe("Unit Test for kochava postMapper", () => { - it("should set all the default values", () => { - const event = { - destination: { - Config: { - apiKey: "" - }, - DestinationDefinition: { - Config: { - cdkEnabled: true - }, - DisplayName: "Kochava", - ID: "1WTpBSTiL3iAUHUdW7rHT4sawgU", - Name: "KOCHAVA" - }, - Enabled: true, - ID: "1WTpIHpH7NTBgjeiUPW1kCUgZGI", - Name: "kochava test", - Transformations: [] - }, - message: { - anonymousId: "sampath", - channel: "web", - context: {}, - event: "product added", - properties: { name: "sampath" }, - type: "track", - event: "eventName" - } - }; - const expected = { - data: { - app_tracking_transparency: { - att: false - }, - device_ver: "", - device_ids: { - idfa: "", - idfv: "", - adid: "", - android_id: "" - }, - event_name: "eventName", - device_ua: "", - currency: "USD" - } - }; - const resp = processExtraPayloadParams(event, {}, {}); - expect(resp).toEqual(expected); - }); - - it("should set all the default values and os_version as empty string", () => { - const event = { - destination: { - Config: { - apiKey: "" - }, - DestinationDefinition: { - Config: { - cdkEnabled: true - }, - DisplayName: "Kochava", - ID: "1WTpBSTiL3iAUHUdW7rHT4sawgU", - Name: "KOCHAVA" - }, - Enabled: true, - ID: "1WTpIHpH7NTBgjeiUPW1kCUgZGI", - Name: "kochava test", - Transformations: [] - }, - message: { - anonymousId: "sampath", - channel: "web", - context: { - os: { - version: "" - } - }, - event: "product added", - properties: { name: "sampath" }, - type: "track", - event: "eventName" - } - }; - const expected = { - data: { - app_tracking_transparency: { - att: false - }, - device_ver: "", - device_ids: { - idfa: "", - idfv: "", - adid: "", - android_id: "" - }, - event_name: "eventName", - device_ua: "", - currency: "USD", - os_version: "" - } - }; - const resp = processExtraPayloadParams(event, {}, {}); - expect(resp).toEqual(expected); - }); -}); diff --git a/test/__tests__/cdk_postMapper/lytics.test.js b/test/__tests__/cdk_postMapper/lytics.test.js deleted file mode 100644 index 0b005155dc..0000000000 --- a/test/__tests__/cdk_postMapper/lytics.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const { cleanResponse } = require("../../../src/cdk/v1/lytics/transform"); - -describe("Test for Lytics common post mapper", () => { - it("should remove both first name and last name from mappedPayload", () => { - const mappedPayload = { - firstname: "somename", - lastName: "lastName", - some: "otherKey" - }; - const resp = cleanResponse({}, mappedPayload, {}); - const expected = { some: "otherKey" }; - expect(resp).toEqual(expected); - }); -}); diff --git a/test/__tests__/cdk_postMapper/new_relic.test.js b/test/__tests__/cdk_postMapper/new_relic.test.js deleted file mode 100644 index 3aab6aaf67..0000000000 --- a/test/__tests__/cdk_postMapper/new_relic.test.js +++ /dev/null @@ -1,86 +0,0 @@ -const { even } = require("is"); -const { commonPostMapper } = require("../../../src/cdk/v1/new_relic/transform"); - -describe("Unit test cases for new_relic common post mapper", () => { - let payload, event, rudderContext, expectedOutput; - beforeEach(() => { - payload = { - event: "first", - timestamp: 1580602989, - abc: "123", - key: 124, - auto: true, - eventType: "standard" - }; - event = { - message: { - userId: "identified user id", - anonymousId: "anon-id-new", - context: { - traits: { trait1: "new-val" }, - ip: "14.5.67.21", - library: { name: "http" } - } - }, - destination: { - Config: { - accountId: "12345", - insertKey: "11111122702j2a2U2K2C7H", - dataCenter: "us", - customEventType: "", - sendDeviceContext: false, - sendUserIdanonymousId: true - } - } - }; - rudderContext = {}; - expectedOutput = { - event: "first", - timestamp: 1580602989, - abc: "123", - key: 124, - eventType: "rudderstack", - userId: "identified user id", - anonymousId: "anon-id-new", - "'auto'": "true" - }; - }); - - it('If user did not provid a eventType name, then we will include "rudderstack" in the payload directly', () => { - // event is manupulated to suit the test-cases - event.destination.Config.sendDeviceContext = false; - expect(commonPostMapper(event, payload, rudderContext)).toEqual( - expectedOutput - ); - }); - - it("If user provides a eventType name, then we will include it in the payload directly", () => { - event.destination.Config.customEventType = "abc"; - // expectedOutput is also manupulated to suit the expectation of the test-case - expectedOutput.eventType = "abc"; - expect(commonPostMapper(event, payload, rudderContext)).toEqual( - expectedOutput - ); - }); - it('when "sendUserIdanonymousId" is false, we do not send userId or anonymousId ', () => { - event.destination.Config.sendUserIdanonymousId = false; - event.destination.Config.customEventType = "abc"; - expectedOutput.eventType = "abc"; - delete expectedOutput.userId; - delete expectedOutput.anonymousId; - expect(commonPostMapper(event, payload, rudderContext)).toEqual( - expectedOutput - ); - }); - - it('when "sendDeviceContext" is true, we will flatten the context and merge with the payload ', () => { - event.destination.Config.sendUserIdanonymousId = true; - event.destination.Config.sendDeviceContext = true; - expectedOutput["traits.trait1"] = "new-val"; - expectedOutput.ip = "14.5.67.21"; - expectedOutput["library.name"] = "http"; - expect(commonPostMapper(event, payload, rudderContext)).toEqual( - expectedOutput - ); - }); -}); diff --git a/test/__tests__/cdk_postMapper/zapier.test.js b/test/__tests__/cdk_postMapper/zapier.test.js deleted file mode 100644 index c12b737afd..0000000000 --- a/test/__tests__/cdk_postMapper/zapier.test.js +++ /dev/null @@ -1,37 +0,0 @@ -const { commonPostMapper } = require("../../../src/cdk/v1/zapier/transform"); - -describe("Unit test cases for zapier common post mapper", () => { - it("should update the rudderContext with default endpoint", () => { - const message = { - type: "track", - userId: "identified user id", - anonymousId: "anon-id-new", - event: "Product Purchased new", - properties: { - name: "Shirt", - revenue: 4.99 - }, - context: { - ip: "14.5.67.21", - library: { - name: "http" - } - }, - timestamp: "2020-02-02T00:23:09.544Z" - }; - const destination = { - Config: { - zapUrl: "zapier.abcd-hook", - trackEventsToZap: {}, - pageScreenEventsToZap: {} - } - }; - const event = { message, destination }; - const expectedRudderContext = { - zapUrl: `zapier.abcd-hook` - }; - const rudderContext = {}; - commonPostMapper(event, {}, rudderContext); - expect(rudderContext).toEqual(expectedRudderContext); - }); -}); diff --git a/test/__tests__/customerio_source.test.js b/test/__tests__/customerio_source.test.js deleted file mode 100644 index d753c8cef7..0000000000 --- a/test/__tests__/customerio_source.test.js +++ /dev/null @@ -1,30 +0,0 @@ -const integration = "customerio"; -const name = "CustomerIO"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].message); - } - }); -}); diff --git a/test/__tests__/data/appcenter_source_input.json b/test/__tests__/data/appcenter_source_input.json deleted file mode 100644 index 1cde0666b1..0000000000 --- a/test/__tests__/data/appcenter_source_input.json +++ /dev/null @@ -1,78 +0,0 @@ -[ - { - "text": "Hello from your abc-test app in App Center!", - "sent_at": "2023-01-02T07: 53: 28.3117824Z", - "url": "https://appcenter.ms/users/abc-rudderstack.com/apps/abc-test" - }, - { - "app_name": "MSAppCenterTesting", - "branch": "master", - "build_status": "Succeeded", - "build_id": "1", - "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1", - "build_reason": "manual", - "finish_time": "2021-03-02T16:41:29.891411Z", - "icon_link": null, - "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", - "os": "Android", - "start_time": "2021-03-02T16:34:13.9184874Z", - "source_version": "7ed5c7b279316f19e9a0c45bb0fb49c0655471af", - "sent_at": "2021-03-02T16:41:55.8819564Z" - }, - { - "app_name": "MSAppCenterTesting", - "branch": "master", - "build_status": "Broken", - "build_id": "2", - "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2", - "build_reason": "automatic", - "finish_time": "2021-03-02T16:52:04.2587506Z", - "icon_link": null, - "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", - "os": "Android", - "start_time": "2021-03-02T16:50:52.2584107Z", - "source_version": "0624e1e3e48eaf2371c37316208ff83bdd5c123b", - "sent_at": "2021-03-02T16:52:35.8848052Z" - }, - { - "app_name": "MSAppCenterTesting", - "app_display_name": "MSAppCenterTesting", - "release_id": "1", - "platform": "Android", - "uploaded_at": "2021-03-02T17:49:35.463Z", - "fingerprint": "9cbdc86d96c5359d2af3972fdda46624", - "release_notes": "Degraded to 4.0.0", - "version": "1614707021", - "short_version": "1.0", - "min_os": "7.1", - "mandatory_update": true, - "size": 2919106, - "provisioning_profile_name": null, - "provisioning_profile_type": null, - "bundle_identifier": "tech.desusai.msappcentertesting", - "install_link": "https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email", - "icon_link": "https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r", - "distribution_group_id": "00000000-0000-0000-0000-000000000000", - "installable": true, - "sent_at": "2021-03-02T17:49:37.127635Z", - "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" - }, - { - "id": "1139624368u", - "name": "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)", - "reason": "java.lang.ArithmeticException: divide by zero", - "file_name": null, - "line_number": null, - "url": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u", - "app_display_name": "MSAppCenterTesting", - "app_platform": "Java", - "app_version": "1.0(1)", - "stack_trace": [ - "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);" - ], - "affected_users": 0, - "crash_count": 0, - "sent_at": "2021-03-02T18:14:33.9713246Z", - "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" - } -] diff --git a/test/__tests__/data/appcenter_source_output.json b/test/__tests__/data/appcenter_source_output.json deleted file mode 100644 index 82b5eb899f..0000000000 --- a/test/__tests__/data/appcenter_source_output.json +++ /dev/null @@ -1,198 +0,0 @@ -[ - { - "outputToSource": { - "body": "eyJ0ZXh0IjoiSGVsbG8gZnJvbSB5b3VyIEFuYW50LXRlc3QgYXBwIGluIEFwcCBDZW50ZXIhIiwic2VudF9hdCI6IjIwMjMtMDEtMDJUMDc6IDUzOiAyOC4zMTE3ODI0WiIsInVybCI6Imh0dHBzOiAvL2FwcGNlbnRlci5tcy91c2Vycy9hbmFudC1ydWRkZXJzdGFjay5jb20vYXBwcy9BbmFudC10ZXN0In0=", - "contentType": "application/json" - }, - "statusCode": 200 - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "APPCENTER" - }, - "app": { - "name": "MSAppCenterTesting", - "build": "1" - }, - "device": { - "type": "Android" - }, - "network": { - "carrier": "Android" - }, - "os": { - "name": "Android" - } - }, - "integrations": { - "APPCENTER": false - }, - "properties": { - "app_name": "MSAppCenterTesting", - "branch": "master", - "build_status": "Succeeded", - "build_id": "1", - "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1", - "build_reason": "manual", - "finish_time": "2021-03-02T16:41:29.891411Z", - "icon_link": null, - "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", - "os": "Android", - "start_time": "2021-03-02T16:34:13.9184874Z", - "source_version": "7ed5c7b279316f19e9a0c45bb0fb49c0655471af", - "sent_at": "2021-03-02T16:41:55.8819564Z" - }, - "type": "track", - "event": "Build Succeeded", - "originalTimeStamp": "2021-03-02T16:34:13.9184874Z", - "anonymousId": "7e32188a4dab669f", - "sentAt": "2021-03-02T16:41:55.8819564Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "APPCENTER" - }, - "app": { - "name": "MSAppCenterTesting", - "build": "2" - }, - "device": { - "type": "Android" - }, - "network": { - "carrier": "Android" - }, - "os": { - "name": "Android" - } - }, - "integrations": { - "APPCENTER": false - }, - "properties": { - "app_name": "MSAppCenterTesting", - "branch": "master", - "build_status": "Broken", - "build_id": "2", - "build_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2", - "build_reason": "automatic", - "finish_time": "2021-03-02T16:52:04.2587506Z", - "icon_link": null, - "notification_settings_link": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications", - "os": "Android", - "start_time": "2021-03-02T16:50:52.2584107Z", - "source_version": "0624e1e3e48eaf2371c37316208ff83bdd5c123b", - "sent_at": "2021-03-02T16:52:35.8848052Z" - }, - "type": "track", - "event": "Build Failed", - "originalTimeStamp": "2021-03-02T16:50:52.2584107Z", - "anonymousId": "7e32188a4dab669f", - "sentAt": "2021-03-02T16:52:35.8848052Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "APPCENTER" - }, - "app": { - "name": "MSAppCenterTesting", - "version": "1.0", - "namespace": "tech.desusai.msappcentertesting" - }, - "device": { - "type": "Android" - }, - "network": { - "carrier": "Android" - }, - "os": { - "name": "Android" - } - }, - "integrations": { - "APPCENTER": false - }, - "properties": { - "app_name": "MSAppCenterTesting", - "app_display_name": "MSAppCenterTesting", - "release_id": "1", - "platform": "Android", - "uploaded_at": "2021-03-02T17:49:35.463Z", - "fingerprint": "9cbdc86d96c5359d2af3972fdda46624", - "release_notes": "Degraded to 4.0.0", - "version": "1614707021", - "short_version": "1.0", - "min_os": "7.1", - "mandatory_update": true, - "size": 2919106, - "provisioning_profile_name": null, - "provisioning_profile_type": null, - "bundle_identifier": "tech.desusai.msappcentertesting", - "install_link": "https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email", - "icon_link": "https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r", - "distribution_group_id": "00000000-0000-0000-0000-000000000000", - "installable": true, - "sent_at": "2021-03-02T17:49:37.127635Z", - "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" - }, - "type": "track", - "event": "Released Version 1.0", - "anonymousId": "7e32188a4dab669f", - "sentAt": "2021-03-02T17:49:37.127635Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "APPCENTER" - }, - "app": { - "name": "MSAppCenterTesting", - "version": "1.0(1)" - } - }, - "integrations": { - "APPCENTER": false - }, - "properties": { - "id": "1139624368u", - "name": "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)", - "reason": "java.lang.ArithmeticException: divide by zero", - "file_name": null, - "line_number": null, - "url": "https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u", - "app_display_name": "MSAppCenterTesting", - "app_platform": "Java", - "app_version": "1.0(1)", - "stack_trace": [ - "tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);" - ], - "affected_users": 0, - "crash_count": 0, - "sent_at": "2021-03-02T18:14:33.9713246Z", - "app_id": "ce8b5280-4605-4c1c-8c48-bd54c8fdda31" - }, - "type": "track", - "event": "App Crashed", - "anonymousId": "7e32188a4dab669f", - "sentAt": "2021-03-02T18:14:33.9713246Z" - } -] diff --git a/test/__tests__/data/appsflyer_source_input.json b/test/__tests__/data/appsflyer_source_input.json deleted file mode 100644 index 694281924d..0000000000 --- a/test/__tests__/data/appsflyer_source_input.json +++ /dev/null @@ -1,908 +0,0 @@ -[ - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "customer_user_id": "hi.from@appsflyer.example.com", - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "device_type": "iPhoneXR", - "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "ios", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "customer_user_id": "hi.from@appsflyer.example.com", - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "device_type": "Nokia 5.3", - "idfa": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "android", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "customer_user_id": "hi.from@appsflyer.example.com", - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "device_type": "iPhoneXR", - "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "ios", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "device_type": "iPhoneXR", - "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "ios", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "customer_user_id": "hi.from@appsflyer.example.com", - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "ios", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "customer_user_id": "hi.from@appsflyer.example.com", - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "watchos", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "customer_user_id": "hi.from@appsflyer.example.com", - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "ipados", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "customer_user_id": "hi.from@appsflyer.example.com", - "is_lat": null, - "contributor_2_af_prt": null, - "bundle_id": "com.appsflyer.AppsFlyer", - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "app_version": "1.4.1", - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "city": "Khu Pho Binh Hoa", - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "app_name": "AppsFlyer", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "postal_code": "823941", - "wifi": true, - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "country_code": "VN", - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "appsflyer_id": "1547985076649-5309999", - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "ip": "1.1.1.1", - "oaid": null, - "event_time": "2020-01-15 14:57:24.898", - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "android_id": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "idfa": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "carrier": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "os_version": "12.3.1", - "platform": "tvos", - "af_sub3": null, - "contributor_3_match_type": null, - "selected_timezone": "UTC", - "af_ad_id": null, - "contributor_3_touch_time": null, - "user_agent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - } -] diff --git a/test/__tests__/data/appsflyer_source_output.json b/test/__tests__/data/appsflyer_source_output.json deleted file mode 100644 index 03eb49a8ae..0000000000 --- a/test/__tests__/data/appsflyer_source_output.json +++ /dev/null @@ -1,1092 +0,0 @@ -[ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "AF" - }, - "ip": "1.1.1.1", - "timezone": "UTC", - "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "app": { - "namespace": "com.appsflyer.AppsFlyer", - "version": "1.4.1", - "name": "AppsFlyer" - }, - "device": { - "model": "iPhoneXR", - "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "adTrackingEnabled": true - }, - "network": { - "wifi": true - }, - "os": { - "name": "ios", - "version": "12.3.1" - }, - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - }, - "userId": "hi.from@appsflyer.example.com" - }, - "externalId": [ - { - "type": "appsflyerExternalId", - "value": "1547985076649-5309999" - } - ] - }, - "integrations": { - "AF": false - }, - "properties": { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "oaid": null, - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "af_sub3": null, - "contributor_3_match_type": null, - "af_ad_id": null, - "contributor_3_touch_time": null, - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - "type": "track", - "event": "My Apps", - "userId": "hi.from@appsflyer.example.com", - "timestamp": "2020-01-15 14:57:24.898", - "originalTimestamp": "2020-01-15 14:57:24.898", - "platform": "ios", - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "AF" - }, - "ip": "1.1.1.1", - "timezone": "UTC", - "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "app": { - "namespace": "com.appsflyer.AppsFlyer", - "version": "1.4.1", - "name": "AppsFlyer" - }, - "device": { - "model": "Nokia 5.3", - "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "adTrackingEnabled": true - }, - "network": { - "wifi": true - }, - "os": { - "name": "android", - "version": "12.3.1" - }, - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - }, - "userId": "hi.from@appsflyer.example.com" - }, - "externalId": [ - { - "type": "appsflyerExternalId", - "value": "1547985076649-5309999" - } - ] - }, - "integrations": { - "AF": false - }, - "properties": { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "oaid": null, - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "af_sub3": null, - "contributor_3_match_type": null, - "af_ad_id": null, - "contributor_3_touch_time": null, - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - "type": "track", - "event": "My Apps", - "userId": "hi.from@appsflyer.example.com", - "timestamp": "2020-01-15 14:57:24.898", - "originalTimestamp": "2020-01-15 14:57:24.898", - "platform": "android", - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - } - }, - { - "statusCode": 400, - "message": "Unknwon event type from Appsflyer" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "AF" - }, - "ip": "1.1.1.1", - "timezone": "UTC", - "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "app": { - "namespace": "com.appsflyer.AppsFlyer", - "version": "1.4.1", - "name": "AppsFlyer" - }, - "device": { - "model": "iPhoneXR", - "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "adTrackingEnabled": true - }, - "network": { - "wifi": true - }, - "os": { - "name": "ios", - "version": "12.3.1" - }, - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - }, - "externalId": [ - { - "type": "appsflyerExternalId", - "value": "1547985076649-5309999" - } - ] - }, - "integrations": { - "AF": false - }, - "type": "track", - "event": "My Apps", - "properties": { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "oaid": null, - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "af_sub3": null, - "contributor_3_match_type": null, - "af_ad_id": null, - "contributor_3_touch_time": null, - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - "timestamp": "2020-01-15 14:57:24.898", - "originalTimestamp": "2020-01-15 14:57:24.898", - "platform": "ios", - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "AF" - }, - "ip": "1.1.1.1", - "timezone": "UTC", - "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "app": { - "namespace": "com.appsflyer.AppsFlyer", - "version": "1.4.1", - "name": "AppsFlyer" - }, - "device": { - "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "adTrackingEnabled": true - }, - "network": { - "wifi": true - }, - "os": { - "name": "ios", - "version": "12.3.1" - }, - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - }, - "userId": "hi.from@appsflyer.example.com" - }, - "externalId": [ - { - "type": "appsflyerExternalId", - "value": "1547985076649-5309999" - } - ] - }, - "integrations": { - "AF": false - }, - "properties": { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "oaid": null, - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "af_sub3": null, - "contributor_3_match_type": null, - "af_ad_id": null, - "contributor_3_touch_time": null, - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - "type": "track", - "event": "My Apps", - "userId": "hi.from@appsflyer.example.com", - "timestamp": "2020-01-15 14:57:24.898", - "originalTimestamp": "2020-01-15 14:57:24.898", - "platform": "ios", - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "AF" - }, - "ip": "1.1.1.1", - "timezone": "UTC", - "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "app": { - "namespace": "com.appsflyer.AppsFlyer", - "version": "1.4.1", - "name": "AppsFlyer" - }, - "device": { - "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "adTrackingEnabled": true - }, - "network": { - "wifi": true - }, - "os": { - "name": "watchos", - "version": "12.3.1" - }, - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - }, - "userId": "hi.from@appsflyer.example.com" - }, - "externalId": [ - { - "type": "appsflyerExternalId", - "value": "1547985076649-5309999" - } - ] - }, - "integrations": { - "AF": false - }, - "properties": { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "oaid": null, - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "af_sub3": null, - "contributor_3_match_type": null, - "af_ad_id": null, - "contributor_3_touch_time": null, - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - "type": "track", - "event": "My Apps", - "userId": "hi.from@appsflyer.example.com", - "timestamp": "2020-01-15 14:57:24.898", - "originalTimestamp": "2020-01-15 14:57:24.898", - "platform": "watchos", - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "AF" - }, - "ip": "1.1.1.1", - "timezone": "UTC", - "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "app": { - "namespace": "com.appsflyer.AppsFlyer", - "version": "1.4.1", - "name": "AppsFlyer" - }, - "device": { - "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "adTrackingEnabled": true - }, - "network": { - "wifi": true - }, - "os": { - "name": "ipados", - "version": "12.3.1" - }, - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - }, - "userId": "hi.from@appsflyer.example.com" - }, - "externalId": [ - { - "type": "appsflyerExternalId", - "value": "1547985076649-5309999" - } - ] - }, - "integrations": { - "AF": false - }, - "properties": { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "oaid": null, - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "af_sub3": null, - "contributor_3_match_type": null, - "af_ad_id": null, - "contributor_3_touch_time": null, - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - "type": "track", - "event": "My Apps", - "userId": "hi.from@appsflyer.example.com", - "timestamp": "2020-01-15 14:57:24.898", - "originalTimestamp": "2020-01-15 14:57:24.898", - "platform": "ipados", - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "AF" - }, - "ip": "1.1.1.1", - "timezone": "UTC", - "userAgent": "AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0", - "app": { - "namespace": "com.appsflyer.AppsFlyer", - "version": "1.4.1", - "name": "AppsFlyer" - }, - "device": { - "advertisingId": "A7071198-3848-40A5-B3D0-94578D9BZZZZ", - "adTrackingEnabled": true - }, - "network": { - "wifi": true - }, - "os": { - "name": "tvos", - "version": "12.3.1" - }, - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - }, - "userId": "hi.from@appsflyer.example.com" - }, - "externalId": [ - { - "type": "appsflyerExternalId", - "value": "1547985076649-5309999" - } - ] - }, - "integrations": { - "AF": false - }, - "properties": { - "idfv": "868049A3-4B2F-4A11-9B00-CFFC362XXXXX", - "device_category": "phone", - "af_sub1": null, - "is_lat": null, - "contributor_2_af_prt": null, - "gp_broadcast_referrer": "", - "contributor_2_touch_time": null, - "contributor_3_touch_type": null, - "event_source": "SDK", - "af_cost_value": null, - "contributor_1_match_type": null, - "contributor_3_af_prt": null, - "custom_data": null, - "contributor_2_touch_type": null, - "gp_install_begin": null, - "amazon_aid": null, - "gp_referrer": null, - "af_cost_model": null, - "af_c_id": null, - "attributed_touch_time_selected_timezone": null, - "selected_currency": "USD", - "install_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "install_time": "2019-01-20 04:51:16.000", - "operator": null, - "attributed_touch_type": null, - "af_attribution_lookback": null, - "campaign_type": null, - "keyword_match_type": null, - "af_adset_id": null, - "device_download_time_selected_timezone": "2019-01-20 04:51:16.000+0000", - "contributor_2_media_source": null, - "conversion_type": null, - "contributor_2_match_type": null, - "api_version": "2.0", - "attributed_touch_time": null, - "revenue_in_selected_currency": null, - "is_retargeting": false, - "gp_click_time": null, - "contributor_1_af_prt": null, - "match_type": null, - "dma": "None", - "http_referrer": null, - "af_sub5": null, - "af_prt": null, - "event_revenue_currency": "USD", - "store_reinstall": null, - "install_app_store": null, - "media_source": "organic", - "deeplink_url": null, - "campaign": null, - "af_keywords": null, - "region": "AS", - "cost_in_selected_currency": null, - "event_value": "{}", - "oaid": null, - "is_receipt_validated": null, - "contributor_1_campaign": null, - "af_sub4": null, - "imei": null, - "contributor_3_campaign": null, - "event_revenue_usd": null, - "af_sub2": null, - "original_url": null, - "contributor_2_campaign": null, - "contributor_3_media_source": null, - "af_adset": null, - "af_ad": null, - "state": "57", - "network_account_id": null, - "retargeting_conversion_type": null, - "af_channel": null, - "af_cost_currency": null, - "contributor_1_media_source": null, - "keyword_id": null, - "device_download_time": "2019-01-20 04:51:16.000", - "contributor_1_touch_type": null, - "af_reengagement_window": null, - "af_siteid": null, - "language": "en-US", - "app_id": "id1217828636", - "contributor_1_touch_time": null, - "event_revenue": null, - "af_ad_type": null, - "event_name": "My Apps", - "af_sub_siteid": null, - "advertising_id": null, - "af_sub3": null, - "contributor_3_match_type": null, - "af_ad_id": null, - "contributor_3_touch_time": null, - "is_primary_attribution": true, - "sdk_version": "v4.10.0", - "event_time_selected_timezone": "2020-01-15 14:57:24.898+0000" - }, - "type": "track", - "event": "My Apps", - "userId": "hi.from@appsflyer.example.com", - "timestamp": "2020-01-15 14:57:24.898", - "originalTimestamp": "2020-01-15 14:57:24.898", - "platform": "tvos", - "traits": { - "address": { - "city": "Khu Pho Binh Hoa", - "zip": "823941", - "country": "VN" - } - } - } -] diff --git a/test/__tests__/data/canny_source_input.json b/test/__tests__/data/canny_source_input.json deleted file mode 100644 index 5547473209..0000000000 --- a/test/__tests__/data/canny_source_input.json +++ /dev/null @@ -1,667 +0,0 @@ -[ - { - "created": "2022-07-28T10:52:46.294Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 13, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "commentCount": 0, - "created": "2022-07-28T10:52:46.172Z", - "customFields": [ - { - "id": "62e13820d7949d44b92d3876", - "name": "abc", - "value": "123" - } - ], - "details": "Array of images", - "eta": null, - "id": "62e26a7e1d4ea13c124337bd", - "imageURLs": [ - "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", - "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" - ], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Custom Fields Testing", - "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" - }, - "objectType": "post", - "type": "post.created" - }, - { - "created": "2022-07-26T10:35:16.390Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 10, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "commentCount": 0, - "created": "2022-07-26T08:18:52.459Z", - "deletedBy": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "details": "This is the post's details", - "eta": null, - "id": "62dfa36c9950e94655320fe7", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-4" - }, - "objectType": "post", - "type": "post.deleted" - }, - { - "created": "2022-07-26T18:32:28.337Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "category": null, - "commentCount": 0, - "created": "2022-07-26T10:43:43.752Z", - "details": "This is the post's details", - "eta": null, - "id": "62dfc55ffe7f6f465b9b4568", - "imageURLs": [], - "issue": { - "description": "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", - "id": "10001", - "key": "TES-2", - "status": "To Do", - "summary": "Canny Source Testing", - "url": "https://rudderstack-user.atlassian.net/browse/TES-2" - }, - "owner": null, - "score": 2, - "status": "open", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-8" - }, - "objectType": "post", - "type": "post.jira_issue_linked" - }, - { - "created": "2022-07-27T04:08:24.377Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "category": null, - "commentCount": 0, - "created": "2022-07-26T11:32:31.228Z", - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "issue": { - "description": "Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2", - "id": "10002", - "key": "TES-3", - "status": "To Do", - "summary": "Images testing", - "url": "https://rudderstack-user.atlassian.net/browse/TES-3" - }, - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - }, - "objectType": "post", - "type": "post.jira_issue_unlinked" - }, - { - "created": "2022-07-26T18:07:03.143Z", - "object": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "changeComment": { - "imageURLs": ["https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp"], - "value": "" - }, - "changedAt": "2022-07-26T18:07:03.143Z", - "changer": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "commentCount": 1, - "created": "2022-07-26T08:22:31.089Z", - "details": "This is the post's details", - "eta": null, - "id": "62dfa4479950e9465532a31e", - "imageURLs": [], - "jira": { - "linkedIssues": [], - "linkedIssueIDs": [] - }, - "owner": null, - "score": 2, - "status": "planned", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" - }, - "objectType": "post", - "type": "post.status_changed" - }, - { - "created": "2022-07-26T10:52:17.712Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 11, - "url": "https://rudder.canny.io/admin/board/features" - }, - "created": "2022-07-26T10:52:17.618Z", - "id": "62dfc761af6e2b467381b103", - "imageURLs": ["https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp"], - "internal": true, - "mentions": [], - "parentID": null, - "post": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 1, - "details": "This is the post's details", - "eta": null, - "id": "62dfa4479950e9465532a31e", - "imageURLs": [], - "owner": null, - "score": 2, - "status": "open", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" - }, - "private": false, - "value": "webhook-test" - }, - "objectType": "comment", - "type": "comment.created" - }, - { - "created": "2022-07-27T04:12:09.290Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "created": "2022-07-27T04:11:59.942Z", - "id": "62e0bb0faf6e2b467328b133", - "imageURLs": [], - "parentID": null, - "post": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 0, - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - }, - "private": false, - "value": "good" - }, - "objectType": "comment", - "type": "comment.deleted" - }, - { - "created": "2022-07-26T11:32:31.378Z", - "object": { - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "created": "2022-07-26T11:32:31.263Z", - "id": "62dfd0cfb2870d468c9618f5", - "post": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 0, - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - }, - "score": 1, - "voter": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - } - }, - "objectType": "vote", - "type": "vote.created" - }, - { - "created": "2022-07-26T18:09:27.358Z", - "object": { - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "created": "2022-07-26T08:22:31.109Z", - "id": "62dfa4479950e9465532a338", - "post": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 1, - "details": "This is the post's details", - "eta": null, - "id": "62dfa4479950e9465532a31e", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "planned", - "tags": [ - { - "id": "62e02db67ad24c46bc175f56", - "name": "abc-tag", - "postCount": 1, - "url": "https://rudder.canny.io/admin/board/features?tags=abc-tag" - } - ], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" - }, - "score": 0, - "voter": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - } - }, - "objectType": "vote", - "type": "vote.deleted" - }, - { - "created": "2022-07-28T10:52:46.294Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": "sampleuserId" - }, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 13, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "commentCount": 0, - "created": "2022-07-28T10:52:46.172Z", - "customFields": [ - { - "id": "62e13820d7949d44b92d3876", - "name": "abc", - "value": "123" - } - ], - "details": "Array of images", - "eta": null, - "id": "62e26a7e1d4ea13c124337bd", - "imageURLs": [ - "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", - "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" - ], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Custom Fields Testing", - "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" - }, - "objectType": "post", - "type": "post.created" - }, - { - "created": "2022-07-26T11:32:31.378Z", - "object": { - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "created": "2022-07-26T11:32:31.263Z", - "id": "62dfd0cfb2870d468c9618f5", - "post": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 0, - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - }, - "score": 1, - "voter": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": "123" - } - }, - "objectType": "vote", - "type": "vote.created" - }, - { - "created": "2022-07-26T18:09:27.358Z", - "object": { - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "created": "2022-07-26T08:22:31.109Z", - "id": "62dfa4479950e9465532a338", - "post": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 1, - "details": "This is the post's details", - "eta": null, - "id": "62dfa4479950e9465532a31e", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "planned", - "tags": [ - { - "id": "62e02db67ad24c46bc175f56", - "name": "abc-tag", - "postCount": 1, - "url": "https://rudder.canny.io/admin/board/features?tags=abc-tag" - } - ], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" - }, - "score": 0, - "voter": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": null, - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - } - }, - "objectType": "vote", - "type": "vote.deleted" - }, - { - "created": "2022-07-26T10:35:16.390Z", - "object": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 10, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "commentCount": 0, - "created": "2022-07-26T08:18:52.459Z", - "deletedBy": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "details": "This is the post's details", - "eta": null, - "id": "62dfa36c9950e94655320fe7", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-4" - }, - "objectType": "post" - } -] diff --git a/test/__tests__/data/canny_source_output.json b/test/__tests__/data/canny_source_output.json deleted file mode 100644 index 67f919ba9b..0000000000 --- a/test/__tests__/data/canny_source_output.json +++ /dev/null @@ -1,789 +0,0 @@ -[ - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "post.created", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-28T10:52:46.294Z", - "originalTimestamp": "2022-07-28T10:52:46.294Z", - "type": "track", - "properties": { - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 13, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "commentCount": 0, - "created": "2022-07-28T10:52:46.172Z", - "customFields": [ - { - "id": "62e13820d7949d44b92d3876", - "name": "abc", - "value": "123" - } - ], - "details": "Array of images", - "eta": null, - "id": "62e26a7e1d4ea13c124337bd", - "imageURLs": [ - "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", - "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" - ], - "objectType": "post", - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Custom Fields Testing", - "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "post.deleted", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-26T10:35:16.390Z", - "originalTimestamp": "2022-07-26T10:35:16.390Z", - "type": "track", - "properties": { - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 10, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "commentCount": 0, - "created": "2022-07-26T08:18:52.459Z", - "deletedBy": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "details": "This is the post's details", - "eta": null, - "id": "62dfa36c9950e94655320fe7", - "imageURLs": [], - "objectType": "post", - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-4" - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "post.jira_issue_linked", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-26T18:32:28.337Z", - "originalTimestamp": "2022-07-26T18:32:28.337Z", - "type": "track", - "properties": { - "by": null, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "category": null, - "commentCount": 0, - "created": "2022-07-26T10:43:43.752Z", - "details": "This is the post's details", - "eta": null, - "id": "62dfc55ffe7f6f465b9b4568", - "imageURLs": [], - "issue": { - "description": "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", - "id": "10001", - "key": "TES-2", - "status": "To Do", - "summary": "Canny Source Testing", - "url": "https://rudderstack-user.atlassian.net/browse/TES-2" - }, - "objectType": "post", - "owner": null, - "score": 2, - "status": "open", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-8" - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "post.jira_issue_unlinked", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-27T04:08:24.377Z", - "originalTimestamp": "2022-07-27T04:08:24.377Z", - "type": "track", - "properties": { - "objectType": "post", - "by": null, - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "category": null, - "commentCount": 0, - "created": "2022-07-26T11:32:31.228Z", - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "issue": { - "description": "Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2", - "id": "10002", - "key": "TES-3", - "status": "To Do", - "summary": "Images testing", - "url": "https://rudderstack-user.atlassian.net/browse/TES-3" - }, - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "post.status_changed", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-26T18:07:03.143Z", - "originalTimestamp": "2022-07-26T18:07:03.143Z", - "type": "track", - "properties": { - "objectType": "post", - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "changeComment": { - "imageURLs": ["https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp"], - "value": "" - }, - "changedAt": "2022-07-26T18:07:03.143Z", - "changer": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "commentCount": 1, - "created": "2022-07-26T08:22:31.089Z", - "details": "This is the post's details", - "eta": null, - "id": "62dfa4479950e9465532a31e", - "imageURLs": [], - "jira": { - "linkedIssues": [], - "linkedIssueIDs": [] - }, - "owner": null, - "score": 2, - "status": "planned", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "comment.created", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-26T10:52:17.712Z", - "originalTimestamp": "2022-07-26T10:52:17.712Z", - "type": "track", - "properties": { - "objectType": "comment", - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 11, - "url": "https://rudder.canny.io/admin/board/features" - }, - "created": "2022-07-26T10:52:17.618Z", - "id": "62dfc761af6e2b467381b103", - "imageURLs": ["https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp"], - "internal": true, - "mentions": [], - "parentID": null, - "post": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 1, - "details": "This is the post's details", - "eta": null, - "id": "62dfa4479950e9465532a31e", - "imageURLs": [], - "owner": null, - "score": 2, - "status": "open", - "tags": [], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" - }, - "private": false, - "value": "webhook-test" - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "comment.deleted", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-27T04:12:09.290Z", - "originalTimestamp": "2022-07-27T04:12:09.290Z", - "type": "track", - "properties": { - "objectType": "comment", - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "created": "2022-07-27T04:11:59.942Z", - "id": "62e0bb0faf6e2b467328b133", - "imageURLs": [], - "parentID": null, - "post": { - "author": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 0, - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - }, - "private": false, - "value": "good" - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "vote.created", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-26T11:32:31.378Z", - "originalTimestamp": "2022-07-26T11:32:31.378Z", - "type": "track", - "properties": { - "objectType": "vote", - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "created": "2022-07-26T11:32:31.263Z", - "id": "62dfd0cfb2870d468c9618f5", - "post": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 0, - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - }, - "score": 1 - } - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "event": "vote.deleted", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-26T18:09:27.358Z", - "originalTimestamp": "2022-07-26T18:09:27.358Z", - "type": "track", - "properties": { - "objectType": "vote", - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "created": "2022-07-26T08:22:31.109Z", - "id": "62dfa4479950e9465532a338", - "post": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 1, - "details": "This is the post's details", - "eta": null, - "id": "62dfa4479950e9465532a31e", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "planned", - "tags": [ - { - "id": "62e02db67ad24c46bc175f56", - "name": "abc-tag", - "postCount": 1, - "url": "https://rudder.canny.io/admin/board/features?tags=abc-tag" - } - ], - "title": "Post Title", - "url": "https://rudder.canny.io/admin/board/features/p/post-title-7" - }, - "score": 0 - } - }, - { - "userId": "sampleuserId", - "event": "post.created", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-28T10:52:46.294Z", - "originalTimestamp": "2022-07-28T10:52:46.294Z", - "type": "track", - "properties": { - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 13, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "category": null, - "commentCount": 0, - "created": "2022-07-28T10:52:46.172Z", - "customFields": [ - { - "id": "62e13820d7949d44b92d3876", - "name": "abc", - "value": "123" - } - ], - "details": "Array of images", - "eta": null, - "id": "62e26a7e1d4ea13c124337bd", - "imageURLs": [ - "https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg", - "https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg" - ], - "objectType": "post", - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Custom Fields Testing", - "url": "https://rudder.canny.io/admin/board/features/p/custom-fields-testing" - } - }, - { - "userId": "123", - "event": "vote.created", - "integrations": { - "Canny": false - }, - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Canny", - "version": "1.0.0" - }, - "traits": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser" - }, - "externalId": [ - { - "type": "cannyUserId", - "id": "62d14c90fff7c80d0ec08375" - } - ] - }, - "timestamp": "2022-07-26T11:32:31.378Z", - "originalTimestamp": "2022-07-26T11:32:31.378Z", - "type": "track", - "properties": { - "objectType": "vote", - "board": { - "created": "2022-07-25T12:11:19.895Z", - "id": "62de88676bc28b44aaaf25cc", - "name": "features", - "postCount": 12, - "url": "https://rudder.canny.io/admin/board/features" - }, - "by": null, - "created": "2022-07-26T11:32:31.263Z", - "id": "62dfd0cfb2870d468c9618f5", - "post": { - "author": { - "avatarURL": "https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png", - "created": "2022-07-15T11:16:32.648Z", - "email": "test@rudderstack.com", - "id": "62d14c90fff7c80d0ec08375", - "isAdmin": true, - "name": "Rudder Test", - "url": "https://rudder.canny.io/admin/users/dummyUser", - "userID": null - }, - "by": null, - "category": null, - "commentCount": 0, - "details": "Array of images", - "eta": null, - "id": "62dfd0cfb2870d468c9618dd", - "imageURLs": [], - "owner": null, - "score": 1, - "status": "open", - "tags": [], - "title": "Images testing", - "url": "https://rudder.canny.io/admin/board/features/p/images-testing-2" - }, - "score": 1 - } - }, - { - "message": "Missing essential fields from Canny. Error: (TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received null)" - }, - { - "message": "Missing essential fields from Canny" - } -] diff --git a/test/__tests__/data/customerio_source_input.json b/test/__tests__/data/customerio_source_input.json deleted file mode 100644 index 769c1b7fd3..0000000000 --- a/test/__tests__/data/customerio_source_input.json +++ /dev/null @@ -1,390 +0,0 @@ -[ - { - "data": { - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "email_address": "test@example.com" - }, - "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ", - "object_type": "customer", - "metric": "subscribed", - "timestamp": "abc" - }, - { - "data": { - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "email_address": "test@example.com" - }, - "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ", - "object_type": "customer", - "metric": "subscribed", - "timestamp": "1585250199" - }, - { - "data": { - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "email_address": "test@example.com" - }, - "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ", - "object_type": "customer", - "metric": "subscribed", - "timestamp": 1585250199 - }, - { - "data": { - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "email_address": "test@example.com" - }, - "event_id": "01E4C4C6P79C12J5A6KPE6XNFD", - "object_type": "customer", - "metric": "unsubscribed", - "timestamp": 1585250179 - }, - { - "data": { - "action_id": 36, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgABcRhIBqSp7kiPekGBIeVh" - }, - "event_id": "01E4C4G1S0AMNG0XVF2M7RPH5S", - "object_type": "email", - "metric": "drafted", - "timestamp": 1585250305 - }, - { - "data": { - "content_id": 1146, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=", - "failure_message": "550 5.5.0 Requested action not taken: mailbox unavailable", - "newsletter_id": 736, - "recipient": "test@example.com", - "subject": "Thanks for joining!" - }, - "event_id": "12ASDG7S9P6MAZPTJ78DAND9GDC", - "object_type": "email", - "metric": "bounced", - "timestamp": 1234567890 - }, - { - "data": { - "action_id": 36, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgABcRhIBqSp7kiPekGBIeVh", - "href": "http://google.com", - "link_id": 1, - "recipient": "test@example.com", - "subject": "hello" - }, - "event_id": "01E4C8BES5XT87ZWRJFTB35YJ3", - "object_type": "email", - "metric": "clicked", - "timestamp": 1585254348 - }, - { - "data": { - "action_id": 42, - "campaign_id": 23, - "content": "Welcome to the club, we are with you.", - "customer_id": "user-123", - "delivery_id": "RAECAAFwnUSneIa0ZXkmq8EdkAM==", - "headers": { - "Custom-Header": ["custom-value"] - }, - "identifiers": { - "id": "user-123" - }, - "recipient": "test@example.com", - "subject": "Thanks for signing up" - }, - "event_id": "01E2EMRMM6TZ12TF9WGZN0WJQT", - "metric": "sent", - "object_type": "email", - "timestamp": 1644227937 - }, - { - "data": { - "customer_id": "user-123", - "delivery_id": "REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==", - "identifiers": { - "cio_id": "7ef807109981", - "id": "user-123" - }, - "recipient": "test@example.com", - "subject": "Thanks for signing up", - "transactional_message_id": 2 - }, - "event_id": "01ER4R5WB62QWCNREKFB4DYXGR", - "metric": "delivered", - "object_type": "email", - "timestamp": 1675196819 - }, - { - "data": { - "action_id": 38, - "campaign_id": 6, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RAEABQFxN56fWzydfV4_EGvfobI=", - "failure_message": "NoDevicesSynced" - }, - "event_id": "01E4VSX8SZ0T9AQMH4Q16NRB89", - "object_type": "push", - "metric": "attempted", - "timestamp": 1585776075 - }, - { - "data": { - "action_id": 37, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", - "recipients": [ - { - "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof", - "device_platform": "android" - } - ] - }, - "event_id": "01E4C4HDQ7P1X9KTKF0ZX7PWHE", - "object_type": "push", - "metric": "sent", - "timestamp": 1585250350 - }, - { - "data": { - "action_id": 37, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", - "href": "ciosas://product/2", - "link_id": 1, - "recipients": [ - { - "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" - } - ] - }, - "event_id": "01E4V2SBHYK4TNTG8WKMP39G9R", - "object_type": "push", - "metric": "clicked", - "timestamp": 1585751829 - }, - { - "data": { - "action_id": 41, - "campaign_id": 7, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "ROk1AAIBcR4iT6mueuxiDtzO8HXv", - "failure_message": "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309." - }, - "event_id": "01E4F3DCS83P8HT7R3E6DWQN1X", - "object_type": "sms", - "metric": "attempted", - "timestamp": 1234567890 - }, - { - "data": { - "action_id": 38, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgIBcRh6qzHz-8gKvscP2UZa", - "href": "https://app.com/verify", - "link_id": 1, - "recipient": "+18008675309" - }, - "event_id": "01E4XXPN42JDF4B1ATQKTZ8WHV", - "object_type": "sms", - "metric": "clicked", - "timestamp": 1585847161 - }, - { - "data": { - "action_id": 39, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgQBcRhNAufb0s30bmz5HD7Y", - "recipient": "#signups" - }, - "event_id": "01E4C4TQKD6KJ274870J5DE2HB", - "object_type": "slack", - "metric": "sent", - "timestamp": 1585250655 - }, - { - "data": { - "action_id": 39, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgQBcRhocpCJE3mFfwvRzNe6", - "href": "http://bing.com", - "link_id": 1, - "recipient": "#signups" - }, - "event_id": "01E4C6HJTBNDX18XC4B88M3Y2G", - "object_type": "slack", - "metric": "clicked", - "timestamp": 1585252451 - }, - { - "data": { - "action_id": 39, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgQBcRhIBqRiZAc0fyQiLvkC", - "failure_message": "value passed for channel was invalid" - }, - "event_id": "01E4C4HDQ77BCN0X23Z3WBE764", - "object_type": "slack", - "metric": "failed", - "timestamp": 1585250350 - }, - { - "data": { - "action_id": 40, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgEBcRhIBqSrYcXDr2ks6Pj9" - }, - "event_id": "01E4C4G1S04QCV1NASF4NWMQNR", - "object_type": "webhook", - "metric": "drafted", - "timestamp": 1585250305 - }, - { - "data": { - "action_id": 38, - "broadcast_id": 6, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RAECAQFxNeUBx6LqgjqrN1j-BJc=", - "failure_message": "Variable 'customer.test' is missing" - }, - "event_id": "01E4TYA2KA9T0XGHCRJ784B774", - "object_type": "webhook", - "metric": "attempted", - "timestamp": 1585747134 - }, - { - "data": { - "action_id": 40, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgEBcRhNAufr2aU82jtDZEh6", - "recipient": "https://test.example.com/process" - }, - "event_id": "01E4C6EP0HCKRHKFARMZ5XEH7A", - "object_type": "webhook", - "metric": "sent", - "timestamp": 1585252357 - }, - { - "data": { - "action_id": 40, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgEBcRhNAufr2aU82jtDZEh6", - "href": "http://bing.com", - "link_id": 1, - "recipient": "https://test.example.com/process" - }, - "event_id": "01E4C6F5N1Y54TVGJTN64Y1ZS9", - "object_type": "webhook", - "metric": "clicked", - "timestamp": 1585252373 - }, - { - "data": { - "action_id": 38, - "broadcast_id": 6, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RAECAQFxNeK3bC4SYqhQqFGBQrQ=", - "failure_message": "HTTP 404 Not Found []" - }, - "event_id": "01E4TY5FVB0ZQ4KVDKRME0XSYZ", - "object_type": "webhook", - "metric": "failed", - "timestamp": 1585746984 - }, - { - "data": { - "action_id": 37, - "broadcast_id": 9, - "customer_id": "0200102", - "identifiers": { - "id": "0200102" - }, - "delivery_id": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", - "href": "ciosas://product/2", - "link_id": 1, - "recipients": [ - { - "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" - } - ] - }, - "event_id": "01E4V2SBHYK4TNTG8WKMP39G9S", - "object_type": "push", - "metric": "delivered", - "timestamp": 1585751830 - } -] diff --git a/test/__tests__/data/customerio_source_output.json b/test/__tests__/data/customerio_source_output.json deleted file mode 100644 index 52df88e833..0000000000 --- a/test/__tests__/data/customerio_source_output.json +++ /dev/null @@ -1,651 +0,0 @@ -[ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Customer Subscribed", - "properties": { - "eventId": "01E4C4CT6YDC7Y5M7FE1GWWPQJ" - }, - "userId": "0200102" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Customer Subscribed", - "properties": { - "eventId": "01E4C4CT6YDC7Y5M7FE1GWWPQJ" - }, - "userId": "0200102" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Customer Subscribed", - "properties": { - "eventId": "01E4C4CT6YDC7Y5M7FE1GWWPQJ" - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:16:39.000Z", - "sentAt": "2020-03-26T19:16:39.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Customer Unsubscribed", - "properties": { - "eventId": "01E4C4C6P79C12J5A6KPE6XNFD" - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:16:19.000Z", - "sentAt": "2020-03-26T19:16:19.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Email Drafted", - "properties": { - "eventId": "01E4C4G1S0AMNG0XVF2M7RPH5S", - "deliveryId": "RPILAgABcRhIBqSp7kiPekGBIeVh", - "actionId": 36, - "broadcastId": 9 - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:18:25.000Z", - "sentAt": "2020-03-26T19:18:25.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Email Bounced", - "properties": { - "eventId": "12ASDG7S9P6MAZPTJ78DAND9GDC", - "deliveryId": "RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=", - "contentId": 1146, - "emailSubject": "Thanks for joining!", - "reason": "550 5.5.0 Requested action not taken: mailbox unavailable", - "newsletterId": 736 - }, - "userId": "0200102", - "originalTimestamp": "2009-02-13T23:31:30.000Z", - "sentAt": "2009-02-13T23:31:30.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Email Link Clicked", - "properties": { - "eventId": "01E4C8BES5XT87ZWRJFTB35YJ3", - "deliveryId": "RPILAgABcRhIBqSp7kiPekGBIeVh", - "actionId": 36, - "broadcastId": 9, - "emailSubject": "hello", - "link": { - "url": "http://google.com", - "id": 1 - } - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T20:25:48.000Z", - "sentAt": "2020-03-26T20:25:48.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Email Sent", - "properties": { - "eventId": "01E2EMRMM6TZ12TF9WGZN0WJQT", - "deliveryId": "RAECAAFwnUSneIa0ZXkmq8EdkAM==", - "actionId": 42, - "content": "Welcome to the club, we are with you.", - "emailSubject": "Thanks for signing up", - "campaignId": 23 - }, - "userId": "user-123", - "originalTimestamp": "2022-02-07T09:58:57.000Z", - "sentAt": "2022-02-07T09:58:57.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "cioId": "7ef807109981", - "email": "test@example.com" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Email Delivered", - "properties": { - "eventId": "01ER4R5WB62QWCNREKFB4DYXGR", - "deliveryId": "REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==", - "emailSubject": "Thanks for signing up", - "transactionalMessageId": 2 - }, - "userId": "user-123", - "originalTimestamp": "2023-01-31T20:26:59.000Z", - "sentAt": "2023-01-31T20:26:59.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Push Attempted", - "properties": { - "eventId": "01E4VSX8SZ0T9AQMH4Q16NRB89", - "deliveryId": "RAEABQFxN56fWzydfV4_EGvfobI=", - "actionId": 38, - "reason": "NoDevicesSynced", - "campaignId": 6 - }, - "userId": "0200102", - "originalTimestamp": "2020-04-01T21:21:15.000Z", - "sentAt": "2020-04-01T21:21:15.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Push Sent", - "properties": { - "eventId": "01E4C4HDQ7P1X9KTKF0ZX7PWHE", - "deliveryId": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", - "actionId": 37, - "broadcastId": 9, - "recipients": [ - { - "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof", - "device_platform": "android" - } - ] - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:19:10.000Z", - "sentAt": "2020-03-26T19:19:10.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Push Link Clicked", - "properties": { - "eventId": "01E4V2SBHYK4TNTG8WKMP39G9R", - "deliveryId": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", - "actionId": 37, - "broadcastId": 9, - "link": { - "url": "ciosas://product/2", - "id": 1 - }, - "recipients": [ - { - "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" - } - ] - }, - "userId": "0200102", - "originalTimestamp": "2020-04-01T14:37:09.000Z", - "sentAt": "2020-04-01T14:37:09.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "SMS Attempted", - "properties": { - "eventId": "01E4F3DCS83P8HT7R3E6DWQN1X", - "deliveryId": "ROk1AAIBcR4iT6mueuxiDtzO8HXv", - "actionId": 41, - "reason": "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309.", - "campaignId": 7 - }, - "userId": "0200102", - "originalTimestamp": "2009-02-13T23:31:30.000Z", - "sentAt": "2009-02-13T23:31:30.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "+18008675309" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "SMS Link Clicked", - "properties": { - "eventId": "01E4XXPN42JDF4B1ATQKTZ8WHV", - "deliveryId": "RPILAgIBcRh6qzHz-8gKvscP2UZa", - "actionId": 38, - "broadcastId": 9, - "link": { - "url": "https://app.com/verify", - "id": 1 - } - }, - "userId": "0200102", - "originalTimestamp": "2020-04-02T17:06:01.000Z", - "sentAt": "2020-04-02T17:06:01.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "#signups" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Slack Message Sent", - "properties": { - "eventId": "01E4C4TQKD6KJ274870J5DE2HB", - "deliveryId": "RPILAgQBcRhNAufb0s30bmz5HD7Y", - "actionId": 39, - "broadcastId": 9 - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:24:15.000Z", - "sentAt": "2020-03-26T19:24:15.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "#signups" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Slack Message Link Clicked", - "properties": { - "eventId": "01E4C6HJTBNDX18XC4B88M3Y2G", - "deliveryId": "RPILAgQBcRhocpCJE3mFfwvRzNe6", - "actionId": 39, - "broadcastId": 9, - "link": { - "url": "http://bing.com", - "id": 1 - } - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:54:11.000Z", - "sentAt": "2020-03-26T19:54:11.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Slack Message Failed", - "properties": { - "eventId": "01E4C4HDQ77BCN0X23Z3WBE764", - "deliveryId": "RPILAgQBcRhIBqRiZAc0fyQiLvkC", - "actionId": 39, - "broadcastId": 9, - "reason": "value passed for channel was invalid" - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:19:10.000Z", - "sentAt": "2020-03-26T19:19:10.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Webhook Message Drafted", - "properties": { - "eventId": "01E4C4G1S04QCV1NASF4NWMQNR", - "deliveryId": "RPILAgEBcRhIBqSrYcXDr2ks6Pj9", - "actionId": 40, - "broadcastId": 9 - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:18:25.000Z", - "sentAt": "2020-03-26T19:18:25.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Webhook Message Attempted", - "properties": { - "eventId": "01E4TYA2KA9T0XGHCRJ784B774", - "deliveryId": "RAECAQFxNeUBx6LqgjqrN1j-BJc=", - "actionId": 38, - "broadcastId": 6, - "reason": "Variable 'customer.test' is missing" - }, - "userId": "0200102", - "originalTimestamp": "2020-04-01T13:18:54.000Z", - "sentAt": "2020-04-01T13:18:54.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "https://test.example.com/process" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Webhook Message Sent", - "properties": { - "eventId": "01E4C6EP0HCKRHKFARMZ5XEH7A", - "deliveryId": "RPILAgEBcRhNAufr2aU82jtDZEh6", - "actionId": 40, - "broadcastId": 9 - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:52:37.000Z", - "sentAt": "2020-03-26T19:52:37.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - }, - "traits": { - "email": "https://test.example.com/process" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Webhook Message Link Clicked", - "properties": { - "eventId": "01E4C6F5N1Y54TVGJTN64Y1ZS9", - "deliveryId": "RPILAgEBcRhNAufr2aU82jtDZEh6", - "actionId": 40, - "broadcastId": 9, - "link": { - "url": "http://bing.com", - "id": 1 - } - }, - "userId": "0200102", - "originalTimestamp": "2020-03-26T19:52:53.000Z", - "sentAt": "2020-03-26T19:52:53.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Webhook Message Failed", - "properties": { - "eventId": "01E4TY5FVB0ZQ4KVDKRME0XSYZ", - "deliveryId": "RAECAQFxNeK3bC4SYqhQqFGBQrQ=", - "actionId": 38, - "broadcastId": 6, - "reason": "HTTP 404 Not Found []" - }, - "userId": "0200102", - "originalTimestamp": "2020-04-01T13:16:24.000Z", - "sentAt": "2020-04-01T13:16:24.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Customer.io" - } - }, - "integrations": { - "Customer.io": false - }, - "type": "track", - "event": "Push Delivered", - "properties": { - "eventId": "01E4V2SBHYK4TNTG8WKMP39G9S", - "deliveryId": "RPILAgUBcRhIBqSfeiIwdIYJKxTY", - "actionId": 37, - "broadcastId": 9, - "link": { - "url": "ciosas://product/2", - "id": 1 - }, - "recipients": [ - { - "device_id": "eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof" - } - ] - }, - "userId": "0200102", - "originalTimestamp": "2020-04-01T14:37:10.000Z", - "sentAt": "2020-04-01T14:37:10.000Z" - } -] diff --git a/test/__tests__/data/formsort_source.json b/test/__tests__/data/formsort_source.json deleted file mode 100644 index d94cfd677b..0000000000 --- a/test/__tests__/data/formsort_source.json +++ /dev/null @@ -1,94 +0,0 @@ -[ - { - "description": "when we receive finalized as false", - "input": { - "answers": { - "yes": true, - "enter_email": "test@user.com", - "enter_name": "2022-11-17", - "yes_or_no": false - }, - "responder_uuid": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", - "flow_label": "new-flow-2022-11-25", - "variant_label": "main", - "variant_uuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea", - "finalized": false, - "created_at": "2022-11-25T14:41:22+00:00" - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Formsort" - }, - "page": { - "title": "new-flow-2022-11-25" - }, - "variantLabel": "main", - "variantUuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea" - }, - "integrations": { - "Formsort": false - }, - "type": "track", - "userId": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", - "originalTimestamp": "2022-11-25T14:41:22+00:00", - "properties": { - "yes": true, - "enter_email": "test@user.com", - "enter_name": "2022-11-17", - "yes_or_no": false - }, - "event": "FlowLoaded" - } - }, - { - "description": "when we receive finalized as true", - "input": { - "answers": { - "yes": true, - "enter_email": "test@user.com", - "enter_name": "2022-11-17", - "yes_or_no": false - }, - "responder_uuid": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", - "flow_label": "new-flow-2022-11-25", - "variant_label": "main", - "variant_uuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea", - "finalized": true, - "created_at": "2022-11-25T14:41:22+00:00" - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Formsort" - }, - "page": { - "title": "new-flow-2022-11-25" - }, - "variantLabel": "main", - "variantUuid": "0828efa7-7215-4e7d-a7ab-6c1079010cea" - }, - "integrations": { - "Formsort": false - }, - "type": "track", - "userId": "66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7", - "originalTimestamp": "2022-11-25T14:41:22+00:00", - "properties": { - "yes": true, - "enter_email": "test@user.com", - "enter_name": "2022-11-17", - "yes_or_no": false - }, - "event": "FlowFinalized" - } - } -] diff --git a/test/__tests__/data/gainsightpx_source.json b/test/__tests__/data/gainsightpx_source.json deleted file mode 100644 index 438d1d0cf6..0000000000 --- a/test/__tests__/data/gainsightpx_source.json +++ /dev/null @@ -1,1519 +0,0 @@ -[ - { - "description": "Identify Call", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "SIGN_UP", - "eventId": "1283c08b-f290-4bc4-9deb-75c7867d69ee", - "propertyKey": "AP-EOXPSEZGC5LA-2-1", - "date": 1665582808376, - "sessionId": "AP-EOXPSEZGC5LA-2-1665582441084-16821368", - "globalContext": {}, - "userType": "USER" - }, - "configId": "32f07727-d231-4c9d-881e-fb50b80bad63" - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "identify", - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "score": 0, - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "id": "New!", - "country": "India", - "account": { - "id": "IBM", - "name": "International Business Machine", - "numberOfEmployees": 0, - "numberOfUsers": 0 - } - }, - "userId": "New!", - "createdAt": "2022-10-12T13:53:11.753Z", - "originalTimestamp": "2022-10-12T13:53:11.753Z" - } - }, - { - "description": "Custom Track Call ", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "CUSTOM", - "eventId": "df58cbd6-2736-4f8a-ad26-6049eac2e150", - "propertyKey": "AP-EOXPSEZGC5LA-2-1", - "date": 1665656881448, - "sessionId": "AP-EOXPSEZGC5LA-2-1665656622955-48127533", - "globalContext": {}, - "userType": "USER", - "eventName": "Product Clicked", - "attributes": { - "Audience Size": 5000, - "name": "TESTing TRACK CALL FIRST", - "Launched date": 1520532660000, - "Launched": true - }, - "url": "http://127.0.0.1:5501/GPXTEST2.html", - "referrer": "", - "remoteHost": "122.161.66.140" - }, - "configId": "32f07727-d231-4c9d-881e-fb50b80bad63" - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "ip": "122.161.66.140", - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-EOXPSEZGC5LA-2-1", - "Audience Size": 5000, - "name": "TESTing TRACK CALL FIRST", - "Launched date": 1520532660000, - "Launched": true, - "ip": "122.161.66.140", - "url": "http://127.0.0.1:5501/GPXTEST2.html" - }, - "userId": "New!", - "category": "CUSTOM", - "event": "Product Clicked", - "sentAt": "2022-10-13T10:28:01.448Z", - "originalTimestamp": "2022-10-13T10:28:01.448Z" - } - }, - { - "description": "Feedback Track Call ", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "FEEDBACK", - "eventId": "d007bd76-decb-4a77-8456-d84fb15c6a83", - "propertyKey": "AP-E9VUBBLZ6BIS-2-1", - "date": 1665415753621, - "sessionId": "AP-E9VUBBLZ6BIS-2-1665415678379-45445457", - "globalContext": null, - "userType": "USER", - "subject": "feedback title", - "category": "Labels test", - "description": "feedback body", - "labels": ["492120f5-3573-11ec-bef0-42010a800545"], - "remoteHost": "122.161.66.140", - "source": "Knowledge Center Bot" - }, - "configId": "32f07727-d231-4c9d-881e-fb50b80bad63" - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ], - "ip": "122.161.66.140" - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-E9VUBBLZ6BIS-2-1", - "feedback": { - "labels": ["492120f5-3573-11ec-bef0-42010a800545"], - "description": "feedback body", - "subject": "feedback title", - "source": "Knowledge Center Bot" - }, - "ip": "122.161.66.140" - }, - "userId": "New!", - "category": "FEEDBACK", - "event": "Labels test", - "sentAt": "2022-10-10T15:29:13.621Z", - "originalTimestamp": "2022-10-10T15:29:13.621Z" - } - }, - { - "description": "Feature Match Track Call ", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "FEATURE_MATCH", - "eventId": "ae1e5538-1736-4088-86d1-e90a10ffe901-05951b40-944f-4052-9a4a-51c74683f658", - "propertyKey": "AP-8MF5LPSWUBFW-2-1", - "date": 1665582808376, - "sessionId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", - "globalContext": { - "role": "Admin" - }, - "userType": "USER", - "featureId": "05951b40-944f-4052-9a4a-51c74683f658", - "featureName": "Charts" - } - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-8MF5LPSWUBFW-2-1", - "globalContext": { - "role": "Admin" - }, - "featureId": "05951b40-944f-4052-9a4a-51c74683f658" - }, - "userId": "New!", - "category": "FEATURE_MATCH", - "event": "Charts", - "sentAt": "2022-10-12T13:53:28.376Z", - "originalTimestamp": "2022-10-12T13:53:28.376Z" - } - }, - { - "description": "Segment Match Track Call and no userId and yes anonymousId as event.sessionId", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "SEGMENT", - "eventId": "ddb9ca94-beb1-449c-bdcd-b53190f8e784", - "propertyKey": "AP-8MF5LPSWUBFW-2-1", - "date": 1665582808376, - "sessionId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", - "globalContext": { - "role": "Admin" - }, - "userType": "USER", - "segmentId": "e3ab2e48-24f9-4602-ab92-b9f1f4343845", - "segmentName": "Linux User" - } - }, - "output": { - "anonymousId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-8MF5LPSWUBFW-2-1", - "globalContext": { - "role": "Admin" - }, - "segmentId": "e3ab2e48-24f9-4602-ab92-b9f1f4343845" - }, - "category": "SEGMENT", - "event": "Linux User", - "sentAt": "2022-10-12T13:53:28.376Z", - "originalTimestamp": "2022-10-12T13:53:28.376Z" - } - }, - { - "description": "No Match Track Call ", - "input": { - "event": { - "eventType": "Unavailable", - "eventId": "ddb9ca94-beb1-449c-bdcd-b53190f8e784", - "propertyKey": "AP-8MF5LPSWUBFW-2-1", - "date": 1601303075964, - "sessionId": "AP-8MF5LPSWUBFW-2-1601303023809-98881162", - "globalContext": { - "role": "Admin" - }, - "userType": "USER", - "segmentId": "e3ab2e48-24f9-4602-ab92-b9f1f4343845", - "segmentName": "Linux User" - } - }, - "output": { - "error": "Event type Unavailable not supported" - } - }, - { - "description": "Survey Track Call -> Multi Question Survey ", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "SURVEY", - "eventId": "c9883e3b-05d4-4f96-8b9c-e2ce10430493", - "propertyKey": "AP-N6SV00EVMR1E-2-1", - "date": 1601303075964, - "sessionId": "AP-N6SV00EVMR1E-2-1605265939566-23853426", - "globalContext": { - "role": "Admin" - }, - "userType": "EMPTY_USER_TYPE", - "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", - "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", - "engagementName": "Quarterly Survey", - "surveyType": "Multi Question", - "interaction": "SINGLE_STEP_SURVEY_RESPONDED", - "score": 0, - "activation": "Auto", - "executionId": "1ad2d383-d1fa-425d-84f0-2a531e17a5d9", - "executionDate": 1605265939965, - "questionType": "Multi choice", - "questionId": "de9e6bf1-351c-46ec-907d-c985bd420c2b", - "questionHtml": "
Favorite travel destinations
", - "questionText": "Favorite travel destinations", - "answers": [ - { - "answerId": "563e2103-2906-4088-869f-bcccd185f288", - "answerHtml": "
Europe
", - "answerText": "Europe" - } - ] - } - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-N6SV00EVMR1E-2-1", - "globalContext": { - "role": "Admin" - }, - "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", - "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", - "surveyType": "Multi Question", - "interaction": "SINGLE_STEP_SURVEY_RESPONDED", - "survey": { - "activation": "Auto", - "questionType": "Multi choice", - "score": 0, - "questionId": "de9e6bf1-351c-46ec-907d-c985bd420c2b", - "questionHtml": "
Favorite travel destinations
", - "questionText": "Favorite travel destinations", - "answers": [ - { - "answerId": "563e2103-2906-4088-869f-bcccd185f288", - "answerHtml": "
Europe
", - "answerText": "Europe" - } - ] - } - }, - "userId": "New!", - "category": "SURVEY", - "event": "Quarterly Survey", - "sentAt": "2020-09-28T14:24:35.964Z", - "originalTimestamp": "2020-09-28T14:24:35.964Z" - } - }, - { - "description": "Survey Track Call -> NPS ", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "SURVEY", - "eventId": "c9883e3b-05d4-4f96-8b9c-e2ce10430493", - "propertyKey": "AP-N6SV00EVMR1E-2-1", - "date": 1601303075964, - "sessionId": "AP-N6SV00EVMR1E-2-1605265939566-23853426", - "globalContext": { - "role": "Admin" - }, - "userType": "EMPTY_USER_TYPE", - "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", - "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", - "engagementName": "Quarterly Survey", - "surveyType": "Multi Question", - "interaction": "SINGLE_STEP_SURVEY_RESPONDED", - "score": 0, - "scoreType": null, - "stepNumber": null, - "userInput": "I like new features", - "activation": "Auto", - "executionId": "1ad2d383-d1fa-425d-84f0-2a531e17a5d9", - "executionDate": 1605265939965, - "questionType": "Open text question", - "questionHtml": "
\n
\n How was your experience?\n
\n
\n", - "questionText": "How was your experience?" - } - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-N6SV00EVMR1E-2-1", - "globalContext": { - "role": "Admin" - }, - "engagementId": "e5362226-75da-4ef6-999a-823727e3d7a7", - "contentType": "IN_APP_MULTIPLE_QUESTION_SURVEY", - "surveyType": "Multi Question", - "interaction": "SINGLE_STEP_SURVEY_RESPONDED", - "survey": { - "activation": "Auto", - "userInput": "I like new features", - "questionType": "Open text question", - "score": 0, - "questionHtml": "
\n
\n How was your experience?\n
\n
\n", - "questionText": "How was your experience?" - } - }, - "userId": "New!", - "category": "SURVEY", - "event": "Quarterly Survey", - "sentAt": "2020-09-28T14:24:35.964Z", - "originalTimestamp": "2020-09-28T14:24:35.964Z" - } - }, - { - "description": "Engagement Track Call ", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "ENGAGEMENT", - "eventId": "6494e73a-976b-4ee5-b8a8-de9effff7e80", - "propertyKey": "AP-N6SV00EVMR1E-2-1", - "date": 1605262539389, - "sessionId": "AP-N6SV00EVMR1E-2-1605262502068-24197555", - "globalContext": { - "role": "Admin" - }, - "userType": "EMPTY_USER_TYPE", - "contentType": "IN_APP_DIALOG", - "engagementId": "83c30d4e-88c3-4054-a0fa-33451a6ea7fc", - "engagementType": "Dialog", - "engagementName": "Release Announcement", - "interaction": "VIEWED", - "stepNumber": 1, - "activation": "Auto", - "executionId": "b633945f-d4a5-404a-ae39-5ced5b542240", - "executionDate": 1605262539389 - } - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-N6SV00EVMR1E-2-1", - "engagementId": "83c30d4e-88c3-4054-a0fa-33451a6ea7fc", - "contentType": "IN_APP_DIALOG", - "engagementType": "Dialog", - "interaction": "VIEWED", - "globalContext": { - "role": "Admin" - }, - "engagement": { - "stepNumber": 1, - "activation": "Auto" - } - }, - "userId": "New!", - "category": "ENGAGEMENT", - "event": "Release Announcement", - "sentAt": "2020-11-13T10:15:39.389Z", - "originalTimestamp": "2020-11-13T10:15:39.389Z" - } - }, - { - "description": "SegmentIO S2S Track Call ", - "input": { - "user": { - "aptrinsicId": "cab9c469-8602-4933-acdb-68338fbb9ab1", - "identifyId": "New!", - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "lastSeenDate": 1665582808669, - "signUpDate": 1665582791753, - "firstVisitDate": 1665582791753, - "title": "Mr.", - "phone": "", - "score": 0, - "role": "", - "subscriptionId": "", - "accountId": "IBM", - "numberOfVisits": 1, - "location": { - "countryName": "India", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665582808376, - "lastModifiedDate": 1665582808717, - "customAttributes": null, - "globalUnsubscribe": false, - "sfdcContactId": "", - "lastVisitedUserAgentData": null, - "id": "New!", - "lastInferredLocation": null - }, - "account": { - "id": "IBM", - "name": "International Business Machine", - "trackedSubscriptionId": "", - "sfdcId": "", - "lastSeenDate": 1665582808669, - "dunsNumber": "", - "industry": "", - "numberOfEmployees": 0, - "sicCode": "", - "website": "", - "naicsCode": "", - "plan": "", - "location": { - "countryName": "", - "countryCode": "", - "stateName": "", - "stateCode": "", - "city": "", - "street": "", - "postalCode": "", - "continent": "", - "regionName": "", - "timeZone": "", - "coordinates": { - "latitude": 0, - "longitude": 0 - } - }, - "numberOfUsers": 0, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "createDate": 1665578567565, - "lastModifiedDate": 1665582808669, - "customAttributes": null, - "parentGroupId": "" - }, - "event": { - "eventType": "SEGMENT_IO", - "eventId": "ajs-next-69810a17571dc115ccead5281cc3fb7d", - "propertyKey": "AP-EOXPSEZGC5LA-2-1", - "date": 1666687235178, - "sessionId": "31a524fa-1490-48db-9600-adfb1fa95333", - "globalContext": {}, - "userType": "USER", - "segmentIOEvent": { - "pxPropertyKey": "AP-EOXPSEZGC5LA-2", - "type": "group", - "userId": "1001", - "anonymousId": "a4303a13-eb10-46d8-8935-d787daf1cfbd", - "context": { - "ip": "122.161.67.121", - "library": { - "name": "analytics.js", - "version": "next-1.45.0" - }, - "locale": "en-GB", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", - "page": { - "path": "/abc.html", - "title": "Engage Testing", - "url": "http://127.0.0.1:5501/abc.html" - } - }, - "messageId": "ajs-next-69810a17571dc115ccead5281cc3fb7d", - "receivedAt": "2022-10-25T08:40:35.184Z", - "sentAt": "2022-10-25T08:40:34.809Z", - "timestamp": "2022-10-25T08:40:35.178Z", - "traits": { - "name": "International Business Machine" - }, - "version": 2, - "channel": "client", - "groupId": "IBM" - } - } - }, - "output": { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "GAINSIGHTPX" - }, - "traits": { - "type": "USER", - "gender": "EMPTY_GENDER", - "email": "userEmail@address.com", - "firstName": "test", - "lastName": "rudderlabs", - "title": "Mr.", - "globalUnsubscribe": false, - "accountId": "IBM", - "numberOfVisits": 1, - "propertyKeys": ["AP-EOXPSEZGC5LA-2-1"], - "score": 0, - "id": "New!", - "country": "India", - "account": { - "numberOfEmployees": 0, - "numberOfUsers": 0, - "id": "IBM", - "name": "International Business Machine" - } - }, - "externalId": [ - { - "type": "gainsightpxAptrinsicId", - "id": "cab9c469-8602-4933-acdb-68338fbb9ab1" - } - ] - }, - "integrations": { - "GAINSIGHTPX": false - }, - "type": "track", - "properties": { - "propertyKey": "AP-EOXPSEZGC5LA-2-1", - "pxPropertyKey": "AP-EOXPSEZGC5LA-2", - "type": "group", - "userId": "1001", - "anonymousId": "a4303a13-eb10-46d8-8935-d787daf1cfbd", - "context": { - "ip": "122.161.67.121", - "library": { - "name": "analytics.js", - "version": "next-1.45.0" - }, - "locale": "en-GB", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36", - "page": { - "path": "/abc.html", - "title": "Engage Testing", - "url": "http://127.0.0.1:5501/abc.html" - } - }, - "messageId": "ajs-next-69810a17571dc115ccead5281cc3fb7d", - "receivedAt": "2022-10-25T08:40:35.184Z", - "sentAt": "2022-10-25T08:40:34.809Z", - "timestamp": "2022-10-25T08:40:35.178Z", - "traits": { - "name": "International Business Machine" - }, - "version": 2, - "channel": "client", - "groupId": "IBM" - }, - "userId": "New!", - "category": "SEGMENT_IO", - "event": "SegmentIO Cloud Server", - "sentAt": "2022-10-25T08:40:35.178Z", - "originalTimestamp": "2022-10-25T08:40:35.178Z" - } - } -] diff --git a/test/__tests__/data/iterable_source_input.json b/test/__tests__/data/iterable_source_input.json deleted file mode 100644 index 798b0818c1..0000000000 --- a/test/__tests__/data/iterable_source_input.json +++ /dev/null @@ -1,600 +0,0 @@ -[ - { - "email": "test@rudderstack.com", - "eventName": "emailSubscribe", - "dataFields": { - "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", - "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", - "signupSource": "WebForm", - "email": "test@rudderstack.com", - "createdAt": "2022-04-19 03:33:50 +00:00", - "messageTypeIds": [], - "emailListIds": [1589748], - "channelIds": [] - } - }, - { - "eventName": "emailSubscribe", - "dataFields": { - "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", - "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", - "signupSource": "WebForm", - "email": "test@abcd.com", - "createdAt": "2022-04-19 03:33:50 +00:00", - "messageTypeIds": [], - "emailListIds": [1589748], - "channelIds": [] - } - }, - { - "email": "test@ruddstack.com", - "eventTitle": "smsReceived", - "dataFields": { - "fromPhoneNumber": "+16503926753", - "toPhoneNumber": "+14155824541", - "smsMessage": "Message text", - "email": "docs@iterable.com", - "createdAt": "2016-12-05 22:51:25 +00:00" - } - }, - { - "email": "test@rudderstack.com", - "eventName": "inAppSendSkip" - }, - { - "email": "test@rudderstack.com", - "eventName": "emailSend", - "dataFields": { - "contentId": 331201, - "email": "test@rudderstack.com", - "createdAt": "2016-12-02 20:21:04 +00:00", - "campaignId": 59667, - "templateId": 93849, - "messageId": "d0aa7801f91f4824997a631f3ed583c3", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c59667:t93849:docs@iterable.com" - } - }, - { - "email": "invalid_email@iterable.com", - "eventName": "emailBounce", - "dataFields": { - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2598, - "messageTypeId": 2870, - "experimentId": null, - "recipientState": "HardBounce", - "templateId": 167484, - "email": "invalid_email@iterable.com", - "createdAt": "2017-05-15 23:59:47 +00:00", - "campaignId": 114746, - "messageId": "d0aa7801f91f4824997a631f3ed583c3", - "emailId": "c114746:t167484:invalid_email@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "emailClick", - "dataFields": { - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36", - "ip": "162.245.22.184", - "templateId": 93849, - "userAgentDevice": "Mac", - "url": "https://www.iterable.com", - "canonicalUrlId": "3145668988", - "city": "San Francisco", - "region": "CA", - "email": "docs@iterable.com", - "createdAt": "2016-12-02 20:31:39 +00:00", - "campaignId": 59667, - "messageId": "d0aa7801f91f4824997a631f3ed583c3", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "linkUrl": "https://www.iterable.com", - "linkId": "3145668988", - "emailId": "c59667:t93849:docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "emailComplaint", - "dataFields": { - "recipientState": "Complaint", - "templateId": 79190, - "email": "docs@iterable.com", - "createdAt": "2016-12-09 18:52:19 +00:00", - "campaignId": 49313, - "messageId": "d3c44d47b4994306b4db8d16a94db025", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "test template", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c49313:t79190:docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "emailOpen", - "dataFields": { - "userAgent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", - "proxySource": "Gmail", - "ip": "66.249.84.204", - "templateId": 79190, - "device": "Gmail", - "email": "docs@iterable.com", - "createdAt": "2016-12-02 18:51:45 +00:00", - "campaignId": 49313, - "messageId": "210badf49fe54f2591d64ad0d055f4fb", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c49313:t79190:docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "emailSendSkip", - "dataFields": { - "createdAt": "2019-08-07 18:56:10 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 721398, - "messageId": "98430abe1b9842c991ce221010121553", - "email": "docs@iterable.com" - } - }, - { - "email": "test@rudderstack.com", - "eventName": "emailSubscribe", - "dataFields": { - "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", - "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", - "signupSource": "WebForm", - "email": "test@abcd.com", - "createdAt": "2022-04-19 03:33:50 +00:00", - "messageTypeIds": [], - "emailListIds": [1589748], - "channelIds": [] - } - }, - { - "email": "docs@iterable.com", - "eventName": "emailUnSubscribe", - "dataFields": { - "campaignId": 1089024, - "messageId": "bf008db8ab194b65816398c05bf30f99", - "emailId": "c1089024:t1526112:docs@iterable.com", - "workflowName": "My test workflow", - "messageTypeIds": [], - "locale": null, - "templateId": 1526112, - "emailSubject": "Upcoming events!", - "labels": [], - "unsubSource": "EmailLink", - "createdAt": "2020-03-20 23:34:15 +00:00", - "templateName": "My test template", - "emailListIds": [], - "messageTypeId": 31082, - "experimentId": null, - "channelIds": [27447], - "campaignName": "My test campaign", - "workflowId": 76786, - "email": "docs@iterable.com", - "channelId": 27447 - } - }, - { - "email": "docs@iterable.com", - "userId": "1", - "eventName": "hostedUnsubscribeClick", - "dataFields": { - "country": "United States", - "city": "San Jose", - "campaignId": 1074721, - "ip": "192.168.0.1", - "userAgentDevice": "Mac", - "messageId": "ceb3d4d929fc406ca93b28a0ef1efff1", - "emailId": "c1074721:t1506266:docs@iterable.com", - "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", - "workflowName": "My workflow", - "locale": null, - "templateId": 1506266, - "emailSubject": "My email subject", - "url": "https://iterable.com", - "labels": [], - "createdAt": "2020-03-21 00:24:08 +00:00", - "templateName": "My email template", - "messageTypeId": 13406, - "experimentId": null, - "region": "CA", - "campaignName": "My email campaign", - "workflowId": 60102, - "email": "docs@iterable.com", - "channelId": 12466 - } - }, - { - "email": "docs@iterable.com", - "eventName": "inAppClick", - "dataFields": { - "email": "docs@iterable.com", - "createdAt": "2018-03-27 00:44:40 +00:00", - "campaignId": 269450 - } - }, - { - "email": "docs@iterable.com", - "eventName": "inAppOpen", - "dataFields": { - "email": "docs@iterable.com", - "createdAt": "2018-03-27 00:44:30 +00:00", - "campaignId": 269450 - } - }, - { - "email": "docs@iterable.com", - "eventName": "inAppSend", - "dataFields": { - "messageContext": { - "saveToInbox": false, - "trigger": "immediate" - }, - "campaignId": 732678, - "contentId": 18997, - "messageId": "vA16d48VVi4LQ5hMuZuquKzL0BXTdQJJUMJRjKnL1", - "workflowName": null, - "emailId": "c732678:t1032729:docs@iterable.com", - "locale": null, - "templateId": 1032729, - "inAppBody": "", - "email": "docs@iterable.com", - "createdAt": "2016-12-10 01:00:38 +00:00", - "campaignId": 74768, - "templateId": 113554, - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2203, - "messageTypeId": 2439, - "experimentId": null, - "payload": { - "path": "yourpath/subpath" - }, - "sound": "", - "badge": null, - "contentAvailable": false, - "deeplink": null, - "locale": null - } - }, - { - "email": "docs@iterable.com", - "eventName": "pushOpen", - "dataFields": { - "appAlreadyRunning": false, - "email": "docs@iterable.com", - "createdAt": "2016-12-08 01:25:22 +00:00", - "campaignId": 74768, - "templateId": 113554, - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2203, - "messageTypeId": 2439, - "experimentId": null, - "payload": { - "path": "shop_home" - }, - "sound": null, - "badge": null, - "contentAvailable": false, - "deeplink": null, - "locale": null - } - }, - { - "email": "docs@iterable.com", - "eventName": "pushSend", - "dataFields": { - "contentId": 6724, - "platformEndpoint": "", - "email": "docs@iterable.com", - "createdAt": "2016-12-08 00:53:11 +00:00", - "campaignId": 74758, - "templateId": 113541, - "messageId": "73f2d3f13cd04db0b56c6143b179adc5", - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 1744, - "messageTypeId": 1759, - "experimentId": null, - "payload": { - "a": "2" - }, - "sound": "", - "badge": "", - "contentAvailable": false, - "deeplink": null, - "locale": null - } - }, - { - "email": "docs@iterable.com", - "eventName": "pushSendSkip", - "dataFields": { - "createdAt": "2019-08-07 22:28:51 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 732667, - "messageId": "8306ae0c74324635b7554947c5ec0e56", - "email": "docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "pushUninstall", - "dataFields": { - "isGhostPush": false, - "platformEndpoint": "", - "email": "docs@iterable.com", - "createdAt": "2016-12-09 20:50:54 +00:00", - "campaignId": 74768, - "templateId": 113554, - "messageId": "73f2d3f13cd04db0b56c6143b179adc5", - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2203, - "messageTypeId": 2439, - "experimentId": null, - "payload": { - "path": "your_folder/30" - }, - "sound": "", - "badge": null, - "contentAvailable": false, - "deeplink": null, - "locale": null - } - }, - { - "email": "docs@iterable.com", - "eventName": "smsBounce", - "dataFields": { - "smsProviderResponse": { - "status": 404, - "message": "The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found", - "code": 20404, - "more_info": "https://www.twilio.com/docs/errors/20404" - }, - "email": "docs@iterable.com", - "createdAt": "2016-12-05 22:43:24 +00:00", - "campaignId": 74003, - "templateId": 112561, - "smsMessage": "Here is example message, please respond with 'received'", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 4270, - "messageTypeId": 4769, - "experimentId": null, - "fromPhoneNumberId": 268, - "imageUrl": null, - "locale": null, - "emailId": "c74003:t112561:docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "smsClick", - "dataFields": { - "campaignId": 1234567, - "campaignName": "My test campaign", - "workflowId": null, - "workflowName": null, - "templateName": "My template", - "locale": null, - "channelId": 98765, - "messageTypeId": 43210, - "experimentId": null, - "labels": [], - "smsMessage": "Test SMS! https://www.example.com", - "fromPhoneNumberId": 1234, - "imageUrl": null, - "clickedUrl": "https://www.example.com", - "email": "docs@iterable.com", - "createdAt": "2022-03-10 05:00:14 +00:00", - "templateId": 1112222, - "messageId": "ebd8f3cfc1f74353b423c5e0f3dd8b39", - "emailId": "c1234567:t9876543:docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "smsReceived", - "dataFields": { - "fromPhoneNumber": "+16503926753", - "toPhoneNumber": "+14155824541", - "smsMessage": "Message text", - "email": "docs@iterable.com", - "createdAt": "2016-12-05 22:51:25 +00:00" - } - }, - { - "email": "docs@iterable.com", - "eventName": "smsSend", - "dataFields": { - "toPhoneNumber": "+16503926753", - "fromSMSSenderId": 258, - "contentId": 2086, - "email": "docs@iterable.com", - "createdAt": "2016-12-05 21:50:32 +00:00", - "campaignId": 73974, - "templateId": 112523, - "smsMessage": "Message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 4270, - "messageTypeId": 4769, - "experimentId": null, - "fromPhoneNumberId": 258, - "imageUrl": null, - "locale": null, - "emailId": "c73974:t112523:docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "smsSendSkip", - "dataFields": { - "createdAt": "2019-08-07 18:49:48 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 729390, - "messageId": "2c780bf42f26485db0fc6571d2e0f6a0", - "email": "docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "emailSend", - "dataFields": { - "contentId": 274222, - "email": "docs@iterable.com", - "createdAt": "2016-12-02 18:51:40 +00:00", - "campaignId": 49313, - "transactionalData": { - "__comment": "transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total." - }, - "templateId": 79190, - "messageId": "210badf49fe54f2591d64ad0d055f4fb", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c49313:t79190:docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "webPushSend", - "dataFields": { - "campaignId": 723636, - "browserToken": "cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b", - "contentId": 3681, - "messageId": "af4c726ae76b48c7871b6d0d7760d47c", - "workflowName": "My workflow name", - "emailId": "c723636:t1020396:docs@iterable.com", - "locale": null, - "webPushIcon": null, - "templateId": 1020396, - "labels": [], - "createdAt": "2019-08-07 23:43:02 +00:00", - "templateName": "My template name", - "webPushMessage": "", - "messageTypeId": 9106, - "webPushBody": null, - "experimentId": null, - "webPushClickAction": null, - "campaignName": "My campaign name", - "workflowId": 53505, - "channelId": 8539, - "email": "docs@iterable.com" - } - }, - { - "email": "docs@iterable.com", - "eventName": "webPushSendSkip", - "dataFields": { - "createdAt": "2019-08-07 23:43:48 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 723636, - "messageId": "4238c918b20a41dfbe9a910275b76f12", - "email": "docs@iterable.com" - } - } -] diff --git a/test/__tests__/data/iterable_source_output.json b/test/__tests__/data/iterable_source_output.json deleted file mode 100644 index b1ff817241..0000000000 --- a/test/__tests__/data/iterable_source_output.json +++ /dev/null @@ -1,1084 +0,0 @@ -[ - { - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "test@rudderstack.com" - } - }, - "event": "emailSubscribe", - "integrations": { - "Iterable": false - }, - "properties": { - "channelIds": [], - "createdAt": "2022-04-19 03:33:50 +00:00", - "emailListIds": [1589748], - "messageTypeIds": [], - "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", - "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", - "signupSource": "WebForm" - }, - "receivedAt": "2022-04-19T03:33:50.000Z", - "timestamp": "2022-04-19T03:33:50.000Z", - "type": "track" - }, - { - "message": "Unknwon event type from Iterable" - }, - { - "message": "Unknwon event type from Iterable" - }, - { - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "test@rudderstack.com" - } - }, - "event": "inAppSendSkip", - "integrations": { - "Iterable": false - }, - "type": "track", - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7" - }, - { - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "test@rudderstack.com" - } - }, - "event": "emailSend", - "integrations": { - "Iterable": false - }, - "properties": { - "contentId": 331201, - "createdAt": "2016-12-02 20:21:04 +00:00", - "campaignId": 59667, - "templateId": 93849, - "messageId": "d0aa7801f91f4824997a631f3ed583c3", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c59667:t93849:docs@iterable.com" - }, - "receivedAt": "2016-12-02T20:21:04.000Z", - "timestamp": "2016-12-02T20:21:04.000Z", - "type": "track" - }, - { - "userId": "b053765f5d0d23b0d5e4dd960be9513f", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "invalid_email@iterable.com" - } - }, - "event": "emailBounce", - "integrations": { - "Iterable": false - }, - "properties": { - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2598, - "messageTypeId": 2870, - "experimentId": null, - "recipientState": "HardBounce", - "templateId": 167484, - "createdAt": "2017-05-15 23:59:47 +00:00", - "campaignId": 114746, - "messageId": "d0aa7801f91f4824997a631f3ed583c3", - "emailId": "c114746:t167484:invalid_email@iterable.com" - }, - "receivedAt": "2017-05-15T23:59:47.000Z", - "timestamp": "2017-05-15T23:59:47.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "emailClick", - "integrations": { - "Iterable": false - }, - "properties": { - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36", - "ip": "162.245.22.184", - "templateId": 93849, - "userAgentDevice": "Mac", - "url": "https://www.iterable.com", - "canonicalUrlId": "3145668988", - "city": "San Francisco", - "region": "CA", - "createdAt": "2016-12-02 20:31:39 +00:00", - "campaignId": 59667, - "messageId": "d0aa7801f91f4824997a631f3ed583c3", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "linkUrl": "https://www.iterable.com", - "linkId": "3145668988", - "emailId": "c59667:t93849:docs@iterable.com" - }, - "receivedAt": "2016-12-02T20:31:39.000Z", - "timestamp": "2016-12-02T20:31:39.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "emailComplaint", - "integrations": { - "Iterable": false - }, - "properties": { - "recipientState": "Complaint", - "templateId": 79190, - "createdAt": "2016-12-09 18:52:19 +00:00", - "campaignId": 49313, - "messageId": "d3c44d47b4994306b4db8d16a94db025", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "test template", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c49313:t79190:docs@iterable.com" - }, - "receivedAt": "2016-12-09T18:52:19.000Z", - "timestamp": "2016-12-09T18:52:19.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "emailOpen", - "integrations": { - "Iterable": false - }, - "properties": { - "userAgent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", - "proxySource": "Gmail", - "ip": "66.249.84.204", - "templateId": 79190, - "device": "Gmail", - "createdAt": "2016-12-02 18:51:45 +00:00", - "campaignId": 49313, - "messageId": "210badf49fe54f2591d64ad0d055f4fb", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c49313:t79190:docs@iterable.com" - }, - "receivedAt": "2016-12-02T18:51:45.000Z", - "timestamp": "2016-12-02T18:51:45.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "emailSendSkip", - "integrations": { - "Iterable": false - }, - "properties": { - "createdAt": "2019-08-07 18:56:10 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 721398, - "messageId": "98430abe1b9842c991ce221010121553" - }, - "receivedAt": "2019-08-07T18:56:10.000Z", - "timestamp": "2019-08-07T18:56:10.000Z", - "type": "track" - }, - { - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "test@rudderstack.com" - } - }, - "event": "emailSubscribe", - "integrations": { - "Iterable": false - }, - "properties": { - "channelIds": [], - "createdAt": "2022-04-19 03:33:50 +00:00", - "emailListIds": [1589748], - "messageTypeIds": [], - "profileUpdatedAt": "2022-04-19 03:33:50 +00:00", - "publicIdString": "ad474bf7-e785-480f-b9d0-861b85ab5bf5", - "signupSource": "WebForm" - }, - "receivedAt": "2022-04-19T03:33:50.000Z", - "timestamp": "2022-04-19T03:33:50.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "emailUnSubscribe", - "integrations": { - "Iterable": false - }, - "properties": { - "campaignId": 1089024, - "messageId": "bf008db8ab194b65816398c05bf30f99", - "emailId": "c1089024:t1526112:docs@iterable.com", - "workflowName": "My test workflow", - "messageTypeIds": [], - "locale": null, - "templateId": 1526112, - "emailSubject": "Upcoming events!", - "labels": [], - "unsubSource": "EmailLink", - "createdAt": "2020-03-20 23:34:15 +00:00", - "templateName": "My test template", - "emailListIds": [], - "messageTypeId": 31082, - "experimentId": null, - "channelIds": [27447], - "campaignName": "My test campaign", - "workflowId": 76786, - "channelId": 27447 - }, - "receivedAt": "2020-03-20T23:34:15.000Z", - "timestamp": "2020-03-20T23:34:15.000Z", - "type": "track" - }, - { - "userId": "1", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "hostedUnsubscribeClick", - "integrations": { - "Iterable": false - }, - "properties": { - "country": "United States", - "city": "San Jose", - "campaignId": 1074721, - "ip": "192.168.0.1", - "userAgentDevice": "Mac", - "messageId": "ceb3d4d929fc406ca93b28a0ef1efff1", - "emailId": "c1074721:t1506266:docs@iterable.com", - "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", - "workflowName": "My workflow", - "locale": null, - "templateId": 1506266, - "emailSubject": "My email subject", - "url": "https://iterable.com", - "labels": [], - "createdAt": "2020-03-21 00:24:08 +00:00", - "templateName": "My email template", - "messageTypeId": 13406, - "experimentId": null, - "region": "CA", - "campaignName": "My email campaign", - "workflowId": 60102, - "channelId": 12466 - }, - "receivedAt": "2020-03-21T00:24:08.000Z", - "timestamp": "2020-03-21T00:24:08.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "inAppClick", - "integrations": { - "Iterable": false - }, - "properties": { - "createdAt": "2018-03-27 00:44:40 +00:00", - "campaignId": 269450 - }, - "receivedAt": "2018-03-27T00:44:40.000Z", - "timestamp": "2018-03-27T00:44:40.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "inAppOpen", - "integrations": { - "Iterable": false - }, - "properties": { - "createdAt": "2018-03-27 00:44:30 +00:00", - "campaignId": 269450 - }, - "receivedAt": "2018-03-27T00:44:30.000Z", - "timestamp": "2018-03-27T00:44:30.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "inAppSend", - "integrations": { - "Iterable": false - }, - "properties": { - "messageContext": { - "saveToInbox": false, - "trigger": "immediate" - }, - "campaignId": 732678, - "contentId": 18997, - "messageId": "vA16d48VVi4LQ5hMuZuquKzL0BXTdQJJUMJRjKnL1", - "workflowName": null, - "emailId": "c732678:t1032729:docs@iterable.com", - "locale": null, - "templateId": 1032729, - "inAppBody": "", - "createdAt": "2016-12-10 01:00:38 +00:00", - "campaignId": 74768, - "templateId": 113554, - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2203, - "messageTypeId": 2439, - "experimentId": null, - "payload": { - "path": "yourpath/subpath" - }, - "sound": "", - "badge": null, - "contentAvailable": false, - "deeplink": null, - "locale": null - }, - "receivedAt": "2016-12-10T01:00:38.000Z", - "timestamp": "2016-12-10T01:00:38.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "pushOpen", - "integrations": { - "Iterable": false - }, - "properties": { - "appAlreadyRunning": false, - "createdAt": "2016-12-08 01:25:22 +00:00", - "campaignId": 74768, - "templateId": 113554, - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2203, - "messageTypeId": 2439, - "experimentId": null, - "payload": { - "path": "shop_home" - }, - "sound": null, - "badge": null, - "contentAvailable": false, - "deeplink": null, - "locale": null - }, - "receivedAt": "2016-12-08T01:25:22.000Z", - "timestamp": "2016-12-08T01:25:22.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "pushSend", - "integrations": { - "Iterable": false - }, - "properties": { - "contentId": 6724, - "platformEndpoint": "", - "createdAt": "2016-12-08 00:53:11 +00:00", - "campaignId": 74758, - "templateId": 113541, - "messageId": "73f2d3f13cd04db0b56c6143b179adc5", - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 1744, - "messageTypeId": 1759, - "experimentId": null, - "payload": { - "a": "2" - }, - "sound": "", - "badge": "", - "contentAvailable": false, - "deeplink": null, - "locale": null - }, - "receivedAt": "2016-12-08T00:53:11.000Z", - "timestamp": "2016-12-08T00:53:11.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "pushSendSkip", - "integrations": { - "Iterable": false - }, - "properties": { - "createdAt": "2019-08-07 22:28:51 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 732667, - "messageId": "8306ae0c74324635b7554947c5ec0e56" - }, - "receivedAt": "2019-08-07T22:28:51.000Z", - "timestamp": "2019-08-07T22:28:51.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "pushUninstall", - "integrations": { - "Iterable": false - }, - "properties": { - "isGhostPush": false, - "platformEndpoint": "", - "createdAt": "2016-12-09 20:50:54 +00:00", - "campaignId": 74768, - "templateId": 113554, - "messageId": "73f2d3f13cd04db0b56c6143b179adc5", - "pushMessage": "Push message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 2203, - "messageTypeId": 2439, - "experimentId": null, - "payload": { - "path": "your_folder/30" - }, - "sound": "", - "badge": null, - "contentAvailable": false, - "deeplink": null, - "locale": null - }, - "receivedAt": "2016-12-09T20:50:54.000Z", - "timestamp": "2016-12-09T20:50:54.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "smsBounce", - "integrations": { - "Iterable": false - }, - "properties": { - "smsProviderResponse": { - "status": 404, - "message": "The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found", - "code": 20404, - "more_info": "https://www.twilio.com/docs/errors/20404" - }, - "createdAt": "2016-12-05 22:43:24 +00:00", - "campaignId": 74003, - "templateId": 112561, - "smsMessage": "Here is example message, please respond with 'received'", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 4270, - "messageTypeId": 4769, - "experimentId": null, - "fromPhoneNumberId": 268, - "imageUrl": null, - "locale": null, - "emailId": "c74003:t112561:docs@iterable.com" - }, - "receivedAt": "2016-12-05T22:43:24.000Z", - "timestamp": "2016-12-05T22:43:24.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "smsClick", - "integrations": { - "Iterable": false - }, - "properties": { - "campaignId": 1234567, - "campaignName": "My test campaign", - "workflowId": null, - "workflowName": null, - "templateName": "My template", - "locale": null, - "channelId": 98765, - "messageTypeId": 43210, - "experimentId": null, - "labels": [], - "smsMessage": "Test SMS! https://www.example.com", - "fromPhoneNumberId": 1234, - "imageUrl": null, - "clickedUrl": "https://www.example.com", - "createdAt": "2022-03-10 05:00:14 +00:00", - "templateId": 1112222, - "messageId": "ebd8f3cfc1f74353b423c5e0f3dd8b39", - "emailId": "c1234567:t9876543:docs@iterable.com" - }, - "receivedAt": "2022-03-10T05:00:14.000Z", - "timestamp": "2022-03-10T05:00:14.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "smsReceived", - "integrations": { - "Iterable": false - }, - "properties": { - "fromPhoneNumber": "+16503926753", - "toPhoneNumber": "+14155824541", - "smsMessage": "Message text", - "createdAt": "2016-12-05 22:51:25 +00:00" - }, - "receivedAt": "2016-12-05T22:51:25.000Z", - "timestamp": "2016-12-05T22:51:25.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "smsSend", - "integrations": { - "Iterable": false - }, - "properties": { - "toPhoneNumber": "+16503926753", - "fromSMSSenderId": 258, - "contentId": 2086, - "createdAt": "2016-12-05 21:50:32 +00:00", - "campaignId": 73974, - "templateId": 112523, - "smsMessage": "Message text", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 4270, - "messageTypeId": 4769, - "experimentId": null, - "fromPhoneNumberId": 258, - "imageUrl": null, - "locale": null, - "emailId": "c73974:t112523:docs@iterable.com" - }, - "receivedAt": "2016-12-05T21:50:32.000Z", - "timestamp": "2016-12-05T21:50:32.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "smsSendSkip", - "integrations": { - "Iterable": false - }, - "properties": { - "createdAt": "2019-08-07 18:49:48 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 729390, - "messageId": "2c780bf42f26485db0fc6571d2e0f6a0" - }, - "receivedAt": "2019-08-07T18:49:48.000Z", - "timestamp": "2019-08-07T18:49:48.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "emailSend", - "integrations": { - "Iterable": false - }, - "properties": { - "contentId": 274222, - "createdAt": "2016-12-02 18:51:40 +00:00", - "campaignId": 49313, - "transactionalData": { - "__comment": "transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total." - }, - "templateId": 79190, - "messageId": "210badf49fe54f2591d64ad0d055f4fb", - "emailSubject": "My subject", - "campaignName": "My campaign name", - "workflowId": null, - "workflowName": null, - "templateName": "My template name", - "channelId": 3420, - "messageTypeId": 3866, - "experimentId": null, - "emailId": "c49313:t79190:docs@iterable.com" - }, - "receivedAt": "2016-12-02T18:51:40.000Z", - "timestamp": "2016-12-02T18:51:40.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "webPushSend", - "integrations": { - "Iterable": false - }, - "properties": { - "campaignId": 723636, - "browserToken": "cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b", - "contentId": 3681, - "messageId": "af4c726ae76b48c7871b6d0d7760d47c", - "workflowName": "My workflow name", - "emailId": "c723636:t1020396:docs@iterable.com", - "locale": null, - "webPushIcon": null, - "templateId": 1020396, - "labels": [], - "createdAt": "2019-08-07 23:43:02 +00:00", - "templateName": "My template name", - "webPushMessage": "", - "messageTypeId": 9106, - "webPushBody": null, - "experimentId": null, - "webPushClickAction": null, - "campaignName": "My campaign name", - "workflowId": 53505, - "channelId": 8539 - }, - "receivedAt": "2019-08-07T23:43:02.000Z", - "timestamp": "2019-08-07T23:43:02.000Z", - "type": "track" - }, - { - "userId": "0e13848b1c7e27eb5d88c5d35b70783e", - "context": { - "integration": { - "name": "Iterable", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "docs@iterable.com" - } - }, - "event": "webPushSendSkip", - "integrations": { - "Iterable": false - }, - "properties": { - "createdAt": "2019-08-07 23:43:48 +00:00", - "reason": "DuplicateMarketingMessage", - "campaignId": 723636, - "messageId": "4238c918b20a41dfbe9a910275b76f12" - }, - "receivedAt": "2019-08-07T23:43:48.000Z", - "timestamp": "2019-08-07T23:43:48.000Z", - "type": "track" - } -] diff --git a/test/__tests__/data/mailjet_source.json b/test/__tests__/data/mailjet_source.json deleted file mode 100644 index 6d9562e2c4..0000000000 --- a/test/__tests__/data/mailjet_source.json +++ /dev/null @@ -1,369 +0,0 @@ -[ - { - "description": "MailJet email open event", - "input": [ - { - "event": "open", - "time": 1664443614, - "MessageID": 94857068804950690, - "Message_GUID": "54d6cdec-f659-4547-8926-13d9c4126b82", - "email": "test@rudderstack.com", - "mj_campaign_id": 108760, - "mj_contact_id": 399962859, - "customcampaign": "mj.nl=58424", - "ip": "66.249.84.231", - "geo": "US", - "agent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", - "CustomID": "", - "Payload": "" - } - ], - "output": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "MailJet" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "ip": "66.249.84.231", - "userAgent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)", - "externalId": [ - { - "type": "mailjetContactId", - "id": 399962859 - } - ] - }, - "integrations": { - "MailJet": false - }, - "type": "track", - "event": "open", - "properties": { - "ip": "66.249.84.231", - "customcampaign": "mj.nl=58424", - "mj_campaign_id": 108760, - "Payload": "" - }, - "originalTimestamp": "2022-09-29T09:26:54.000Z", - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7" - } - ] - }, - { - "description": "MailJet email bounce event where input event is of type ", - "input": { - "event": "bounce", - "time": 1664444171, - "MessageID": 55169098999352350, - "Message_GUID": "447d7eab-3335-4aba-9a51-09454bc14b81", - "email": "test@rudderstack.com", - "mj_campaign_id": 108892, - "mj_contact_id": 373142816, - "customcampaign": "mj.nl=58486", - "blocked": false, - "hard_bounce": false, - "error_related_to": "system", - "error": "connection issue" - }, - "output": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "MailJet" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "externalId": [ - { - "type": "mailjetContactId", - "id": 373142816 - } - ] - }, - "integrations": { - "MailJet": false - }, - "type": "track", - "event": "bounce", - "properties": { - "customcampaign": "mj.nl=58486", - "mj_campaign_id": 108892 - }, - "originalTimestamp": "2022-09-29T09:36:11.000Z", - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7" - } - ] - }, - { - "description": "MailJet email sent event", - "input": [ - { - "event": "sent", - "time": 1664444171, - "MessageID": 92886743924596480, - "Message_GUID": "0230c73a-2b77-4aea-8ef2-ed15d0edc5fd", - "email": "test@rudderstack.com", - "mj_campaign_id": 108892, - "mj_contact_id": 372651182, - "customcampaign": "mj.nl=58486", - "smtp_reply": "250 2.0.0 OK DMARC:Quarantine 1664444171 u17-20020adfdd51000000b0022cc3f2bf13si3225188wrm.271 - gsmtp" - } - ], - "output": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "MailJet" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "externalId": [ - { - "type": "mailjetContactId", - "id": 372651182 - } - ] - }, - "integrations": { - "MailJet": false - }, - "type": "track", - "event": "sent", - "properties": { - "customcampaign": "mj.nl=58486", - "mj_campaign_id": 108892 - }, - "originalTimestamp": "2022-09-29T09:36:11.000Z", - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7" - } - ] - }, - { - "description": "MailJet email bounce event", - "input": [ - { - "event": "bounce", - "time": 1664444170, - "MessageID": 56013522696710744, - "Message_GUID": "dbe4f0a3-4a5a-4784-a724-a9794d3c0444", - "email": "test@rudderstack.com", - "mj_campaign_id": 108892, - "mj_contact_id": 373142182, - "customcampaign": "mj.nl=58486", - "blocked": false, - "hard_bounce": false, - "error_related_to": "system", - "error": "connection issue" - } - ], - "output": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "MailJet" - }, - "traits": { - "email": "test@rudderstack.com" - }, - "externalId": [ - { - "type": "mailjetContactId", - "id": 373142182 - } - ] - }, - "integrations": { - "MailJet": false - }, - "type": "track", - "event": "bounce", - "properties": { - "customcampaign": "mj.nl=58486", - "mj_campaign_id": 108892 - }, - "originalTimestamp": "2022-09-29T09:36:10.000Z", - "userId": "5b6a3426dba2cb24e4f0aeec43bee9d7" - } - ] - }, - { - "description": "MailJet when no email is present", - "input": [ - { - "event": "bounce", - "time": 1664444170, - "MessageID": 56013522696710744, - "Message_GUID": "dbe4f0a3-4a5a-4784-a724-a9794d3c0444", - "mj_campaign_id": 108892, - "mj_contact_id": 373142182, - "customcampaign": "mj.nl=58486", - "blocked": false, - "hard_bounce": false, - "error_related_to": "system", - "error": "connection issue" - } - ], - "output": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "MailJet" - }, - "externalId": [ - { - "type": "mailjetContactId", - "id": 373142182 - } - ] - }, - "integrations": { - "MailJet": false - }, - "type": "track", - "event": "bounce", - "properties": { - "customcampaign": "mj.nl=58486", - "mj_campaign_id": 108892 - }, - "originalTimestamp": "2022-09-29T09:36:10.000Z" - } - ] - }, - { - "description": "MailJet Multiple payloads in single request", - "input": [ - { - "event": "open", - "time": 1704458040, - "MessageID": 987654, - "Message_GUID": "876r-oihugyf-7tfygh", - "email": "abc@r.com", - "mj_campaign_id": 321, - "mj_contact_id": 123, - "customcampaign": "test_campaign", - "url": "https://www.example.com/", - "ip": "ip_info", - "geo": "some geo info", - "agent": "mailjet api test" - }, - { - "event": "click", - "time": 1704458041, - "MessageID": 12345234567, - "Message_GUID": "12345-kjhgfd-2efv", - "email": "abc@r.com", - "mj_campaign_id": 12, - "mj_contact_id": 32532, - "customcampaign": "test_campaign", - "url": "https://www.example.com/", - "ip": "ip_info", - "geo": "some geo info", - "agent": "mailjet api test" - } - ], - "output": [ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "ip": "ip_info", - "integration": { - "name": "MailJet" - }, - "traits": { - "email": "abc@r.com" - }, - "page": { - "url": "https://www.example.com/" - }, - "userAgent": "mailjet api test", - "externalId": [ - { - "type": "mailjetContactId", - "id": 123 - } - ] - }, - "integrations": { - "MailJet": false - }, - "type": "track", - "event": "open", - "properties": { - "customcampaign": "test_campaign", - "mj_campaign_id": 321, - "ip": "ip_info", - "url": "https://www.example.com/" - }, - "userId": "593a5aff0b445b3b77a6d9676b7ec86e", - "originalTimestamp": "2024-01-05T12:34:00.000Z" - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "page": { - "url": "https://www.example.com/" - }, - - "integration": { - "name": "MailJet" - }, - "traits": { - "email": "abc@r.com" - }, - "userAgent": "mailjet api test", - "ip": "ip_info", - "externalId": [ - { - "type": "mailjetContactId", - "id": 32532 - } - ] - }, - "integrations": { - "MailJet": false - }, - "type": "track", - "event": "click", - "properties": { - "customcampaign": "test_campaign", - "mj_campaign_id": 12, - "ip": "ip_info", - "url": "https://www.example.com/" - }, - "userId": "593a5aff0b445b3b77a6d9676b7ec86e", - "originalTimestamp": "2024-01-05T12:34:01.000Z" - } - ] - } -] diff --git a/test/__tests__/data/mailmodo_source_input.json b/test/__tests__/data/mailmodo_source_input.json deleted file mode 100644 index 5ecc44b8f2..0000000000 --- a/test/__tests__/data/mailmodo_source_input.json +++ /dev/null @@ -1,153 +0,0 @@ -[ - { - "triggerData": { - "data": {}, - "triggerSource": "CsvList", - "email": "gouhgc@mailmodo.com", - "triggerDetails": "file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e", - "userId": "d3775892hvh4f2f-b9d5-e49810eb2cae", - "journeyId": "1a69df39hgvh4e0b-8b5c-73776157aa37", - "eventProperty": {} - } - }, - { - "fuuid": "27905", - "next-step-id": "success", - "total-steps": "3", - "responseId": "b9a5d224-cc5a-4e64-9800-5a3db9515fdf", - "recipientEmail": "test.rudderlabs21997@gmail.com", - "formId": "formosztd5", - "recordedAt": { - "ts": 1662695704, - "date": "2022-09-09", - "hour": 9, - "minute": 25 - }, - "submissionSource": "amp", - "elementjbtz42": "Everything ", - "element8jzo13": ["Reliable", "High Quality", "Useful"], - "recipientData": { - "email": "test.rudderlabs21997@gmail.com" - }, - "recommend": "9", - "liking": "upvote", - "satisfaction": "4", - "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", - "campaignName": "Campaign-testing" - }, - { - "triggerData": { - "data": {}, - "triggerSource": "Manual Add To List", - "email": "gou****@mailmodo.com", - "userId": "d3775892-****-4f2f-b9d5-e49810eb2cae", - "journeyId": "349e986e-f56c-****-bc3b-b5f13c3e34da", - "eventProperty": {} - } - }, - { - "triggerData": { - "data": {}, - "triggerSource": "Dashboard-change in property: first_name", - "email": "gou****@mailmodo.com", - "userId": "cc56708d-****-****-8c07-a4bfa5a7b79b", - "journeyId": "a78d7221-de34-47d8-81c6-5ad70cf4ee38", - "eventProperty": {} - } - }, - { - "triggerData": { - "data": {}, - "formSubmissionData": { - "element6ehxt3": "Te**", - "element6jkcy4": "Bang****", - "fuuid": "47949", - "next-step-id": "step7tr7n2", - "total-steps": "3", - "responseId": "4a8bfda7-****-4a8c-9cd1-a30d30a6dab9", - "recipientEmail": "gou****@mailmodo.com", - "formId": "formmqxnu2", - "recordedAt": { - "ts": 1657097786, - "date": "2022-07-06", - "hour": 14, - "minute": 26 - }, - "submissionSource": "amp" - }, - "email": "gou****@mailmodo.com", - "triggerSource": "form submission", - "userId": "11bff3e8-****-4e93-a533-fd8f9defc768", - "journeyId": "03664747-****-412e-8790-de9e9abe96a5", - "eventProperty": {} - } - }, - { - "triggerData": { - "data": {}, - "eventProperty": { - "Name": "APPLE iPhone 13 (Blue, 128 GB)", - "Category": "Mobiles", - "Is Purchased": "false", - "Price": "829", - "Currency": "USD" - }, - "triggerSource": "New Custom Event Trigger - Product Viewed", - "email": "gou****@mailmodo.com", - "userId": "d3775892-****-4f2f-b9d5-e49810eb2cae", - "journeyId": "3f135bf7-****-4e31-b265-f61cfe1bd423" - } - }, - { - "triggerData": { - "email": "gou****@mailmodo.com", - "data": {}, - "userId": "d3775892-****-4f2f-b9d5-e49810eb2cae", - "journeyId": "b1ee6bf6-****-4b5a-b7b5-0637853cd8c3", - "triggerSource": "Api", - "eventProperty": {} - } - }, - { - "eventData": { - "type": "html" - }, - "triggerData": { - "data": {}, - "triggerSource": "CsvList", - "email": "gou****@mailmodo.com", - "triggerDetails": "file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af", - "userId": "cc56708d-****-4fea-8c07-a4bfa5a7b79b", - "journeyId": "5d31c2b4-****-4a84-acd3-834cae80231b", - "eventProperty": {} - }, - "lastCampaignEmailRef": "064c76e7-****-4780-a001-226c066aaa12", - "lastCampaignId": "31422f76-****-4a72-a630-dd6f9f615bc3" - }, - { - "fuuid": "98255", - "next-step-id": "success", - "total-steps": "3", - "responseId": "ad20a980-4fce-44b6-887d-2236df514a76", - "recipientEmail": "test@rudderstack.com", - "formId": "formosztd5", - "recordedAt": { - "ts": 1662695887, - "date": "2022-09-09", - "hour": 9, - "minute": 28 - }, - "submissionSource": "amp", - "elementjbtz42": "peace", - "element8jzo13": ["Useful"], - "recipientData": { - "email": "test@rudderstack.com", - "first_name": "abcda" - }, - "recommend": "1", - "liking": "downvote", - "satisfaction": "1", - "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", - "campaignName": "Campaign-testing" - } -] diff --git a/test/__tests__/data/mailmodo_source_output.json b/test/__tests__/data/mailmodo_source_output.json deleted file mode 100644 index 3ffcf147f1..0000000000 --- a/test/__tests__/data/mailmodo_source_output.json +++ /dev/null @@ -1,315 +0,0 @@ -[ - { - "anonymousId": "f43848cce166e51b097cbed2851adc16ed9d4c341928f1c790215c50cefb59b0", - "context": { - "externalId": [ - { - "id": "d3775892hvh4f2f-b9d5-e49810eb2cae", - "type": "mailmodoUserId" - } - ], - "traits": { - "email": "gouhgc@mailmodo.com" - }, - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "event": "CsvList", - "integrations": { - "Mailmodo": false - }, - "properties": { - "triggerData.triggerSource": "CsvList", - "triggerData.triggerDetails": "file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e", - "triggerData.journeyId": "1a69df39hgvh4e0b-8b5c-73776157aa37" - }, - "type": "track" - }, - { - "anonymousId": "a80b34ec43ca959c7b8e5116ac626c3cf8561f62616e000a01729a8a900cc0a0", - "context": { - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "test.rudderlabs21997@gmail.com" - } - }, - "event": "Form Submitted", - "integrations": { - "Mailmodo": false - }, - "originalTimestamp": "2022-09-09T03:55:04.000Z", - "properties": { - "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", - "campaignName": "Campaign-testing", - "element8jzo13[0]": "Reliable", - "element8jzo13[1]": "High Quality", - "element8jzo13[2]": "Useful", - "elementjbtz42": "Everything ", - "formId": "formosztd5", - "fuuid": "27905", - "liking": "upvote", - "next-step-id": "success", - "recommend": "9", - "responseId": "b9a5d224-cc5a-4e64-9800-5a3db9515fdf", - "satisfaction": "4", - "submissionSource": "amp", - "total-steps": "3" - }, - "type": "track" - }, - { - "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", - "context": { - "externalId": [ - { - "id": "d3775892-****-4f2f-b9d5-e49810eb2cae", - "type": "mailmodoUserId" - } - ], - "traits": { - "email": "gou****@mailmodo.com" - }, - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "event": "Manual Add To List", - "integrations": { - "Mailmodo": false - }, - "properties": { - "triggerData.triggerSource": "Manual Add To List", - "triggerData.journeyId": "349e986e-f56c-****-bc3b-b5f13c3e34da" - }, - "type": "track" - }, - { - "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", - "context": { - "externalId": [ - { - "id": "cc56708d-****-****-8c07-a4bfa5a7b79b", - "type": "mailmodoUserId" - } - ], - "traits": { - "email": "gou****@mailmodo.com" - }, - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "event": "Dashboard-change in property: first_name", - "integrations": { - "Mailmodo": false - }, - "properties": { - "triggerData.triggerSource": "Dashboard-change in property: first_name", - "triggerData.journeyId": "a78d7221-de34-47d8-81c6-5ad70cf4ee38" - }, - "type": "track" - }, - { - "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", - "context": { - "externalId": [ - { - "id": "11bff3e8-****-4e93-a533-fd8f9defc768", - "type": "mailmodoUserId" - } - ], - "traits": { - "email": "gou****@mailmodo.com" - }, - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "event": "form submission", - "integrations": { - "Mailmodo": false - }, - "originalTimestamp": "2022-07-06T08:56:26.000Z", - "properties": { - "triggerData.triggerSource": "form submission", - "triggerData.formSubmissionData.element6ehxt3": "Te**", - "triggerData.formSubmissionData.element6jkcy4": "Bang****", - "triggerData.formSubmissionData.formId": "formmqxnu2", - "triggerData.formSubmissionData.fuuid": "47949", - "triggerData.formSubmissionData.next-step-id": "step7tr7n2", - "triggerData.formSubmissionData.responseId": "4a8bfda7-****-4a8c-9cd1-a30d30a6dab9", - "triggerData.formSubmissionData.submissionSource": "amp", - "triggerData.formSubmissionData.total-steps": "3", - "triggerData.journeyId": "03664747-****-412e-8790-de9e9abe96a5" - }, - "type": "track" - }, - { - "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", - "context": { - "externalId": [ - { - "id": "d3775892-****-4f2f-b9d5-e49810eb2cae", - "type": "mailmodoUserId" - } - ], - "traits": { - "email": "gou****@mailmodo.com" - }, - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "event": "New Custom Event Trigger - Product Viewed", - "integrations": { - "Mailmodo": false - }, - "properties": { - "triggerData.eventProperty.Category": "Mobiles", - "triggerData.eventProperty.Currency": "USD", - "triggerData.eventProperty.Is Purchased": "false", - "triggerData.eventProperty.Name": "APPLE iPhone 13 (Blue, 128 GB)", - "triggerData.eventProperty.Price": "829", - "triggerData.journeyId": "3f135bf7-****-4e31-b265-f61cfe1bd423", - "triggerData.triggerSource": "New Custom Event Trigger - Product Viewed" - }, - "type": "track" - }, - { - "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", - "context": { - "externalId": [ - { - "id": "d3775892-****-4f2f-b9d5-e49810eb2cae", - "type": "mailmodoUserId" - } - ], - "traits": { - "email": "gou****@mailmodo.com" - }, - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "event": "Api", - "integrations": { - "Mailmodo": false - }, - "properties": { - "triggerData.triggerSource": "Api", - "triggerData.journeyId": "b1ee6bf6-****-4b5a-b7b5-0637853cd8c3" - }, - "type": "track" - }, - { - "anonymousId": "26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92", - "context": { - "externalId": [ - { - "id": "cc56708d-****-4fea-8c07-a4bfa5a7b79b", - "type": "mailmodoUserId" - } - ], - "traits": { - "email": "gou****@mailmodo.com" - }, - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "event": "CsvList", - "integrations": { - "Mailmodo": false - }, - "properties": { - "eventData.type": "html", - "lastCampaignEmailRef": "064c76e7-****-4780-a001-226c066aaa12", - "lastCampaignId": "31422f76-****-4a72-a630-dd6f9f615bc3", - "triggerData.journeyId": "5d31c2b4-****-4a84-acd3-834cae80231b", - "triggerData.triggerDetails": "file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af", - "triggerData.triggerSource": "CsvList" - }, - "type": "track" - }, - { - "anonymousId": "1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd", - "context": { - "integration": { - "name": "Mailmodo", - "version": "1.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "email": "test@rudderstack.com", - "first_name": "abcda" - } - }, - "event": "Form Submitted", - "integrations": { - "Mailmodo": false - }, - "originalTimestamp": "2022-09-09T03:58:07.000Z", - "properties": { - "fuuid": "98255", - "next-step-id": "success", - "total-steps": "3", - "responseId": "ad20a980-4fce-44b6-887d-2236df514a76", - "formId": "formosztd5", - "submissionSource": "amp", - "elementjbtz42": "peace", - "element8jzo13[0]": "Useful", - "recommend": "1", - "liking": "downvote", - "satisfaction": "1", - "campaignId": "0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd", - "campaignName": "Campaign-testing" - }, - "type": "track" - } -] diff --git a/test/__tests__/data/monday_source_input.json b/test/__tests__/data/monday_source_input.json deleted file mode 100644 index bb4f729460..0000000000 --- a/test/__tests__/data/monday_source_input.json +++ /dev/null @@ -1,125 +0,0 @@ -[ - { - "event": { - "userId": 33556506, - "originalTriggerUuid": null, - "boardId": 3139815405, - "pulseId": 3160188786, - "pulseName": "New Sprint Item", - "groupId": "topics", - "groupName": "Group Title", - "groupColor": "#579bfc", - "isTopGroup": true, - "columnValues": {}, - "app": "monday", - "type": "create_pulse", - "triggerTime": "2022-08-30T09:02:39.191Z", - "subscriptionId": 150881106, - "triggerUuid": "049869226bf6711705c62e301a2c3eee" - } - }, - { - "event": { - "userId": 33556506, - "originalTriggerUuid": null, - "boardId": 3139815405, - "itemId": 3160188786, - "itemName": "New Sprint Item", - "app": "monday", - "type": "delete_pulse", - "triggerTime": "2022-08-30T09:06:09.176Z", - "subscriptionId": 150882006, - "triggerUuid": "4e4f87c8255c4ba4ba2f5e9934cb6d40" - } - }, - { - "event": { - "userId": 33556506, - "originalTriggerUuid": null, - "boardId": 3139815405, - "groupId": "topics", - "pulseId": 3160181387, - "pulseName": "New Sprint Item", - "columnId": "status", - "columnType": "color", - "columnTitle": "Status", - "value": { - "label": { - "index": 1, - "text": "Done", - "style": { - "color": "#00c875", - "border": "#00B461", - "var_name": "green-shadow" - }, - "is_done": true - }, - "post_id": null - }, - "previousValue": null, - "changedAt": 1661859406.8970098, - "isTopGroup": true, - "app": "monday", - "type": "update_column_value", - "triggerTime": "2022-08-30T11:36:47.406Z", - "subscriptionId": 150894742, - "triggerUuid": "51730730740a9d00ec45203bd392a9bd" - } - }, - { - "event": { - "userId": 33556506, - "originalTriggerUuid": null, - "boardId": 3139815405, - "groupId": "topics", - "pulseId": 3160181387, - "value": { - "name": "New Sprint Item renamed" - }, - "previousValue": { - "name": "New Sprint Item" - }, - "app": "monday", - "type": "update_name", - "triggerTime": "2022-08-30T11:40:17.351Z", - "subscriptionId": 150910867, - "triggerUuid": "05ce13d32d0256c4fb7dd5de25b1a1ba" - } - }, - { - "event": { - "userId": 33556506, - "originalTriggerUuid": null, - "boardId": 3160805239, - "pulseId": 3161163765, - "pulseName": "new subitem", - "groupId": "topics", - "groupName": "Subitems", - "groupColor": "#579bfc", - "isTopGroup": true, - "columnValues": {}, - "app": "monday", - "type": "create_pulse", - "triggerTime": "2022-08-30T12:56:27.281Z", - "subscriptionId": 150911592, - "triggerUuid": "70a2219427804e47a508a91b5c244543", - "parentItemId": "3160181387", - "parentItemBoardId": "3139815405", - "itemId": 3161163765 - } - }, - { - "event": { - "userId": 33556506, - "originalTriggerUuid": null, - "boardId": 3139815405, - "itemId": 3160181387, - "itemName": "New Sprint Item renamed", - "app": "monday", - "type": "archive_pulse", - "triggerTime": "2022-08-30T12:58:15.844Z", - "subscriptionId": 150925947, - "triggerUuid": "aa8bd5dbb6fd592aedd57322dd776379" - } - } -] diff --git a/test/__tests__/data/monday_source_output.json b/test/__tests__/data/monday_source_output.json deleted file mode 100644 index cf636d818a..0000000000 --- a/test/__tests__/data/monday_source_output.json +++ /dev/null @@ -1,251 +0,0 @@ -[ - { - "type": "track", - "event": "Create Pulse", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "externalId": [ - { - "id": 33556506, - "type": "mondayUserId" - } - ], - "integration": { - "name": "MONDAY" - } - }, - "timestamp": "2022-08-30T09:02:39.191Z", - "properties": { - "app": "monday", - "type": "create_pulse", - "boardId": 3139815405, - "groupId": "topics", - "pulseId": 3160188786, - "groupName": "Group Title", - "pulseName": "New Sprint Item", - "groupColor": "#579bfc", - "isTopGroup": true, - "triggerUuid": "049869226bf6711705c62e301a2c3eee", - "columnValues": {}, - "subscriptionId": 150881106, - "originalTriggerUuid": null - }, - "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", - "integrations": { - "MONDAY": false - }, - "originalTimestamp": "2022-08-30T09:02:39.191Z" - }, - { - "type": "track", - "event": "Delete Pulse", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "externalId": [ - { - "id": 33556506, - "type": "mondayUserId" - } - ], - "integration": { - "name": "MONDAY" - } - }, - "timestamp": "2022-08-30T09:06:09.176Z", - "properties": { - "app": "monday", - "type": "delete_pulse", - "itemId": 3160188786, - "boardId": 3139815405, - "itemName": "New Sprint Item", - "triggerUuid": "4e4f87c8255c4ba4ba2f5e9934cb6d40", - "subscriptionId": 150882006, - "originalTriggerUuid": null - }, - "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", - "integrations": { - "MONDAY": false - }, - "originalTimestamp": "2022-08-30T09:06:09.176Z" - }, - { - "type": "track", - "event": "Update Column Value", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "externalId": [ - { - "id": 33556506, - "type": "mondayUserId" - } - ], - "integration": { - "name": "MONDAY" - } - }, - "timestamp": "2022-08-30T11:36:47.406Z", - "properties": { - "app": "monday", - "type": "update_column_value", - "value": { - "label": { - "text": "Done", - "index": 1, - "style": { - "color": "#00c875", - "border": "#00B461", - "var_name": "green-shadow" - }, - "is_done": true - }, - "post_id": null - }, - "boardId": 3139815405, - "groupId": "topics", - "pulseId": 3160181387, - "columnId": "status", - "changedAt": 1661859406.8970098, - "pulseName": "New Sprint Item", - "columnType": "color", - "isTopGroup": true, - "columnTitle": "Status", - "triggerUuid": "51730730740a9d00ec45203bd392a9bd", - "previousValue": null, - "subscriptionId": 150894742, - "originalTriggerUuid": null - }, - "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", - "integrations": { - "MONDAY": false - }, - "originalTimestamp": "2022-08-30T11:36:47.406Z" - }, - { - "type": "track", - "event": "Update Name", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "externalId": [ - { - "id": 33556506, - "type": "mondayUserId" - } - ], - "integration": { - "name": "MONDAY" - } - }, - "timestamp": "2022-08-30T11:40:17.351Z", - "properties": { - "app": "monday", - "type": "update_name", - "value": { - "name": "New Sprint Item renamed" - }, - "boardId": 3139815405, - "groupId": "topics", - "pulseId": 3160181387, - "triggerUuid": "05ce13d32d0256c4fb7dd5de25b1a1ba", - "previousValue": { - "name": "New Sprint Item" - }, - "subscriptionId": 150910867, - "originalTriggerUuid": null - }, - "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", - "integrations": { - "MONDAY": false - }, - "originalTimestamp": "2022-08-30T11:40:17.351Z" - }, - { - "type": "track", - "event": "Create Pulse", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "externalId": [ - { - "id": 33556506, - "type": "mondayUserId" - } - ], - "integration": { - "name": "MONDAY" - } - }, - "timestamp": "2022-08-30T12:56:27.281Z", - "properties": { - "app": "monday", - "type": "create_pulse", - "itemId": 3161163765, - "boardId": 3160805239, - "groupId": "topics", - "pulseId": 3161163765, - "groupName": "Subitems", - "pulseName": "new subitem", - "groupColor": "#579bfc", - "isTopGroup": true, - "triggerUuid": "70a2219427804e47a508a91b5c244543", - "columnValues": {}, - "parentItemId": "3160181387", - "subscriptionId": 150911592, - "parentItemBoardId": "3139815405", - "originalTriggerUuid": null - }, - "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", - "integrations": { - "MONDAY": false - }, - "originalTimestamp": "2022-08-30T12:56:27.281Z" - }, - { - "type": "track", - "event": "Archive Pulse", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "externalId": [ - { - "id": 33556506, - "type": "mondayUserId" - } - ], - "integration": { - "name": "MONDAY" - } - }, - "timestamp": "2022-08-30T12:58:15.844Z", - "properties": { - "app": "monday", - "type": "archive_pulse", - "itemId": 3160181387, - "boardId": 3139815405, - "itemName": "New Sprint Item renamed", - "triggerUuid": "aa8bd5dbb6fd592aedd57322dd776379", - "subscriptionId": 150925947, - "originalTriggerUuid": null - }, - "anonymousId": "6f0a3dc76a335860e17fa1d8ab779742e2ca", - "integrations": { - "MONDAY": false - }, - "originalTimestamp": "2022-08-30T12:58:15.844Z" - } -] diff --git a/test/__tests__/data/olark_source.json b/test/__tests__/data/olark_source.json deleted file mode 100644 index 96707bfbb2..0000000000 --- a/test/__tests__/data/olark_source.json +++ /dev/null @@ -1,299 +0,0 @@ -[ - { - "description": "Olark webhook response", - "input": { - "kind": "Conversation", - "id": "ho6HrHxoabmm6q0G103JU0JFaor0BobA", - "manuallySubmitted": false, - "items": [ - { - "kind": "OfflineMessage", - "timestamp": "1669285628.796693", - "body": "name: test rudderlabs\nemail: ruddertest@gmail.com\nMessage: I am Fine" - } - ], - "tags": [], - "visitor": { - "kind": "Visitor", - "id": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", - "fullName": "test", - "emailAddress": "ruddertest@gmail.com", - "ip": "", - "country": "India", - "countryCode": "IN", - "browser": "Chrome 105.0.0.0", - "operatingSystem": "Macintosh", - "conversationBeginPage": "http://localhost:5503/" - } - }, - "output": [ - { - "type": "track", - "event": "Conversation", - "traits": {}, - "userId": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", - "context": { - "os": { - "name": "Macintosh" - }, - "page": { - "url": "http://localhost:5503/" - }, - "traits": { - "name": "test", - "email": "ruddertest@gmail.com", - "country": "India" - }, - "browser": { - "name": "Chrome", - "version": "105.0.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Olark" - } - }, - "properties": { - "tags": [], - "items": [ - { - "body": "name: test rudderlabs\nemail: ruddertest@gmail.com\nMessage: I am Fine", - "kind": "OfflineMessage", - "timestamp": "1669285628.796693" - } - ] - }, - "integrations": { - "Olark": false - } - } - ] - }, - { - "description": "Olark webhook response", - "input": { - "kind": "Conversation", - "id": "NOTAREALTRANSCRIPT5LGcbVTa3hKBRB", - "manuallySubmitted": false, - "items": [ - { - "kind": "MessageToVisitor", - "nickname": "Olark operator", - "operatorId": "6208911878914048", - "timestamp": "1473774819.263083", - "body": "Hi from an operator" - }, - { - "kind": "MessageToOperator", - "nickname": "Returning Visitor | USA (San Francisco, CA) #7617", - "timestamp": "1473774821.411154", - "body": "Hi from a visitor", - "visitor_nickname": "Olark Visitor" - } - ], - "tags": ["test_example"], - "visitor": { - "kind": "Visitor", - "id": "NOTAREALVISITORIDS5LGl6QUrK2OaPP", - "fullName": "Olark", - "phoneNumber": "5555555555", - "emailAddress": "support+integrationtest@olark.com", - "ip": "", - "city": "San Francisco", - "region": "CA", - "country": "United States", - "countryCode": "US", - "organization": "Visitor Organization", - "browser": "Internet Explorer 11", - "operatingSystem": "Windows", - "referrer": "http://www.olark.com", - "conversationBeginPage": "http://www.olark.com", - "chat_feedback": { - "overall_chat": 4, - "responsiveness": 5, - "knowledge": 4, - "friendliness": 5 - } - }, - "operators": { - "6208911878914048": { - "kind": "Operator", - "id": "6208911878914048", - "nickname": "integration", - "emailAddress": "integration-accounts@rudderstack.com", - "username": "integration-accounts-92750bc547" - } - } - }, - "output": [ - { - "type": "track", - "event": "Conversation", - "traits": { - "organization": "Visitor Organization", - "chat_feedback": { - "knowledge": 4, - "friendliness": 5, - "overall_chat": 4, - "responsiveness": 5 - } - }, - "userId": "NOTAREALVISITORIDS5LGl6QUrK2OaPP", - "context": { - "os": { - "name": "Windows" - }, - "page": { - "url": "http://www.olark.com", - "referrer": "http://www.olark.com" - }, - "traits": { - "city": "San Francisco", - "name": "Olark", - "email": "support+integrationtest@olark.com", - "phone": "5555555555", - "region": "CA", - "country": "United States" - }, - "browser": { - "name": "Internet Explorer", - "version": "11" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Olark" - } - }, - "properties": { - "tags": ["test_example"], - "items": [ - { - "body": "Hi from an operator", - "kind": "MessageToVisitor", - "nickname": "Olark operator", - "timestamp": "1473774819.263083", - "operatorId": "6208911878914048" - }, - { - "body": "Hi from a visitor", - "kind": "MessageToOperator", - "nickname": "Returning Visitor | USA (San Francisco, CA) #7617", - "timestamp": "1473774821.411154", - "visitor_nickname": "Olark Visitor" - } - ] - }, - "integrations": { - "Olark": false - } - } - ] - }, - { - "description": "Olark webhook response", - "input": { - "kind": "Conversation", - "id": "ho6HrHxoabmm6q0G103JU0JFaor0BobA", - "manuallySubmitted": false, - "items": [ - { - "kind": "OfflineMessage", - "timestamp": "1669288532.567071", - "body": "name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv" - } - ], - "tags": [], - "groups": [ - { - "kind": "Group", - "id": "ca77f4296fb7568909ad864aebf48201", - "name": "Group 1" - } - ], - "visitor": { - "kind": "Visitor", - "id": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", - "fullName": "test rudderstack", - "emailAddress": "rudder14@gmail.com", - "ip": "", - "country": "India", - "countryCode": "IN", - "browser": "Chrome 105.0.0.0", - "operatingSystem": "Macintosh", - "conversationBeginPage": "http://localhost:5503/" - } - }, - "output": [ - { - "type": "track", - "event": "Conversation", - "traits": {}, - "userId": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", - "context": { - "os": { - "name": "Macintosh" - }, - "page": { - "url": "http://localhost:5503/" - }, - "traits": { - "name": "test rudderstack", - "email": "rudder14@gmail.com", - "country": "India" - }, - "browser": { - "name": "Chrome", - "version": "105.0.0.0" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Olark" - } - }, - "properties": { - "tags": [], - "items": [ - { - "body": "name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv", - "kind": "OfflineMessage", - "timestamp": "1669288532.567071" - } - ] - }, - "integrations": { - "Olark": false - } - }, - { - "name": "Group 1", - "type": "group", - "traits": { - "kind": "Group" - }, - "userId": "45WjM9eMYwJ7cJMo103JU0JaForAA6Db", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Olark" - } - }, - "groupId": "ca77f4296fb7568909ad864aebf48201", - "integrations": { - "Olark": false - } - } - ] - } -] diff --git a/test/__tests__/data/pagerduty_source.json b/test/__tests__/data/pagerduty_source.json deleted file mode 100644 index 0d116cff9b..0000000000 --- a/test/__tests__/data/pagerduty_source.json +++ /dev/null @@ -1,639 +0,0 @@ -[ - { - "description": "Incident Triggered", - "input": { - "event": { - "id": "01DEN0V2VIFEN5871PQGX72URP", - "event_type": "incident.triggered", - "resource_type": "incident", - "occurred_at": "2022-12-07T10:56:52.337Z", - "agent": { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - }, - "client": { - "name": "Monitoring Service", - "url": "https://monitoring.service.com" - }, - "data": { - "id": "Q3S7IX2U5KTCOY", - "type": "incident", - "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "number": 2, - "status": "triggered", - "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", - "created_at": "2022-12-07T10:56:52Z", - "title": "Server Crashed", - "service": { - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "summary": "Database", - "type": "service_reference" - }, - "assignees": [ - { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - } - ], - "escalation_policy": { - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "summary": "Default", - "type": "escalation_policy_reference" - }, - "teams": [], - "priority": { - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", - "id": "PPMNDVQ", - "self": "https://api.pagerduty.com/priorities/PPMNDVQ", - "summary": "P1", - "type": "priority_reference" - }, - "urgency": "high", - "conference_bridge": null, - "resolve_reason": null - } - } - }, - "output": { - "type": "track", - "event": "Incident Triggered", - "userId": "PXZZD2E", - "context": { - "traits": { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "PagerDuty" - } - }, - "messageId": "01DEN0V2VIFEN5871PQGX72URP", - "properties": { - "data": { - "id": "Q3S7IX2U5KTCOY", - "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "type": "incident", - "teams": [], - "title": "Server Crashed", - "number": 2, - "status": "triggered", - "service": { - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "type": "service_reference", - "summary": "Database", - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" - }, - "urgency": "high", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "priority": { - "id": "PPMNDVQ", - "self": "https://api.pagerduty.com/priorities/PPMNDVQ", - "type": "priority_reference", - "summary": "P1", - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" - }, - "assignees": [ - { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - } - ], - "created_at": "2022-12-07T10:56:52Z", - "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", - "resolve_reason": null, - "conference_bridge": null, - "escalation_policy": { - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "type": "escalation_policy_reference", - "summary": "Default", - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" - } - }, - "client": { - "url": "https://monitoring.service.com", - "name": "Monitoring Service" - }, - "resourceType": "incident" - }, - "integrations": { - "PagerDuty": false - }, - "originalTimestamp": "2022-12-07T10:56:52.000Z" - } - }, - { - "description": "Incident Priority Updated", - "input": { - "event": { - "id": "01DFU6P4VDDZCIHVQ5Q0ME99OE", - "event_type": "incident.priority_updated", - "resource_type": "incident", - "occurred_at": "2022-12-20T11:43:24.342Z", - "agent": { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - }, - "client": null, - "data": { - "id": "Q1KRTY75EUMGM0", - "type": "incident", - "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "number": 7, - "status": "acknowledged", - "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", - "created_at": "2022-12-20T11:37:19Z", - "title": "Event Stream Failure", - "service": { - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "summary": "Database", - "type": "service_reference" - }, - "assignees": [ - { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - } - ], - "escalation_policy": { - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "summary": "Default", - "type": "escalation_policy_reference" - }, - "teams": [], - "priority": { - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", - "id": "PPMNDVQ", - "self": "https://api.pagerduty.com/priorities/PPMNDVQ", - "summary": "P1", - "type": "priority_reference" - }, - "urgency": "high", - "conference_bridge": null, - "resolve_reason": null - } - } - }, - "output": { - "type": "track", - "event": "Incident Priority Updated", - "userId": "PXZZD2E", - "context": { - "traits": { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "PagerDuty" - } - }, - "messageId": "01DFU6P4VDDZCIHVQ5Q0ME99OE", - "properties": { - "data": { - "id": "Q1KRTY75EUMGM0", - "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "type": "incident", - "teams": [], - "title": "Event Stream Failure", - "number": 7, - "status": "acknowledged", - "service": { - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "type": "service_reference", - "summary": "Database", - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" - }, - "urgency": "high", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "priority": { - "id": "PPMNDVQ", - "self": "https://api.pagerduty.com/priorities/PPMNDVQ", - "type": "priority_reference", - "summary": "P1", - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" - }, - "assignees": [ - { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - } - ], - "created_at": "2022-12-20T11:37:19Z", - "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", - "resolve_reason": null, - "conference_bridge": null, - "escalation_policy": { - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "type": "escalation_policy_reference", - "summary": "Default", - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" - } - }, - "resourceType": "incident" - }, - "integrations": { - "PagerDuty": false - }, - "originalTimestamp": "2022-12-20T11:43:24.000Z" - } - }, - { - "description": "Incident Responder Added", - "input": { - "event": { - "id": "01DFU6Z1ZCLMV9SEK3X5JZ5WLW", - "event_type": "incident.responder.added", - "resource_type": "incident", - "occurred_at": "2022-12-20T11:46:44.213Z", - "agent": { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - }, - "client": null, - "data": { - "incident": { - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "id": "Q1KRTY75EUMGM0", - "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "summary": "Event Stream Failure", - "type": "incident_reference" - }, - "user": { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - }, - "escalation_policy": null, - "message": "Please help with \"Event Stream Failure\"", - "state": "pending", - "type": "incident_responder" - } - } - }, - "output": { - "type": "track", - "event": "Incident Responder Added", - "userId": "PXZZD2E", - "context": { - "traits": { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "PagerDuty" - } - }, - "messageId": "01DFU6Z1ZCLMV9SEK3X5JZ5WLW", - "properties": { - "data": { - "type": "incident_responder", - "user": { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - }, - "state": "pending", - "message": "Please help with \"Event Stream Failure\"", - "incident": { - "id": "Q1KRTY75EUMGM0", - "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "type": "incident_reference", - "summary": "Event Stream Failure", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0" - }, - "escalation_policy": null - }, - "resourceType": "incident" - }, - "integrations": { - "PagerDuty": false - }, - "originalTimestamp": "2022-12-20T11:46:44.000Z" - } - }, - { - "description": "Incident Escalated", - "input": { - "event": { - "id": "01DFU77KTKK9UUYX779UX0N1ZP", - "event_type": "incident.escalated", - "resource_type": "incident", - "occurred_at": "2022-12-20T11:49:35.385Z", - "agent": { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - }, - "client": null, - "data": { - "id": "Q1KRTY75EUMGM0", - "type": "incident", - "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "number": 7, - "status": "triggered", - "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", - "created_at": "2022-12-20T11:37:19Z", - "title": "Event Stream Failure", - "service": { - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "summary": "Database", - "type": "service_reference" - }, - "assignees": [ - { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - } - ], - "escalation_policy": { - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "summary": "Default", - "type": "escalation_policy_reference" - }, - "teams": [], - "priority": { - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", - "id": "PPMNDVQ", - "self": "https://api.pagerduty.com/priorities/PPMNDVQ", - "summary": "P1", - "type": "priority_reference" - }, - "urgency": "high", - "conference_bridge": null, - "resolve_reason": null - } - } - }, - "output": { - "type": "track", - "event": "Incident Escalated", - "userId": "PXZZD2E", - "context": { - "traits": { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "PagerDuty" - } - }, - "messageId": "01DFU77KTKK9UUYX779UX0N1ZP", - "properties": { - "data": { - "id": "Q1KRTY75EUMGM0", - "self": "https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "type": "incident", - "teams": [], - "title": "Event Stream Failure", - "number": 7, - "status": "triggered", - "service": { - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "type": "service_reference", - "summary": "Database", - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" - }, - "urgency": "high", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0", - "priority": { - "id": "PPMNDVQ", - "self": "https://api.pagerduty.com/priorities/PPMNDVQ", - "type": "priority_reference", - "summary": "P1", - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" - }, - "assignees": [ - { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - } - ], - "created_at": "2022-12-20T11:37:19Z", - "incident_key": "a3e0e442f8b74a8c94298f19de0dcbed", - "resolve_reason": null, - "conference_bridge": null, - "escalation_policy": { - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "type": "escalation_policy_reference", - "summary": "Default", - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" - } - }, - "resourceType": "incident" - }, - "integrations": { - "PagerDuty": false - }, - "originalTimestamp": "2022-12-20T11:49:35.000Z" - } - }, - { - "description": "Incident Resolved", - "input": { - "event": { - "id": "01DEN1HNLBC1VITK192ETJ1MPJ", - "event_type": "incident.resolved", - "resource_type": "incident", - "occurred_at": "2022-12-07T11:04:27.459Z", - "agent": { - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E", - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "summary": "rudder test", - "type": "user_reference" - }, - "client": null, - "data": { - "id": "Q3S7IX2U5KTCOY", - "type": "incident", - "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "number": 2, - "status": "resolved", - "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", - "created_at": "2022-12-07T10:56:52Z", - "title": "Server Crashed", - "service": { - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT", - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "summary": "Database", - "type": "service_reference" - }, - "assignees": [], - "escalation_policy": { - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4", - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "summary": "Default", - "type": "escalation_policy_reference" - }, - "teams": [], - "priority": { - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities", - "id": "P5DBC3A", - "self": "https://api.pagerduty.com/priorities/P5DBC3A", - "summary": "P3", - "type": "priority_reference" - }, - "urgency": "high", - "conference_bridge": { - "conference_number": "", - "conference_url": "" - }, - "resolve_reason": null - } - } - }, - "output": { - "type": "track", - "event": "Incident Resolved", - "userId": "PXZZD2E", - "context": { - "traits": { - "id": "PXZZD2E", - "self": "https://api.pagerduty.com/users/user@1", - "type": "user_reference", - "summary": "rudder test", - "html_url": "https://rudderlabs-com.pagerduty.com/users/PXZZD2E" - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "PagerDuty" - } - }, - "messageId": "01DEN1HNLBC1VITK192ETJ1MPJ", - "properties": { - "data": { - "id": "Q3S7IX2U5KTCOY", - "self": "https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "type": "incident", - "teams": [], - "title": "Server Crashed", - "number": 2, - "status": "resolved", - "service": { - "id": "PAJBUTT", - "self": "https://api.pagerduty.com/services/PAJBUTT", - "type": "service_reference", - "summary": "Database", - "html_url": "https://rudderlabs-com.pagerduty.com/services/PAJBUTT" - }, - "urgency": "high", - "html_url": "https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY", - "priority": { - "id": "P5DBC3A", - "self": "https://api.pagerduty.com/priorities/P5DBC3A", - "type": "priority_reference", - "summary": "P3", - "html_url": "https://rudderlabs-com.pagerduty.com/account/incident_priorities" - }, - "assignees": [], - "created_at": "2022-12-07T10:56:52Z", - "incident_key": "faaecfc0aca04b6ea07154188b5d3c6c", - "resolve_reason": null, - "conference_bridge": { - "conference_url": "", - "conference_number": "" - }, - "escalation_policy": { - "id": "PB7HKU4", - "self": "https://api.pagerduty.com/escalation_policies/PB7HKU4", - "type": "escalation_policy_reference", - "summary": "Default", - "html_url": "https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4" - } - }, - "resourceType": "incident" - }, - "integrations": { - "PagerDuty": false - }, - "originalTimestamp": "2022-12-07T11:04:27.000Z" - } - } -] diff --git a/test/__tests__/data/pipedream_source.json b/test/__tests__/data/pipedream_source.json deleted file mode 100644 index 2d542e8673..0000000000 --- a/test/__tests__/data/pipedream_source.json +++ /dev/null @@ -1,275 +0,0 @@ -[ - { - "description": "No type or userId is given", - "input": { - "anonymousId": "63767499ca6fb1b7c988d5bb", - "artist": "Gautam", - "genre": "Jazz", - "song": "Take Five" - }, - "output": { - "event": "pipedream_source_event", - "anonymousId": "63767499ca6fb1b7c988d5bb", - "context": { - "integration": { - "name": "PIPEDREAM" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "integrations": { - "PIPEDREAM": false - }, - "type": "track", - "properties": { - "anonymousId": "63767499ca6fb1b7c988d5bb", - "artist": "Gautam", - "genre": "Jazz", - "song": "Take Five" - } - } - }, - { - "description": "No type or anonymousId is given", - "input": { - "userId": "12", - "artist": "Gautam", - "genre": "Jazz", - "song": "Take Five" - }, - "output": { - "event": "pipedream_source_event", - "anonymousId": "12", - "context": { - "integration": { - "name": "PIPEDREAM" - }, - "library": { - "name": "unknown", - "version": "unknown" - } - }, - "integrations": { - "PIPEDREAM": false - }, - "type": "track", - "properties": { - "userId": "12", - "artist": "Gautam", - "genre": "Jazz", - "song": "Take Five" - } - } - }, - { - "description": "Track Call -> type and userId is given", - "input": { - "event": "Song Played", - "userId": "R1234", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe", - "userDeleted": false - }, - "locale": "en", - "location": { - "country": "IN", - "countryName": "India", - "short": "India", - "long": "India" - }, - "device": { - "os": "macOS", - "type": "desktop" - }, - "page": { - "referrer": "http://127.0.0.1:5500/testSm.html" - } - }, - "type": "track", - "properties": { - "artist": "John", - "Album": "ABCD" - } - }, - "output": { - "event": "Song Played", - "userId": "R1234", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe", - "userDeleted": false - }, - "locale": "en", - "location": { - "country": "IN", - "countryName": "India", - "short": "India", - "long": "India" - }, - "device": { - "os": "macOS", - "type": "desktop" - }, - "page": { - "referrer": "http://127.0.0.1:5500/testSm.html" - } - }, - "type": "track", - "properties": { - "artist": "John", - "Album": "ABCD" - } - } - }, - { - "description": "Identify type -> type and userId is given", - "input": { - "userId": "1", - "originalTimestamp": "2020-09-28T19:53:31.900Z", - "traits": { - "firstName": "John", - "lastName": "doe", - "email": "John@r.com", - "hasPurchased": "yes", - "address": { - "Home": { - "city": "iudcb" - }, - "Office": { - "abc": "jbc" - } - }, - "state": "Delhi", - "title": "Mr" - }, - "timestamp": "2020-09-29T14:50:29.907+05:30", - "type": "identify" - }, - "output": { - "userId": "1", - "originalTimestamp": "2020-09-28T19:53:31.900Z", - "traits": { - "firstName": "John", - "lastName": "doe", - "email": "John@r.com", - "hasPurchased": "yes", - "address": { - "Home": { - "city": "iudcb" - }, - "Office": { - "abc": "jbc" - } - }, - "state": "Delhi", - "title": "Mr" - }, - "timestamp": "2020-09-29T14:50:29.907+05:30", - "type": "identify" - } - }, - { - "description": "Group type -> type and userId is given", - "input": { - "userId": "user123", - "groupId": "17", - "context": {}, - "traits": { - "operation": "add" - }, - "type": "group" - }, - "output": { - "userId": "user123", - "groupId": "17", - "context": {}, - "traits": { - "operation": "add" - }, - "type": "group" - } - }, - { - "description": "Page type -> type and userId is given", - "input": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "9" - }, - "timezone": "Asia/Kolkata", - "traits": { - "customProp": "customValue" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "name": "Home", - "properties": { - "title": "Home | RudderStack", - "url": "http://www.rudderstack.com" - }, - "receivedAt": "2020-09-29T14:50:43.005+05:30", - "type": "page" - }, - "output": { - "anonymousId": "21e13f4bc7ceddad", - "channel": "mobile", - "context": { - "os": { - "name": "Android", - "version": "9" - }, - "timezone": "Asia/Kolkata", - "traits": { - "customProp": "customValue" - }, - "userAgent": "Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)" - }, - "name": "Home", - "properties": { - "title": "Home | RudderStack", - "url": "http://www.rudderstack.com" - }, - "receivedAt": "2020-09-29T14:50:43.005+05:30", - "type": "page" - } - }, - { - "description": "Alias type -> type and userId is given", - "input": { - "type": "alias", - "previousId": "name@surname.com", - "userId": "12345" - }, - "output": { - "type": "alias", - "previousId": "name@surname.com", - "userId": "12345" - } - } -] diff --git a/test/__tests__/data/refiner_source.json b/test/__tests__/data/refiner_source.json deleted file mode 100644 index c5ed3ab2e8..0000000000 --- a/test/__tests__/data/refiner_source.json +++ /dev/null @@ -1,394 +0,0 @@ -[ - { - "description": "Refiner webhook response", - "input": { - "uuid": "d769e130-49cf-11ed-968d-936a69fadf81", - "project_uuid": "0d8759d0-401c-11ed-8ded-9757c4929b55", - "remote_id": "user@17", - "email": "test17@user.com", - "display_name": "test user", - "first_seen_at": "2022-10-12T01:47:33.000000Z", - "last_seen_at": "2022-10-12T02:00:00.000000Z", - "attributes": { - "address": null, - "address_city": null, - "address_state": null, - "age": null, - "another_attribute": null, - "city": null, - "country": null, - "created_at": null, - "email": "test17@user.com", - "event": null, - "first_name": null, - "first_seen_at": "2022-10-12T01:47:33.000000Z", - "form_submissions_count": "1", - "form_views_count": "2", - "gender": null, - "last_form_submission_at": "2022-10-12T02:05:55.000000Z", - "last_form_view_at": "2022-10-12T02:03:46.000000Z", - "last_name": null, - "last_seen_at": "2022-10-12T02:00:00.000000Z", - "name": "test user", - "phone": null, - "some_attribute": null, - "status": null, - "student": null, - "tag": null, - "trait1": null, - "trait2": null, - "trait3": null, - "url": null, - "user_address_city": null, - "user_address_state": null, - "user_country": null, - "user_id": null, - "username": null, - "useroccupation": null, - "why_did_you_cancel_your_subscription": "Pricing" - }, - "segments": [ - { - "uuid": "0d91d7a0-401c-11ed-8898-bb1ee0c23ae5", - "name": "All Users", - "created_at": "2022-10-12T01:47:34.000000Z", - "updated_at": "2022-10-12T01:47:34.000000Z" - }, - { - "uuid": "f71ad940-455c-11ed-85e0-bf25f168b224", - "name": "test-segment", - "created_at": "2022-10-12T01:47:34.000000Z", - "updated_at": "2022-10-12T01:47:34.000000Z" - } - ], - "account": { - "uuid": "d76c9e80-49cf-11ed-a783-6317eca951a6", - "remote_id": "ACCOUNT-ID-ABC-1", - "domain": null, - "display_name": "Awesome Inc.", - "first_seen_at": "2022-10-12T01:47:33.000000Z", - "last_seen_at": "2022-10-12T02:00:00.000000Z", - "attributes": { - "a_date_at": "2022-10-01T00:00:00.000000Z", - "business_email": null, - "company": null, - "email": null, - "isfunded": null, - "name": "Awesome Inc.", - "revenue": null, - "some_account_data": "something", - "trait1": null, - "trait2": null, - "trait3": null - } - }, - "triggered_event": "Completed Survey", - "form": { - "uuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", - "name": "Customer Churn Survey" - }, - "response": { - "uuid": "eb117cb0-49cf-11ed-b050-03a44b32151c", - "first_shown_at": "2022-10-12T01:48:06.000000Z", - "last_shown_at": "2022-10-12T02:03:46.000000Z", - "show_counter": null, - "first_data_reception_at": "2022-10-12T02:05:55.000000Z", - "last_data_reception_at": "2022-10-12T02:05:55.000000Z", - "completed_at": "2022-10-12T02:05:55.000000Z", - "dismissed_at": null, - "received_at": "2022-10-12T02:05:55.000000Z", - "data": { - "why_did_you_cancel_your_subscription": "Pricing" - }, - "tags": [] - } - }, - "output": [ - { - "context": { - "traits": { - "email": "test17@user.com", - "segments": [ - { - "name": "All Users", - "uuid": "0d91d7a0-401c-11ed-8898-bb1ee0c23ae5", - "created_at": "2022-10-12T01:47:34.000000Z", - "updated_at": "2022-10-12T01:47:34.000000Z" - }, - { - "name": "test-segment", - "uuid": "f71ad940-455c-11ed-85e0-bf25f168b224", - "created_at": "2022-10-12T01:47:34.000000Z", - "updated_at": "2022-10-12T01:47:34.000000Z" - } - ] - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Refiner" - }, - "formUuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", - "formName": "Customer Churn Survey" - }, - "integrations": { "Refiner": false }, - "type": "identify", - "userId": "user@17", - "traits": { "why_did_you_cancel_your_subscription": "Pricing" }, - "originalTimestamp": "2022-10-12T02:05:55.000000Z" - }, - { - "type": "track", - "event": "Completed Survey", - "userId": "user@17", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "formName": "Customer Churn Survey", - "formUuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", - "integration": { - "name": "Refiner" - } - }, - "properties": { - "response": { - "data": { - "why_did_you_cancel_your_subscription": "Pricing" - }, - "tags": [], - "uuid": "eb117cb0-49cf-11ed-b050-03a44b32151c", - "received_at": "2022-10-12T02:05:55.000000Z", - "completed_at": "2022-10-12T02:05:55.000000Z", - "last_shown_at": "2022-10-12T02:03:46.000000Z", - "first_shown_at": "2022-10-12T01:48:06.000000Z", - "last_data_reception_at": "2022-10-12T02:05:55.000000Z", - "first_data_reception_at": "2022-10-12T02:05:55.000000Z" - }, - "refiner_form_name": "Customer Churn Survey", - "refiner_form_uuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae" - }, - "integrations": { - "Refiner": false - }, - "originalTimestamp": "2022-10-12T02:05:55.000000Z" - }, - { - "type": "group", - "traits": { - "name": "Awesome Inc.", - "a_date_at": "2022-10-01T00:00:00.000000Z", - "some_account_data": "something" - }, - "userId": "user@17", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Refiner" - } - }, - "groupId": "ACCOUNT-ID-ABC-1", - "integrations": { - "Refiner": false - }, - "originalTimestamp": "2022-10-12T02:05:55.000000Z" - } - ] - }, - { - "description": "Refiner webhook response", - "input": { - "uuid": "69b83e20-4ea2-11ed-941c-e1cb6c7a3870", - "cookie_uuid": "2f9b7e6a-9ba8-1c68-d474-48d719d92a60", - "project_uuid": "0d8759d0-401c-11ed-8ded-9757c4929b55", - "remote_id": "sdk@30", - "email": "sdk30@gmail.com", - "display_name": "", - "first_seen_at": "2022-10-18T05:04:58.000000Z", - "last_seen_at": "2022-10-18T05:04:58.000000Z", - "attributes": { - "address": null, - "address_city": null, - "address_state": null, - "age": null, - "another_attribute": null, - "city": null, - "country": null, - "created_at": null, - "email": "sdk30@gmail.com", - "event": null, - "first_name": null, - "first_seen_at": "2022-10-18T05:04:58.000000Z", - "form_submissions_count": "1", - "form_views_count": "1", - "gender": null, - "last_form_submission_at": "2022-10-18T05:05:45.000000Z", - "last_form_view_at": "2022-10-18T05:05:29.000000Z", - "last_name": null, - "last_seen_at": "2022-10-18T05:04:58.000000Z", - "name": null, - "phone": null, - "some_attribute": null, - "status": null, - "student": null, - "tag": null, - "trait1": null, - "trait2": null, - "trait3": null, - "url": null, - "user_address_city": null, - "user_address_state": null, - "user_country": null, - "user_id": null, - "username": null, - "useroccupation": null, - "why_did_you_cancel_your_subscription": "Missing features" - }, - "segments": [ - { - "uuid": "0d91d7a0-401c-11ed-8898-bb1ee0c23ae5", - "name": "All Users", - "created_at": "2022-10-18T05:04:58.000000Z", - "updated_at": "2022-10-18T05:04:58.000000Z" - }, - { - "uuid": "f71ad940-455c-11ed-85e0-bf25f168b224", - "name": "test-segment", - "created_at": "2022-10-18T05:04:58.000000Z", - "updated_at": "2022-10-18T05:04:58.000000Z" - } - ], - "account": { - "uuid": "69ba2030-4ea2-11ed-adfc-595e70c7ab07", - "remote_id": null, - "domain": null, - "display_name": "", - "first_seen_at": "2022-10-18T05:04:58.000000Z", - "last_seen_at": "2022-10-18T05:04:58.000000Z", - "attributes": { - "1": null, - "2": null, - "3": null, - "4": null, - "a_date_at": null, - "business_email": null, - "company": null, - "email": null, - "isfunded": null, - "location": null, - "name": null, - "revenue": null, - "some_account_data": null, - "trait1": null, - "trait2": null, - "trait3": null, - "user_id": null - } - }, - "triggered_event": "Completed Survey", - "form": { - "uuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", - "name": "Customer Churn Survey" - }, - "response": { - "uuid": "7c508c60-4ea2-11ed-9302-57708fe11d26", - "first_shown_at": "2022-10-18T05:05:29.000000Z", - "last_shown_at": "2022-10-18T05:05:29.000000Z", - "show_counter": null, - "first_data_reception_at": "2022-10-18T05:05:45.000000Z", - "last_data_reception_at": "2022-10-18T05:05:45.000000Z", - "completed_at": "2022-10-18T05:05:45.000000Z", - "dismissed_at": null, - "received_at": "2022-10-18T05:05:45.000000Z", - "data": { - "why_did_you_cancel_your_subscription": "Missing features" - }, - "tags": [] - } - }, - "output": [ - { - "type": "identify", - "traits": { - "why_did_you_cancel_your_subscription": "Missing features" - }, - "userId": "sdk@30", - "context": { - "traits": { - "email": "sdk30@gmail.com", - "segments": [ - { - "name": "All Users", - "uuid": "0d91d7a0-401c-11ed-8898-bb1ee0c23ae5", - "created_at": "2022-10-18T05:04:58.000000Z", - "updated_at": "2022-10-18T05:04:58.000000Z" - }, - { - "name": "test-segment", - "uuid": "f71ad940-455c-11ed-85e0-bf25f168b224", - "created_at": "2022-10-18T05:04:58.000000Z", - "updated_at": "2022-10-18T05:04:58.000000Z" - } - ] - }, - "library": { - "name": "unknown", - "version": "unknown" - }, - "formName": "Customer Churn Survey", - "formUuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", - "integration": { - "name": "Refiner" - } - }, - "integrations": { - "Refiner": false - }, - "originalTimestamp": "2022-10-18T05:05:45.000000Z" - }, - { - "type": "track", - "event": "Completed Survey", - "userId": "sdk@30", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "formName": "Customer Churn Survey", - "formUuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae", - "integration": { - "name": "Refiner" - } - }, - "properties": { - "response": { - "data": { - "why_did_you_cancel_your_subscription": "Missing features" - }, - "tags": [], - "uuid": "7c508c60-4ea2-11ed-9302-57708fe11d26", - "received_at": "2022-10-18T05:05:45.000000Z", - "completed_at": "2022-10-18T05:05:45.000000Z", - "last_shown_at": "2022-10-18T05:05:29.000000Z", - "first_shown_at": "2022-10-18T05:05:29.000000Z", - "last_data_reception_at": "2022-10-18T05:05:45.000000Z", - "first_data_reception_at": "2022-10-18T05:05:45.000000Z" - }, - "refiner_form_name": "Customer Churn Survey", - "refiner_form_uuid": "0d94c790-401c-11ed-bb27-e31f6832c5ae" - }, - "integrations": { - "Refiner": false - }, - "originalTimestamp": "2022-10-18T05:05:45.000000Z" - } - ] - } -] diff --git a/test/__tests__/data/satismeter_source.json b/test/__tests__/data/satismeter_source.json deleted file mode 100644 index 97b8b44a15..0000000000 --- a/test/__tests__/data/satismeter_source.json +++ /dev/null @@ -1,443 +0,0 @@ -[ - { - "description": " All fields Check with event as completed", - "input": { - "response": { - "id": "63767499ca6fb1b7c988d5bb", - "created": "2022-11-17T17:51:21.764Z", - "rating": 5, - "feedback": "Many things to imporve\n", - "dismissed": false, - "pending": false, - "answers": [ - { - "label": "How likely are you to recommend us to your friends and colleagues?", - "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", - "value": 5, - "name": "SM_rating", - "type": "scale", - "metric": "nps" - }, - { - "label": "What could we do to improve?", - "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", - "value": "Many things to imporve\n", - "name": "SM_comment", - "type": "long-text" - }, - { - "label": "The company made it easy for me to handle my issue.", - "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "scale", - "metric": "ces" - }, - { - "label": "How satisfied were you with the service you received?", - "id": "24c5b290-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "smiley", - "metric": "csat" - }, - { - "label": "How you like to rate the surevy?", - "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", - "value": 4, - "type": "scale" - }, - { - "label": "Your Name (Single Answer)", - "id": "37a8c000-66a0-11ed-856c-6f39711bf041", - "value": "a", - "type": "single-choice" - }, - { - "label": "Your Name (Multiple Answer)", - "id": "4b435da0-66a0-11ed-856c-6f39711bf041", - "value": ["a1", "b1"], - "type": "multiple-choice" - } - ], - "category": "detractor", - "score": -100, - "user": { - "id": "63766fbb7ac7b72676145338", - "name": "John Doe", - "email": "john@doe.com", - "userId": "No response", - "deleted": false, - "groups": { - "group1": "grooupId" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe" - } - }, - "device": { - "os": "macOS", - "type": "desktop" - }, - "location": { - "country": "IN", - "countryName": "India", - "region": "", - "city": "", - "short": "India", - "long": "India" - }, - "referrer": "http://127.0.0.1:5500/testSm.html", - "method": "In-app", - "language": "en", - "project": "6372247a764986ebee62bf66", - "campaign": "6373271b764986ebee62bfca" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe" - }, - "campaign": { - "id": "6373271b764986ebee62bfca", - "name": "NPS Survey" - }, - "event": "completed" - }, - "output": { - "event": "Survey completed", - "anonymousId": "63766fbb7ac7b72676145338", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe", - "userDeleted": false - }, - "locale": "en", - "campaign": { - "id": "6373271b764986ebee62bfca", - "name": "NPS Survey" - }, - "integration": { - "name": "SATISMETER" - }, - "location": { - "country": "IN", - "countryName": "India", - "short": "India", - "long": "India" - }, - "device": { - "os": "macOS", - "type": "desktop" - }, - "page": { - "referrer": "http://127.0.0.1:5500/testSm.html" - } - }, - "integrations": { - "SATISMETER": false - }, - "type": "track", - "traits": { - "groups": { "group1": "grooupId" } - }, - "userId": "No response", - "properties": { - "category": "detractor", - "answers": [ - { - "label": "How likely are you to recommend us to your friends and colleagues?", - "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", - "value": 5, - "name": "SM_rating", - "type": "scale", - "metric": "nps" - }, - { - "label": "What could we do to improve?", - "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", - "value": "Many things to imporve\n", - "name": "SM_comment", - "type": "long-text" - }, - { - "label": "The company made it easy for me to handle my issue.", - "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "scale", - "metric": "ces" - }, - { - "label": "How satisfied were you with the service you received?", - "id": "24c5b290-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "smiley", - "metric": "csat" - }, - { - "label": "How you like to rate the surevy?", - "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", - "value": 4, - "type": "scale" - }, - { - "label": "Your Name (Single Answer)", - "id": "37a8c000-66a0-11ed-856c-6f39711bf041", - "value": "a", - "type": "single-choice" - }, - { - "label": "Your Name (Multiple Answer)", - "id": "4b435da0-66a0-11ed-856c-6f39711bf041", - "value": ["a1", "b1"], - "type": "multiple-choice" - } - ], - "surveyDismissed": false, - "surveyPending": false, - "receivedAt": "2022-11-17T17:51:21.764Z" - } - } - }, - { - "description": " Neither reponse.user.id or response.user.userId is provided in payload then mapping response.id to anonymousId", - "input": { - "response": { - "id": "63767499ca6fb1b7c988d5bb", - "created": "2022-11-17T17:51:21.764Z", - "rating": 5, - "feedback": "Many things to imporve\n", - "dismissed": false, - "pending": false, - "answers": [ - { - "label": "How likely are you to recommend us to your friends and colleagues?", - "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", - "value": 5, - "name": "SM_rating", - "type": "scale", - "metric": "nps" - }, - { - "label": "What could we do to improve?", - "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", - "value": "Many things to imporve\n", - "name": "SM_comment", - "type": "long-text" - }, - { - "label": "The company made it easy for me to handle my issue.", - "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "scale", - "metric": "ces" - }, - { - "label": "How satisfied were you with the service you received?", - "id": "24c5b290-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "smiley", - "metric": "csat" - }, - { - "label": "How you like to rate the surevy?", - "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", - "value": 4, - "type": "scale" - }, - { - "label": "Your Name (Single Answer)", - "id": "37a8c000-66a0-11ed-856c-6f39711bf041", - "value": "a", - "type": "single-choice" - }, - { - "label": "Your Name (Multiple Answer)", - "id": "4b435da0-66a0-11ed-856c-6f39711bf041", - "value": ["a1", "b1"], - "type": "multiple-choice" - } - ], - "category": "detractor", - "score": -100, - "user": { - "name": "John Doe", - "email": "john@doe.com", - "deleted": false, - "groups": { - "group1": "grooupId" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe" - } - }, - "device": { - "os": "macOS", - "type": "desktop" - }, - "location": { - "country": "IN", - "countryName": "India", - "region": "", - "city": "", - "short": "India", - "long": "India" - }, - "referrer": "http://127.0.0.1:5500/testSm.html", - "method": "In-app", - "language": "en", - "project": "6372247a764986ebee62bf66", - "campaign": "6373271b764986ebee62bfca" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe" - }, - "campaign": { - "id": "6373271b764986ebee62bfca", - "name": "NPS Survey" - }, - "event": "completed" - }, - "output": { - "event": "Survey completed", - "anonymousId": "63767499ca6fb1b7c988d5bb", - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "traits": { - "createdAt": "2022-10-15T05:41:06.016Z", - "custom": { - "key1": "v1", - "key2": "V2" - }, - "email": "john@doe.com", - "name": "John Doe", - "userDeleted": false - }, - "locale": "en", - "campaign": { - "id": "6373271b764986ebee62bfca", - "name": "NPS Survey" - }, - "integration": { - "name": "SATISMETER" - }, - "location": { - "country": "IN", - "countryName": "India", - "short": "India", - "long": "India" - }, - "device": { - "os": "macOS", - "type": "desktop" - }, - "page": { - "referrer": "http://127.0.0.1:5500/testSm.html" - } - }, - "integrations": { - "SATISMETER": false - }, - "type": "track", - "traits": { - "groups": { "group1": "grooupId" } - }, - "properties": { - "category": "detractor", - "answers": [ - { - "label": "How likely are you to recommend us to your friends and colleagues?", - "id": "7ddb22b0-64a8-11ed-a4c7-b3bed73771cd", - "value": 5, - "name": "SM_rating", - "type": "scale", - "metric": "nps" - }, - { - "label": "What could we do to improve?", - "id": "7ddb22b1-64a8-11ed-a4c7-b3bed73771cd", - "value": "Many things to imporve\n", - "name": "SM_comment", - "type": "long-text" - }, - { - "label": "The company made it easy for me to handle my issue.", - "id": "1dc53f60-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "scale", - "metric": "ces" - }, - { - "label": "How satisfied were you with the service you received?", - "id": "24c5b290-66a0-11ed-856c-6f39711bf041", - "value": 4, - "name": null, - "type": "smiley", - "metric": "csat" - }, - { - "label": "How you like to rate the surevy?", - "id": "27b3d1d0-66a0-11ed-856c-6f39711bf041", - "value": 4, - "type": "scale" - }, - { - "label": "Your Name (Single Answer)", - "id": "37a8c000-66a0-11ed-856c-6f39711bf041", - "value": "a", - "type": "single-choice" - }, - { - "label": "Your Name (Multiple Answer)", - "id": "4b435da0-66a0-11ed-856c-6f39711bf041", - "value": ["a1", "b1"], - "type": "multiple-choice" - } - ], - "surveyDismissed": false, - "surveyPending": false, - "receivedAt": "2022-11-17T17:51:21.764Z" - } - } - } -] diff --git a/test/__tests__/data/segment_source_input.json b/test/__tests__/data/segment_source_input.json deleted file mode 100644 index f5c7173e00..0000000000 --- a/test/__tests__/data/segment_source_input.json +++ /dev/null @@ -1,112 +0,0 @@ -[ - [ - { - "date": "2020-07-10T07:43:07.766Z", - "type": "s", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", - "details": { - "prompts": [], - "completedAt": 1594366987765, - "elapsedTime": null, - "session_id": "**************_***************" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": true - }, - { - "date": "2020-07-10T07:43:09.620Z", - "type": "seacft", - "description": "", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "okhttp 2.7.5 / Other 0.0.0", - "details": { - "code": "*************Xst" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": false - }, - { - "date": "2020-07-10T07:43:07.766Z", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", - "details": { - "prompts": [], - "completedAt": 1594366987765, - "elapsedTime": null, - "session_id": "**************_***************" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": true - }, - { - "type": "s", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", - "details": { - "prompts": [], - "completedAt": 1594366987765, - "elapsedTime": null, - "session_id": "**************_***************" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": true - } - ] -] diff --git a/test/__tests__/data/segment_source_output.json b/test/__tests__/data/segment_source_output.json deleted file mode 100644 index f5c7173e00..0000000000 --- a/test/__tests__/data/segment_source_output.json +++ /dev/null @@ -1,112 +0,0 @@ -[ - [ - { - "date": "2020-07-10T07:43:07.766Z", - "type": "s", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", - "details": { - "prompts": [], - "completedAt": 1594366987765, - "elapsedTime": null, - "session_id": "**************_***************" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": true - }, - { - "date": "2020-07-10T07:43:09.620Z", - "type": "seacft", - "description": "", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "okhttp 2.7.5 / Other 0.0.0", - "details": { - "code": "*************Xst" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": false - }, - { - "date": "2020-07-10T07:43:07.766Z", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", - "details": { - "prompts": [], - "completedAt": 1594366987765, - "elapsedTime": null, - "session_id": "**************_***************" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": true - }, - { - "type": "s", - "connection_id": "", - "client_id": "********************************", - "client_name": "My App", - "ip": "47.15.6.58", - "user_agent": "Chrome Mobile 69.0.3497 / Android 0.0.0", - "details": { - "prompts": [], - "completedAt": 1594366987765, - "elapsedTime": null, - "session_id": "**************_***************" - }, - "hostname": "************.us.auth0.com", - "user_id": "auth0|************************", - "user_name": "example@test.com", - "auth0_client": { - "name": "Auth0.Android", - "env": { - "android": "28" - }, - "version": "1.23.0" - }, - "log_id": "********************************************************", - "_id": "********************************************************", - "isMobile": true - } - ] -] diff --git a/test/__tests__/data/shopify.json b/test/__tests__/data/shopify.json deleted file mode 100644 index 48ca8c75a0..0000000000 --- a/test/__tests__/data/shopify.json +++ /dev/null @@ -1,515 +0,0 @@ -[ - { - "description": "Track Call -> carts_create ", - "input": { - "id": "shopify_test3", - "query_parameters": { - "topic": ["carts_create"] - }, - "token": "shopify_test3", - "line_items": [], - "note": null, - "updated_at": "2023-02-10T12:16:07.251Z", - "created_at": "2023-02-10T12:05:04.402Z" - }, - "output": { - "outputToSource": { - "body": "T0s=", - "contentType": "text/plain" - }, - "statusCode": 200 - } - }, - { - "description": "No Query Parameters", - "input": {}, - "output": { - "error": "Query_parameters is missing" - } - }, - { - "description": "Invalid topic", - "input": { - "query_parameters": { - "signature": ["rudderstack"], - "writeKey": ["sample-write-key"] - } - }, - "output": { - "error": "Invalid topic in query_parameters" - } - }, - { - "description": "Topic Not found", - "input": { - "query_parameters": { - "topic": [], - "signature": ["rudderstack"], - "writeKey": ["sample-write-key"] - } - }, - "output": { - "error": "Topic not found" - } - }, - { - "description": "Unsupported Event Type", - "input": { - "query_parameters": { - "topic": ["random_event"], - "signature": ["rudderstack"], - "writeKey": ["sample-write-key"] - } - }, - "output": { - "outputToSource": { - "body": "T0s=", - "contentType": "text/plain" - }, - "statusCode": 200 - } - }, - { - "description": "Identify Call for customers create event", - "input": { - "query_parameters": { - "topic": ["customers_create"], - "signature": ["rudderstack"], - "writeKey": ["sample-write-key"] - }, - "id": 5747017285820, - "email": "anuraj@rudderstack.com", - "accepts_marketing": false, - "created_at": "2021-12-29T15:15:19+05:30", - "updated_at": "2021-12-29T15:15:20+05:30", - "first_name": "Anuraj", - "last_name": "Guha", - "orders_count": 0, - "state": "disabled", - "total_spent": "0.00", - "last_order_id": null, - "note": "", - "verified_email": true, - "multipass_identifier": null, - "tax_exempt": false, - "phone": "+919876543210", - "tags": "", - "last_order_name": null, - "currency": "INR", - "addresses": [ - { - "id": 6947581821116, - "customer_id": 5747017285820, - "first_name": "Anuraj", - "last_name": "Guha", - "company": "Rudderstack", - "address1": "Home", - "address2": "Apartment", - "city": "Kolkata", - "province": "West Bengal", - "country": "India", - "zip": "708091", - "phone": "+919876543210", - "name": "Anuraj Guha", - "province_code": "WB", - "country_code": "IN", - "country_name": "India", - "default": true - } - ], - "accepts_marketing_updated_at": "2021-12-29T15:15:20+05:30", - "marketing_opt_in_level": null, - "tax_exemptions": [], - "sms_marketing_consent": { - "state": "not_subscribed", - "opt_in_level": "single_opt_in", - "consent_updated_at": null, - "consent_collected_from": "SHOPIFY" - }, - "admin_graphql_api_id": "gid://shopify/Customer/5747017285820", - "default_address": { - "id": 6947581821116, - "customer_id": 5747017285820, - "first_name": "Anuraj", - "last_name": "Guha", - "company": "Rudderstack", - "address1": "Home", - "address2": "Apartment", - "city": "Kolkata", - "province": "West Bengal", - "country": "India", - "zip": "708091", - "phone": "+919876543210", - "name": "Anuraj Guha", - "province_code": "WB", - "country_code": "IN", - "country_name": "India", - "default": true - } - }, - "output": { - "context": { - "library": { - "name": "RudderStack Shopify Cloud", - "version": "1.0.0" - }, - "integration": { - "name": "SHOPIFY" - }, - "topic": "customers_create" - }, - "integrations": { - "SHOPIFY": true - }, - "type": "identify", - "userId": "5747017285820", - "traits": { - "email": "anuraj@rudderstack.com", - "firstName": "Anuraj", - "lastName": "Guha", - "phone": "+919876543210", - "addressList": [ - { - "id": 6947581821116, - "customer_id": 5747017285820, - "first_name": "Anuraj", - "last_name": "Guha", - "company": "Rudderstack", - "address1": "Home", - "address2": "Apartment", - "city": "Kolkata", - "province": "West Bengal", - "country": "India", - "zip": "708091", - "phone": "+919876543210", - "name": "Anuraj Guha", - "province_code": "WB", - "country_code": "IN", - "country_name": "India", - "default": true - } - ], - "address": { - "id": 6947581821116, - "customer_id": 5747017285820, - "first_name": "Anuraj", - "last_name": "Guha", - "company": "Rudderstack", - "address1": "Home", - "address2": "Apartment", - "city": "Kolkata", - "province": "West Bengal", - "country": "India", - "zip": "708091", - "phone": "+919876543210", - "name": "Anuraj Guha", - "province_code": "WB", - "country_code": "IN", - "country_name": "India", - "default": true - }, - "acceptsMarketing": false, - "orderCount": 0, - "state": "disabled", - "totalSpent": "0.00", - "note": "", - "verifiedEmail": true, - "taxExempt": false, - "tags": "", - "currency": "INR", - "taxExemptions": [], - "smsMarketingConsent": { - "state": "not_subscribed", - "opt_in_level": "single_opt_in", - "consent_updated_at": null, - "consent_collected_from": "SHOPIFY" - }, - "adminGraphqlApiId": "gid://shopify/Customer/5747017285820", - "acceptsMarketingUpdatedAt": "2021-12-29T15:15:20+05:30" - }, - "timestamp": "2021-12-29T09:45:20.000Z" - } - }, - { - "description": "Unsupported checkout event", - "input": { - "query_parameters": { - "topic": ["checkout_delete"], - "writeKey": ["sample-write-key"], - "signature": ["rudderstack"] - }, - "admin_graphql_api_id": "gid://shopify/Fulfillment/4124667937024", - "created_at": "2022-01-05T18:13:02+05:30", - "destination": null, - "id": 4124667937024, - "line_items": [], - "customer": { - "email": "test_person@email.com", - "first_name": "Test", - "last_name": "Person" - }, - "billing_address": { - "address1": "11 Rani Sankari Lane Patuapara Bhowanipore" - }, - "shipping_address": { - "address1": "11 Rani Sankari Lane Patuapara Bhowanipore" - }, - "location_id": 66855371008, - "name": "#1002.1", - "order_id": 4617255092480, - "origin_address": null, - "receipt": {}, - "service": "manual", - "shipment_status": null, - "status": "success", - "tracking_company": "Amazon Logistics UK", - "tracking_number": "Sample001test", - "tracking_numbers": ["Sample001test"], - "tracking_url": "https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530", - "tracking_urls": ["https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530"], - "updated_at": "2022-01-05T18:16:48+05:30" - }, - "output": { - "outputToSource": { - "body": "T0s=", - "contentType": "text/plain" - }, - "statusCode": 200 - } - }, - { - "description": "Track Call -> Fullfillments updated event", - "input": { - "query_parameters": { - "topic": ["fulfillments_update"], - "writeKey": ["sample-write-key"], - "signature": ["rudderstack"] - }, - "shipping_address": { - "address1": "11 Rani Sankari Lane Patuapara Bhowanipore" - }, - "billing_address": { - "address1": "11 Rani Sankari Lane Patuapara Bhowanipore" - }, - "admin_graphql_api_id": "gid://shopify/Fulfillment/4124667937024", - "created_at": "2022-01-05T18:13:02+05:30", - "destination": null, - "email": "test_person@email.com", - "id": 4124667937024, - "line_items": [ - { - "admin_graphql_api_id": "gid://shopify/LineItem/11896203149568", - "discount_allocations": [], - "duties": [], - "fulfillable_quantity": 0, - "fulfillment_service": "manual", - "fulfillment_status": "fulfilled", - "gift_card": false, - "grams": 0, - "id": 11896203149568, - "name": "p1", - "origin_location": { - "address1": "74 CC/7, Anupama Housing Estate - II", - "address2": "", - "city": "Kolkatta", - "country_code": "IN", - "id": 3373642219776, - "name": "74 CC/7, Anupama Housing Estate - II", - "province_code": "WB", - "zip": "700052" - }, - "price": "5000.00", - "price_set": { - "presentment_money": { - "amount": "5000.00", - "currency_code": "INR" - }, - "shop_money": { - "amount": "5000.00", - "currency_code": "INR" - } - }, - "product_exists": true, - "product_id": 7510929801472, - "properties": [], - "quantity": 1, - "requires_shipping": true, - "sku": "15", - "tax_lines": [ - { - "channel_liable": false, - "price": "900.00", - "price_set": { - "presentment_money": { - "amount": "900.00", - "currency_code": "INR" - }, - "shop_money": { - "amount": "900.00", - "currency_code": "INR" - } - }, - "rate": 0.18, - "title": "IGST" - } - ], - "taxable": true, - "title": "p1", - "total_discount": "0.00", - "total_discount_set": { - "presentment_money": { - "amount": "0.00", - "currency_code": "INR" - }, - "shop_money": { - "amount": "0.00", - "currency_code": "INR" - } - }, - "variant_id": 42211160228096, - "variant_inventory_management": "shopify", - "variant_title": "", - "vendor": "rudderstack-store" - } - ], - "location_id": 66855371008, - "name": "#1002.1", - "order_id": 4617255092480, - "origin_address": null, - "receipt": {}, - "service": "manual", - "shipment_status": null, - "status": "success", - "tracking_company": "Amazon Logistics UK", - "tracking_number": "Sample001test", - "tracking_numbers": ["Sample001test"], - "tracking_url": "https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530", - "tracking_urls": ["https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530"], - "updated_at": "2022-01-05T18:16:48+05:30" - }, - "output": { - "context": { - "library": { - "name": "RudderStack Shopify Cloud", - "version": "1.0.0" - }, - "integration": { - "name": "SHOPIFY" - }, - "topic": "fulfillments_update" - }, - "integrations": { - "SHOPIFY": true - }, - "type": "track", - "userId": "shopify-admin", - "event": "Fulfillments Update", - "properties": { - "admin_graphql_api_id": "gid://shopify/Fulfillment/4124667937024", - "created_at": "2022-01-05T18:13:02+05:30", - "destination": null, - "email": "test_person@email.com", - "id": 4124667937024, - "location_id": 66855371008, - "name": "#1002.1", - "order_id": 4617255092480, - "origin_address": null, - "receipt": {}, - "service": "manual", - "shipment_status": null, - "status": "success", - "tracking_company": "Amazon Logistics UK", - "tracking_number": "Sample001test", - "tracking_numbers": ["Sample001test"], - "tracking_url": "https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530", - "tracking_urls": [ - "https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530" - ], - "updated_at": "2022-01-05T18:16:48+05:30", - "products": [ - { - "product_id": 7510929801472, - "sku": "15", - "title": "p1", - "price": "5000.00", - "brand": "rudderstack-store", - "quantity": 1, - "admin_graphql_api_id": "gid://shopify/LineItem/11896203149568", - "discount_allocations": [], - "duties": [], - "fulfillable_quantity": 0, - "fulfillment_service": "manual", - "fulfillment_status": "fulfilled", - "gift_card": false, - "grams": 0, - "id": 11896203149568, - "origin_location": { - "address1": "74 CC/7, Anupama Housing Estate - II", - "address2": "", - "city": "Kolkatta", - "country_code": "IN", - "id": 3373642219776, - "name": "74 CC/7, Anupama Housing Estate - II", - "province_code": "WB", - "zip": "700052" - }, - "price_set": { - "presentment_money": { - "amount": "5000.00", - "currency_code": "INR" - }, - "shop_money": { - "amount": "5000.00", - "currency_code": "INR" - } - }, - "product_exists": true, - "properties": [], - "requires_shipping": true, - "tax_lines": [ - { - "channel_liable": false, - "price": "900.00", - "price_set": { - "presentment_money": { - "amount": "900.00", - "currency_code": "INR" - }, - "shop_money": { - "amount": "900.00", - "currency_code": "INR" - } - }, - "rate": 0.18, - "title": "IGST" - } - ], - "taxable": true, - "total_discount": "0.00", - "total_discount_set": { - "presentment_money": { - "amount": "0.00", - "currency_code": "INR" - }, - "shop_money": { - "amount": "0.00", - "currency_code": "INR" - } - }, - "variant_inventory_management": "shopify", - "variant": "42211160228096 " - } - ] - }, - "traits": { - "shippingAddress": { - "address1": "11 Rani Sankari Lane Patuapara Bhowanipore" - }, - "billingAddress": { - "address1": "11 Rani Sankari Lane Patuapara Bhowanipore" - }, - "email": "test_person@email.com" - } - } - } -] diff --git a/test/__tests__/data/signl4_source_input.json b/test/__tests__/data/signl4_source_input.json deleted file mode 100644 index a3309cd03c..0000000000 --- a/test/__tests__/data/signl4_source_input.json +++ /dev/null @@ -1,123 +0,0 @@ -[ - { - "eventType": 200, - "eventRaisedUtc": "2017-09-01T08:11:37.4815663Z", - "subscription": { - "id": "0acf8014-22f2-4503-88d7-f7d05b46744f" - }, - "alert": { - "statusCode": 1, - "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "externalEventId": "INC091210", - "id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" - }, - "id": "dd209a2d-e037-41ee-b37d-f605cc0a39fb" - }, - { - "eventType": 201, - "eventRaisedUtc": "2017-09-01T08:11:37.4815663Z", - "subscription": { - "id": "0acf8014-22f2-4503-88d7-f7d05b46744f" - }, - "user": { - "username": "Rene", - "mailaddress": "rene@signl4.com", - "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" - }, - "alert": { - "statusCode": 2, - "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "externalEventId": "Content you passed in the X-S4-ExternalID parameter", - "acknowledgedUserIds": ["f0bd5063-9588-51cf-b3d9-94e5647dedc5"], - "id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" - }, - "id": "dd209a2d-e037-41ee-b37d-f605cc0a39fb" - }, - { - "eventType": 201, - "eventRaisedUtc": "2017-09-01T08:11:37.4815663Z", - "subscription": { - "id": "0acf8014-22f2-4503-88d7-f7d05b46744f" - }, - "user": { - "username": "Rene", - "mailaddress": "rene@signl4.com", - "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" - }, - "alert": { - "statusCode": 4, - "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "externalEventId": "Content you passed in the X-S4-ExternalID parameter", - "acknowledgedUserIds": ["f0bd5063-9588-51cf-b3d9-94e5647dedc5"], - "id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" - }, - "id": "dd209a2d-e037-41ee-b37d-f605cc0a39fb" - }, - { - "eventType": 202, - "eventRaisedUtc": "2020-01-10T12:27:19Z", - "subscription": { - "id": "b8fdd850-e2ad-45ff-924d-9c332a063200" - }, - "team": { - "id": "0e8979f7-0c6a-472d-8918-ecfd339252f8" - }, - "alert": { - "statusCode": 1, - "eventId": "2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9", - "externalEventId": "INC091210", - "acknowledgedUserIds": [], - "id": "2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2" - }, - "id": "27283793-47c8-4da2-9767-d37be224338d" - }, - { - "eventType": 203, - "eventRaisedUtc": "2018-04-17T15:00:32Z", - "subscription": { - "id": "1578ebd9-0a27-44ab-bc8e-52cd7d32e81d" - }, - "user": { - "username": "Rene", - "mailaddress": "rene@signl4.com", - "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" - }, - "alert": { - "statusCode": 0, - "eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "externalEventId": "Content you passed in the X-S4-ExternalID parameter", - "id": "2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2" - }, - "annotation": { - "message": "OK, I'll take care about it.", - "id": "2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761" - }, - "id": "141c0f88-7831-4d5e-b055-f6e83c269770" - }, - { - "eventType": 300, - "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", - "team": { "id": "f1801955-4724-44de-902a-f6f02ba9e10f" }, - "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" - }, - { - "eventType": 301, - "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", - "team": { "id": "f1801955-4724-44de-902a-f6f02ba9e10f" }, - "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" - }, - { - "eventType": 302, - "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", - "team": { "id": "f1801955-4724-44de-902a-f6f02ba9e10f" }, - "user": { "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" }, - "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" - }, - { - "eventType": 303, - "eventRaisedUtc": "2017-09-01T09:16:17.3717355Z", - "team": { "id": "f1801955-4724-44de-902a-f6f02ba9e10f" }, - "user": { "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" }, - "id": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3" - } -] diff --git a/test/__tests__/data/signl4_source_output.json b/test/__tests__/data/signl4_source_output.json deleted file mode 100644 index a56fb814de..0000000000 --- a/test/__tests__/data/signl4_source_output.json +++ /dev/null @@ -1,269 +0,0 @@ -[ - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - } - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "dd209a2d-e037-41ee-b37d-f605cc0a39fb", - "originalTimestamp": "2017-09-01T08:11:37.000Z", - "event": "New Alert Created", - "properties": { - "eventType": 200, - "subscription.id": "0acf8014-22f2-4503-88d7-f7d05b46744f", - "alert.statusCode": 1, - "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "alert.externalEventId": "INC091210", - "alert.id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - }, - "externalId": [ - { - "type": "signl4UserId", - "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" - } - ], - "traits": { - "email": "rene@signl4.com", - "name": "Rene" - } - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "dd209a2d-e037-41ee-b37d-f605cc0a39fb", - "originalTimestamp": "2017-09-01T08:11:37.000Z", - "event": "Alert Confirmed", - "properties": { - "eventType": 201, - "subscription.id": "0acf8014-22f2-4503-88d7-f7d05b46744f", - "alert.statusCode": 2, - "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "alert.externalEventId": "Content you passed in the X-S4-ExternalID parameter", - "alert.acknowledgedUserIds[0]": "f0bd5063-9588-51cf-b3d9-94e5647dedc5", - "alert.id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - }, - "externalId": [ - { - "type": "signl4UserId", - "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" - } - ], - "traits": { - "email": "rene@signl4.com", - "name": "Rene" - } - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "dd209a2d-e037-41ee-b37d-f605cc0a39fb", - "originalTimestamp": "2017-09-01T08:11:37.000Z", - "event": "Alert Resolved", - "properties": { - "eventType": 201, - "subscription.id": "0acf8014-22f2-4503-88d7-f7d05b46744f", - "alert.statusCode": 4, - "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "alert.externalEventId": "Content you passed in the X-S4-ExternalID parameter", - "alert.acknowledgedUserIds[0]": "f0bd5063-9588-51cf-b3d9-94e5647dedc5", - "alert.id": "2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685" - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - } - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "27283793-47c8-4da2-9767-d37be224338d", - "originalTimestamp": "2020-01-10T12:27:19.000Z", - "event": "Alert Escalated", - "properties": { - "eventType": 202, - "subscription.id": "b8fdd850-e2ad-45ff-924d-9c332a063200", - "team.id": "0e8979f7-0c6a-472d-8918-ecfd339252f8", - "alert.statusCode": 1, - "alert.eventId": "2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9", - "alert.externalEventId": "INC091210", - "alert.id": "2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2", - "alert.acknowledgedUserIds": [] - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - }, - "externalId": [ - { - "type": "signl4UserId", - "id": "f0bd5063-9588-51cf-b3d9-94e5647dedc5" - } - ], - "traits": { - "email": "rene@signl4.com", - "name": "Rene" - } - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "141c0f88-7831-4d5e-b055-f6e83c269770", - "originalTimestamp": "2018-04-17T15:00:32.000Z", - "event": "Alert Annotated", - "properties": { - "eventType": 203, - "subscription.id": "1578ebd9-0a27-44ab-bc8e-52cd7d32e81d", - "alert.statusCode": 0, - "alert.eventId": "2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2", - "alert.externalEventId": "Content you passed in the X-S4-ExternalID parameter", - "alert.id": "2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2", - "annotation.message": "OK, I'll take care about it.", - "annotation.id": "2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761" - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - } - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", - "originalTimestamp": "2017-09-01T09:16:17.000Z", - "event": "Duty Period Started", - "properties": { - "eventType": 300, - "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" - } - }, - - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - } - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", - "originalTimestamp": "2017-09-01T09:16:17.000Z", - "event": "Duty Period Ended", - "properties": { - "eventType": 301, - "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - }, - "externalId": [ - { - "type": "signl4UserId", - "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" - } - ] - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", - "originalTimestamp": "2017-09-01T09:16:17.000Z", - "event": "Somebody Punched-In", - "properties": { - "eventType": 302, - "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" - } - }, - { - "context": { - "library": { - "name": "unknown", - "version": "unknown" - }, - "integration": { - "name": "Signl4" - }, - "externalId": [ - { - "type": "signl4UserId", - "id": "e31da15f-7e13-43f1-b4a5-1ce3b470a504" - } - ] - }, - "integrations": { - "Signl4": false - }, - "type": "track", - "messageId": "f56a6b59-1197-4e7d-8eca-8d21a4b57ec3", - "originalTimestamp": "2017-09-01T09:16:17.000Z", - "event": "Somebody Punched-Out", - "properties": { - "eventType": 303, - "team.id": "f1801955-4724-44de-902a-f6f02ba9e10f" - } - } -] diff --git a/test/__tests__/data/versioned_processor_heap_input.json b/test/__tests__/data/versioned_processor_heap_input.json index d9f94fe9b5..901eea3a9f 100644 --- a/test/__tests__/data/versioned_processor_heap_input.json +++ b/test/__tests__/data/versioned_processor_heap_input.json @@ -11,7 +11,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, @@ -74,7 +74,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, @@ -138,7 +138,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, @@ -204,7 +204,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, @@ -272,7 +272,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, @@ -340,7 +340,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, diff --git a/test/__tests__/data/versioned_processor_heap_output.json b/test/__tests__/data/versioned_processor_heap_output.json index 3041a6f35c..73ef473017 100644 --- a/test/__tests__/data/versioned_processor_heap_output.json +++ b/test/__tests__/data/versioned_processor_heap_output.json @@ -139,7 +139,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, @@ -153,7 +153,7 @@ "errorCategory": "dataValidation", "errorType": "instrumentation", "feature": "processor", - "implementation": "cdkV1", + "implementation": "cdkV", "module": "destination", "destType": "HEAP" } @@ -171,7 +171,7 @@ "ID": "1WTbl0l5GjOQKOvfmcGwk0T49kV", "Name": "HEAP", "Config": { - "cdkEnabled": true + "cdkV2Enabled": true } }, "Enabled": true, @@ -184,7 +184,7 @@ "statTags": { "errorCategory": "transformation", "feature": "processor", - "implementation": "cdkV1", + "implementation": "cdkV2", "module": "destination", "destType": "HEAP" } diff --git a/test/__tests__/formsort_source.test.js b/test/__tests__/formsort_source.test.js deleted file mode 100644 index 29c1c0831d..0000000000 --- a/test/__tests__/formsort_source.test.js +++ /dev/null @@ -1,26 +0,0 @@ -const integration = "formsort"; -const name = "formsort"; - -const version = "v0"; -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${name} Tests: payload: ${index} - ${data.description}`, () => { - try { - const output = transformer.process(data.input); - delete output.anonymousId; - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output.message); - } - }); -}); diff --git a/test/__tests__/gpx_source.test.js b/test/__tests__/gpx_source.test.js deleted file mode 100644 index c8e7df5f4a..0000000000 --- a/test/__tests__/gpx_source.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const integration = "gainsightpx"; -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${index}. ${integration} - ${data.description}`, () => { - try { - const output = transformer.process(data.input); - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output.error); - } - }); -}); diff --git a/test/__tests__/iterable_source.test.js b/test/__tests__/iterable_source.test.js deleted file mode 100644 index e478966bd7..0000000000 --- a/test/__tests__/iterable_source.test.js +++ /dev/null @@ -1,30 +0,0 @@ -const integration = "iterable"; -const name = "Iterable"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].message); - } - }); -}); diff --git a/test/__tests__/mailjet_source.test.js b/test/__tests__/mailjet_source.test.js deleted file mode 100644 index 7a778e7b4e..0000000000 --- a/test/__tests__/mailjet_source.test.js +++ /dev/null @@ -1,26 +0,0 @@ -const integration = "mailjet"; -const name = "MailJet"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${name} Tests: payload: ${index}`, () => { - try { - const output = transformer.process(data.input); - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output); - } - }); -}); diff --git a/test/__tests__/mailmodo_source.test.js b/test/__tests__/mailmodo_source.test.js deleted file mode 100644 index d038e4236c..0000000000 --- a/test/__tests__/mailmodo_source.test.js +++ /dev/null @@ -1,30 +0,0 @@ -const integration = "mailmodo"; -const name = "Mailmodo"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].message); - } - }); -}); diff --git a/test/__tests__/monday_source.test.js b/test/__tests__/monday_source.test.js deleted file mode 100644 index d97f73451e..0000000000 --- a/test/__tests__/monday_source.test.js +++ /dev/null @@ -1,30 +0,0 @@ -const integration = "monday"; -const name = "Monday"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].message); - } - }); -}); diff --git a/test/__tests__/olark_source.test.js b/test/__tests__/olark_source.test.js deleted file mode 100644 index 6e69bd466c..0000000000 --- a/test/__tests__/olark_source.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const integration = "olark"; - -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${index}. ${integration} - ${data.description}`, () => { - try { - const output = transformer.process(data.input); - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output.message); - } - }); -}); diff --git a/test/__tests__/pagerduty_source.test.js b/test/__tests__/pagerduty_source.test.js deleted file mode 100644 index ddfb69aba6..0000000000 --- a/test/__tests__/pagerduty_source.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const integration = "pagerduty"; - -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${index}. ${integration} - ${data.description}`, () => { - try { - const output = transformer.process(data.input); - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output.message); - } - }); -}); diff --git a/test/__tests__/pipedream_source.test.js b/test/__tests__/pipedream_source.test.js deleted file mode 100644 index 1edc642bad..0000000000 --- a/test/__tests__/pipedream_source.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const integration = "pipedream"; - -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${index}. ${integration} - ${data.description}`, () => { - try { - const output = transformer.process(data.input); - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output.message); - } - }); -}); diff --git a/test/__tests__/refiner_source.test.js b/test/__tests__/refiner_source.test.js deleted file mode 100644 index 5a064d0472..0000000000 --- a/test/__tests__/refiner_source.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const integration = "refiner"; - -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${index}. ${integration} - ${data.description}`, () => { - try { - const output = transformer.process(data.input); - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output.message); - } - }); -}); diff --git a/test/__tests__/satismeter_source.test.js b/test/__tests__/satismeter_source.test.js deleted file mode 100644 index d0d1a540d3..0000000000 --- a/test/__tests__/satismeter_source.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const integration = "satismeter"; -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${integration}/transform`); - -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source.json`) -); - -const testData = JSON.parse(testDataFile); - -testData.forEach((data, index) => { - it(`${index}. ${integration} - ${data.description}`, () => { - try { - const output = transformer.process(data.input); - expect(output).toEqual(data.output); - } catch (error) { - expect(error.message).toEqual(data.output.error); - } - }); -}); diff --git a/test/__tests__/segment_source.test.js b/test/__tests__/segment_source.test.js deleted file mode 100644 index 3668232e4a..0000000000 --- a/test/__tests__/segment_source.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const integration = "segment"; -const name = "Segment"; - -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${integration}/transform`); - -test(`${name} Tests`, () => { - const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) - ); - const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) - ); - const inputData = JSON.parse(inputDataFile); - const expectedData = JSON.parse(outputDataFile); - inputData.forEach(async (input, index) => { - const output = transformer.process(input); - expect(output).toEqual(expectedData[index]); - }); -}); diff --git a/test/__tests__/shopify_source.test.js b/test/__tests__/shopify_source.test.js deleted file mode 100644 index 2a7e69bd82..0000000000 --- a/test/__tests__/shopify_source.test.js +++ /dev/null @@ -1,32 +0,0 @@ -const integration = "shopify"; -const name = "Shopify"; - -const fs = require("fs"); -const path = require("path"); - -const transformer = require(`../../src/v0/sources/${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 { - const output = await transformer.process(dataPoint.input); - // anonId is being set dynamically by the transformer. - // so removing it before json comparison. - // Note: the anonymousId field is removed from the output json as well. - delete output.anonymousId; - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); -}); diff --git a/test/__tests__/signl4_source.test.js b/test/__tests__/signl4_source.test.js deleted file mode 100644 index 2bdec5aedf..0000000000 --- a/test/__tests__/signl4_source.test.js +++ /dev/null @@ -1,30 +0,0 @@ -const integration = "signl4"; -const name = "SIGNL4"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/sources/${integration}/transform`); - -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_source_output.json`) -); - -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -inputData.forEach((input, index) => { - it(`${name} Tests: payload: ${index}`, async () => { - try { - const output = await transformer.process(input); - delete output.anonymousId; - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].message); - } - }); -}); diff --git a/test/__tests__/utilities/test-utils.js b/test/__tests__/utilities/test-utils.js deleted file mode 100644 index 4d5d7fc909..0000000000 --- a/test/__tests__/utilities/test-utils.js +++ /dev/null @@ -1,135 +0,0 @@ -const fs = require("fs"); -const _ = require("lodash"); -const path = require("path"); -const { ConfigFactory, Executor } = require("rudder-transformer-cdk"); -const { assertRouterOutput } = require('../../testHelper'); - -// TODO: separate this out later as the list grows -const cdkEnabledDestinations = { - variance: true, - autopilot: true, - heap: true, - userlist: true, - lytics: true, - kochava: true, - statsig: true, - new_relic: true, - zapier: true, - vitally: true -}; - -function getDestFromTestFile(filePath) { - const filePathArr = filePath.split("/"); - return filePathArr[filePathArr.length - 1].replace(".test.js", ""); -} - -function formTestParams(dest, transformAt) { - //for router test - let trCat = ""; - if (transformAt === "router") { - trCat += "router_"; - } - const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `../data/${dest}_${trCat}input.json`) - ); - const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `../data/${dest}_${trCat}output.json`) - ); - const inputData = JSON.parse(inputDataFile); - const expected = JSON.parse(outputDataFile); - return { - input: inputData, - expected, - iscdkDest: cdkEnabledDestinations[dest] - }; -} - -function routerCommonformTestParams() { - const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `../data/routerCommonInput.json`) - ); - const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `../data/routerCommonOutput.json`) - ); - - const inputData = JSON.parse(inputDataFile); - const expected = JSON.parse(outputDataFile); - return { - commonInput: inputData, - commonExpected: expected - }; -} - -function fetchCdkStageFromConfig(destination) { - let cdkEnabled = false; - if ( - destination.DestinationDefinition && - destination.DestinationDefinition.Config && - destination.DestinationDefinition.Config.cdkEnabled - ) { - cdkEnabled = destination.DestinationDefinition.Config.cdkEnabled; - } - return cdkEnabled; -} - -function executeTransformationTest(dest, transformAt) { - const testParams = formTestParams(dest, transformAt); - const routerCommonTestParams = routerCommonformTestParams(); - const { iscdkDest, expected, input } = testParams; - const { commonInput, commonExpected } = routerCommonTestParams; - const basePath = path.resolve(__dirname, "../../../src/cdk/v1"); - ConfigFactory.init({ basePath, loggingMode: "production" }); - - describe(`${dest} ${transformAt} tests`, () => { - input.map((tcInput, index) => { - const cdkEnabled = fetchCdkStageFromConfig(tcInput.destination); - return it(`${dest} ${transformAt} tests - ${index}`, async () => { - let actualData; - try { - if ((iscdkDest || cdkEnabled) && transformAt === "processor") { - const baseConfig = await ConfigFactory.getConfig(dest); - // We currently support processor transformation only in CDK - actualData = await Executor.execute(tcInput, baseConfig); - } else { - const version = "v0"; - const transformer = require(`../../../src/${version}/destinations/${dest}/transform`); - if (transformAt == "processor") { - actualData = await transformer.process(tcInput); - } else { - actual = await transformer.processRouterDest([tcInput]) - assertRouterOutput(actual, [tcInput]); - actualData = (actual)[0]; - } - } - // Compare actual and expected data - expect(actualData).toEqual(expected[index]); - } catch (error) { - // Force fail the test case if the expected exception is not raised - expect(error.message).toEqual(expected[index].error); - } - }); - }); - }); - if (transformAt == "router") { - describe(`${dest} ${transformAt} Common tests`, () => { - it(`${dest} ${transformAt} Common tests`, async () => { - let actualData; - try { - const version = "v0"; - const transformer = require(`../../../src/${version}/destinations/${dest}/transform`); - actualData = await transformer.processRouterDest(commonInput); - assertRouterOutput(actualData, commonInput); - const cloneActual = _.cloneDeep(actualData); - cloneActual[0].statTags = "undefined"; - // Compare actual and expected data - expect(cloneActual).toEqual(commonExpected); - } catch (error) { - // Force fail the test case if the expected exception is not raised - expect(error.message).toEqual(commonExpected); - } - }); - }); - } -} - -module.exports = { getDestFromTestFile, executeTransformationTest }; diff --git a/test/apitests/data_scenarios/cdk_v1/failure.json b/test/apitests/data_scenarios/cdk_v1/failure.json deleted file mode 100644 index df45006d84..0000000000 --- a/test/apitests/data_scenarios/cdk_v1/failure.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "input": [ - { - "message": { - "anonymousId": "2073230", - "channel": "offline", - "context": { - "traits": { - "email": "test.c97@gmail.com", - "firstName": "test", - "gender": "Male", - "lastName": "Rudderlabs", - "phone": "+919876543210" - } - }, - "event": "Product Added", - "messageId": "2af9f397-eef2-407f-bd95-e61867c0bfd0", - "originalTimestamp": "2022-12-30T21:12:23.295+05:30", - "properties": { - "brand": "Gamepro", - "category": "Games", - "coupon": "DISC21", - "image_url": "https://www.website.com/product/path.png", - "name": "Game", - "position": 1, - "price": 13.49, - "product_id": "123", - "quantity": 11, - "sku": "F15", - "url": "https://www.website.com/product/path", - "variant": "111" - }, - "receivedAt": "2022-12-30T21:12:19.720+05:30", - "request_ip": "[::1]", - "rudderId": "c6bac0d9-5ed4-45d8-a937-bf9e62060b78", - "sentAt": "2022-12-30T21:12:23.295+05:30", - "timestamp": "2022-12-30T21:12:19.719+05:30", - "type": "track", - "userId": "2564871" - }, - "metadata": { - "sourceId": "27O0bmEEx3GgfmEhZHUcPwJQVWC", - "workspaceId": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "namespace": "", - "instanceId": "1", - "sourceType": "HTTP", - "sourceCategory": "", - "trackingPlanId": "", - "trackingPlanVersion": 0, - "sourceTpConfig": null, - "mergedTpConfig": null, - "destinationId": "2JVZ3owjdCdDajoiZwWgJbR9y0q", - "jobRunId": "", - "jobId": 1, - "sourceBatchId": "", - "sourceJobId": "", - "sourceJobRunId": "", - "sourceTaskId": "", - "sourceTaskRunId": "", - "recordId": null, - "destinationType": "ZAPIER", - "messageId": "2af9f397-eef2-407f-bd95-e61867c0bfd0", - "oauthAccessToken": "", - "messageIds": null, - "rudderId": "<<>>2073230<<>>2564871", - "receivedAt": "2022-12-30T21:12:19.720+05:30", - "eventName": "Product Added", - "eventType": "track", - "sourceDefinitionId": "1b6gJdqOPOCadT3cddw8eidV591", - "destinationDefinitionId": "" - }, - "destination": { - "ID": "2JVZ3owjdCdDajoiZwWgJbR9y0q", - "Name": "Zapier-dev", - "DestinationDefinition": { - "ID": "2EAFTAOU0JrG8tHwYB5ZlV7yzo6", - "Name": "ZAPIER", - "DisplayName": "Zapier", - "Config": { - "cdkEnabled": true, - "destConfig": { - "defaultConfig": ["zapUrl", "trackEventsToZap", "pageScreenEventsToZap"] - }, - "excludeKeys": [], - "includeKeys": ["zapUrl", "trackEventsToZap", "pageScreenEventsToZap"], - "saveDestinationResponse": true, - "secretKeys": ["zapUrl"], - "supportedMessageTypes": ["track", "page", "screen"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter", - "cordova", - "warehouse" - ], - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "zapUrl": "https://hooks.zapier.com/hooks/catch/14157843/b7l4oz2/" - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2JdjA2o6s9AfokHcz6bX0SPCdJZ" - }, - "libraries": null - } - ], - "output": [ - { - "metadata": { - "sourceId": "27O0bmEEx3GgfmEhZHUcPwJQVWC", - "workspaceId": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "namespace": "", - "instanceId": "1", - "sourceType": "HTTP", - "sourceCategory": "", - "trackingPlanId": "", - "trackingPlanVersion": 0, - "sourceTpConfig": null, - "mergedTpConfig": null, - "destinationId": "2JVZ3owjdCdDajoiZwWgJbR9y0q", - "jobRunId": "", - "jobId": 1, - "sourceBatchId": "", - "sourceJobId": "", - "sourceJobRunId": "", - "sourceTaskId": "", - "sourceTaskRunId": "", - "recordId": null, - "destinationType": "ZAPIER", - "messageId": "2af9f397-eef2-407f-bd95-e61867c0bfd0", - "oauthAccessToken": "", - "messageIds": null, - "rudderId": "<<>>2073230<<>>2564871", - "receivedAt": "2022-12-30T21:12:19.720+05:30", - "eventName": "Product Added", - "eventType": "track", - "sourceDefinitionId": "1b6gJdqOPOCadT3cddw8eidV591", - "destinationDefinitionId": "" - }, - "statusCode": 400, - "error": "Unknown error occurred. Original error: Unsupported \"channel\": \"offline\". It must be one of: web,server,mobile,sources", - "statTags": { - "errorCategory": "transformation", - "destType": "ZAPIER", - "module": "destination", - "implementation": "cdkV1", - "feature": "processor", - "destinationId": "2JVZ3owjdCdDajoiZwWgJbR9y0q", - "workspaceId": "27O0bhB6p5ehfOWeeZlOSsSDTLg" - } - } - ] -} diff --git a/test/apitests/data_scenarios/cdk_v1/success.json b/test/apitests/data_scenarios/cdk_v1/success.json deleted file mode 100644 index 68d68a2b5f..0000000000 --- a/test/apitests/data_scenarios/cdk_v1/success.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "input": [ - { - "message": { - "anonymousId": "2073230", - "channel": "web", - "context": { - "traits": { - "email": "test.c97@gmail.com", - "firstName": "test", - "gender": "Male", - "lastName": "Rudderlabs", - "phone": "+919876543210" - } - }, - "event": "Product Added", - "messageId": "ace693c0-79c3-47b8-9e7f-6a894672597f", - "originalTimestamp": "2022-12-31T20:30:35.282+05:30", - "properties": { - "brand": "Gamepro", - "category": "Games", - "coupon": "DISC21", - "image_url": "https://www.website.com/product/path.png", - "name": "Game", - "position": 1, - "price": 13.49, - "product_id": "123", - "quantity": 11, - "sku": "F15", - "url": "https://www.website.com/product/path", - "variant": "111" - }, - "receivedAt": "2022-12-31T20:30:34.567+05:30", - "request_ip": "[::1]", - "rudderId": "c6bac0d9-5ed4-45d8-a937-bf9e62060b78", - "sentAt": "2022-12-31T20:30:35.282+05:30", - "timestamp": "2022-12-31T20:30:34.566+05:30", - "type": "track", - "userId": "2564871" - }, - "metadata": { - "sourceId": "27O0bmEEx3GgfmEhZHUcPwJQVWC", - "workspaceId": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "namespace": "", - "instanceId": "1", - "sourceType": "HTTP", - "sourceCategory": "", - "trackingPlanId": "", - "trackingPlanVersion": 0, - "sourceTpConfig": null, - "mergedTpConfig": null, - "destinationId": "2JVZ3owjdCdDajoiZwWgJbR9y0q", - "jobRunId": "", - "jobId": 1, - "sourceBatchId": "", - "sourceJobId": "", - "sourceJobRunId": "", - "sourceTaskId": "", - "sourceTaskRunId": "", - "recordId": null, - "destinationType": "ZAPIER", - "messageId": "ace693c0-79c3-47b8-9e7f-6a894672597f", - "oauthAccessToken": "", - "messageIds": null, - "rudderId": "<<>>2073230<<>>2564871", - "receivedAt": "2022-12-31T20:30:34.567+05:30", - "eventName": "Product Added", - "eventType": "track", - "sourceDefinitionId": "1b6gJdqOPOCadT3cddw8eidV591", - "destinationDefinitionId": "" - }, - "destination": { - "ID": "2JVZ3owjdCdDajoiZwWgJbR9y0q", - "Name": "Zapier-dev", - "DestinationDefinition": { - "ID": "2EAFTAOU0JrG8tHwYB5ZlV7yzo6", - "Name": "ZAPIER", - "DisplayName": "Zapier", - "Config": { - "cdkEnabled": true, - "destConfig": { - "defaultConfig": ["zapUrl", "trackEventsToZap", "pageScreenEventsToZap"] - }, - "excludeKeys": [], - "includeKeys": ["zapUrl", "trackEventsToZap", "pageScreenEventsToZap"], - "saveDestinationResponse": true, - "secretKeys": ["zapUrl"], - "supportedMessageTypes": ["track", "page", "screen"], - "supportedSourceTypes": [ - "android", - "ios", - "web", - "unity", - "amp", - "cloud", - "reactnative", - "flutter", - "cordova", - "warehouse" - ], - "transformAt": "processor", - "transformAtV1": "processor" - }, - "ResponseRules": {} - }, - "Config": { - "zapUrl": "https://hooks.zapier.com/hooks/catch/test/abc/" - }, - "Enabled": true, - "WorkspaceID": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "Transformations": [], - "IsProcessorEnabled": true, - "RevisionID": "2JdjA2o6s9AfokHcz6bX0SPCdJZ" - }, - "libraries": null - } - ], - "output": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://hooks.zapier.com/hooks/catch/test/abc/", - "headers": { - "content-type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "anonymousId": "2073230", - "channel": "web", - "context": { - "traits": { - "email": "test.c97@gmail.com", - "firstName": "test", - "gender": "Male", - "lastName": "Rudderlabs", - "phone": "+919876543210" - } - }, - "event": "Product Added", - "messageId": "ace693c0-79c3-47b8-9e7f-6a894672597f", - "originalTimestamp": "2022-12-31T20:30:35.282+05:30", - "properties": { - "brand": "Gamepro", - "category": "Games", - "coupon": "DISC21", - "image_url": "https://www.website.com/product/path.png", - "name": "Game", - "position": 1, - "price": 13.49, - "product_id": "123", - "quantity": 11, - "sku": "F15", - "url": "https://www.website.com/product/path", - "variant": "111" - }, - "receivedAt": "2022-12-31T20:30:34.567+05:30", - "request_ip": "[::1]", - "rudderId": "c6bac0d9-5ed4-45d8-a937-bf9e62060b78", - "sentAt": "2022-12-31T20:30:35.282+05:30", - "timestamp": "2022-12-31T20:30:34.566+05:30", - "type": "track", - "userId": "2564871" - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "sourceId": "27O0bmEEx3GgfmEhZHUcPwJQVWC", - "workspaceId": "27O0bhB6p5ehfOWeeZlOSsSDTLg", - "namespace": "", - "instanceId": "1", - "sourceType": "HTTP", - "sourceCategory": "", - "trackingPlanId": "", - "trackingPlanVersion": 0, - "sourceTpConfig": null, - "mergedTpConfig": null, - "destinationId": "2JVZ3owjdCdDajoiZwWgJbR9y0q", - "jobRunId": "", - "jobId": 1, - "sourceBatchId": "", - "sourceJobId": "", - "sourceJobRunId": "", - "sourceTaskId": "", - "sourceTaskRunId": "", - "recordId": null, - "destinationType": "ZAPIER", - "messageId": "ace693c0-79c3-47b8-9e7f-6a894672597f", - "oauthAccessToken": "", - "messageIds": null, - "rudderId": "<<>>2073230<<>>2564871", - "receivedAt": "2022-12-31T20:30:34.567+05:30", - "eventName": "Product Added", - "eventType": "track", - "sourceDefinitionId": "1b6gJdqOPOCadT3cddw8eidV591", - "destinationDefinitionId": "" - }, - "statusCode": 200 - } - ] -} diff --git a/test/apitests/service.api.test.ts b/test/apitests/service.api.test.ts index e46357f824..b4ed8d3b09 100644 --- a/test/apitests/service.api.test.ts +++ b/test/apitests/service.api.test.ts @@ -604,28 +604,6 @@ describe('Source api tests', () => { }); }); -describe('CDK V1 api tests', () => { - test('(zapier) successful transform', async () => { - const data = getDataFromPath('./data_scenarios/cdk_v1/success.json'); - const response = await request(server) - .post('/v0/destinations/zapier') - .set('Accept', 'application/json') - .send(data.input); - expect(response.status).toEqual(200); - expect(JSON.parse(response.text)).toEqual(data.output); - }); - - test('(zapier) failure transform', async () => { - const data = getDataFromPath('./data_scenarios/cdk_v1/failure.json'); - const response = await request(server) - .post('/v0/destinations/zapier') - .set('Accept', 'application/json') - .send(data.input); - expect(response.status).toEqual(200); - expect(JSON.parse(response.text)).toEqual(data.output); - }); -}); - describe('CDK V2 api tests', () => { test('(pinterest_tag) successful transform', async () => { const data = getDataFromPath('./data_scenarios/cdk_v2/success.json'); diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index d4c109c55c..e7645db64d 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -211,6 +211,7 @@ const sourceTestHandler = async (tcData) => { // Trigger the test suites describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { beforeEach(() => { + jest.resetAllMocks(); jest.clearAllMocks(); }); // add special mocks for specific destinations diff --git a/test/integrations/destinations/af/deleteUsers/data.ts b/test/integrations/destinations/af/deleteUsers/data.ts index c552b79f67..608e7e5586 100644 --- a/test/integrations/destinations/af/deleteUsers/data.ts +++ b/test/integrations/destinations/af/deleteUsers/data.ts @@ -7,7 +7,7 @@ import utils from '../../../../../src/v0/util'; const defaultMockFns = () => { jest.spyOn(Date.prototype, 'toISOString').mockReturnValue('2023-09-24T11:22:24.018Z'); - jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); + jest.spyOn(utils, 'generateUUID').mockReturnValueOnce('97fcd7b2-cc24-47d7-b776-057b7b199513'); }; const requests = [ diff --git a/test/integrations/destinations/airship/processor/data.ts b/test/integrations/destinations/airship/processor/data.ts index cafbd02e74..3a6c5394cb 100644 --- a/test/integrations/destinations/airship/processor/data.ts +++ b/test/integrations/destinations/airship/processor/data.ts @@ -2381,4 +2381,9 @@ export const data = [ }, }, }, -]; +].map((tc) => ({ + ...tc, + mockFns: (_) => { + jest.spyOn(Date.prototype, 'toISOString').mockReturnValue('2015-02-23T22:28:55Z'); + }, +})); diff --git a/test/integrations/destinations/airship/router/data.ts b/test/integrations/destinations/airship/router/data.ts index 8ed6f57a42..df500d7413 100644 --- a/test/integrations/destinations/airship/router/data.ts +++ b/test/integrations/destinations/airship/router/data.ts @@ -465,4 +465,10 @@ export const data = [ }, }, }, -]; +].map((tc) => ({ + ...tc, + mockFns: (_) => { + jest.spyOn(Date.prototype, 'toISOString').mockReturnValue('2015-02-23T22:28:55Z'); + // jest.spyOn(Date, 'now').mockReturnValue(new Date('2023-10-14T12:34:56.789Z').valueOf()); + }, +})); diff --git a/test/integrations/destinations/attentive_tag/processor/data.ts b/test/integrations/destinations/attentive_tag/processor/data.ts index f585fb58d8..12e0f4bea1 100644 --- a/test/integrations/destinations/attentive_tag/processor/data.ts +++ b/test/integrations/destinations/attentive_tag/processor/data.ts @@ -1,5 +1,5 @@ export const mockFns = (_) => { - jest.useFakeTimers().setSystemTime(new Date('2023-10-14')); + jest.spyOn(Date, 'now').mockReturnValue(new Date('2023-10-14T00:00:00.000Z').valueOf()); }; export const data = [ @@ -1678,4 +1678,4 @@ export const data = [ }, }, }, -]; +].map((d) => ({ ...d, mockFns })); diff --git a/test/integrations/destinations/braze/processor/data.ts b/test/integrations/destinations/braze/processor/data.ts index 644bebace1..240206791e 100644 --- a/test/integrations/destinations/braze/processor/data.ts +++ b/test/integrations/destinations/braze/processor/data.ts @@ -309,6 +309,7 @@ export const data = [ name: 'braze revenue test', time: '2020-01-24T11:59:02.403+05:30', properties: { + currency: 'USD', revenue: 50, }, external_id: 'mickeyMouse', @@ -437,6 +438,7 @@ export const data = [ time: '2020-01-24T11:59:02.403+05:30', properties: { revenue: 50, + currency: 'USD', }, external_id: 'mickeyMouse', }, @@ -772,6 +774,7 @@ export const data = [ properties: { currency: 'USD', revenue: 50, + event_name: 'braze revenue test 2', }, receivedAt: '2020-01-24T11:59:02.403+05:30', request_ip: '[::1]:53710', @@ -823,6 +826,7 @@ export const data = [ time: '2020-01-24T11:59:02.403+05:30', properties: { revenue: 50, + currency: 'USD', }, _update_existing_only: false, user_alias: { @@ -993,6 +997,7 @@ export const data = [ affiliation: 'Google Store', checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', coupon: 'hasbros', + currency: 'USD', discount: 2.5, order_id: '50314b8e9bcf000000000000', products: [ @@ -1976,6 +1981,7 @@ export const data = [ properties: { mergeObjectsUpdateOperation: false, revenue: 50, + currency: 'USD', }, external_id: 'finalUserTestCA', }, @@ -2192,6 +2198,7 @@ export const data = [ properties: { mergeObjectsUpdateOperation: false, revenue: 50, + currency: 'USD', }, external_id: 'finalUserTestCA', }, @@ -3398,6 +3405,7 @@ export const data = [ time: '2020-01-24T11:59:02.403+05:30', properties: { revenue: 50, + currency: 'USD', }, external_id: 'mickeyMouse', app_id: '123', @@ -3985,6 +3993,7 @@ export const data = [ subtotal: 22.5, tax: 2, total: 27.5, + currency: 'USD', }, _update_existing_only: false, user_alias: { @@ -4036,7 +4045,6 @@ export const data = [ Transformations: [], }, message: { - anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', channel: 'web', context: { traits: { diff --git a/test/integrations/destinations/clevertap/processor/data.ts b/test/integrations/destinations/clevertap/processor/data.ts index 1d7bdd7e78..49647e1937 100644 --- a/test/integrations/destinations/clevertap/processor/data.ts +++ b/test/integrations/destinations/clevertap/processor/data.ts @@ -2550,4 +2550,808 @@ export const data = [ }, }, }, + { + name: 'clevertap', + description: 'Test 22: device token type via integrations object takes precedence over os type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + passcode: 'sample_passcode', + accountId: '476550467', + trackAnonymous: true, + enableObjectIdMapping: true, + }, + }, + message: { + type: 'identify', + event: 'identify', + sentAt: '2021-05-24T08:53:38.762Z', + userId: 'useran4', + channel: 'mobile', + context: { + os: { + name: 'Android', + version: '10', + }, + app: { + name: 'myfirstapp', + build: '1', + version: '1.0', + namespace: 'com.example.myfirstapp', + }, + device: { + id: 'f54bb572361c4fd1', + name: 'whyred', + type: 'Android', + model: 'Redmi Note 5 Pro', + manufacturer: 'Xiaomi', + token: 'frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf', + }, + locale: 'en-IN', + screen: { + width: 1080, + height: 2118, + density: 420, + }, + traits: { + id: 'useran4', + email: 'tony4an@testmail.com', + phone: '4444457700', + userId: 'useran4', + lastname: 'Stark', + firstname: 'Tony4AN', + anonymousId: 'f54bb572361c4fd1', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.12', + }, + network: { + wifi: true, + carrier: 'airtel', + cellular: true, + bluetooth: false, + }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi Note 5 Pro Build/QQ3A.200805.001)', + }, + rudderId: 'd8dd4917-bdb2-4c17-8f62-24c79d87a937', + messageId: '1621846417928-7fbb739f-5f96-48ca-9ebb-5bfc4076a687', + anonymousId: 'f54bb572361c4fd1', + integrations: { + All: true, + clevertap: { + deviceTokenType: 'chrome', + }, + }, + originalTimestamp: '2021-05-24T08:53:37.929Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'profile', + profileData: { + Email: 'tony4an@testmail.com', + Phone: '4444457700', + Name: 'Tony4AN Stark', + identity: 'useran4', + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'token', + tokenData: { + id: 'frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf', + type: 'chrome', + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'clevertap', + description: + 'Test 23: device token type via integrations object does not take precedence over os type when the token type is not within the allowed types ', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + passcode: 'sample_passcode', + accountId: '476550467', + trackAnonymous: true, + enableObjectIdMapping: true, + }, + }, + message: { + type: 'identify', + event: 'identify', + sentAt: '2021-05-24T08:53:38.762Z', + userId: 'useran4', + channel: 'mobile', + context: { + os: { + name: 'Android', + version: '10', + }, + app: { + name: 'myfirstapp', + build: '1', + version: '1.0', + namespace: 'com.example.myfirstapp', + }, + device: { + id: 'f54bb572361c4fd1', + name: 'whyred', + type: 'Android', + model: 'Redmi Note 5 Pro', + manufacturer: 'Xiaomi', + token: 'frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf', + }, + locale: 'en-IN', + screen: { + width: 1080, + height: 2118, + density: 420, + }, + traits: { + id: 'useran4', + email: 'tony4an@testmail.com', + phone: '4444457700', + userId: 'useran4', + lastname: 'Stark', + firstname: 'Tony4AN', + anonymousId: 'f54bb572361c4fd1', + }, + library: { + name: 'com.rudderstack.android.sdk.core', + version: '1.0.12', + }, + network: { + wifi: true, + carrier: 'airtel', + cellular: true, + bluetooth: false, + }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi Note 5 Pro Build/QQ3A.200805.001)', + }, + rudderId: 'd8dd4917-bdb2-4c17-8f62-24c79d87a937', + messageId: '1621846417928-7fbb739f-5f96-48ca-9ebb-5bfc4076a687', + anonymousId: 'f54bb572361c4fd1', + integrations: { + All: true, + clevertap: { + deviceTokenType: 'random', + }, + }, + originalTimestamp: '2021-05-24T08:53:37.929Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'profile', + profileData: { + Email: 'tony4an@testmail.com', + Phone: '4444457700', + Name: 'Tony4AN Stark', + identity: 'useran4', + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'token', + tokenData: { + id: 'frfsgvrwe:APfdsafsgdfsgghfgfgjkhfsfgdhjhbvcvnetry767456fxsasdf', + type: 'fcm', + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'clevertap', + description: 'Test 24: chrome auth keys to be mapped via integrations object', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + passcode: 'sample_passcode', + accountId: '476550467', + trackAnonymous: true, + enableObjectIdMapping: true, + }, + }, + message: { + type: 'identify', + event: 'identify', + sentAt: '2021-05-24T08:53:38.762Z', + userId: 'useran4', + channel: 'mobile', + context: { + os: { name: 'Android', version: '10' }, + app: { + name: 'myfirstapp', + build: '1', + version: '1.0', + namespace: 'com.example.myfirstapp', + }, + device: { + id: 'f54bb572361c4fd1', + name: 'whyred', + type: 'Android', + model: 'Redmi Note 5 Pro', + manufacturer: 'Xiaomi', + token: + 'dR7jSUNlQ_qr_maG7Qd4R-:APA91bEuIZUlyF2Or7FzDp9slk2LTVoUIucV4hL7dvUqJzl6yWAfIFTBaU2uec9broasHAHAvga9ha1tszSEJobuAC-Zbh6l3DoXO4vnSrN4LcllybmGr_lIw5k8CgFoNuvSb8BWEb90', + }, + locale: 'en-IN', + screen: { width: 1080, height: 2118, density: 420 }, + traits: { + id: 'useran4', + email: 'tony4an@testmail.com', + phone: '+919432240789', + userId: 'useran4', + lastname: 'Stark', + firstname: 'Tony4AN', + anonymousId: 'f54bb572361c4fd1', + }, + library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.12' }, + network: { wifi: true, carrier: 'airtel', cellular: true, bluetooth: false }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi Note 5 Pro Build/QQ3A.200805.001)', + }, + rudderId: 'd8dd4917-bdb2-4c17-8f62-24c79d87a937', + messageId: '1621846417928-7fbb739f-5f96-48ca-9ebb-5bfc4076a687', + anonymousId: 'f54bb572361c4fd1', + integrations: { + All: true, + clevertap: { + deviceTokenType: 'chrome', + chromeKeys: { auth: '5I2Bu2oKdyy9CwL8QVF0NQ==' }, + }, + }, + originalTimestamp: '2021-05-24T08:53:37.929Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'profile', + profileData: { + Email: 'tony4an@testmail.com', + Phone: '+919432240789', + Name: 'Tony4AN Stark', + identity: 'useran4', + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'token', + tokenData: { + id: 'dR7jSUNlQ_qr_maG7Qd4R-:APA91bEuIZUlyF2Or7FzDp9slk2LTVoUIucV4hL7dvUqJzl6yWAfIFTBaU2uec9broasHAHAvga9ha1tszSEJobuAC-Zbh6l3DoXO4vnSrN4LcllybmGr_lIw5k8CgFoNuvSb8BWEb90', + type: 'chrome', + keys: { + auth: '5I2Bu2oKdyy9CwL8QVF0NQ==', + }, + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'clevertap', + description: + 'Test 25: chrome auth key with only p256dh key to be mapped via integrations object', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + passcode: 'sample_passcode', + accountId: '476550467', + trackAnonymous: true, + enableObjectIdMapping: true, + }, + }, + message: { + type: 'identify', + event: 'identify', + sentAt: '2021-05-24T08:53:38.762Z', + userId: 'useran4', + channel: 'mobile', + context: { + os: { name: 'Android', version: '10' }, + app: { + name: 'myfirstapp', + build: '1', + version: '1.0', + namespace: 'com.example.myfirstapp', + }, + device: { + id: 'f54bb572361c4fd1', + name: 'whyred', + type: 'Android', + model: 'Redmi Note 5 Pro', + manufacturer: 'Xiaomi', + token: + 'dR7jSUNlQ_qr_maG7Qd4R-:APA91bEuIZUlyF2Or7FzDp9slk2LTVoUIucV4hL7dvUqJzl6yWAfIFTBaU2uec9broasHAHAvga9ha1tszSEJobuAC-Zbh6l3DoXO4vnSrN4LcllybmGr_lIw5k8CgFoNuvSb8BWEb90', + }, + locale: 'en-IN', + screen: { width: 1080, height: 2118, density: 420 }, + traits: { + id: 'useran4', + email: 'tony4an@testmail.com', + phone: '+919432240789', + userId: 'useran4', + lastname: 'Stark', + firstname: 'Tony4AN', + anonymousId: 'f54bb572361c4fd1', + }, + library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.12' }, + network: { wifi: true, carrier: 'airtel', cellular: true, bluetooth: false }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi Note 5 Pro Build/QQ3A.200805.001)', + }, + rudderId: 'd8dd4917-bdb2-4c17-8f62-24c79d87a937', + messageId: '1621846417928-7fbb739f-5f96-48ca-9ebb-5bfc4076a687', + anonymousId: 'f54bb572361c4fd1', + integrations: { + All: true, + clevertap: { + deviceTokenType: 'chrome', + chromeKeys: { + p256dh: + 'BLc4xRzKlKORKWlbdgFaBrrPK3ydWAHo4M0gs0i1oEKgPpWC5cW8OCzVrOQRv-1npXRWk8udnW3oYhIO4475rds=', + }, + }, + }, + originalTimestamp: '2021-05-24T08:53:37.929Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'profile', + profileData: { + Email: 'tony4an@testmail.com', + Phone: '+919432240789', + Name: 'Tony4AN Stark', + identity: 'useran4', + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'token', + tokenData: { + id: 'dR7jSUNlQ_qr_maG7Qd4R-:APA91bEuIZUlyF2Or7FzDp9slk2LTVoUIucV4hL7dvUqJzl6yWAfIFTBaU2uec9broasHAHAvga9ha1tszSEJobuAC-Zbh6l3DoXO4vnSrN4LcllybmGr_lIw5k8CgFoNuvSb8BWEb90', + type: 'chrome', + keys: { + p256dh: + 'BLc4xRzKlKORKWlbdgFaBrrPK3ydWAHo4M0gs0i1oEKgPpWC5cW8OCzVrOQRv-1npXRWk8udnW3oYhIO4475rds=', + }, + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'clevertap', + description: + 'Test 25: chrome auth key object can have any random field and to be mapped via integrations object', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + passcode: 'sample_passcode', + accountId: '476550467', + trackAnonymous: true, + enableObjectIdMapping: true, + }, + }, + message: { + type: 'identify', + event: 'identify', + sentAt: '2021-05-24T08:53:38.762Z', + userId: 'useran4', + channel: 'mobile', + context: { + os: { name: 'Android', version: '10' }, + app: { + name: 'myfirstapp', + build: '1', + version: '1.0', + namespace: 'com.example.myfirstapp', + }, + device: { + id: 'f54bb572361c4fd1', + name: 'whyred', + type: 'Android', + model: 'Redmi Note 5 Pro', + manufacturer: 'Xiaomi', + token: + 'dR7jSUNlQ_qr_maG7Qd4R-:APA91bEuIZUlyF2Or7FzDp9slk2LTVoUIucV4hL7dvUqJzl6yWAfIFTBaU2uec9broasHAHAvga9ha1tszSEJobuAC-Zbh6l3DoXO4vnSrN4LcllybmGr_lIw5k8CgFoNuvSb8BWEb90', + }, + locale: 'en-IN', + screen: { width: 1080, height: 2118, density: 420 }, + traits: { + id: 'useran4', + email: 'tony4an@testmail.com', + phone: '+919432240789', + userId: 'useran4', + lastname: 'Stark', + firstname: 'Tony4AN', + anonymousId: 'f54bb572361c4fd1', + }, + library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.12' }, + network: { wifi: true, carrier: 'airtel', cellular: true, bluetooth: false }, + timezone: 'Asia/Kolkata', + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi Note 5 Pro Build/QQ3A.200805.001)', + }, + rudderId: 'd8dd4917-bdb2-4c17-8f62-24c79d87a937', + messageId: '1621846417928-7fbb739f-5f96-48ca-9ebb-5bfc4076a687', + anonymousId: 'f54bb572361c4fd1', + integrations: { + All: true, + clevertap: { + deviceTokenType: 'chrome', + chromeKeys: { + random: 'random key', + }, + }, + }, + originalTimestamp: '2021-05-24T08:53:37.929Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'profile', + profileData: { + Email: 'tony4an@testmail.com', + Phone: '+919432240789', + Name: 'Tony4AN Stark', + identity: 'useran4', + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.clevertap.com/1/upload', + headers: { + 'X-CleverTap-Account-Id': '476550467', + 'X-CleverTap-Passcode': 'sample_passcode', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + d: [ + { + type: 'token', + tokenData: { + id: 'dR7jSUNlQ_qr_maG7Qd4R-:APA91bEuIZUlyF2Or7FzDp9slk2LTVoUIucV4hL7dvUqJzl6yWAfIFTBaU2uec9broasHAHAvga9ha1tszSEJobuAC-Zbh6l3DoXO4vnSrN4LcllybmGr_lIw5k8CgFoNuvSb8BWEb90', + type: 'chrome', + keys: { + random: 'random key', + }, + }, + objectId: 'f54bb572361c4fd1', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/customerio/processor/data.ts b/test/integrations/destinations/customerio/processor/data.ts index 5bbbfe7b10..92cea4250d 100644 --- a/test/integrations/destinations/customerio/processor/data.ts +++ b/test/integrations/destinations/customerio/processor/data.ts @@ -8275,4 +8275,58 @@ export const data = [ }, }, }, + { + name: 'customerio', + description: 'Test 66 -> Invalid Page call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + }, + type: 'page', + anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + integrations: { + All: true, + }, + }, + destination: { + Config: { + datacenter: 'US', + siteID: '46be54768e7d49ab2628', + apiKey: 'dummyApiKey', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event Name type should be a string', + statTags: { + destType: 'CUSTOMERIO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/emarsys/deleteUsers/data.ts b/test/integrations/destinations/emarsys/deleteUsers/data.ts index 2bafe58a4c..96b27cad0d 100644 --- a/test/integrations/destinations/emarsys/deleteUsers/data.ts +++ b/test/integrations/destinations/emarsys/deleteUsers/data.ts @@ -1,10 +1,10 @@ +import crypto from 'crypto'; + +const buf = Buffer.from('5398e214ae99c2e50afb709a3bc423f9', 'hex'); export const mockFns = (_) => { + jest.spyOn(Date.prototype, 'toISOString').mockReturnValueOnce('2023-10-14T00:00:00.000Z'); // @ts-ignore - jest.useFakeTimers().setSystemTime(new Date('2023-10-14')); - jest.mock('crypto', () => ({ - ...jest.requireActual('crypto'), - randomBytes: jest.fn().mockReturnValue(Buffer.from('5398e214ae99c2e50afb709a3bc423f9', 'hex')), - })); + jest.spyOn(crypto, 'randomBytes').mockReturnValue(buf); }; const commonEventMap = [ diff --git a/test/integrations/destinations/emarsys/processor/data.ts b/test/integrations/destinations/emarsys/processor/data.ts index cfa53fd4f6..badd14e7cc 100644 --- a/test/integrations/destinations/emarsys/processor/data.ts +++ b/test/integrations/destinations/emarsys/processor/data.ts @@ -1,10 +1,12 @@ +import crypto from 'crypto'; + +const buf = Buffer.from('5398e214ae99c2e50afb709a3bc423f9', 'hex'); + export const mockFns = (_) => { // @ts-ignore - jest.useFakeTimers().setSystemTime(new Date('2023-10-14')); - jest.mock('crypto', () => ({ - ...jest.requireActual('crypto'), - randomBytes: jest.fn().mockReturnValue(Buffer.from('5398e214ae99c2e50afb709a3bc423f9', 'hex')), - })); + jest.spyOn(Date.prototype, 'toISOString').mockReturnValueOnce('2023-10-14T00:00:00.000Z'); + // @ts-ignore + jest.spyOn(crypto, 'randomBytes').mockReturnValue(buf); }; const comonHeader = { diff --git a/test/integrations/destinations/emarsys/router/data.ts b/test/integrations/destinations/emarsys/router/data.ts index 8f449bd351..5f6dad1077 100644 --- a/test/integrations/destinations/emarsys/router/data.ts +++ b/test/integrations/destinations/emarsys/router/data.ts @@ -53,13 +53,13 @@ const commonDestination = { Enabled: true, }; +const buf = Buffer.from('5398e214ae99c2e50afb709a3bc423f9', 'hex'); + export const mockFns = (_) => { // @ts-ignore - jest.useFakeTimers().setSystemTime(new Date('2019-10-14')); - jest.mock('crypto', () => ({ - ...jest.requireActual('crypto'), - randomBytes: jest.fn().mockReturnValue(Buffer.from('5398e214ae99c2e50afb709a3bc423f9', 'hex')), - })); + jest.spyOn(Date.prototype, 'toISOString').mockReturnValueOnce('2019-10-14T00:00:00.000Z'); + // @ts-ignore + jest.spyOn(crypto, 'randomBytes').mockReturnValue(buf); }; export const data = [ diff --git a/test/integrations/destinations/facebook_conversions/mocks.ts b/test/integrations/destinations/facebook_conversions/mocks.ts index c155897bc4..ea2c8f8205 100644 --- a/test/integrations/destinations/facebook_conversions/mocks.ts +++ b/test/integrations/destinations/facebook_conversions/mocks.ts @@ -1,3 +1,3 @@ export const defaultMockFns = () => { - jest.spyOn(Date, 'now').mockImplementation(() => new Date('2023-11-12T15:46:51.000Z').valueOf()); + jest.spyOn(Date, 'now').mockReturnValue(new Date('2023-11-12T15:46:51.000Z').valueOf()); }; diff --git a/test/integrations/destinations/facebook_conversions/processor/data.ts b/test/integrations/destinations/facebook_conversions/processor/data.ts index 3224a15771..d72114c15b 100644 --- a/test/integrations/destinations/facebook_conversions/processor/data.ts +++ b/test/integrations/destinations/facebook_conversions/processor/data.ts @@ -314,7 +314,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -433,7 +433,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -552,7 +552,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -671,7 +671,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -797,7 +797,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -917,7 +917,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1036,7 +1036,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1155,7 +1155,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1283,7 +1283,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1411,7 +1411,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1511,7 +1511,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1632,7 +1632,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/facebook_conversions/router/data.ts b/test/integrations/destinations/facebook_conversions/router/data.ts index 9c6759df61..5a9c0c513f 100644 --- a/test/integrations/destinations/facebook_conversions/router/data.ts +++ b/test/integrations/destinations/facebook_conversions/router/data.ts @@ -112,7 +112,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -150,7 +150,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts index 5d429d297d..8e7f50ec2d 100644 --- a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts @@ -218,7 +218,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { @@ -572,7 +572,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { @@ -890,7 +890,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { diff --git a/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts b/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts index a0f85e45e3..d242ac990d 100644 --- a/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts @@ -444,7 +444,7 @@ export const validationTestData = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: 'https://graph.facebook.com/v18.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', files: {}, headers: {}, method: 'POST', diff --git a/test/integrations/destinations/facebook_pixel/router/data.ts b/test/integrations/destinations/facebook_pixel/router/data.ts index c754ffdc61..f3df4506a5 100644 --- a/test/integrations/destinations/facebook_pixel/router/data.ts +++ b/test/integrations/destinations/facebook_pixel/router/data.ts @@ -126,7 +126,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, body: { @@ -165,7 +165,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/fb_custom_audience/router/data.ts b/test/integrations/destinations/fb_custom_audience/router/data.ts index 72438e74b0..ab9bfee973 100644 --- a/test/integrations/destinations/fb_custom_audience/router/data.ts +++ b/test/integrations/destinations/fb_custom_audience/router/data.ts @@ -28,7 +28,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v18.0/aud1/users', + endpoint: 'https://graph.facebook.com/v20.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -79,7 +79,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/aud1/users', + endpoint: 'https://graph.facebook.com/v20.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -187,7 +187,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v18.0/aud1/users', + endpoint: 'https://graph.facebook.com/v20.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -238,7 +238,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/aud1/users', + endpoint: 'https://graph.facebook.com/v20.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -369,7 +369,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -558,7 +558,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v18.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -647,7 +647,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -720,7 +720,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -877,7 +877,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -907,7 +907,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v18.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', diff --git a/test/integrations/destinations/ga4/mocks.ts b/test/integrations/destinations/ga4/mocks.ts index 3a27349ff7..19bb0c8ff4 100644 --- a/test/integrations/destinations/ga4/mocks.ts +++ b/test/integrations/destinations/ga4/mocks.ts @@ -1,5 +1,3 @@ -export const defaultMockFns = () => { - return jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date('2022-04-29T05:17:09Z').valueOf()); +export const defaultMockFns = (_) => { + return jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2022-04-29T05:17:09Z').valueOf()); }; diff --git a/test/integrations/destinations/ga4/processor/validationTestData.ts b/test/integrations/destinations/ga4/processor/validationTestData.ts index 4e5d09bfcf..0030ee178e 100644 --- a/test/integrations/destinations/ga4/processor/validationTestData.ts +++ b/test/integrations/destinations/ga4/processor/validationTestData.ts @@ -151,6 +151,7 @@ export const validationTestData: ProcessorTestData[] = [ ], }, }, + // @ts-ignore mockFns: defaultMockFns, }, { @@ -208,7 +209,11 @@ export const validationTestData: ProcessorTestData[] = [ ], }, }, - mockFns: defaultMockFns, + mockFns: (_) => { + return jest + .spyOn(Date, 'now') + .mockReturnValueOnce(new Date('2012-04-29T05:17:09Z').valueOf()); + }, }, { id: 'ga4-validation-test-3', @@ -756,6 +761,11 @@ export const validationTestData: ProcessorTestData[] = [ ], }, }, + mockFns: (_) => { + return jest + .spyOn(Date, 'now') + .mockReturnValueOnce(new Date('2023-04-29T05:17:09Z').valueOf()); + }, }, { id: 'ga4-validation-test-14', @@ -801,6 +811,11 @@ export const validationTestData: ProcessorTestData[] = [ ], }, }, + mockFns: (_) => { + return jest + .spyOn(Date, 'now') + .mockReturnValueOnce(new Date('2021-04-29T05:17:09Z').valueOf()); + }, }, { id: 'ga4-validation-test-15', diff --git a/test/integrations/destinations/ga4_v2/mocks.ts b/test/integrations/destinations/ga4_v2/mocks.ts index 3a27349ff7..e7f5e144eb 100644 --- a/test/integrations/destinations/ga4_v2/mocks.ts +++ b/test/integrations/destinations/ga4_v2/mocks.ts @@ -1,5 +1,3 @@ export const defaultMockFns = () => { - return jest - .spyOn(Date, 'now') - .mockImplementation(() => new Date('2022-04-29T05:17:09Z').valueOf()); + return jest.spyOn(Date, 'now').mockReturnValue(new Date('2022-04-29T05:17:09Z').valueOf()); }; diff --git a/test/integrations/destinations/ga4_v2/processor/customMappings.ts b/test/integrations/destinations/ga4_v2/processor/customMappings.ts index b1db2121ea..28e8c5a5b4 100644 --- a/test/integrations/destinations/ga4_v2/processor/customMappings.ts +++ b/test/integrations/destinations/ga4_v2/processor/customMappings.ts @@ -1,3 +1,5 @@ +import { Destination } from '../../../../../src/types'; +import { overrideDestination } from '../../../testUtils'; import { defaultMockFns } from '../mocks'; const traits = { @@ -65,7 +67,10 @@ const properties = { }; const integrations = { - GA4: { + 'Google Analytics 4 (GA4) V2': { + clientId: '6d374e5d-78d3-4169-991d-2573ec0d1c67', + sessionId: '123', + sessionNumber: 3, consents: { ad_personalization: 'GRANTED', ad_user_data: 'DENIED', @@ -212,7 +217,7 @@ const eventsMapping = [ }, ]; -const destination = { +const destination: Destination = { Config: { apiSecret: 'dummyApiSecret', measurementId: 'G-T40PE6KET4', @@ -224,6 +229,19 @@ const destination = { eventFilteringOption: 'disable', eventsMapping, }, + ID: 'ga4_v2', + Name: 'Google Analytics 4', + Enabled: true, + WorkspaceID: '123', + DestinationDefinition: { + ID: '123', + Name: 'Google Analytics 4', + DisplayName: 'Google Analytics 4', + Config: {}, + }, + IsProcessorEnabled: true, + Transformations: [], + IsConnectionEnabled: true, }; export const customMappingTestCases = [ { @@ -297,6 +315,7 @@ export const customMappingTestCases = [ }, ], prices: 456, + session_number: 3, }, }, ], @@ -398,6 +417,7 @@ export const customMappingTestCases = [ }, ], prices: 456, + session_number: 3, }, }, ], @@ -461,6 +481,7 @@ export const customMappingTestCases = [ }, ], prices: 456, + session_number: 3, }, }, ], @@ -540,6 +561,7 @@ export const customMappingTestCases = [ }, body: { JSON: { + client_id: 'root_anonId', user_id: 'root_user', timestamp_micros: 1651105389000000, non_personalized_ads: false, @@ -594,6 +616,7 @@ export const customMappingTestCases = [ products_1_item_category2: 'regulars', products_1_item_category3: 'grocery', products_1_some_data: 'someValue', + session_number: 3, }, }, ], @@ -668,6 +691,111 @@ export const customMappingTestCases = [ timestamp_micros: 1651105389000000, non_personalized_ads: false, client_id: 'root_anonId', + events: [ + { + name: 'join_group', + params: { + city: 'London', + engagement_time_msec: 1, + firstName: 'John', + group: 'test group', + lastName: 'Gomes', + session_number: 3, + state: 'UK', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + }, + ], + user_properties: { + firstName: { + value: 'John', + }, + lastName: { + value: 'Gomes', + }, + city: { + value: 'London', + }, + state: { + value: 'UK', + }, + group: { + value: 'test group', + }, + }, + consent: { + ad_user_data: 'DENIED', + ad_personalization: 'GRANTED', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns: defaultMockFns, + }, + { + name: 'ga4_v2', + id: 'ga4_custom_mapping_test_4', + description: 'Custom Mapping Test For Hybrid mode', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'group', + userId: 'root_user', + anonymousId: 'root_anonId', + context: { + device, + traits, + }, + properties, + originalTimestamp: '2022-04-28T00:23:09.544Z', + integrations, + }, + destination: overrideDestination(destination, { + connectionMode: 'hybrid', + }), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.google-analytics.com/mp/collect', + headers: { + HOST: 'www.google-analytics.com', + 'Content-Type': 'application/json', + }, + params: { + api_secret: 'dummyApiSecret', + measurement_id: 'G-T40PE6KET4', + }, + body: { + JSON: { + user_id: 'root_user', + timestamp_micros: 1651105389000000, + non_personalized_ads: false, + client_id: '6d374e5d-78d3-4169-991d-2573ec0d1c67', events: [ { name: 'join_group', @@ -679,6 +807,8 @@ export const customMappingTestCases = [ lastName: 'Gomes', state: 'UK', streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + session_id: '123', + session_number: 3, }, }, ], diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts index ed1741e939..c0d8454548 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts @@ -166,7 +166,7 @@ export const testScenariosForV0API = [ output: { status: 400, message: - 'Request contains an invalid argument. during ga_audience response transformation', + '{"error":{"code":400,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure","errors":[{"errorCode":{"offlineUserDataJobError":"INVALID_SHA256_FORMAT"},"message":"The SHA256 encoded value is malformed.","location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"remove"},{"fieldName":"user_identifiers","index":0},{"fieldName":"hashed_email"}]}}]}],"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}} during ga_audience response transformation', destinationResponse: { error: { code: 400, @@ -313,11 +313,11 @@ export const testScenariosForV1API = [ body: { output: { message: - 'Request contains an invalid argument. during ga_audience response transformation', + '{"error":{"code":400,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure","errors":[{"errorCode":{"offlineUserDataJobError":"INVALID_SHA256_FORMAT"},"message":"The SHA256 encoded value is malformed.","location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"remove"},{"fieldName":"user_identifiers","index":0},{"fieldName":"hashed_email"}]}}]}],"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}} during ga_audience response transformation', response: [ { error: - 'Request contains an invalid argument. during ga_audience response transformation', + '{"error":{"code":400,"details":[{"@type":"type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure","errors":[{"errorCode":{"offlineUserDataJobError":"INVALID_SHA256_FORMAT"},"message":"The SHA256 encoded value is malformed.","location":{"fieldPathElements":[{"fieldName":"operations","index":0},{"fieldName":"remove"},{"fieldName":"user_identifiers","index":0},{"fieldName":"hashed_email"}]}}]}],"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}} during ga_audience response transformation', metadata: generateGoogleOAuthMetadata(1), statusCode: 400, }, diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts index b7f93a6945..9fd695a7a3 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts @@ -1,5 +1,16 @@ -import { generateProxyV1Payload } from '../../../testUtils'; -import { commonHeaders, commonParams, expectedStatTags, validRequestPayload1 } from './business'; +import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; +import { commonHeaders, commonParams, validRequestPayload1 } from './business'; + +const commonStatTags = { + destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS', + destinationId: 'default-destinationId', + errorCategory: 'network', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', +}; export const oauthError = [ { @@ -31,11 +42,11 @@ export const oauthError = [ output: { authErrorCategory: 'REFRESH_TOKEN', message: - 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. during ga_audience response transformation', + '{"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}} during ga_audience response transformation', response: [ { error: - 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. during ga_audience response transformation', + '{"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}} during ga_audience response transformation', metadata: { attemptNum: 1, destinationId: 'default-destinationId', @@ -51,16 +62,51 @@ export const oauthError = [ statusCode: 401, }, ], - statTags: { - destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS', - destinationId: 'default-destinationId', - errorCategory: 'network', - errorType: 'aborted', - feature: 'dataDelivery', - implementation: 'native', - module: 'destination', - workspaceId: 'default-workspaceId', - }, + statTags: commonStatTags, + status: 401, + }, + }, + }, + }, + }, + { + id: 'garl_oauth_scenario_with_wrong_customer_id', + name: 'google_adwords_remarketing_lists', + description: '[Proxy v1 API] :: Oauth where customer has provided wrong customerId', + successCriteria: 'The proxy should return 401 with authErrorCategory as AUTH_STATUS_INACTIVE', + scenario: 'Oauth', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload({ + headers: { ...commonHeaders, Authorization: 'Bearer wrongCustomerID' }, + params: { ...commonParams, customerId: 'wrongCustomerID' }, + JSON: validRequestPayload1, + endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + accessToken: 'wrongCustomerID', + }), + method: 'POST', + }, + }, + output: { + response: { + status: 401, + body: { + output: { + authErrorCategory: 'AUTH_STATUS_INACTIVE', + message: + '{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"CUSTOMER_NOT_FOUND"},"message":"No customer found for the provided customer id."}],"requestId":"lvB3KOjGHsgduHjt0wCglQ"}]}} during ga_audience response transformation', + response: [ + { + error: + '{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"CUSTOMER_NOT_FOUND"},"message":"No customer found for the provided customer id."}],"requestId":"lvB3KOjGHsgduHjt0wCglQ"}]}} during ga_audience response transformation', + metadata: { ...generateMetadata(1), secret: { accessToken: 'wrongCustomerID' } }, + statusCode: 401, + }, + ], + statTags: commonStatTags, status: 401, }, }, diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts index 1fd95858a1..d17f518c46 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts @@ -241,4 +241,52 @@ export const networkCallsData = [ }, }, }, + { + httpReq: { + url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create', + data: { + job: { + type: 'CUSTOMER_MATCH_USER_LIST', + customerMatchUserListMetadata: { + userList: 'customers/wrongCustomerID/userLists/709078448', + consent: { + adPersonalization: 'UNSPECIFIED', + adUserData: 'UNSPECIFIED', + }, + }, + }, + }, + headers: { + Authorization: 'Bearer wrongCustomerID', + 'Content-Type': 'application/json', + 'developer-token': 'dummy-dev-token', + }, + method: 'POST', + }, + httpRes: { + status: 401, + data: { + error: { + code: 401, + message: + 'Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + status: 'UNAUTHENTICATED', + details: [ + { + '@type': 'type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { + authenticationError: 'CUSTOMER_NOT_FOUND', + }, + message: 'No customer found for the provided customer id.', + }, + ], + requestId: 'lvB3KOjGHsgduHjt0wCglQ', + }, + ], + }, + }, + }, + }, ]; diff --git a/test/integrations/destinations/intercom/network.ts b/test/integrations/destinations/intercom/network.ts index d98e447824..2f90beac40 100644 --- a/test/integrations/destinations/intercom/network.ts +++ b/test/integrations/destinations/intercom/network.ts @@ -959,5 +959,87 @@ const deliveryCallsData = [ }, }, }, + { + httpReq: { + method: 'get', + url: 'https://api.eu.intercom.io/companies?company_id=company id', + data: {}, + headers: commonHeaders, + }, + httpRes: { + status: 200, + data: { + id: '123', + }, + }, + }, + { + httpReq: { + method: 'delete', + url: 'https://api.eu.intercom.io/contacts/70701240741e45d040/companies/123', + data: {}, + headers: commonHeaders, + }, + httpRes: { + status: 200, + data: {}, + }, + }, + { + httpReq: { + method: 'get', + url: 'https://api.eu.intercom.io/companies?company_id=unavailable company id', + data: {}, + headers: commonHeaders, + }, + httpRes: { + status: 404, + data: { + type: 'error.list', + request_id: 'req123', + errors: [ + { + code: 'company_not_found', + message: 'Company Not Found', + }, + ], + }, + }, + }, + { + httpReq: { + method: 'get', + url: 'https://api.eu.intercom.io/companies?company_id=other company id', + data: {}, + headers: commonHeaders, + }, + httpRes: { + status: 200, + data: { + id: 'other123', + }, + }, + }, + { + httpReq: { + method: 'delete', + url: 'https://api.eu.intercom.io/contacts/70701240741e45d040/companies/other123', + data: {}, + headers: commonHeaders, + }, + httpRes: { + status: 404, + data: { + type: 'error.list', + request_id: 'req123', + errors: [ + { + code: 'company_not_found', + message: 'Company Not Found', + }, + ], + }, + }, + }, ]; export const networkCallsData = [...deleteNwData, ...deliveryCallsData]; diff --git a/test/integrations/destinations/intercom/router/data.ts b/test/integrations/destinations/intercom/router/data.ts index 17245fb65b..cc89d3f1e2 100644 --- a/test/integrations/destinations/intercom/router/data.ts +++ b/test/integrations/destinations/intercom/router/data.ts @@ -466,6 +466,78 @@ const routerRequest2: RouterTransformationRequest = { }, metadata: generateMetadata(3), }, + { + destination: destination4, + message: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + channel: 'mobile', + context: { + app: { + build: '1.0', + name: 'Test_Example', + namespace: 'com.example.testapp', + version: '1.0', + }, + device: { + id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + manufacturer: 'Apple', + model: 'iPhone', + name: 'iPod touch (7th generation)', + type: 'iOS', + }, + library: { + name: 'test-ios-library', + version: '1.0.7', + }, + locale: 'en-US', + network: { + bluetooth: false, + carrier: 'unavailable', + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '14.0', + }, + screen: { + density: 2, + height: 320, + width: 568, + }, + timezone: 'Asia/Kolkata', + traits: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + name: 'Test Name', + firstName: 'Test', + lastName: 'Name', + createdAt: '2020-09-30T19:11:00.337Z', + userId: 'test_user_id_1', + email: 'test_1@test.com', + phone: '9876543210', + key1: 'value1', + company: { + id: 'company id', + name: 'Test Company', + remove: true, + }, + }, + userAgent: 'unknown', + }, + event: 'Test Event 2', + integrations: { + All: true, + }, + messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8', + originalTimestamp: '2020-09-30T19:11:00.337Z', + receivedAt: '2020-10-01T00:41:11.369+05:30', + request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18', + sentAt: '2020-09-30T19:11:10.382Z', + timestamp: '2020-10-01T00:41:01.324+05:30', + type: 'identify', + }, + metadata: generateMetadata(4), + }, ], destType: 'intercom', }; @@ -636,6 +708,96 @@ const routerRequest3: RouterTransformationRequest = { destType: 'intercom', }; +const routerRequest4: RouterTransformationRequest = { + input: [ + { + destination: destination3, + message: { + userId: 'user@1', + channel: 'web', + context: { + traits: { + age: 23, + email: 'test+5@rudderlabs.com', + phone: '+91 9599999999', + firstName: 'John', + lastName: 'Snow', + address: 'california usa', + ownerId: '13', + company: { + id: 'company id', + name: 'Test Company', + remove: true, + }, + }, + }, + type: 'identify', + integrations: { All: true }, + originalTimestamp: '2023-11-10T14:42:44.724Z', + timestamp: '2023-11-22T10:12:44.757+05:30', + }, + metadata: generateMetadata(1), + }, + { + destination: destination3, + message: { + userId: 'user@1', + channel: 'web', + context: { + traits: { + age: 23, + email: 'test+5@rudderlabs.com', + phone: '+91 9599999999', + firstName: 'John', + lastName: 'Snow', + address: 'california usa', + ownerId: '13', + company: { + id: 'unavailable company id', + name: 'Test Company', + remove: true, + }, + }, + }, + type: 'identify', + integrations: { All: true }, + originalTimestamp: '2023-11-10T14:42:44.724Z', + timestamp: '2023-11-22T10:12:44.757+05:30', + }, + metadata: generateMetadata(2), + }, + { + destination: destination3, + message: { + userId: 'user@1', + channel: 'web', + context: { + traits: { + age: 23, + email: 'test+5@rudderlabs.com', + phone: '+91 9599999999', + firstName: 'John', + lastName: 'Snow', + address: 'california usa', + ownerId: '13', + company: { + id: 'other company id', + name: 'Test Company', + remove: true, + }, + }, + }, + type: 'identify', + integrations: { All: true }, + originalTimestamp: '2023-11-10T14:42:44.724Z', + timestamp: '2023-11-22T10:12:44.757+05:30', + }, + metadata: generateMetadata(3), + }, + ], + destType: 'intercom', +}; + export const data: RouterTestData[] = [ { id: 'Intercom-router-test-1', @@ -983,6 +1145,153 @@ export const data: RouterTestData[] = [ metadata: [generateMetadata(3)], statusCode: 299, }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.intercom.io/users', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer testApiKey', + Accept: 'application/json', + 'Intercom-Version': '1.4', + 'User-Agent': 'RudderStack', + }, + 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: false, + user_id: 'test_user_id_1', + companies: [ + { + company_id: 'company id', + custom_attributes: {}, + name: 'Test Company', + remove: true, + }, + ], + custom_attributes: { + anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + key1: 'value1', + }, + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33', + }, + metadata: [generateMetadata(4)], + batched: false, + statusCode: 200, + destination: destination4, + }, + ], + }, + }, + }, + }, + { + id: 'Intercom-router-test-3', + scenario: 'Framework', + successCriteria: + 'Some identify events should be transformed successfully and some should fail for apiVersion v2', + name: 'intercom', + description: + 'Intercom router tests for detaching contact from company in intercom for apiVersion v2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: routerRequest4, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + JSON: { + email: 'test+5@rudderlabs.com', + external_id: 'user@1', + name: 'John Snow', + owner_id: 13, + phone: '+91 9599999999', + custom_attributes: { + address: 'california usa', + age: 23, + }, + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + endpoint: 'https://api.eu.intercom.io/contacts/70701240741e45d040', + files: {}, + headers: { + Authorization: 'Bearer testApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + 'Intercom-Version': '2.10', + 'User-Agent': 'RudderStack', + }, + method: 'PUT', + params: {}, + type: 'REST', + version: '1', + }, + destination: destination3, + metadata: [generateMetadata(1)], + statusCode: 200, + }, + { + batched: false, + error: + 'Unable to get company id due to : {"type":"error.list","request_id":"req123","errors":[{"code":"company_not_found","message":"Company Not Found"}]}', + statTags: { + destType: 'INTERCOM', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'cdkV2', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + destination: destination3, + metadata: [generateMetadata(2)], + statusCode: 400, + }, + { + batched: false, + error: + 'Unable to detach contact and company due to : {"type":"error.list","request_id":"req123","errors":[{"code":"company_not_found","message":"Company Not Found"}]}', + statTags: { + destType: 'INTERCOM', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'cdkV2', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + destination: destination3, + metadata: [generateMetadata(3)], + statusCode: 400, + }, ], }, }, diff --git a/test/integrations/destinations/klaviyo/processor/data.ts b/test/integrations/destinations/klaviyo/processor/data.ts index 06c4a3e530..71a10fc39c 100644 --- a/test/integrations/destinations/klaviyo/processor/data.ts +++ b/test/integrations/destinations/klaviyo/processor/data.ts @@ -4,8 +4,10 @@ import { identifyData } from './identifyTestData'; import { screenTestData } from './screenTestData'; import { trackTestData } from './trackTestData'; import { validationTestData } from './validationTestData'; +import { dataV2 } from './dataV2'; export const data = [ + ...dataV2, ...identifyData, ...trackTestData, ...screenTestData, diff --git a/test/integrations/destinations/klaviyo/processor/dataV2.ts b/test/integrations/destinations/klaviyo/processor/dataV2.ts new file mode 100644 index 0000000000..32c3c4206a --- /dev/null +++ b/test/integrations/destinations/klaviyo/processor/dataV2.ts @@ -0,0 +1,13 @@ +import { groupTestData } from './groupTestDataV2'; +import { identifyData } from './identifyTestDataV2'; +import { screenTestData } from './screenTestDataV2'; +import { trackTestData } from './trackTestDataV2'; +import { validationTestData } from './validationTestData'; + +export const dataV2 = [ + ...identifyData, + ...trackTestData, + ...screenTestData, + ...groupTestData, + ...validationTestData, +]; diff --git a/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts new file mode 100644 index 0000000000..dcd7fbc38e --- /dev/null +++ b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts @@ -0,0 +1,182 @@ +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; +import { + generateMetadata, + generateSimplifiedGroupPayload, + transformResultBuilder, +} from '../../../testUtils'; + +const destination: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + apiVersion: 'v2', + privateApiKey: 'dummyPrivateApiKey', + consent: ['email'], + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; + +const headers = { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2024-06-15', +}; + +const endpoint = 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs'; + +const commonOutputSubscriptionProps = { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'test@rudderstack.com', + phone_number: '+12 345 678 900', + subscriptions: { + email: { marketing: { consent: 'SUBSCRIBED' } }, + }, + }, + }, + ], + }, +}; + +const subscriptionRelations = { + list: { + data: { + type: 'list', + id: 'group_list_id', + }, + }, +}; + +export const groupTestData: ProcessorTestData[] = [ + { + id: 'klaviyo-group-test-1', + name: 'klaviyo', + description: 'Simple group call', + scenario: 'Business', + successCriteria: + 'Response should contain only group payload and status code should be 200, for the group payload a subscription payload should be present in the final payload with email and phone', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination, + message: generateSimplifiedGroupPayload({ + userId: 'user123', + groupId: 'group_list_id', + traits: { + subscribe: true, + }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: ['email'], + }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }), + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: commonOutputSubscriptionProps, + relationships: subscriptionRelations, + }, + }, + endpoint: endpoint, + headers: headers, + method: 'POST', + userId: '', + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'klaviyo-group-test-2', + name: 'klaviyo', + description: 'Simple group call without groupId', + scenario: 'Business', + successCriteria: + 'Response should contain error message and status code should be 400, as we are not sending groupId in the payload and groupId is a required field for group events', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination, + message: generateSimplifiedGroupPayload({ + userId: 'user123', + groupId: '', + traits: { + subscribe: true, + }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: 'email', + }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }), + metadata: generateMetadata(2), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'groupId is a required field for group events', + statTags: { + destType: 'KLAVIYO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + statusCode: 400, + metadata: generateMetadata(2), + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts new file mode 100644 index 0000000000..80ae918af0 --- /dev/null +++ b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts @@ -0,0 +1,375 @@ +import { removeUndefinedAndNullValues } from '@rudderstack/integrations-lib'; +import { + overrideDestination, + transformResultBuilder, + generateSimplifiedIdentifyPayload, + generateMetadata, +} from '../../../testUtils'; +import { ProcessorTestData } from '../../../testTypes'; +import { Destination } from '../../../../../src/types'; + +const destination: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + apiVersion: 'v2', + privateApiKey: 'dummyPrivateApiKey', + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; + +const commonTraits = { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12 345 578 900', + userId: 'user@1', + title: 'Developer', + organization: 'Rudder', + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + Flagged: false, + Residence: 'Shibuya', + street: '63, Shibuya', + properties: { + listId: 'XUepkK', + subscribe: true, + consent: ['email', 'sms'], + }, +}; + +const commonOutputUserProps = { + external_id: 'user@1', + anonymous_id: '97c46c81-3140-456d-b2a9-690d70aaca35', + email: 'test@rudderstack.com', + first_name: 'Test', + last_name: 'Rudderlabs', + phone_number: '+12 345 578 900', + title: 'Developer', + organization: 'Rudder', + location: { + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + address1: '63, Shibuya', + }, + properties: { + Flagged: false, + Residence: 'Shibuya', + }, +}; + +const commonOutputSubscriptionProps = { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'test@rudderstack.com', + phone_number: '+12 345 578 900', + subscriptions: { + email: { marketing: { consent: 'SUBSCRIBED' } }, + sms: { marketing: { consent: 'SUBSCRIBED' } }, + }, + }, + }, + ], + }, +}; +const subscriptionRelations = { + list: { + data: { + type: 'list', + id: 'XUepkK', + }, + }, +}; + +const commonOutputHeaders = { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2024-06-15', +}; + +const anonymousId = '97c46c81-3140-456d-b2a9-690d70aaca35'; +const userId = 'user@1'; +const sentAt = '2021-01-03T17:02:53.195Z'; +const originalTimestamp = '2021-01-03T17:02:53.193Z'; +const userProfileCommonEndpoint = 'https://a.klaviyo.com/api/profile-import'; +const subscribeEndpoint = 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs'; + +export const identifyData: ProcessorTestData[] = [ + { + id: 'klaviyo-identify-150624-test-1', + name: 'klaviyo', + description: + '150624 -> Identify call with flattenProperties enabled in destination config and subscribe', + scenario: 'Business', + successCriteria: + 'The profile response should contain the flattened properties of the friend object and one request object for subscribe', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(destination, { flattenProperties: true }), + message: generateSimplifiedIdentifyPayload({ + sentAt, + userId, + context: { + traits: { + ...commonTraits, + friend: { + names: { + first: 'Alice', + last: 'Smith', + }, + age: 25, + }, + }, + }, + anonymousId, + originalTimestamp, + }), + metadata: generateMetadata(2), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + userId: '', + method: 'POST', + endpoint: userProfileCommonEndpoint, + headers: commonOutputHeaders, + JSON: { + data: { + type: 'profile', + attributes: { + ...commonOutputUserProps, + properties: { + ...commonOutputUserProps.properties, + 'friend.age': 25, + 'friend.names.first': 'Alice', + 'friend.names.last': 'Smith', + }, + }, + meta: { + patch_properties: {}, + }, + }, + }, + }), + statusCode: 200, + metadata: generateMetadata(2), + }, + { + output: transformResultBuilder({ + userId: '', + method: 'POST', + endpoint: subscribeEndpoint, + headers: commonOutputHeaders, + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: commonOutputSubscriptionProps, + relationships: subscriptionRelations, + }, + }, + }), + statusCode: 200, + metadata: generateMetadata(2), + }, + ], + }, + }, + }, + { + id: 'klaviyo-identify-150624-test-2', + name: 'klaviyo', + description: + '150624 -> Profile without subscribing the user and get klaviyo id from externalId', + scenario: 'Business', + successCriteria: + 'Response should contain only profile update payload and status code should be 200 as subscribe is set to false in the payload', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination, + message: generateSimplifiedIdentifyPayload({ + sentAt, + userId, + context: { + externalId: [ + { + type: 'klaviyo-profileId', + id: '12345678', + }, + ], + traits: { + ...commonTraits, + appendList1: 'New Value 1', + appendList2: 'New Value 2', + unappendList1: 'Old Value 1', + unappendList2: 'Old Value 2', + properties: { ...commonTraits.properties, subscribe: false }, + }, + }, + integrations: { + Klaviyo: { + fieldsToUnset: ['Unset1', 'Unset2'], + fieldsToAppend: ['appendList1', 'appendList2'], + fieldsToUnappend: ['unappendList1', 'unappendList2'], + }, + All: true, + }, + anonymousId, + originalTimestamp, + }), + metadata: generateMetadata(4), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + endpoint: userProfileCommonEndpoint, + headers: commonOutputHeaders, + JSON: { + data: { + type: 'profile', + id: '12345678', + attributes: commonOutputUserProps, + meta: { + patch_properties: { + append: { + appendList1: 'New Value 1', + appendList2: 'New Value 2', + }, + unappend: { + unappendList1: 'Old Value 1', + unappendList2: 'Old Value 2', + }, + unset: ['Unset1', 'Unset2'], + }, + }, + }, + }, + userId: '', + }), + statusCode: 200, + metadata: generateMetadata(4), + }, + ], + }, + }, + }, + { + id: 'klaviyo-identify-150624-test-5', + name: 'klaviyo', + description: '150624 -> Identify call with enforceEmailAsPrimary enabled in destination config', + scenario: 'Business', + successCriteria: + 'Response should contain two payloads one for profile and other for subscription, response status code should be 200, for the profile updation payload there should be no external_id field in the payload as enforceEmailAsPrimary is set to true in the destination config and the userId should be mapped to _id field in the properties object', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(destination, { enforceEmailAsPrimary: true }), + message: generateSimplifiedIdentifyPayload({ + sentAt, + userId, + context: { + traits: commonTraits, + }, + anonymousId, + originalTimestamp, + }), + metadata: generateMetadata(5), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + userId: '', + method: 'POST', + endpoint: userProfileCommonEndpoint, + headers: commonOutputHeaders, + JSON: { + data: { + type: 'profile', + attributes: removeUndefinedAndNullValues({ + ...commonOutputUserProps, + properties: { + ...commonOutputUserProps.properties, + _id: userId, + }, + // remove external_id from the payload + external_id: undefined, + }), + meta: { + patch_properties: {}, + }, + }, + }, + }), + statusCode: 200, + metadata: generateMetadata(5), + }, + { + output: transformResultBuilder({ + userId: '', + method: 'POST', + endpoint: subscribeEndpoint, + headers: commonOutputHeaders, + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: commonOutputSubscriptionProps, + relationships: subscriptionRelations, + }, + }, + }), + statusCode: 200, + metadata: generateMetadata(5), + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts new file mode 100644 index 0000000000..5ccbed600c --- /dev/null +++ b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts @@ -0,0 +1,148 @@ +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; +import { + generateMetadata, + generateSimplifiedPageOrScreenPayload, + transformResultBuilder, +} from '../../../testUtils'; + +const destination: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + apiVersion: 'v2', + privateApiKey: 'dummyPrivateApiKey', + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; + +export const screenTestData: ProcessorTestData[] = [ + { + id: 'klaviyo-screen-150624-test-1', + name: 'klaviyo', + description: '150624 -> Screen event call with properties and contextual traits', + scenario: 'Business', + successCriteria: + 'Response should contain only event payload and status code should be 200, for the event payload should contain properties and contextual traits in the payload', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination, + message: generateSimplifiedPageOrScreenPayload( + { + name: 'Viewed Screen', + sentAt: '2021-01-25T16:12:02.048Z', + userId: 'sajal12', + integrations: { + klaviyo: { + fieldsToAppend: ['append1'], + }, + }, + context: { + traits: { + id: 'user@1', + age: '22', + email: 'test@rudderstack.com', + phone: '9112340375', + anonymousId: '9c6bd77ea9da3e68', + append1: 'value1', + }, + }, + properties: { + value: 9.99, + currency: 'USD', + PreviouslyVicePresident: true, + YearElected: 1801, + VicePresidents: ['Aaron Burr', 'George Clinton'], + }, + anonymousId: '9c6bd77ea9da3e68', + originalTimestamp: '2021-01-25T15:32:56.409Z', + }, + 'screen', + ), + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/events', + headers: { + Accept: 'application/json', + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + JSON: { + data: { + type: 'event', + attributes: { + time: '2021-01-25T15:32:56.409Z', + value: 9.99, + value_currency: 'USD', + metric: { + data: { + type: 'metric', + attributes: { + name: 'Viewed Screen', + }, + }, + }, + properties: { + PreviouslyVicePresident: true, + YearElected: 1801, + VicePresidents: ['Aaron Burr', 'George Clinton'], + }, + profile: { + data: { + attributes: { + anonymous_id: '9c6bd77ea9da3e68', + external_id: 'sajal12', + email: 'test@rudderstack.com', + meta: { + patch_properties: { + append: { + append1: 'value1', + }, + }, + }, + phone_number: '9112340375', + properties: { + id: 'user@1', + age: '22', + }, + }, + type: 'profile', + }, + }, + }, + }, + }, + userId: '', + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts new file mode 100644 index 0000000000..ecea141d38 --- /dev/null +++ b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts @@ -0,0 +1,293 @@ +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; +import { + generateMetadata, + generateSimplifiedTrackPayload, + generateTrackPayload, + overrideDestination, + transformResultBuilder, +} from '../../../testUtils'; + +const destination: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + privateApiKey: 'dummyPrivateApiKey', + apiVersion: 'v2', + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; + +const commonTraits = { + id: 'user@1', + age: '22', + anonymousId: '9c6bd77ea9da3e68', +}; + +const commonProps = { + PreviouslVicePresident: true, + YearElected: 1801, + VicePresidents: ['AaronBurr', 'GeorgeClinton'], +}; + +const commonOutputHeaders = { + Accept: 'application/json', + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + revision: '2024-06-15', +}; +const profileAttributes = { + email: 'test@rudderstack.com', + phone_number: '9112340375', + anonymous_id: '9c6bd77ea9da3e68', + properties: { + age: '22', + name: 'Test', + description: 'Sample description', + id: 'user@1', + }, + meta: { + patch_properties: {}, + }, +}; +const eventEndPoint = 'https://a.klaviyo.com/api/events'; + +export const trackTestData: ProcessorTestData[] = [ + { + id: 'klaviyo-track-150624-test-1', + name: 'klaviyo', + description: '150624 -> Simple track event call', + scenario: 'Business', + successCriteria: + 'Response should contain profile and event payload and status code should be 200, for the event payload should contain contextual traits and properties in the payload', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination, + message: generateSimplifiedTrackPayload({ + type: 'track', + event: 'TestEven002', + sentAt: '2021-01-25T16:12:02.048Z', + userId: 'sajal12', + context: { + traits: { + ...commonTraits, + name: 'Test', + email: 'test@rudderstack.com', + phone: '9112340375', + description: 'Sample description', + }, + }, + properties: { + ...commonProps, + revenue: 3000, + currency: 'USD', + }, + anonymousId: '9c6bd77ea9da3e68', + originalTimestamp: '2021-01-25T15:32:56.409Z', + }), + metadata: generateMetadata(2), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + endpoint: eventEndPoint, + headers: commonOutputHeaders, + JSON: { + data: { + type: 'event', + attributes: { + metric: { + data: { + type: 'metric', + attributes: { + name: 'TestEven002', + }, + }, + }, + profile: { + data: { + type: 'profile', + attributes: { ...profileAttributes, external_id: 'sajal12' }, + }, + }, + properties: commonProps, + value: 3000, + value_currency: 'USD', + time: '2021-01-25T15:32:56.409Z', + }, + }, + }, + userId: '', + }), + statusCode: 200, + metadata: generateMetadata(2), + }, + ], + }, + }, + }, + { + id: 'klaviyo-track-150624-test-2', + name: 'klaviyo', + description: + '150624 -> Track event call, with make email or phone as primary identifier toggle on', + scenario: 'Business', + successCriteria: + 'Response should contain only event payload with profile object and status code should be 200, for the event payload should contain contextual traits and properties in the payload, and email should be mapped to email and userId should be mapped to external_id as usual', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(destination, { enforceEmailAsPrimary: true }), + message: generateSimplifiedTrackPayload({ + type: 'track', + event: 'TestEven001', + sentAt: '2021-01-25T16:12:02.048Z', + userId: 'sajal12', + context: { + traits: { + ...commonTraits, + description: 'Sample description', + name: 'Test', + email: 'test@rudderstack.com', + phone: '9112340375', + }, + }, + properties: commonProps, + anonymousId: '9c6bd77ea9da3e68', + originalTimestamp: '2021-01-25T15:32:56.409Z', + }), + metadata: generateMetadata(3), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + endpoint: eventEndPoint, + headers: commonOutputHeaders, + JSON: { + data: { + type: 'event', + attributes: { + metric: { + data: { + type: 'metric', + attributes: { + name: 'TestEven001', + }, + }, + }, + properties: commonProps, + profile: { + data: { + type: 'profile', + attributes: { + ...profileAttributes, + properties: { ...profileAttributes.properties, _id: 'sajal12' }, + }, + }, + }, + time: '2021-01-25T15:32:56.409Z', + }, + }, + }, + userId: '', + }), + statusCode: 200, + metadata: generateMetadata(3), + }, + ], + }, + }, + }, + { + id: 'klaviyo-track-150624-test-3', + name: 'klaviyo', + description: '150624 -> Invalid `value` Field Format', + scenario: 'Business', + successCriteria: + 'Response should contain only event payload with vallue field as object and status code should be 200', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(destination, { enforceEmailAsPrimary: true }), + message: generateSimplifiedTrackPayload({ + type: 'track', + event: 'TestEven001', + sentAt: '2021-01-25T16:12:02.048Z', + userId: 'sajal12', + context: { + traits: { + ...commonTraits, + description: 'Sample description', + name: 'Test', + email: 'test@rudderstack.com', + phone: '9112340375', + }, + }, + properties: { ...commonProps, value: { price: 9.99 } }, + anonymousId: '9c6bd77ea9da3e68', + originalTimestamp: '2021-01-25T15:32:56.409Z', + }), + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Invalid float value', + statTags: { + destType: 'KLAVIYO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + statusCode: 400, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts new file mode 100644 index 0000000000..10e2d15db0 --- /dev/null +++ b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts @@ -0,0 +1,83 @@ +import { Destination } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; +import { generateMetadata } from '../../../testUtils'; + +const destination: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + privateApiKey: 'dummyPrivateApiKey', + apiVersion: 'v2', + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; + +export const validationTestData: ProcessorTestData[] = [ + { + id: 'klaviyo-validation-150624-test-1', + name: 'klaviyo', + description: '150624->[Error]: Check for unsupported message type', + scenario: 'Framework', + successCriteria: + 'Response should contain error message and status code should be 400, as we are sending a message type which is not supported by Klaviyo destination and the error message should be Event type random is not supported', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination, + message: { + userId: 'user123', + type: 'random', + groupId: 'XUepkK', + traits: { + subscribe: true, + }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: 'email', + }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event type random is not supported', + statTags: { + destType: 'KLAVIYO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + statusCode: 400, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/klaviyo/router/commonConfig.ts b/test/integrations/destinations/klaviyo/router/commonConfig.ts new file mode 100644 index 0000000000..a1297635eb --- /dev/null +++ b/test/integrations/destinations/klaviyo/router/commonConfig.ts @@ -0,0 +1,199 @@ +import { generateMetadata } from '../../../testUtils'; +import { Destination, RouterTransformationRequest } from '../../../../../src/types'; +const destination: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + privateApiKey: 'dummyPrivateApiKey', + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; +const destinationV2: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + privateApiKey: 'dummyPrivateApiKey', + apiVersion: 'v2', + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; +const getRequest = (apiVersion) => { + return [ + { + destination: apiVersion === 'v2' ? destinationV2 : destination, + metadata: generateMetadata(1), + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'test', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test_1@rudderstack.com', + phone: '+12 345 578 900', + userId: 'Testc', + title: 'Developer', + organization: 'Rudder', + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + Flagged: false, + Residence: 'Shibuya', + properties: { consent: ['email', 'sms'] }, + }, + 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', + integrations: { All: true }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + { + destination: apiVersion === 'v2' ? destinationV2 : destination, + metadata: generateMetadata(2), + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'test', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12 345 578 900', + userId: 'test', + title: 'Developer', + organization: 'Rudder', + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + Flagged: false, + Residence: 'Shibuya', + properties: { listId: 'XUepkK', subscribe: true, consent: ['email', 'sms'] }, + }, + 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', + integrations: { All: true }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + { + destination: apiVersion === 'v2' ? destinationV2 : destination, + metadata: generateMetadata(3), + message: { + userId: 'user123', + type: 'group', + groupId: 'XUepkK', + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + subscribe: true, + consent: ['email'], + }, + context: { + ip: '14.5.67.21', + library: { name: 'http' }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + }, + { + destination: apiVersion === 'v2' ? destinationV2 : destination, + metadata: generateMetadata(4), + message: { + userId: 'user123', + type: 'random', + groupId: 'XUepkK', + traits: { subscribe: true }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: 'email', + }, + ip: '14.5.67.21', + library: { name: 'http' }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + }, + { + destination: apiVersion === 'v2' ? destinationV2 : destination, + metadata: generateMetadata(5), + message: { + userId: 'user123', + type: 'group', + groupId: '', + traits: { subscribe: true }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '+12 345 678 900', + consent: 'email', + }, + ip: '14.5.67.21', + library: { name: 'http' }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + }, + ]; +}; +export const routerRequest: RouterTransformationRequest = { + input: getRequest('v1'), + destType: 'klaviyo', +}; +export const routerRequestV2: RouterTransformationRequest = { + input: getRequest('v2'), + destType: 'klaviyo', +}; diff --git a/test/integrations/destinations/klaviyo/router/data.ts b/test/integrations/destinations/klaviyo/router/data.ts index 8866a8a546..8e8c507f48 100644 --- a/test/integrations/destinations/klaviyo/router/data.ts +++ b/test/integrations/destinations/klaviyo/router/data.ts @@ -1,6 +1,8 @@ import { Destination, RouterTransformationRequest } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; +import { routerRequest } from './commonConfig'; import { generateMetadata } from '../../../testUtils'; +import { dataV2 } from './dataV2'; const destination: Destination = { ID: '123', @@ -12,7 +14,6 @@ const destination: Destination = { Config: {}, }, Config: { - publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey', }, Enabled: true, @@ -20,164 +21,6 @@ const destination: Destination = { Transformations: [], }; -const routerRequest: RouterTransformationRequest = { - input: [ - { - destination, - metadata: generateMetadata(1), - message: { - type: 'identify', - sentAt: '2021-01-03T17:02:53.195Z', - userId: 'test', - channel: 'web', - context: { - os: { name: '', version: '' }, - app: { - name: 'RudderLabs JavaScript SDK', - build: '1.0.0', - version: '1.1.11', - namespace: 'com.rudderlabs.javascript', - }, - traits: { - firstName: 'Test', - lastName: 'Rudderlabs', - email: 'test@rudderstack.com', - phone: '+12 345 578 900', - userId: 'Testc', - title: 'Developer', - organization: 'Rudder', - city: 'Tokyo', - region: 'Kanto', - country: 'JP', - zip: '100-0001', - Flagged: false, - Residence: 'Shibuya', - properties: { consent: ['email', 'sms'] }, - }, - 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', - integrations: { All: true }, - originalTimestamp: '2021-01-03T17:02:53.193Z', - }, - }, - { - destination, - metadata: generateMetadata(2), - message: { - type: 'identify', - sentAt: '2021-01-03T17:02:53.195Z', - userId: 'test', - channel: 'web', - context: { - os: { name: '', version: '' }, - app: { - name: 'RudderLabs JavaScript SDK', - build: '1.0.0', - version: '1.1.11', - namespace: 'com.rudderlabs.javascript', - }, - traits: { - firstName: 'Test', - lastName: 'Rudderlabs', - email: 'test@rudderstack.com', - phone: '+12 345 578 900', - userId: 'test', - title: 'Developer', - organization: 'Rudder', - city: 'Tokyo', - region: 'Kanto', - country: 'JP', - zip: '100-0001', - Flagged: false, - Residence: 'Shibuya', - properties: { listId: 'XUepkK', subscribe: true, consent: ['email', 'sms'] }, - }, - 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', - integrations: { All: true }, - originalTimestamp: '2021-01-03T17:02:53.193Z', - }, - }, - { - destination, - metadata: generateMetadata(3), - message: { - userId: 'user123', - type: 'group', - groupId: 'XUepkK', - traits: { subscribe: true }, - context: { - traits: { - email: 'test@rudderstack.com', - phone: '+12 345 678 900', - consent: ['email'], - }, - ip: '14.5.67.21', - library: { name: 'http' }, - }, - timestamp: '2020-01-21T00:21:34.208Z', - }, - }, - { - destination, - metadata: generateMetadata(4), - message: { - userId: 'user123', - type: 'random', - groupId: 'XUepkK', - traits: { subscribe: true }, - context: { - traits: { - email: 'test@rudderstack.com', - phone: '+12 345 678 900', - consent: 'email', - }, - ip: '14.5.67.21', - library: { name: 'http' }, - }, - timestamp: '2020-01-21T00:21:34.208Z', - }, - }, - { - destination, - metadata: generateMetadata(5), - message: { - userId: 'user123', - type: 'group', - groupId: '', - traits: { subscribe: true }, - context: { - traits: { - email: 'test@rudderstack.com', - phone: '+12 345 678 900', - consent: 'email', - }, - ip: '14.5.67.21', - library: { name: 'http' }, - }, - timestamp: '2020-01-21T00:21:34.208Z', - }, - }, - ], - destType: 'klaviyo', -}; - export const data: RouterTestData[] = [ { id: 'klaviyo-router-test-1', @@ -301,7 +144,7 @@ export const data: RouterTestData[] = [ type: 'profile', attributes: { external_id: 'test', - email: 'test@rudderstack.com', + email: 'test_1@rudderstack.com', first_name: 'Test', last_name: 'Rudderlabs', phone_number: '+12 345 578 900', @@ -368,4 +211,5 @@ export const data: RouterTestData[] = [ }, }, }, + ...dataV2, ]; diff --git a/test/integrations/destinations/klaviyo/router/dataV2.ts b/test/integrations/destinations/klaviyo/router/dataV2.ts new file mode 100644 index 0000000000..714560fdfd --- /dev/null +++ b/test/integrations/destinations/klaviyo/router/dataV2.ts @@ -0,0 +1,1263 @@ +import { Destination } from '../../../../../src/types'; +import { RouterTestData } from '../../../testTypes'; +import { routerRequestV2 } from './commonConfig'; +import { generateMetadata, transformResultBuilder } from '../../../testUtils'; + +const destination: Destination = { + ID: '123', + Name: 'klaviyo', + DestinationDefinition: { + ID: '123', + Name: 'klaviyo', + DisplayName: 'klaviyo', + Config: {}, + }, + Config: { + privateApiKey: 'dummyPrivateApiKey', + apiVersion: 'v2', + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], +}; +const userProfileCommonEndpoint = 'https://a.klaviyo.com/api/profile-import'; + +const headers = { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2024-06-15', +}; +const subscriptionRelations = { + list: { + data: { + type: 'list', + id: 'XUepkK', + }, + }, +}; + +const commonOutputSubscriptionProps = { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'test@rudderstack.com', + phone_number: '+12 345 678 900', + subscriptions: { + email: { marketing: { consent: 'SUBSCRIBED' } }, + }, + }, + }, + ], + }, +}; + +const alreadyTransformedEvent = { + message: { + output: transformResultBuilder({ + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: commonOutputSubscriptionProps, + relationships: subscriptionRelations, + }, + }, + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers: headers, + method: 'POST', + userId: '', + }), + statusCode: 200, + }, + metadata: generateMetadata(10), + destination, +}; + +export const dataV2: RouterTestData[] = [ + { + id: 'klaviyo-router-150624-test-1', + name: 'klaviyo', + description: '150624 -> Basic Router Test to test multiple payloads', + scenario: 'Framework', + successCriteria: + 'All the subscription events from same type of call should be batched. This case does not contain any events which can be batched', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: routerRequestV2, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + // identify 2 with subscriptipon request + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: userProfileCommonEndpoint, + headers, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'test', + email: 'test@rudderstack.com', + first_name: 'Test', + last_name: 'Rudderlabs', + phone_number: '+12 345 578 900', + anonymous_id: '97c46c81-3140-456d-b2a9-690d70aaca35', + title: 'Developer', + organization: 'Rudder', + location: { + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + }, + properties: { Flagged: false, Residence: 'Shibuya' }, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'test@rudderstack.com', + phone_number: '+12 345 578 900', + subscriptions: { + email: { marketing: { consent: 'SUBSCRIBED' } }, + sms: { marketing: { consent: 'SUBSCRIBED' } }, + }, + }, + }, + ], + }, + }, + relationships: subscriptionRelations, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [generateMetadata(2)], + batched: true, + statusCode: 200, + destination, + }, + { + // identify 1 + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: userProfileCommonEndpoint, + headers, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'test', + email: 'test_1@rudderstack.com', + first_name: 'Test', + last_name: 'Rudderlabs', + phone_number: '+12 345 578 900', + anonymous_id: '97c46c81-3140-456d-b2a9-690d70aaca35', + title: 'Developer', + organization: 'Rudder', + location: { + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + }, + properties: { Flagged: false, Residence: 'Shibuya' }, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [generateMetadata(1)], + batched: true, + statusCode: 200, + destination, + }, + { + // group call subscription request + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'test@rudderstack.com', + phone_number: '+12 345 678 900', + subscriptions: { + email: { marketing: { consent: 'SUBSCRIBED' } }, + }, + }, + }, + ], + }, + }, + relationships: subscriptionRelations, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [generateMetadata(3)], + batched: true, + statusCode: 200, + destination, + }, + { + metadata: [generateMetadata(4)], + batched: false, + statusCode: 400, + error: 'Event type random is not supported', + statTags: { + destType: 'KLAVIYO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + destination, + }, + { + metadata: [generateMetadata(5)], + batched: false, + statusCode: 400, + error: 'groupId is a required field for group events', + statTags: { + destType: 'KLAVIYO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + destination, + }, + ], + }, + }, + }, + }, + { + id: 'klaviyo-router-150624-test-2', + name: 'klaviyo', + description: '150624 -> Router Test to test batching based upon same message type', + scenario: 'Framework', + successCriteria: + 'All the subscription events from same type of call should be batched. This case does not contain any events which can be batched', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination, + metadata: generateMetadata(1), + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'test', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test_1@rudderstack.com', + phone: '+12 345 578 900', + userId: 'Testc', + title: 'Developer', + organization: 'Rudder', + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + Flagged: false, + Residence: 'Shibuya', + properties: { listId: 'XUepkK', subscribe: true, consent: ['email'] }, + }, + 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', + integrations: { All: true }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + { + destination, + metadata: generateMetadata(2), + message: { + type: 'identify', + sentAt: '2021-01-03T17:02:53.195Z', + userId: 'test', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + firstName: 'Test', + lastName: 'Rudderlabs', + email: 'test@rudderstack.com', + phone: '+12 345 578 900', + userId: 'test', + title: 'Developer', + organization: 'Rudder', + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + Flagged: false, + Residence: 'Shibuya', + properties: { listId: 'XUepkK', subscribe: true, consent: ['email', 'sms'] }, + }, + 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', + integrations: { All: true }, + originalTimestamp: '2021-01-03T17:02:53.193Z', + }, + }, + ], + destType: 'klaviyo', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + // profile for identify 1 + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: userProfileCommonEndpoint, + headers, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'test', + email: 'test_1@rudderstack.com', + first_name: 'Test', + last_name: 'Rudderlabs', + phone_number: '+12 345 578 900', + anonymous_id: '97c46c81-3140-456d-b2a9-690d70aaca35', + title: 'Developer', + organization: 'Rudder', + location: { + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + }, + properties: { Flagged: false, Residence: 'Shibuya' }, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + // profile for identify 2 + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: userProfileCommonEndpoint, + headers, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'test', + email: 'test@rudderstack.com', + first_name: 'Test', + last_name: 'Rudderlabs', + phone_number: '+12 345 578 900', + anonymous_id: '97c46c81-3140-456d-b2a9-690d70aaca35', + title: 'Developer', + organization: 'Rudder', + location: { + city: 'Tokyo', + region: 'Kanto', + country: 'JP', + zip: '100-0001', + }, + properties: { Flagged: false, Residence: 'Shibuya' }, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + // subscriptiopn for both identify 1 and 2 + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'test_1@rudderstack.com', + phone_number: '+12 345 578 900', + subscriptions: { + email: { marketing: { consent: 'SUBSCRIBED' } }, + }, + }, + }, + { + type: 'profile', + attributes: { + email: 'test@rudderstack.com', + phone_number: '+12 345 578 900', + subscriptions: { + email: { marketing: { consent: 'SUBSCRIBED' } }, + sms: { marketing: { consent: 'SUBSCRIBED' } }, + }, + }, + }, + ], + }, + }, + relationships: subscriptionRelations, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [generateMetadata(1), generateMetadata(2)], + batched: true, + statusCode: 200, + destination, + }, + ], + }, + }, + }, + }, + { + id: 'klaviyo-router-150624-test-3', + name: 'klaviyo', + description: + '150624 -> Router tests to have some anonymous track event, some identify events with subscription and some identified track event', + scenario: 'Framework', + successCriteria: + 'All the subscription events under same message type should be batched and respective profile requests should also be placed in same batched request', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + alreadyTransformedEvent, + { + message: { + // user 1 track call with userId and anonymousId + channel: 'web', + context: { + traits: { + email: 'testklaviyo1@email.com', + firstname: 'Test Klaviyo 1', + }, + }, + type: 'track', + anonymousId: 'anonTestKlaviyo1', + userId: 'testKlaviyo1', + event: 'purchase', + properties: { + price: '12', + }, + }, + metadata: generateMetadata(1, 'testKlaviyo1'), + destination, + }, + { + message: { + // Anonymous Tracking -> user 2 track call with anonymousId only + channel: 'web', + context: { + traits: {}, + }, + type: 'track', + anonymousId: 'anonTestKlaviyo2', + event: 'viewed product', + properties: { + price: '120', + }, + }, + metadata: generateMetadata(2), + destination, + }, + { + message: { + // user 2 idenitfy call with anonymousId and subscription + channel: 'web', + traits: { + email: 'testklaviyo2@rs.com', + firstname: 'Test Klaviyo 2', + properties: { + subscribe: true, + listId: 'configListId', + consent: ['email'], + }, + }, + context: {}, + anonymousId: 'anonTestKlaviyo2', + type: 'identify', + userId: 'testKlaviyo2', + integrations: { + All: true, + }, + }, + metadata: generateMetadata(3, 'testKlaviyo2'), + destination, + }, + { + message: { + // user 2 track call with email only + channel: 'web', + context: { + traits: { + email: 'testklaviyo2@email.com', + firstname: 'Test Klaviyo 2', + }, + }, + type: 'track', + userId: 'testKlaviyo2', + event: 'purchase', + properties: { + price: '120', + }, + }, + metadata: generateMetadata(4, 'testKlaviyo2'), + destination, + }, + { + message: { + // for user 3 identify call without anonymousId and subscriptiontraits: + channel: 'web', + traits: { + email: 'testklaviyo3@rs.com', + firstname: 'Test Klaviyo 3', + properties: { + subscribe: true, + listId: 'configListId', + consent: ['email', 'sms'], + }, + }, + context: {}, + type: 'identify', + userId: 'testKlaviyo3', + integrations: { + All: true, + }, + }, + metadata: generateMetadata(5, 'testKlaviyo3'), + destination, + }, + ], + destType: 'klaviyo', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: transformResultBuilder({ + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: commonOutputSubscriptionProps, + relationships: subscriptionRelations, + }, + }, + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers: headers, + method: 'POST', + userId: '', + }), + metadata: [generateMetadata(10)], + batched: false, + statusCode: 200, + destination, + }, + { + // user 1 track call with userId and anonymousId + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/events', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Accept: 'application/json', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'event', + attributes: { + properties: { + price: '12', + }, + profile: { + data: { + type: 'profile', + attributes: { + external_id: 'testKlaviyo1', + anonymous_id: 'anonTestKlaviyo1', + email: 'testklaviyo1@email.com', + first_name: 'Test Klaviyo 1', + properties: {}, + meta: { + patch_properties: {}, + }, + }, + }, + }, + metric: { + data: { + type: 'metric', + attributes: { + name: 'purchase', + }, + }, + }, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(1, 'testKlaviyo1')], + batched: false, + statusCode: 200, + destination, + }, + { + // anonn event for user 2 + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/events', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Accept: 'application/json', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'event', + attributes: { + properties: { + price: '120', + }, + profile: { + data: { + type: 'profile', + attributes: { + anonymous_id: 'anonTestKlaviyo2', + properties: {}, + meta: { + patch_properties: {}, + }, + }, + }, + }, + metric: { + data: { + type: 'metric', + attributes: { + name: 'viewed product', + }, + }, + }, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(2)], + batched: false, + statusCode: 200, + destination, + }, + { + // identify call for user 2 and user 3 with subscription + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-import', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Accept: 'application/json', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'testKlaviyo2', + anonymous_id: 'anonTestKlaviyo2', + email: 'testklaviyo2@rs.com', + first_name: 'Test Klaviyo 2', + properties: {}, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-import', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Accept: 'application/json', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'testKlaviyo3', + email: 'testklaviyo3@rs.com', + first_name: 'Test Klaviyo 3', + properties: {}, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'testklaviyo2@rs.com', + subscriptions: { + email: { + marketing: { + consent: 'SUBSCRIBED', + }, + }, + }, + }, + }, + { + type: 'profile', + attributes: { + email: 'testklaviyo3@rs.com', + subscriptions: { + email: { + marketing: { + consent: 'SUBSCRIBED', + }, + }, + }, + }, + }, + ], + }, + }, + relationships: { + list: { + data: { + type: 'list', + id: 'configListId', + }, + }, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [generateMetadata(3, 'testKlaviyo2'), generateMetadata(5, 'testKlaviyo3')], + batched: true, + statusCode: 200, + destination, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/events', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Accept: 'application/json', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'event', + attributes: { + properties: { + price: '120', + }, + profile: { + data: { + type: 'profile', + attributes: { + external_id: 'testKlaviyo2', + email: 'testklaviyo2@email.com', + first_name: 'Test Klaviyo 2', + properties: {}, + meta: { + patch_properties: {}, + }, + }, + }, + }, + metric: { + data: { + type: 'metric', + attributes: { + name: 'purchase', + }, + }, + }, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(4, 'testKlaviyo2')], + batched: false, + statusCode: 200, + destination, + }, + ], + }, + }, + }, + }, + { + id: 'klaviyo-router-150624-test-4', + name: 'klaviyo', + description: '150624 -> Retl Router tests to have retl ', + scenario: 'Framework', + successCriteria: + 'All the subscription events with same message type should be batched and respective profile requests should also be placed in same batched request', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + mappedToDestination: 'true', + externalId: [ + { + id: 'testklaviyo1@email.com', + identifierType: 'email', + type: 'KLAVIYO-profile_v2', + }, + ], + traits: { + properties: { + subscribe: false, + }, + email: 'testklaviyo1@email.com', + firstname: 'Test Klaviyo 1', + }, + }, + type: 'identify', + anonymousId: 'anonTestKlaviyo1', + userId: 'testKlaviyo1', + }, + metadata: generateMetadata(1), + destination, + }, + { + message: { + channel: 'web', + traits: { + email: 'testklaviyo2@rs.com', + firstname: 'Test Klaviyo 2', + properties: { + subscribe: true, + listId: 'configListId', + consent: ['email'], + }, + }, + context: { + mappedToDestination: 'true', + externalId: [ + { + id: 'testklaviyo2@rs.com', + identifierType: 'email', + type: 'KLAVIYO-profile_v2', + }, + ], + }, + anonymousId: 'anonTestKlaviyo2', + type: 'identify', + userId: 'testKlaviyo2', + integrations: { + All: true, + }, + }, + metadata: generateMetadata(2), + destination, + }, + ], + destType: 'klaviyo', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-import', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Accept: 'application/json', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'testklaviyo2@rs.com', + anonymous_id: 'anonTestKlaviyo2', + email: 'testklaviyo2@rs.com', + first_name: 'Test Klaviyo 2', + properties: {}, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + 'Content-Type': 'application/json', + Accept: 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile-subscription-bulk-create-job', + attributes: { + profiles: { + data: [ + { + type: 'profile', + attributes: { + email: 'testklaviyo2@rs.com', + subscriptions: { + email: { + marketing: { + consent: 'SUBSCRIBED', + }, + }, + }, + }, + }, + ], + }, + }, + relationships: { + list: { + data: { + type: 'list', + id: 'configListId', + }, + }, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [generateMetadata(2)], + batched: true, + statusCode: 200, + destination, + }, + { + batchedRequest: [ + { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://a.klaviyo.com/api/profile-import', + headers: { + Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Accept: 'application/json', + 'Content-Type': 'application/json', + revision: '2024-06-15', + }, + params: {}, + body: { + JSON: { + data: { + type: 'profile', + attributes: { + external_id: 'testklaviyo1@email.com', + anonymous_id: 'anonTestKlaviyo1', + email: 'testklaviyo1@email.com', + first_name: 'Test Klaviyo 1', + properties: {}, + }, + meta: { + patch_properties: {}, + }, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + ], + metadata: [generateMetadata(1)], + batched: true, + statusCode: 200, + destination, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/mailchimp/network.ts b/test/integrations/destinations/mailchimp/network.ts index b036bf566c..a29712ce9a 100644 --- a/test/integrations/destinations/mailchimp/network.ts +++ b/test/integrations/destinations/mailchimp/network.ts @@ -77,4 +77,42 @@ export const networkCallsData = [ status: 200, }, }, + { + httpReq: { + url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/5587981bdf09024971ff9ddfb2590a6d', + method: 'GET', + headers: { + Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + }, + }, + httpRes: { + data: { + type: 'https://mailchimp.com/developer/marketing/docs/errors/', + title: 'API Key Invalid', + status: 401, + detail: "Your API key may be invalid, or you've attempted to access the wrong datacenter.", + instance: 'd2e09e5b-7c28-8585-68db-8feaf57ee0f7', + }, + status: 401, + }, + }, + { + httpReq: { + url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111', + method: 'GET', + headers: { + Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + }, + }, + httpRes: { + data: { + type: 'https://mailchimp.com/developer/marketing/docs/errors/', + title: 'API Key Invalid', + status: 401, + detail: "Your API key may be invalid, or you've attempted to access the wrong datacenter.", + instance: 'd2e09e5b-7c28-8585-68db-8feaf57ee0f7', + }, + status: 401, + }, + }, ]; diff --git a/test/integrations/destinations/mailchimp/processor/data.ts b/test/integrations/destinations/mailchimp/processor/data.ts index a0ee5de3d3..bf3cb6ad06 100644 --- a/test/integrations/destinations/mailchimp/processor/data.ts +++ b/test/integrations/destinations/mailchimp/processor/data.ts @@ -345,7 +345,7 @@ export const data = [ implementation: 'native', module: 'destination', }, - statusCode: 400, + statusCode: 401, }, ], }, diff --git a/test/integrations/destinations/moengage/processor/data.ts b/test/integrations/destinations/moengage/processor/data.ts index 1ce8705f53..df6e1226b6 100644 --- a/test/integrations/destinations/moengage/processor/data.ts +++ b/test/integrations/destinations/moengage/processor/data.ts @@ -1,3 +1,7 @@ +const mockFns = (_) => { + jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2023-10-14T00:00:00.000Z').valueOf()); +}; + export const data = [ { name: 'moengage', @@ -295,6 +299,7 @@ export const data = [ ], }, }, + mockFns, }, { name: 'moengage', @@ -1629,6 +1634,7 @@ export const data = [ ], }, }, + mockFns, }, { name: 'moengage', diff --git a/test/integrations/destinations/moengage/router/data.ts b/test/integrations/destinations/moengage/router/data.ts index 0f8a3de41b..b24453fd34 100644 --- a/test/integrations/destinations/moengage/router/data.ts +++ b/test/integrations/destinations/moengage/router/data.ts @@ -1,3 +1,7 @@ +const mockFns = (_) => { + jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2023-10-14T00:00:00.000Z').valueOf()); +}; + export const data = [ { name: 'moengage', @@ -432,5 +436,6 @@ export const data = [ }, }, }, + mockFns, }, ]; diff --git a/test/integrations/destinations/mp/common.ts b/test/integrations/destinations/mp/common.ts index d40afa0c02..f8aae81780 100644 --- a/test/integrations/destinations/mp/common.ts +++ b/test/integrations/destinations/mp/common.ts @@ -1,7 +1,7 @@ import { Destination } from '../../../../src/types'; const defaultMockFns = () => { - jest.spyOn(Date, 'now').mockImplementation(() => new Date(Date.UTC(2020, 0, 25)).valueOf()); + jest.spyOn(Date, 'now').mockReturnValue(new Date(Date.UTC(2020, 0, 25)).valueOf()); }; const sampleDestination: Destination = { diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index db5bc840c2..d13cf64cae 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -3670,6 +3670,9 @@ export const data = [ ], }, }, + mockFns: (_) => { + jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2018-12-20T10:26:33.451Z').valueOf()); + }, }, { name: 'mp', diff --git a/test/integrations/destinations/optimizely_fullstack/processor/data.ts b/test/integrations/destinations/optimizely_fullstack/processor/data.ts index 52fbdfe5fe..fb514bc6b8 100644 --- a/test/integrations/destinations/optimizely_fullstack/processor/data.ts +++ b/test/integrations/destinations/optimizely_fullstack/processor/data.ts @@ -1,7 +1,7 @@ import utils from '../../../../../src/v0/util'; export const mockFns = (_) => { // @ts-ignore - jest.spyOn(utils, 'generateUUID').mockImplementation(() => 'generated_uuid'); + jest.spyOn(utils, 'generateUUID').mockReturnValueOnce('generated_uuid'); }; export const data = [ { diff --git a/test/integrations/destinations/pagerduty/processor/data.ts b/test/integrations/destinations/pagerduty/processor/data.ts index 97fe22daa0..bfa924c3bd 100644 --- a/test/integrations/destinations/pagerduty/processor/data.ts +++ b/test/integrations/destinations/pagerduty/processor/data.ts @@ -1,287 +1,287 @@ export const data = [ - { - name: 'pagerduty', - description: 'No Message type', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - sentAt: '2022-10-11T13:10:54.877+05:30', - userId: 'user@45', - rudderId: 'caae04c5-959f-467b-a293-86f6c62d59e6', - messageId: 'b6ce7f31-5d76-4240-94d2-3eea020ef791', - timestamp: '2022-10-11T13:10:52.137+05:30', - receivedAt: '2022-10-11T13:10:52.138+05:30', - request_ip: '[::1]', - originalTimestamp: '2022-10-11T13:10:54.877+05:30', - }, - destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: 'Event type is required', - statTags: { - destType: 'PAGERDUTY', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'Routing Key is not present', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - sentAt: '2022-10-11T13:10:54.877+05:30', - userId: 'user@45', - context: {}, - rudderId: 'caae04c5-959f-467b-a293-86f6c62d59e6', - messageId: 'b6ce7f31-5d76-4240-94d2-3eea020ef791', - timestamp: '2022-10-11T13:10:52.137+05:30', - receivedAt: '2022-10-11T13:10:52.138+05:30', - request_ip: '[::1]', - originalTimestamp: '2022-10-11T13:10:54.877+05:30', - }, - destination: { Config: {} }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: 'Routing Key Is Required', - statTags: { - destType: 'PAGERDUTY', - errorCategory: 'dataValidation', - errorType: 'configuration', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'Unsupported Event type', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - type: 'alias', - sentAt: '2022-10-11T13:10:54.877+05:30', - userId: 'user@45', - context: {}, - rudderId: 'caae04c5-959f-467b-a293-86f6c62d59e6', - messageId: 'b6ce7f31-5d76-4240-94d2-3eea020ef791', - timestamp: '2022-10-11T13:10:52.137+05:30', - receivedAt: '2022-10-11T13:10:52.138+05:30', - request_ip: '[::1]', - originalTimestamp: '2022-10-11T13:10:54.877+05:30', - }, - destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: 'Event type alias is not supported', - statTags: { - destType: 'PAGERDUTY', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'event name is not present', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - type: 'track', - messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', - userId: 'user@45', - properties: {}, - }, - destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: 'Event name is required', - statTags: { - destType: 'PAGERDUTY', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'Parameter source is not present', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - type: 'track', - event: 'Event name is required', - messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', - userId: 'user@45', - properties: { dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e' }, - }, - destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: 'Missing required value from "properties.source"', - statTags: { - destType: 'PAGERDUTY', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'dedup_key is not present', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - type: 'track', - event: 'Event name is required', - messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', - userId: 'user@45', - properties: { action: 'resolve' }, - }, - destination: { - Config: { - routingKey: '9552b56325dc490bd0139be85f7b8fac', - dedupKeyFieldIdentifier: 'properties.dedupKey', - }, - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - error: 'dedup_key required for resolve events', - statTags: { - destType: 'PAGERDUTY', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - statusCode: 400, - }, - ], - }, - }, - }, + // { + // name: 'pagerduty', + // description: 'No Message type', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // sentAt: '2022-10-11T13:10:54.877+05:30', + // userId: 'user@45', + // rudderId: 'caae04c5-959f-467b-a293-86f6c62d59e6', + // messageId: 'b6ce7f31-5d76-4240-94d2-3eea020ef791', + // timestamp: '2022-10-11T13:10:52.137+05:30', + // receivedAt: '2022-10-11T13:10:52.138+05:30', + // request_ip: '[::1]', + // originalTimestamp: '2022-10-11T13:10:54.877+05:30', + // }, + // destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // error: 'Event type is required', + // statTags: { + // destType: 'PAGERDUTY', + // errorCategory: 'dataValidation', + // errorType: 'instrumentation', + // feature: 'processor', + // implementation: 'native', + // module: 'destination', + // }, + // statusCode: 400, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'Routing Key is not present', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // sentAt: '2022-10-11T13:10:54.877+05:30', + // userId: 'user@45', + // context: {}, + // rudderId: 'caae04c5-959f-467b-a293-86f6c62d59e6', + // messageId: 'b6ce7f31-5d76-4240-94d2-3eea020ef791', + // timestamp: '2022-10-11T13:10:52.137+05:30', + // receivedAt: '2022-10-11T13:10:52.138+05:30', + // request_ip: '[::1]', + // originalTimestamp: '2022-10-11T13:10:54.877+05:30', + // }, + // destination: { Config: {} }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // error: 'Routing Key Is Required', + // statTags: { + // destType: 'PAGERDUTY', + // errorCategory: 'dataValidation', + // errorType: 'configuration', + // feature: 'processor', + // implementation: 'native', + // module: 'destination', + // }, + // statusCode: 400, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'Unsupported Event type', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // type: 'alias', + // sentAt: '2022-10-11T13:10:54.877+05:30', + // userId: 'user@45', + // context: {}, + // rudderId: 'caae04c5-959f-467b-a293-86f6c62d59e6', + // messageId: 'b6ce7f31-5d76-4240-94d2-3eea020ef791', + // timestamp: '2022-10-11T13:10:52.137+05:30', + // receivedAt: '2022-10-11T13:10:52.138+05:30', + // request_ip: '[::1]', + // originalTimestamp: '2022-10-11T13:10:54.877+05:30', + // }, + // destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // error: 'Event type alias is not supported', + // statTags: { + // destType: 'PAGERDUTY', + // errorCategory: 'dataValidation', + // errorType: 'instrumentation', + // feature: 'processor', + // implementation: 'native', + // module: 'destination', + // }, + // statusCode: 400, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'event name is not present', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // channel: 'web', + // type: 'track', + // messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + // userId: 'user@45', + // properties: {}, + // }, + // destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // error: 'Event name is required', + // statTags: { + // destType: 'PAGERDUTY', + // errorCategory: 'dataValidation', + // errorType: 'instrumentation', + // feature: 'processor', + // implementation: 'native', + // module: 'destination', + // }, + // statusCode: 400, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'Parameter source is not present', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // channel: 'web', + // type: 'track', + // event: 'Event name is required', + // messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + // userId: 'user@45', + // properties: { dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e' }, + // }, + // destination: { Config: { routingKey: '9552b56325dc490bd0139be85f7b8fac' } }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // error: 'Missing required value from "properties.source"', + // statTags: { + // destType: 'PAGERDUTY', + // errorCategory: 'dataValidation', + // errorType: 'instrumentation', + // feature: 'processor', + // implementation: 'native', + // module: 'destination', + // }, + // statusCode: 400, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'dedup_key is not present', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // channel: 'web', + // type: 'track', + // event: 'Event name is required', + // messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + // userId: 'user@45', + // properties: { action: 'resolve' }, + // }, + // destination: { + // Config: { + // routingKey: '9552b56325dc490bd0139be85f7b8fac', + // dedupKeyFieldIdentifier: 'properties.dedupKey', + // }, + // }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // error: 'dedup_key required for resolve events', + // statTags: { + // destType: 'PAGERDUTY', + // errorCategory: 'dataValidation', + // errorType: 'instrumentation', + // feature: 'processor', + // implementation: 'native', + // module: 'destination', + // }, + // statusCode: 400, + // }, + // ], + // }, + // }, + // }, { name: 'pagerduty', description: 'Timestamp older then 90 days', @@ -363,420 +363,425 @@ export const data = [ ], }, }, - }, - { - name: 'pagerduty', - description: 'Trigger event', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - type: 'track', - event: 'apiSecret is not present', - messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', - userId: 'user@45', - properties: { - action: 'trigger', - dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e', - severity: 'critical', - component: 'ui', - source: 'rudder-webapp', - group: 'destination', - class: 'connection settings', - customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, - imageURLs: [ - { - src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', - alt: 'first image', - }, - { - src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', - alt: 'second image', - }, - { alt: 'third image' }, - ], - linkURLs: [ - { - href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', - text: 'Js Object Error', - }, - { - href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', - text: 'Stack Overflow Error', - }, - { text: 'Destructure Error' }, - ], - }, - }, - destination: { - Config: { - routingKey: '9552b56325dc490bd0139be85f7b8fac', - dedupKeyFieldIdentifier: 'properties.dedupKey', - }, - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON: { - links: [ - { - href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', - text: 'Js Object Error', - }, - { - href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', - text: 'Stack Overflow Error', - }, - ], - images: [ - { - alt: 'first image', - src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', - }, - { - alt: 'second image', - src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', - }, - ], - payload: { - class: 'connection settings', - group: 'destination', - source: 'rudder-webapp', - summary: 'apiSecret is not present', - severity: 'critical', - component: 'ui', - custom_details: { 'ping time': '1500ms', 'load avg': 0.75 }, - }, - dedup_key: '9116b734-7e6b-4497-ab51-c16744d4487e', - routing_key: '9552b56325dc490bd0139be85f7b8fac', - event_action: 'trigger', - }, - JSON_ARRAY: {}, - }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { 'Content-Type': 'application/json' }, - version: '1', - endpoint: 'https://events.pagerduty.com/v2/enqueue', - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'Acknowledge event', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - type: 'track', - event: 'apiSecret is not present', - messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', - userId: 'user@45', - properties: { - action: 'acknowledge', - dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e', - severity: 'critical', - component: 'ui', - source: 'rudder-webapp', - group: 'destination', - class: 'connection settings', - customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, - imageURLs: [ - { - src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', - alt: 'first image', - }, - { - src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', - alt: 'second image', - }, - { alt: 'third image' }, - ], - linkURLs: [ - { - href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', - text: 'Js Object Error', - }, - { - href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', - text: 'Stack Overflow Error', - }, - { text: 'Destructure Error' }, - ], - }, - }, - destination: { - Config: { - routingKey: '9552b56325dc490bd0139be85f7b8fac', - dedupKeyFieldIdentifier: 'properties.dedupKey', - }, - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON: { - dedup_key: '9116b734-7e6b-4497-ab51-c16744d4487e', - routing_key: '9552b56325dc490bd0139be85f7b8fac', - event_action: 'acknowledge', - }, - JSON_ARRAY: {}, - }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { 'Content-Type': 'application/json' }, - version: '1', - endpoint: 'https://events.pagerduty.com/v2/enqueue', - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'Resolve event', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - type: 'track', - event: 'apiSecret is not present', - messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', - userId: 'user@45', - properties: { - action: 'resolve', - dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e', - severity: 'critical', - component: 'ui', - source: 'rudder-webapp', - group: 'destination', - class: 'connection settings', - customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, - imageURLs: [ - { - src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', - alt: 'first image', - }, - { - src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', - alt: 'second image', - }, - { alt: 'third image' }, - ], - linkURLs: [ - { - href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', - text: 'Js Object Error', - }, - { - href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', - text: 'Stack Overflow Error', - }, - { text: 'Destructure Error' }, - ], - }, - }, - destination: { - Config: { - routingKey: '9552b56325dc490bd0139be85f7b8fac', - dedupKeyFieldIdentifier: 'properties.dedupKey', - }, - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON: { - dedup_key: '9116b734-7e6b-4497-ab51-c16744d4487e', - routing_key: '9552b56325dc490bd0139be85f7b8fac', - event_action: 'resolve', - }, - JSON_ARRAY: {}, - }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { 'Content-Type': 'application/json' }, - version: '1', - endpoint: 'https://events.pagerduty.com/v2/enqueue', - userId: '', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'pagerduty', - description: 'Change event', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - type: 'track', - event: 'Github CI/CD Triggered', - messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', - userId: 'user@45', - properties: { - source: 'rudder-webapp', - customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, - imageURLs: [ - { - src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', - alt: 'first image', - }, - { - src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', - alt: 'second image', - }, - { alt: 'third image' }, - ], - linkURLs: [ - { - href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', - text: 'Js Object Error', - }, - { - href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', - text: 'Stack Overflow Error', - }, - { text: 'Destructure Error' }, - ], - }, - integrations: { pagerduty: { type: 'changeEvent' } }, - }, - destination: { - Config: { - routingKey: '9552b56325dc490bd0139be85f7b8fac', - dedupKeyFieldIdentifier: 'properties.dedupKey', - }, - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON: { - links: [ - { - href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', - text: 'Js Object Error', - }, - { - href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', - text: 'Stack Overflow Error', - }, - ], - images: [ - { - alt: 'first image', - src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', - }, - { - alt: 'second image', - src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', - }, - ], - payload: { - source: 'rudder-webapp', - summary: 'Github CI/CD Triggered', - custom_details: { 'load avg': 0.75, 'ping time': '1500ms' }, - }, - routing_key: '9552b56325dc490bd0139be85f7b8fac', - }, - JSON_ARRAY: {}, - }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { 'Content-Type': 'application/json' }, - version: '1', - endpoint: 'https://events.pagerduty.com/v2/change/enqueue', - userId: '', - }, - statusCode: 200, - }, - ], - }, + mockFns: (_) => { + jest.spyOn(Date, 'now').mockImplementation(() => { + return new Date('2022-11-12T15:46:51.000Z').valueOf(); + }); }, }, + // { + // name: 'pagerduty', + // description: 'Trigger event', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // channel: 'web', + // type: 'track', + // event: 'apiSecret is not present', + // messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + // userId: 'user@45', + // properties: { + // action: 'trigger', + // dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e', + // severity: 'critical', + // component: 'ui', + // source: 'rudder-webapp', + // group: 'destination', + // class: 'connection settings', + // customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, + // imageURLs: [ + // { + // src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', + // alt: 'first image', + // }, + // { + // src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', + // alt: 'second image', + // }, + // { alt: 'third image' }, + // ], + // linkURLs: [ + // { + // href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', + // text: 'Js Object Error', + // }, + // { + // href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', + // text: 'Stack Overflow Error', + // }, + // { text: 'Destructure Error' }, + // ], + // }, + // }, + // destination: { + // Config: { + // routingKey: '9552b56325dc490bd0139be85f7b8fac', + // dedupKeyFieldIdentifier: 'properties.dedupKey', + // }, + // }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // output: { + // body: { + // XML: {}, + // FORM: {}, + // JSON: { + // links: [ + // { + // href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', + // text: 'Js Object Error', + // }, + // { + // href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', + // text: 'Stack Overflow Error', + // }, + // ], + // images: [ + // { + // alt: 'first image', + // src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', + // }, + // { + // alt: 'second image', + // src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', + // }, + // ], + // payload: { + // class: 'connection settings', + // group: 'destination', + // source: 'rudder-webapp', + // summary: 'apiSecret is not present', + // severity: 'critical', + // component: 'ui', + // custom_details: { 'ping time': '1500ms', 'load avg': 0.75 }, + // }, + // dedup_key: '9116b734-7e6b-4497-ab51-c16744d4487e', + // routing_key: '9552b56325dc490bd0139be85f7b8fac', + // event_action: 'trigger', + // }, + // JSON_ARRAY: {}, + // }, + // type: 'REST', + // files: {}, + // method: 'POST', + // params: {}, + // headers: { 'Content-Type': 'application/json' }, + // version: '1', + // endpoint: 'https://events.pagerduty.com/v2/enqueue', + // userId: '', + // }, + // statusCode: 200, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'Acknowledge event', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // channel: 'web', + // type: 'track', + // event: 'apiSecret is not present', + // messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + // userId: 'user@45', + // properties: { + // action: 'acknowledge', + // dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e', + // severity: 'critical', + // component: 'ui', + // source: 'rudder-webapp', + // group: 'destination', + // class: 'connection settings', + // customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, + // imageURLs: [ + // { + // src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', + // alt: 'first image', + // }, + // { + // src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', + // alt: 'second image', + // }, + // { alt: 'third image' }, + // ], + // linkURLs: [ + // { + // href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', + // text: 'Js Object Error', + // }, + // { + // href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', + // text: 'Stack Overflow Error', + // }, + // { text: 'Destructure Error' }, + // ], + // }, + // }, + // destination: { + // Config: { + // routingKey: '9552b56325dc490bd0139be85f7b8fac', + // dedupKeyFieldIdentifier: 'properties.dedupKey', + // }, + // }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // output: { + // body: { + // XML: {}, + // FORM: {}, + // JSON: { + // dedup_key: '9116b734-7e6b-4497-ab51-c16744d4487e', + // routing_key: '9552b56325dc490bd0139be85f7b8fac', + // event_action: 'acknowledge', + // }, + // JSON_ARRAY: {}, + // }, + // type: 'REST', + // files: {}, + // method: 'POST', + // params: {}, + // headers: { 'Content-Type': 'application/json' }, + // version: '1', + // endpoint: 'https://events.pagerduty.com/v2/enqueue', + // userId: '', + // }, + // statusCode: 200, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'Resolve event', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // channel: 'web', + // type: 'track', + // event: 'apiSecret is not present', + // messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + // userId: 'user@45', + // properties: { + // action: 'resolve', + // dedupKey: '9116b734-7e6b-4497-ab51-c16744d4487e', + // severity: 'critical', + // component: 'ui', + // source: 'rudder-webapp', + // group: 'destination', + // class: 'connection settings', + // customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, + // imageURLs: [ + // { + // src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', + // alt: 'first image', + // }, + // { + // src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', + // alt: 'second image', + // }, + // { alt: 'third image' }, + // ], + // linkURLs: [ + // { + // href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', + // text: 'Js Object Error', + // }, + // { + // href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', + // text: 'Stack Overflow Error', + // }, + // { text: 'Destructure Error' }, + // ], + // }, + // }, + // destination: { + // Config: { + // routingKey: '9552b56325dc490bd0139be85f7b8fac', + // dedupKeyFieldIdentifier: 'properties.dedupKey', + // }, + // }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // output: { + // body: { + // XML: {}, + // FORM: {}, + // JSON: { + // dedup_key: '9116b734-7e6b-4497-ab51-c16744d4487e', + // routing_key: '9552b56325dc490bd0139be85f7b8fac', + // event_action: 'resolve', + // }, + // JSON_ARRAY: {}, + // }, + // type: 'REST', + // files: {}, + // method: 'POST', + // params: {}, + // headers: { 'Content-Type': 'application/json' }, + // version: '1', + // endpoint: 'https://events.pagerduty.com/v2/enqueue', + // userId: '', + // }, + // statusCode: 200, + // }, + // ], + // }, + // }, + // }, + // { + // name: 'pagerduty', + // description: 'Change event', + // feature: 'processor', + // module: 'destination', + // version: 'v0', + // input: { + // request: { + // body: [ + // { + // message: { + // channel: 'web', + // type: 'track', + // event: 'Github CI/CD Triggered', + // messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + // userId: 'user@45', + // properties: { + // source: 'rudder-webapp', + // customDetails: { 'ping time': '1500ms', 'load avg': 0.75 }, + // imageURLs: [ + // { + // src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', + // alt: 'first image', + // }, + // { + // src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', + // alt: 'second image', + // }, + // { alt: 'third image' }, + // ], + // linkURLs: [ + // { + // href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', + // text: 'Js Object Error', + // }, + // { + // href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', + // text: 'Stack Overflow Error', + // }, + // { text: 'Destructure Error' }, + // ], + // }, + // integrations: { pagerduty: { type: 'changeEvent' } }, + // }, + // destination: { + // Config: { + // routingKey: '9552b56325dc490bd0139be85f7b8fac', + // dedupKeyFieldIdentifier: 'properties.dedupKey', + // }, + // }, + // }, + // ], + // method: 'POST', + // }, + // pathSuffix: '', + // }, + // output: { + // response: { + // status: 200, + // body: [ + // { + // output: { + // body: { + // XML: {}, + // FORM: {}, + // JSON: { + // links: [ + // { + // href: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error', + // text: 'Js Object Error', + // }, + // { + // href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack', + // text: 'Stack Overflow Error', + // }, + // ], + // images: [ + // { + // alt: 'first image', + // src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg', + // }, + // { + // alt: 'second image', + // src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1', + // }, + // ], + // payload: { + // source: 'rudder-webapp', + // summary: 'Github CI/CD Triggered', + // custom_details: { 'load avg': 0.75, 'ping time': '1500ms' }, + // }, + // routing_key: '9552b56325dc490bd0139be85f7b8fac', + // }, + // JSON_ARRAY: {}, + // }, + // type: 'REST', + // files: {}, + // method: 'POST', + // params: {}, + // headers: { 'Content-Type': 'application/json' }, + // version: '1', + // endpoint: 'https://events.pagerduty.com/v2/change/enqueue', + // userId: '', + // }, + // statusCode: 200, + // }, + // ], + // }, + // }, + // }, ]; diff --git a/test/integrations/destinations/pagerduty/router/data.ts b/test/integrations/destinations/pagerduty/router/data.ts index 87761656f9..26efa4a232 100644 --- a/test/integrations/destinations/pagerduty/router/data.ts +++ b/test/integrations/destinations/pagerduty/router/data.ts @@ -267,5 +267,10 @@ export const data = [ }, }, }, + mockFns: (_) => { + jest.spyOn(Date, 'now').mockImplementation(() => { + return new Date('2023-12-20T10:26:33.451Z').valueOf(); + }); + }, }, ]; diff --git a/test/integrations/destinations/rakuten/processor/track.ts b/test/integrations/destinations/rakuten/processor/track.ts index 74d09b8d4c..8c6bc4863d 100644 --- a/test/integrations/destinations/rakuten/processor/track.ts +++ b/test/integrations/destinations/rakuten/processor/track.ts @@ -45,8 +45,8 @@ export const trackSuccess = [ { sku: 'custom sku 2', name: 'SampleProduct', - quantity: 1, - amount: 30, + quantity: 2, + price: 30.99, coupon: 'SALE50', }, ], @@ -82,7 +82,7 @@ export const trackSuccess = [ mid: 'dummyMarketingId', xml: 1, source: 'rudderstack', - amtlist: '2000|2500|3000', + amtlist: '2000|2500|6198', brandlist: 'SampleBrand||', catidlist: '12345||', catlist: 'Electronics||', @@ -93,7 +93,7 @@ export const trackSuccess = [ sequencelist: '123||', shipbylist: 'Express||', shipidlist: 'SHIP123||', - qlist: '5|5|1', + qlist: '5|5|2', marginlist: '0.15||', markdownlist: '5||', taxexemptlist: 'N||', diff --git a/test/integrations/destinations/sendgrid/processor/data.ts b/test/integrations/destinations/sendgrid/processor/data.ts index b1550787b5..4c5ca7f48f 100644 --- a/test/integrations/destinations/sendgrid/processor/data.ts +++ b/test/integrations/destinations/sendgrid/processor/data.ts @@ -1541,4 +1541,137 @@ export const data = [ }, }, }, + { + name: 'sendgrid', + description: 'Identify call traits at root and listId given', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', + Config: { + IPPoolName: '', + apiKey: 'apikey', + attachments: [ + { + content: '', + contentId: '', + disposition: '', + filename: '', + type: '', + }, + ], + clickTracking: true, + listId: 'list123', + clickTrackingEnableText: true, + contents: [ + { + type: 'text/html', + value: + '

Hello from Twilio SendGrid!

Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.

%open-track%

', + }, + ], + customFieldsMapping: [ + { + from: 'name', + to: 'user_name', + }, + ], + eventDelivery: false, + eventDeliveryTS: 1668424218224, + eventNamesSettings: [ + { + event: 'open', + }, + ], + footer: false, + fromEmail: 'a@g.com', + fromName: '', + ganalytics: false, + group: '', + groupsToDisplay: [ + { + groupId: '', + }, + ], + html: '', + mailFromTraits: false, + openTracking: false, + openTrackingSubstitutionTag: '', + replyToEmail: '', + replyToName: '', + sandboxMode: false, + subject: 'hello there from webflow', + subscriptionTracking: false, + substitutionTag: '', + templateId: '', + text: '', + }, + }, + message: { + type: 'identify', + userId: 'user@1', + context: { + traits: { + age: '25', + city: 'Surat', + name: 'rudder test', + email: 'test@rudderstack.com', + phone: '+91 9876543210', + lastName: 'test', + firstName: 'rudder', + state: 'Gujarat', + }, + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { + contactDetails: { + email: 'test@rudderstack.com', + last_name: 'test', + first_name: 'rudder', + unique_name: 'rudder test', + phone_number: '+91 9876543210', + custom_fields: { + w1_T: 'rudder test', + }, + }, + contactListIds: 'list123', + }, + JSON_ARRAY: {}, + }, + type: 'REST', + userId: '', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer apikey', + }, + version: '1', + endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/statsig/processor/data.ts b/test/integrations/destinations/statsig/processor/data.ts index c76ce506dc..2602764032 100644 --- a/test/integrations/destinations/statsig/processor/data.ts +++ b/test/integrations/destinations/statsig/processor/data.ts @@ -312,7 +312,7 @@ export const data = [ destination: { DestinationDefinition: { Config: { - cdkEnabled: true, + cdkV2Enabled: true, }, }, Config: { @@ -734,7 +734,7 @@ export const data = [ destination: { DestinationDefinition: { Config: { - cdkEnabled: true, + cdkV2Enabled: true, }, }, Config: { @@ -1142,7 +1142,7 @@ export const data = [ destination: { DestinationDefinition: { Config: { - cdkEnabled: true, + cdkV2Enabled: true, }, }, Config: { @@ -1466,7 +1466,7 @@ export const data = [ destination: { DestinationDefinition: { Config: { - cdkEnabled: true, + cdkV2Enabled: true, }, }, Config: { @@ -1488,13 +1488,13 @@ export const data = [ { statusCode: 400, error: - 'Bad event. Original error: message type "NOT_A_TYPE" not supported for "statsig"', + 'message type NOT_A_TYPE is not supported: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message type NOT_A_TYPE is not supported', statTags: { errorCategory: 'dataValidation', errorType: 'instrumentation', destType: 'STATSIG', module: 'destination', - implementation: 'cdkV1', + implementation: 'cdkV2', destinationId: 'd1', workspaceId: 'w1', feature: 'processor', diff --git a/test/integrations/destinations/variance/processor/data.ts b/test/integrations/destinations/variance/processor/data.ts index ae33b75e5f..f4f3054296 100644 --- a/test/integrations/destinations/variance/processor/data.ts +++ b/test/integrations/destinations/variance/processor/data.ts @@ -350,7 +350,7 @@ export const data = [ destination: { DestinationDefinition: { Config: { - cdkEnabled: true, + cdkV2Enabled: true, }, }, Config: { @@ -819,7 +819,7 @@ export const data = [ destination: { DestinationDefinition: { Config: { - cdkEnabled: true, + cdkV2Enabled: true, }, }, Config: { diff --git a/test/integrations/sources/adjust/data.ts b/test/integrations/sources/adjust/data.ts index 733a1d6235..e57feb45d4 100644 --- a/test/integrations/sources/adjust/data.ts +++ b/test/integrations/sources/adjust/data.ts @@ -2,7 +2,7 @@ import { skip } from 'node:test'; import utils from '../../../../src/v0/util'; const defaultMockFns = () => { - jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); + jest.spyOn(utils, 'generateUUID').mockReturnValueOnce('97fcd7b2-cc24-47d7-b776-057b7b199513'); }; export const data = [ @@ -11,7 +11,6 @@ export const data = [ description: 'Simple track call', module: 'source', version: 'v0', - skipGo: 'FIXME', input: { request: { body: [ @@ -45,6 +44,7 @@ export const data = [ output: { batch: [ { + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { library: { name: 'unknown', @@ -70,7 +70,6 @@ export const data = [ custom: 'custom', tracker_name: 'dummy', }, - anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], }, @@ -107,15 +106,19 @@ export const data = [ output: { response: { status: 200, - error: 'Query_parameters is missing', - statTags: { - destinationId: 'Non determinable', - errorCategory: 'transformation', - implementation: 'native', - module: 'source', - workspaceId: 'Non determinable', - }, - statusCode: 400, + body: [ + { + error: 'Query_parameters is missing', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], }, }, mockFns: () => { diff --git a/test/integrations/sources/appcenter/data.ts b/test/integrations/sources/appcenter/data.ts new file mode 100644 index 0000000000..0342b622d2 --- /dev/null +++ b/test/integrations/sources/appcenter/data.ts @@ -0,0 +1,372 @@ +import utils from '../../../../src/v0/util'; + +export const data = [ + { + name: 'appcenter', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + text: 'Hello from your abc-test app in App Center!', + sent_at: '2023-01-02T07: 53: 28.3117824Z', + url: 'https://appcenter.ms/users/abc-rudderstack.com/apps/abc-test', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + outputToSource: { + body: 'eyJ0ZXh0IjoiSGVsbG8gZnJvbSB5b3VyIGFiYy10ZXN0IGFwcCBpbiBBcHAgQ2VudGVyISIsInNlbnRfYXQiOiIyMDIzLTAxLTAyVDA3OiA1MzogMjguMzExNzgyNFoiLCJ1cmwiOiJodHRwczovL2FwcGNlbnRlci5tcy91c2Vycy9hYmMtcnVkZGVyc3RhY2suY29tL2FwcHMvYWJjLXRlc3QifQ==', + contentType: 'application/json', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'appcenter', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + app_name: 'MSAppCenterTesting', + branch: 'master', + build_status: 'Succeeded', + build_id: '1', + build_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1', + build_reason: 'manual', + finish_time: '2021-03-02T16:41:29.891411Z', + icon_link: null, + notification_settings_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', + os: 'Android', + start_time: '2021-03-02T16:34:13.9184874Z', + source_version: '7ed5c7b279316f19e9a0c45bb0fb49c0655471af', + sent_at: '2021-03-02T16:41:55.8819564Z', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'APPCENTER' }, + app: { name: 'MSAppCenterTesting', build: '1' }, + device: { type: 'Android' }, + + os: { name: 'Android' }, + }, + integrations: { APPCENTER: false }, + properties: { + app_name: 'MSAppCenterTesting', + branch: 'master', + build_status: 'Succeeded', + build_id: '1', + build_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1', + build_reason: 'manual', + finish_time: '2021-03-02T16:41:29.891411Z', + icon_link: null, + notification_settings_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', + os: 'Android', + start_time: '2021-03-02T16:34:13.9184874Z', + source_version: '7ed5c7b279316f19e9a0c45bb0fb49c0655471af', + sent_at: '2021-03-02T16:41:55.8819564Z', + }, + type: 'track', + event: 'Build Succeeded', + originalTimeStamp: '2021-03-02T16:34:13.9184874Z', + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + sentAt: '2021-03-02T16:41:55.8819564Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appcenter', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + app_name: 'MSAppCenterTesting', + branch: 'master', + build_status: 'Broken', + build_id: '2', + build_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2', + build_reason: 'automatic', + finish_time: '2021-03-02T16:52:04.2587506Z', + icon_link: null, + notification_settings_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', + os: 'Android', + start_time: '2021-03-02T16:50:52.2584107Z', + source_version: '0624e1e3e48eaf2371c37316208ff83bdd5c123b', + sent_at: '2021-03-02T16:52:35.8848052Z', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'APPCENTER' }, + app: { name: 'MSAppCenterTesting', build: '2' }, + device: { type: 'Android' }, + + os: { name: 'Android' }, + }, + integrations: { APPCENTER: false }, + properties: { + app_name: 'MSAppCenterTesting', + branch: 'master', + build_status: 'Broken', + build_id: '2', + build_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2', + build_reason: 'automatic', + finish_time: '2021-03-02T16:52:04.2587506Z', + icon_link: null, + notification_settings_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', + os: 'Android', + start_time: '2021-03-02T16:50:52.2584107Z', + source_version: '0624e1e3e48eaf2371c37316208ff83bdd5c123b', + sent_at: '2021-03-02T16:52:35.8848052Z', + }, + type: 'track', + event: 'Build Failed', + originalTimeStamp: '2021-03-02T16:50:52.2584107Z', + sentAt: '2021-03-02T16:52:35.8848052Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appcenter', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + app_name: 'MSAppCenterTesting', + app_display_name: 'MSAppCenterTesting', + release_id: '1', + platform: 'Android', + uploaded_at: '2021-03-02T17:49:35.463Z', + fingerprint: '9cbdc86d96c5359d2af3972fdda46624', + release_notes: 'Degraded to 4.0.0', + version: '1614707021', + short_version: '1.0', + min_os: '7.1', + mandatory_update: true, + size: 2919106, + provisioning_profile_name: null, + provisioning_profile_type: null, + bundle_identifier: 'tech.desusai.msappcentertesting', + install_link: + 'https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email', + icon_link: + 'https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r', + distribution_group_id: '00000000-0000-0000-0000-000000000000', + installable: true, + sent_at: '2021-03-02T17:49:37.127635Z', + app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'APPCENTER' }, + app: { + name: 'MSAppCenterTesting', + version: '1.0', + namespace: 'tech.desusai.msappcentertesting', + }, + device: { type: 'Android' }, + + os: { name: 'Android' }, + }, + integrations: { APPCENTER: false }, + properties: { + app_name: 'MSAppCenterTesting', + app_display_name: 'MSAppCenterTesting', + release_id: '1', + platform: 'Android', + uploaded_at: '2021-03-02T17:49:35.463Z', + fingerprint: '9cbdc86d96c5359d2af3972fdda46624', + release_notes: 'Degraded to 4.0.0', + version: '1614707021', + short_version: '1.0', + min_os: '7.1', + mandatory_update: true, + size: 2919106, + provisioning_profile_name: null, + provisioning_profile_type: null, + bundle_identifier: 'tech.desusai.msappcentertesting', + install_link: + 'https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email', + icon_link: + 'https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r', + distribution_group_id: '00000000-0000-0000-0000-000000000000', + installable: true, + sent_at: '2021-03-02T17:49:37.127635Z', + app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + }, + type: 'track', + event: 'Released Version 1.0', + sentAt: '2021-03-02T17:49:37.127635Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appcenter', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + id: '1139624368u', + name: 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)', + reason: 'java.lang.ArithmeticException: divide by zero', + file_name: null, + line_number: null, + url: 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u', + app_display_name: 'MSAppCenterTesting', + app_platform: 'Java', + app_version: '1.0(1)', + stack_trace: [ + 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);', + ], + affected_users: 0, + crash_count: 0, + sent_at: '2021-03-02T18:14:33.9713246Z', + app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'APPCENTER' }, + app: { name: 'MSAppCenterTesting', version: '1.0(1)' }, + }, + integrations: { APPCENTER: false }, + properties: { + id: '1139624368u', + name: 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)', + reason: 'java.lang.ArithmeticException: divide by zero', + file_name: null, + line_number: null, + url: 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u', + app_display_name: 'MSAppCenterTesting', + app_platform: 'Java', + app_version: '1.0(1)', + stack_trace: [ + 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);', + ], + affected_users: 0, + crash_count: 0, + sent_at: '2021-03-02T18:14:33.9713246Z', + app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + }, + type: 'track', + event: 'App Crashed', + sentAt: '2021-03-02T18:14:33.9713246Z', + }, + ], + }, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + jest.spyOn(utils, 'generateUUID').mockReturnValueOnce('97fcd7b2-cc24-47d7-b776-057b7b199513'); + }, +})); diff --git a/test/integrations/sources/appsflyer/data.ts b/test/integrations/sources/appsflyer/data.ts new file mode 100644 index 0000000000..5ec64a07a8 --- /dev/null +++ b/test/integrations/sources/appsflyer/data.ts @@ -0,0 +1,2050 @@ +import utils from '../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + +export const data = [ + { + name: 'appsflyer', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'iPhoneXR', + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'AF' }, + ip: '1.1.1.1', + timezone: 'UTC', + userAgent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + app: { + namespace: 'com.appsflyer.AppsFlyer', + version: '1.4.1', + name: 'AppsFlyer', + }, + device: { + model: 'iPhoneXR', + advertisingId: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + adTrackingEnabled: true, + }, + network: { wifi: true }, + os: { name: 'ios', version: '12.3.1' }, + traits: { + address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + userId: 'hi.from@appsflyer.example.com', + }, + externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + }, + integrations: { AF: false }, + properties: { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + oaid: null, + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + af_sub3: null, + contributor_3_match_type: null, + af_ad_id: null, + contributor_3_touch_time: null, + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + type: 'track', + event: 'My Apps', + userId: 'hi.from@appsflyer.example.com', + timestamp: '2020-01-15 14:57:24.898', + originalTimestamp: '2020-01-15 14:57:24.898', + platform: 'ios', + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appsflyer', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'Nokia 5.3', + idfa: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'android', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'AF' }, + ip: '1.1.1.1', + timezone: 'UTC', + userAgent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + app: { + namespace: 'com.appsflyer.AppsFlyer', + version: '1.4.1', + name: 'AppsFlyer', + }, + device: { + model: 'Nokia 5.3', + advertisingId: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + adTrackingEnabled: true, + }, + network: { wifi: true }, + os: { name: 'android', version: '12.3.1' }, + traits: { + address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + userId: 'hi.from@appsflyer.example.com', + }, + externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + }, + integrations: { AF: false }, + properties: { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + oaid: null, + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + af_sub3: null, + contributor_3_match_type: null, + af_ad_id: null, + contributor_3_touch_time: null, + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + type: 'track', + event: 'My Apps', + userId: 'hi.from@appsflyer.example.com', + timestamp: '2020-01-15 14:57:24.898', + originalTimestamp: '2020-01-15 14:57:24.898', + platform: 'android', + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appsflyer', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'iPhoneXR', + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Unknwon event type from Appsflyer', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'appsflyer', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'iPhoneXR', + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'AF' }, + ip: '1.1.1.1', + timezone: 'UTC', + userAgent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + app: { + namespace: 'com.appsflyer.AppsFlyer', + version: '1.4.1', + name: 'AppsFlyer', + }, + device: { + model: 'iPhoneXR', + advertisingId: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + adTrackingEnabled: true, + }, + network: { wifi: true }, + os: { name: 'ios', version: '12.3.1' }, + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + }, + integrations: { AF: false }, + type: 'track', + event: 'My Apps', + properties: { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + oaid: null, + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + af_sub3: null, + contributor_3_match_type: null, + af_ad_id: null, + contributor_3_touch_time: null, + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + timestamp: '2020-01-15 14:57:24.898', + originalTimestamp: '2020-01-15 14:57:24.898', + platform: 'ios', + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appsflyer', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'AF' }, + ip: '1.1.1.1', + timezone: 'UTC', + userAgent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + app: { + namespace: 'com.appsflyer.AppsFlyer', + version: '1.4.1', + name: 'AppsFlyer', + }, + device: { + advertisingId: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + adTrackingEnabled: true, + }, + network: { wifi: true }, + os: { name: 'ios', version: '12.3.1' }, + traits: { + address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + userId: 'hi.from@appsflyer.example.com', + }, + externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + }, + integrations: { AF: false }, + properties: { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + oaid: null, + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + af_sub3: null, + contributor_3_match_type: null, + af_ad_id: null, + contributor_3_touch_time: null, + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + type: 'track', + event: 'My Apps', + userId: 'hi.from@appsflyer.example.com', + timestamp: '2020-01-15 14:57:24.898', + originalTimestamp: '2020-01-15 14:57:24.898', + platform: 'ios', + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appsflyer', + description: 'test-5', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'watchos', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'AF' }, + ip: '1.1.1.1', + timezone: 'UTC', + userAgent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + app: { + namespace: 'com.appsflyer.AppsFlyer', + version: '1.4.1', + name: 'AppsFlyer', + }, + device: { + advertisingId: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + adTrackingEnabled: true, + }, + network: { wifi: true }, + os: { name: 'watchos', version: '12.3.1' }, + traits: { + address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + userId: 'hi.from@appsflyer.example.com', + }, + externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + }, + integrations: { AF: false }, + properties: { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + oaid: null, + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + af_sub3: null, + contributor_3_match_type: null, + af_ad_id: null, + contributor_3_touch_time: null, + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + type: 'track', + event: 'My Apps', + userId: 'hi.from@appsflyer.example.com', + timestamp: '2020-01-15 14:57:24.898', + originalTimestamp: '2020-01-15 14:57:24.898', + platform: 'watchos', + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appsflyer', + description: 'test-6', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ipados', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'AF' }, + ip: '1.1.1.1', + timezone: 'UTC', + userAgent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + app: { + namespace: 'com.appsflyer.AppsFlyer', + version: '1.4.1', + name: 'AppsFlyer', + }, + device: { + advertisingId: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + adTrackingEnabled: true, + }, + network: { wifi: true }, + os: { name: 'ipados', version: '12.3.1' }, + traits: { + address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + userId: 'hi.from@appsflyer.example.com', + }, + externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + }, + integrations: { AF: false }, + properties: { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + oaid: null, + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + af_sub3: null, + contributor_3_match_type: null, + af_ad_id: null, + contributor_3_touch_time: null, + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + type: 'track', + event: 'My Apps', + userId: 'hi.from@appsflyer.example.com', + timestamp: '2020-01-15 14:57:24.898', + originalTimestamp: '2020-01-15 14:57:24.898', + platform: 'ipados', + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'appsflyer', + description: 'test-7', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'tvos', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'AF' }, + ip: '1.1.1.1', + timezone: 'UTC', + userAgent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + app: { + namespace: 'com.appsflyer.AppsFlyer', + version: '1.4.1', + name: 'AppsFlyer', + }, + device: { + advertisingId: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + adTrackingEnabled: true, + }, + network: { wifi: true }, + os: { name: 'tvos', version: '12.3.1' }, + traits: { + address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + userId: 'hi.from@appsflyer.example.com', + }, + externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + }, + integrations: { AF: false }, + properties: { + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + oaid: null, + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + af_sub3: null, + contributor_3_match_type: null, + af_ad_id: null, + contributor_3_touch_time: null, + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }, + type: 'track', + event: 'My Apps', + userId: 'hi.from@appsflyer.example.com', + timestamp: '2020-01-15 14:57:24.898', + originalTimestamp: '2020-01-15 14:57:24.898', + platform: 'tvos', + traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/auth0/data.ts b/test/integrations/sources/auth0/data.ts index 953888920b..b012887bc4 100644 --- a/test/integrations/sources/auth0/data.ts +++ b/test/integrations/sources/auth0/data.ts @@ -10,7 +10,7 @@ export const data = [ description: 'successful signup', module: 'source', version: 'v0', - skipGo: 'dynamic anonymousId', + input: { request: { body: [ @@ -533,7 +533,7 @@ export const data = [ description: 'add member to an organization', module: 'source', version: 'v0', - skipGo: 'dynamic anonymousId', + input: { request: { body: [ @@ -673,7 +673,7 @@ export const data = [ description: 'update tenant settings', module: 'source', version: 'v0', - skipGo: 'dynamic anonymousId', + input: { request: { body: [ @@ -1245,7 +1245,7 @@ export const data = [ description: 'missing userId', module: 'source', version: 'v0', - skipGo: 'dynamic anonymousId', + input: { request: { body: [ @@ -1352,7 +1352,7 @@ export const data = [ description: 'missing userId for all the requests in a batch', module: 'source', version: 'v0', - skipGo: 'dynamic anonymousId', + input: { request: { body: [ @@ -1508,7 +1508,7 @@ export const data = [ description: 'empty batch', module: 'source', version: 'v0', - skipGo: 'dynamic anonymousId', + skipGo: 'Created this case manually', input: { request: { body: [], diff --git a/test/integrations/sources/braze/data.ts b/test/integrations/sources/braze/data.ts index e140bbc030..a4031e1bd0 100644 --- a/test/integrations/sources/braze/data.ts +++ b/test/integrations/sources/braze/data.ts @@ -1,11 +1,17 @@ +import utils from '../../../../src/v0/util'; import { commonSourceConfigProperties, commonSourceDefinition } from './common'; +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + export const data = [ { name: 'braze', description: 'event mapping done in UI', module: 'source', version: 'v1', + skipGo: 'Custom source config', input: { request: { body: [ @@ -88,6 +94,7 @@ export const data = [ description: 'The event is not mapped in the UI', module: 'source', version: 'v1', + input: { request: { body: [ @@ -170,6 +177,7 @@ export const data = [ description: 'users.messages.inappmessage.Click event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -270,6 +278,7 @@ export const data = [ description: 'users.messages.pushnotification.Send event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -365,6 +374,7 @@ export const data = [ description: 'users.messages.email.Open event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -460,6 +470,7 @@ export const data = [ description: 'users.messages.sms.Delivery send', module: 'source', version: 'v1', + input: { request: { body: [ @@ -553,6 +564,7 @@ export const data = [ description: 'users.messages.inappmessage.Click event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -655,6 +667,7 @@ export const data = [ description: 'users.messages.pushnotification.Send event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -752,6 +765,7 @@ export const data = [ description: 'users.messages.email.Open event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -849,6 +863,7 @@ export const data = [ description: 'users.messages.sms.Delivery event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -944,6 +959,7 @@ export const data = [ description: 'users.behaviors.CustomEvent any custom event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -1052,6 +1068,7 @@ export const data = [ description: 'users.behaviors.Purchase event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -1164,6 +1181,7 @@ export const data = [ description: 'users.behaviors.app.SessionStart event', module: 'source', version: 'v1', + input: { request: { body: [ @@ -1249,4 +1267,9 @@ export const data = [ }, }, }, -]; +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/canny/data.ts b/test/integrations/sources/canny/data.ts new file mode 100644 index 0000000000..ac471904f9 --- /dev/null +++ b/test/integrations/sources/canny/data.ts @@ -0,0 +1,1665 @@ +import utils from '../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + +export const data = [ + { + name: 'canny', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-28T10:52:46.294Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 13, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-28T10:52:46.172Z', + customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + details: 'Array of images', + eta: null, + id: '62e26a7e1d4ea13c124337bd', + imageURLs: [ + 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', + 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', + ], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Custom Fields Testing', + url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + }, + objectType: 'post', + type: 'post.created', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'post.created', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-28T10:52:46.294Z', + originalTimestamp: '2022-07-28T10:52:46.294Z', + type: 'track', + properties: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 13, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-28T10:52:46.172Z', + customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + details: 'Array of images', + eta: null, + id: '62e26a7e1d4ea13c124337bd', + imageURLs: [ + 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', + 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', + ], + objectType: 'post', + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Custom Fields Testing', + url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T10:35:16.390Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 10, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-26T08:18:52.459Z', + deletedBy: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + details: "This is the post's details", + eta: null, + id: '62dfa36c9950e94655320fe7', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-4', + }, + objectType: 'post', + type: 'post.deleted', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'post.deleted', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-26T10:35:16.390Z', + originalTimestamp: '2022-07-26T10:35:16.390Z', + type: 'track', + properties: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 10, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-26T08:18:52.459Z', + deletedBy: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + details: "This is the post's details", + eta: null, + id: '62dfa36c9950e94655320fe7', + imageURLs: [], + objectType: 'post', + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-4', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T18:32:28.337Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + category: null, + commentCount: 0, + created: '2022-07-26T10:43:43.752Z', + details: "This is the post's details", + eta: null, + id: '62dfc55ffe7f6f465b9b4568', + imageURLs: [], + issue: { + description: + "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", + id: '10001', + key: 'TES-2', + status: 'To Do', + summary: 'Canny Source Testing', + url: 'https://rudderstack-user.atlassian.net/browse/TES-2', + }, + owner: null, + score: 2, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-8', + }, + objectType: 'post', + type: 'post.jira_issue_linked', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'post.jira_issue_linked', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-26T18:32:28.337Z', + originalTimestamp: '2022-07-26T18:32:28.337Z', + type: 'track', + properties: { + by: null, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + category: null, + commentCount: 0, + created: '2022-07-26T10:43:43.752Z', + details: "This is the post's details", + eta: null, + id: '62dfc55ffe7f6f465b9b4568', + imageURLs: [], + issue: { + description: + "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", + id: '10001', + key: 'TES-2', + status: 'To Do', + summary: 'Canny Source Testing', + url: 'https://rudderstack-user.atlassian.net/browse/TES-2', + }, + objectType: 'post', + owner: null, + score: 2, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-8', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-27T04:08:24.377Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + category: null, + commentCount: 0, + created: '2022-07-26T11:32:31.228Z', + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + issue: { + description: + 'Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2', + id: '10002', + key: 'TES-3', + status: 'To Do', + summary: 'Images testing', + url: 'https://rudderstack-user.atlassian.net/browse/TES-3', + }, + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + objectType: 'post', + type: 'post.jira_issue_unlinked', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'post.jira_issue_unlinked', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-27T04:08:24.377Z', + originalTimestamp: '2022-07-27T04:08:24.377Z', + type: 'track', + properties: { + objectType: 'post', + by: null, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + category: null, + commentCount: 0, + created: '2022-07-26T11:32:31.228Z', + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + issue: { + description: + 'Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2', + id: '10002', + key: 'TES-3', + status: 'To Do', + summary: 'Images testing', + url: 'https://rudderstack-user.atlassian.net/browse/TES-3', + }, + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T18:07:03.143Z', + object: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + changeComment: { + imageURLs: ['https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp'], + value: '', + }, + changedAt: '2022-07-26T18:07:03.143Z', + changer: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + commentCount: 1, + created: '2022-07-26T08:22:31.089Z', + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + jira: { linkedIssues: [], linkedIssueIDs: [] }, + owner: null, + score: 2, + status: 'planned', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + objectType: 'post', + type: 'post.status_changed', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'post.status_changed', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-26T18:07:03.143Z', + originalTimestamp: '2022-07-26T18:07:03.143Z', + type: 'track', + properties: { + objectType: 'post', + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + changeComment: { + imageURLs: ['https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp'], + value: '', + }, + changedAt: '2022-07-26T18:07:03.143Z', + changer: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + commentCount: 1, + created: '2022-07-26T08:22:31.089Z', + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + jira: { linkedIssues: [], linkedIssueIDs: [] }, + owner: null, + score: 2, + status: 'planned', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-5', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T10:52:17.712Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 11, + url: 'https://rudder.canny.io/admin/board/features', + }, + created: '2022-07-26T10:52:17.618Z', + id: '62dfc761af6e2b467381b103', + imageURLs: ['https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp'], + internal: true, + mentions: [], + parentID: null, + post: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 2, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + private: false, + value: 'webhook-test', + }, + objectType: 'comment', + type: 'comment.created', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'comment.created', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-26T10:52:17.712Z', + originalTimestamp: '2022-07-26T10:52:17.712Z', + type: 'track', + properties: { + objectType: 'comment', + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 11, + url: 'https://rudder.canny.io/admin/board/features', + }, + created: '2022-07-26T10:52:17.618Z', + id: '62dfc761af6e2b467381b103', + imageURLs: ['https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp'], + internal: true, + mentions: [], + parentID: null, + post: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 2, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + private: false, + value: 'webhook-test', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-6', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-27T04:12:09.290Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + created: '2022-07-27T04:11:59.942Z', + id: '62e0bb0faf6e2b467328b133', + imageURLs: [], + parentID: null, + post: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + private: false, + value: 'good', + }, + objectType: 'comment', + type: 'comment.deleted', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'comment.deleted', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-27T04:12:09.290Z', + originalTimestamp: '2022-07-27T04:12:09.290Z', + type: 'track', + properties: { + objectType: 'comment', + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + created: '2022-07-27T04:11:59.942Z', + id: '62e0bb0faf6e2b467328b133', + imageURLs: [], + parentID: null, + post: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + private: false, + value: 'good', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-7', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T11:32:31.378Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T11:32:31.263Z', + id: '62dfd0cfb2870d468c9618f5', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + score: 1, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + objectType: 'vote', + type: 'vote.created', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'vote.created', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-26T11:32:31.378Z', + originalTimestamp: '2022-07-26T11:32:31.378Z', + type: 'track', + properties: { + objectType: 'vote', + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T11:32:31.263Z', + id: '62dfd0cfb2870d468c9618f5', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + score: 1, + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-8', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T18:09:27.358Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T08:22:31.109Z', + id: '62dfa4479950e9465532a338', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 1, + status: 'planned', + tags: [ + { + id: '62e02db67ad24c46bc175f56', + name: 'abc-tag', + postCount: 1, + url: 'https://rudder.canny.io/admin/board/features?tags=abc-tag', + }, + ], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + score: 0, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + objectType: 'vote', + type: 'vote.deleted', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + event: 'vote.deleted', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-26T18:09:27.358Z', + originalTimestamp: '2022-07-26T18:09:27.358Z', + type: 'track', + properties: { + objectType: 'vote', + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T08:22:31.109Z', + id: '62dfa4479950e9465532a338', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 1, + status: 'planned', + tags: [ + { + id: '62e02db67ad24c46bc175f56', + name: 'abc-tag', + postCount: 1, + url: 'https://rudder.canny.io/admin/board/features?tags=abc-tag', + }, + ], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + score: 0, + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-9', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-28T10:52:46.294Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: 'sampleuserId', + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 13, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-28T10:52:46.172Z', + customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + details: 'Array of images', + eta: null, + id: '62e26a7e1d4ea13c124337bd', + imageURLs: [ + 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', + 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', + ], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Custom Fields Testing', + url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + }, + objectType: 'post', + type: 'post.created', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: 'sampleuserId', + event: 'post.created', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-28T10:52:46.294Z', + originalTimestamp: '2022-07-28T10:52:46.294Z', + type: 'track', + properties: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 13, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-28T10:52:46.172Z', + customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + details: 'Array of images', + eta: null, + id: '62e26a7e1d4ea13c124337bd', + imageURLs: [ + 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', + 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', + ], + objectType: 'post', + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Custom Fields Testing', + url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-10', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T11:32:31.378Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T11:32:31.263Z', + id: '62dfd0cfb2870d468c9618f5', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + score: 1, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: '123', + }, + }, + objectType: 'vote', + type: 'vote.created', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '123', + event: 'vote.created', + integrations: { Canny: false }, + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Canny', version: '1.0.0' }, + traits: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + }, + externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + }, + timestamp: '2022-07-26T11:32:31.378Z', + originalTimestamp: '2022-07-26T11:32:31.378Z', + type: 'track', + properties: { + objectType: 'vote', + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T11:32:31.263Z', + id: '62dfd0cfb2870d468c9618f5', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + score: 1, + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-11', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T18:09:27.358Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T08:22:31.109Z', + id: '62dfa4479950e9465532a338', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 1, + status: 'planned', + tags: [ + { + id: '62e02db67ad24c46bc175f56', + name: 'abc-tag', + postCount: 1, + url: 'https://rudder.canny.io/admin/board/features?tags=abc-tag', + }, + ], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + score: 0, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: null, + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + objectType: 'vote', + type: 'vote.deleted', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + 'Missing essential fields from Canny. Error: (TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received null)', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + }, + ], + }, + }, + }, + { + name: 'canny', + description: 'test-12', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + created: '2022-07-26T10:35:16.390Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 10, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-26T08:18:52.459Z', + deletedBy: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + details: "This is the post's details", + eta: null, + id: '62dfa36c9950e94655320fe7', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-4', + }, + objectType: 'post', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: 'Missing essential fields from Canny', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/cordial/data.ts b/test/integrations/sources/cordial/data.ts new file mode 100644 index 0000000000..acb02e9fbf --- /dev/null +++ b/test/integrations/sources/cordial/data.ts @@ -0,0 +1,628 @@ +import utils from '../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + +export const data = [ + { + name: 'cordial', + description: 'Simple Single object Input event with normal channel and action', + module: 'source', + version: 'v1', + input: { + request: { + body: [ + { + event: { + contact: { + _id: '6690fe3655e334xx028xxx', + channels: { + email: { + address: 'jondoe@example.com', + subscribeStatus: 'subscribed', + subscribedAt: '2024-07-12T09:58:14+0000', + }, + }, + createdAt: '2024-07-12T09:58:14+0000', + address: { + city: 'San Miego', + }, + first_name: 'John', + last_name: 'Doe', + lastUpdateSource: 'api', + lastModified: '2024-07-12T13:00:49+0000', + cID: '6690fe3655e334xx028xxx', + }, + event: { + _id: '669141857b8cxxx1ba0da2xx', + cID: '6690fe3655e334xx028xxx', + ts: '2024-07-12T14:45:25+00:00', + ats: '2024-07-12T14:45:25+0000', + a: 'browse', + tzo: -7, + rl: 'a', + UID: '4934ee07118197xx3f74d5xxxx7b0076', + time: '2024-07-12T14:45:25+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + category: 'Shirts', + url: 'http://example.com/shirts', + description: 'A really cool khaki shirt.', + price: 9.99, + title: 'Khaki Shirt', + test_key: 'value', + }, + }, + }, + source: {}, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { + name: 'unknown', + version: 'unknown', + }, + integration: { + name: 'Cordial', + }, + traits: { + userId: '6690fe3655e334xx028xxx', + email: 'jondoe@example.com', + _id: '6690fe3655e334xx028xxx', + channels: { + email: { + address: 'jondoe@example.com', + subscribeStatus: 'subscribed', + subscribedAt: '2024-07-12T09:58:14+0000', + }, + }, + createdAt: '2024-07-12T09:58:14+0000', + address: { + city: 'San Miego', + }, + first_name: 'John', + last_name: 'Doe', + lastUpdateSource: 'api', + lastModified: '2024-07-12T13:00:49+0000', + cID: '6690fe3655e334xx028xxx', + }, + externalId: [{ id: '6690fe3655e334xx028xxx', type: 'cordialContactId' }], + }, + integrations: { + Cordial: false, + }, + type: 'track', + event: 'browse', + originalTimestamp: '2024-07-12T14:45:25+00:00', + properties: { + event_id: '669141857b8cxxx1ba0da2xx', + category: 'Shirts', + url: 'http://example.com/shirts', + description: 'A really cool khaki shirt.', + price: 9.99, + title: 'Khaki Shirt', + test_key: 'value', + cID: '6690fe3655e334xx028xxx', + ts: '2024-07-12T14:45:25+00:00', + ats: '2024-07-12T14:45:25+0000', + a: 'browse', + tzo: -7, + rl: 'a', + UID: '4934ee07118197xx3f74d5xxxx7b0076', + time: '2024-07-12T14:45:25+0000', + action: 'browse', + bmID: '', + first: 0, + }, + userId: '6690fe3655e334xx028xxx', + timestamp: '2024-07-12T14:45:25+00:00', + sentAt: '2024-07-12T14:45:25+00:00', + }, + ], + }, + }, + ], + }, + }, + mockFns: () => { + defaultMockFns(); + }, + }, + { + name: 'cordial', + description: 'Multiple object Input event with batched payload', + module: 'source', + version: 'v1', + input: { + request: { + body: [ + { + event: [ + { + contact: { + _id: '633b2fd70a12be027e0b0xxx', + lang_locale: 'EN-US', + channels: { + email: { + address: 'johndoe@example.com', + subscribeStatus: 'none', + }, + }, + createdAt: '2022-10-03T18:54:15+0000', + email_sha256_hash: + 'f959bdf883831ebb96612eb9xxxx1e0c9481780adf5f70xxx862155531bf61df', + first_name: 'john', + last_name: 'doe', + lastUpdateSource: 'cordial', + lastModified: '2024-07-24T07:52:46+0000', + cID: '633b2fd70a12be027e0b0xxx', + }, + event: { + _id: '66a0b2ce5344b55fxxxc5a64', + cID: '633b2fd70a12be027e0b0xxx', + ts: '2024-07-24T07:52:46+00:00', + ats: '2024-07-24T07:52:39+0000', + g: { + countryISO: 'PL', + country: 'Poland', + state: 'MZ', + city: 'Warszawa', + postalCode: '00-686', + geoLoc: { + lat: 52.22744369506836, + lon: 21.009017944335938, + }, + tz: 'Europe/Warsaw', + }, + d: { + type: 'computer', + device: 'Macintosh', + platform: 'OS X', + browser: 'Chrome', + robot: false, + }, + a: 'browse', + UID: '471af949fffe749c2ebfxxx950ea73c', + sp: { + bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e', + }, + tzo: -7, + rl: '6', + time: '2024-07-24T07:52:39+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', + product_item_group_id: ['1094269'], + product_category: ['allproducts'], + product_name: ['wtp ab'], + product_group: ['women'], + }, + }, + }, + { + contact: { + _id: '633b2fd12312be027e0b0xxx', + lang_locale: 'EN-US', + channels: { + email: { + address: 'johndoe1@example.com', + subscribeStatus: 'none', + }, + }, + createdAt: '2022-10-03T18:54:15+0000', + email_sha256_hash: + 'f95912b883831eab11612eb9xxxx1e0c9481780ad45770xxx862155531bf61df', + first_name: 'john', + last_name: 'doe', + lastUpdateSource: 'cordial', + lastModified: '2024-07-24T07:52:46+0000', + cID: '633b2fd12312be027e0b0xxx', + }, + event: { + _id: '66aku0b2ce527b55fx1xc5a64', + cID: '633b2fd12312be027e0b0xxx', + ts: '2024-07-24T07:52:46+00:00', + ats: '2024-07-24T07:52:39+0000', + g: { + countryISO: 'PL', + country: 'Poland', + state: 'MZ', + city: 'Warszawa', + postalCode: '00-686', + geoLoc: { + lat: 52.22744369506836, + lon: 21.009017944335938, + }, + tz: 'Europe/Warsaw', + }, + d: { + type: 'computer', + device: 'Macintosh', + platform: 'OS X', + browser: 'Chrome', + robot: false, + }, + a: 'browse', + UID: '471af949fffe74sdh382ebfxxx950ea73c', + sp: { + bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e', + }, + tzo: -7, + rl: '6', + time: '2024-07-24T07:52:39+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', + product_item_group_id: ['1094269'], + product_category: ['allproducts'], + product_name: ['wtp ab'], + product_group: ['women'], + }, + }, + }, + ], + source: {}, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { + name: 'unknown', + version: 'unknown', + }, + integration: { + name: 'Cordial', + }, + traits: { + userId: '633b2fd70a12be027e0b0xxx', + email: 'johndoe@example.com', + _id: '633b2fd70a12be027e0b0xxx', + lang_locale: 'EN-US', + channels: { + email: { + address: 'johndoe@example.com', + subscribeStatus: 'none', + }, + }, + createdAt: '2022-10-03T18:54:15+0000', + email_sha256_hash: + 'f959bdf883831ebb96612eb9xxxx1e0c9481780adf5f70xxx862155531bf61df', + first_name: 'john', + last_name: 'doe', + lastUpdateSource: 'cordial', + lastModified: '2024-07-24T07:52:46+0000', + cID: '633b2fd70a12be027e0b0xxx', + }, + device: { + type: 'computer', + device: 'Macintosh', + platform: 'OS X', + browser: 'Chrome', + robot: false, + }, + externalId: [{ id: '633b2fd70a12be027e0b0xxx', type: 'cordialContactId' }], + }, + integrations: { + Cordial: false, + }, + type: 'track', + event: 'browse', + properties: { + event_id: '66a0b2ce5344b55fxxxc5a64', + url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', + product_item_group_id: ['1094269'], + product_category: ['allproducts'], + product_name: ['wtp ab'], + product_group: ['women'], + cID: '633b2fd70a12be027e0b0xxx', + ts: '2024-07-24T07:52:46+00:00', + ats: '2024-07-24T07:52:39+0000', + g: { + countryISO: 'PL', + country: 'Poland', + state: 'MZ', + city: 'Warszawa', + postalCode: '00-686', + geoLoc: { + lat: 52.22744369506836, + lon: 21.009017944335938, + }, + tz: 'Europe/Warsaw', + }, + a: 'browse', + UID: '471af949fffe749c2ebfxxx950ea73c', + sp: { + bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e', + }, + tzo: -7, + rl: '6', + time: '2024-07-24T07:52:39+0000', + action: 'browse', + bmID: '', + first: 0, + }, + userId: '633b2fd70a12be027e0b0xxx', + timestamp: '2024-07-24T07:52:46+00:00', + sentAt: '2024-07-24T07:52:46+00:00', + originalTimestamp: '2024-07-24T07:52:46+00:00', + }, + { + context: { + library: { + name: 'unknown', + version: 'unknown', + }, + integration: { + name: 'Cordial', + }, + traits: { + userId: '633b2fd12312be027e0b0xxx', + email: 'johndoe1@example.com', + _id: '633b2fd12312be027e0b0xxx', + lang_locale: 'EN-US', + channels: { + email: { + address: 'johndoe1@example.com', + subscribeStatus: 'none', + }, + }, + createdAt: '2022-10-03T18:54:15+0000', + email_sha256_hash: + 'f95912b883831eab11612eb9xxxx1e0c9481780ad45770xxx862155531bf61df', + first_name: 'john', + last_name: 'doe', + lastUpdateSource: 'cordial', + lastModified: '2024-07-24T07:52:46+0000', + cID: '633b2fd12312be027e0b0xxx', + }, + device: { + type: 'computer', + device: 'Macintosh', + platform: 'OS X', + browser: 'Chrome', + robot: false, + }, + externalId: [{ id: '633b2fd12312be027e0b0xxx', type: 'cordialContactId' }], + }, + integrations: { + Cordial: false, + }, + type: 'track', + event: 'browse', + properties: { + event_id: '66aku0b2ce527b55fx1xc5a64', + url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', + product_item_group_id: ['1094269'], + product_category: ['allproducts'], + product_name: ['wtp ab'], + product_group: ['women'], + cID: '633b2fd12312be027e0b0xxx', + ts: '2024-07-24T07:52:46+00:00', + ats: '2024-07-24T07:52:39+0000', + g: { + countryISO: 'PL', + country: 'Poland', + state: 'MZ', + city: 'Warszawa', + postalCode: '00-686', + geoLoc: { + lat: 52.22744369506836, + lon: 21.009017944335938, + }, + tz: 'Europe/Warsaw', + }, + a: 'browse', + UID: '471af949fffe74sdh382ebfxxx950ea73c', + sp: { + bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e', + }, + tzo: -7, + rl: '6', + time: '2024-07-24T07:52:39+0000', + action: 'browse', + bmID: '', + first: 0, + }, + userId: '633b2fd12312be027e0b0xxx', + timestamp: '2024-07-24T07:52:46+00:00', + sentAt: '2024-07-24T07:52:46+00:00', + originalTimestamp: '2024-07-24T07:52:46+00:00', + }, + ], + }, + }, + ], + }, + }, + mockFns: () => { + defaultMockFns(); + }, + }, + { + name: 'cordial', + description: 'Simple Single object Input event with no CId', + module: 'source', + version: 'v1', + input: { + request: { + body: [ + { + event: { + contact: { + _id: '6690fe3655e334xx028xx1', + channels: { + email: { + address: 'jondoe@example.com', + subscribeStatus: 'subscribed', + subscribedAt: '2024-07-12T09:58:14+0000', + }, + }, + createdAt: '2024-07-12T09:58:14+0000', + address: { + city: 'San Miego', + }, + first_name: 'John', + last_name: 'Doe', + lastUpdateSource: 'api', + lastModified: '2024-07-12T13:00:49+0000', + }, + event: { + _id: '669141857b8cxxx1ba0da2x1', + ts: '2024-07-12T14:45:25+00:00', + ats: '2024-07-12T14:45:25+0000', + d: { + type: 'computer', + device: false, + platform: false, + browser: false, + robot: true, + }, + a: 'browse', + tzo: -7, + rl: 'a', + UID: '4934ee07197xx3f74d5xxxx7b0076', + time: '2024-07-12T14:45:25+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + category: 'Shirts', + url: 'http://example.com/shirts', + description: 'A really cool khaki shirt.', + price: 9.99, + title: 'Khaki Shirt', + test_key: 'value', + }, + }, + }, + source: {}, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { + name: 'unknown', + version: 'unknown', + }, + integration: { + name: 'Cordial', + }, + traits: { + userId: '6690fe3655e334xx028xx1', + email: 'jondoe@example.com', + _id: '6690fe3655e334xx028xx1', + channels: { + email: { + address: 'jondoe@example.com', + subscribeStatus: 'subscribed', + subscribedAt: '2024-07-12T09:58:14+0000', + }, + }, + createdAt: '2024-07-12T09:58:14+0000', + address: { + city: 'San Miego', + }, + first_name: 'John', + last_name: 'Doe', + lastUpdateSource: 'api', + lastModified: '2024-07-12T13:00:49+0000', + }, + device: { + type: 'computer', + device: false, + platform: false, + browser: false, + robot: true, + }, + externalId: [], + }, + integrations: { + Cordial: false, + }, + type: 'track', + event: 'browse', + originalTimestamp: '2024-07-12T14:45:25+00:00', + properties: { + event_id: '669141857b8cxxx1ba0da2x1', + category: 'Shirts', + url: 'http://example.com/shirts', + description: 'A really cool khaki shirt.', + price: 9.99, + title: 'Khaki Shirt', + test_key: 'value', + ts: '2024-07-12T14:45:25+00:00', + ats: '2024-07-12T14:45:25+0000', + a: 'browse', + tzo: -7, + rl: 'a', + UID: '4934ee07197xx3f74d5xxxx7b0076', + time: '2024-07-12T14:45:25+0000', + action: 'browse', + bmID: '', + first: 0, + }, + userId: '6690fe3655e334xx028xx1', + timestamp: '2024-07-12T14:45:25+00:00', + sentAt: '2024-07-12T14:45:25+00:00', + }, + ], + }, + }, + ], + }, + }, + mockFns: () => { + defaultMockFns(); + }, + }, +]; diff --git a/test/integrations/sources/customerio/data.ts b/test/integrations/sources/customerio/data.ts new file mode 100644 index 0000000000..be2fc1a62e --- /dev/null +++ b/test/integrations/sources/customerio/data.ts @@ -0,0 +1,1439 @@ +import utils from '../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + +export const data = [ + { + name: 'customerio', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: 'abc', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Customer Subscribed', + properties: { eventId: '01E4C4CT6YDC7Y5M7FE1GWWPQJ' }, + userId: '0200102', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: '1585250199', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Customer Subscribed', + properties: { eventId: '01E4C4CT6YDC7Y5M7FE1GWWPQJ' }, + userId: '0200102', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: 1585250199, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Customer Subscribed', + properties: { eventId: '01E4C4CT6YDC7Y5M7FE1GWWPQJ' }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:16:39.000Z', + sentAt: '2020-03-26T19:16:39.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4C6P79C12J5A6KPE6XNFD', + object_type: 'customer', + metric: 'unsubscribed', + timestamp: 1585250179, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Customer Unsubscribed', + properties: { eventId: '01E4C4C6P79C12J5A6KPE6XNFD' }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:16:19.000Z', + sentAt: '2020-03-26T19:16:19.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 36, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + }, + event_id: '01E4C4G1S0AMNG0XVF2M7RPH5S', + object_type: 'email', + metric: 'drafted', + timestamp: 1585250305, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Email Drafted', + properties: { + eventId: '01E4C4G1S0AMNG0XVF2M7RPH5S', + deliveryId: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + actionId: 36, + broadcastId: 9, + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:18:25.000Z', + sentAt: '2020-03-26T19:18:25.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-5', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + content_id: 1146, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=', + failure_message: '550 5.5.0 Requested action not taken: mailbox unavailable', + newsletter_id: 736, + recipient: 'test@example.com', + subject: 'Thanks for joining!', + }, + event_id: '12ASDG7S9P6MAZPTJ78DAND9GDC', + object_type: 'email', + metric: 'bounced', + timestamp: 1234567890, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Email Bounced', + properties: { + eventId: '12ASDG7S9P6MAZPTJ78DAND9GDC', + deliveryId: 'RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=', + contentId: 1146, + emailSubject: 'Thanks for joining!', + reason: '550 5.5.0 Requested action not taken: mailbox unavailable', + newsletterId: 736, + }, + userId: '0200102', + originalTimestamp: '2009-02-13T23:31:30.000Z', + sentAt: '2009-02-13T23:31:30.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-6', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 36, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + href: 'http://google.com', + link_id: 1, + recipient: 'test@example.com', + subject: 'hello', + }, + event_id: '01E4C8BES5XT87ZWRJFTB35YJ3', + object_type: 'email', + metric: 'clicked', + timestamp: 1585254348, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Email Link Clicked', + properties: { + eventId: '01E4C8BES5XT87ZWRJFTB35YJ3', + deliveryId: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + actionId: 36, + broadcastId: 9, + emailSubject: 'hello', + link: { url: 'http://google.com', id: 1 }, + }, + userId: '0200102', + originalTimestamp: '2020-03-26T20:25:48.000Z', + sentAt: '2020-03-26T20:25:48.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-7', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 42, + campaign_id: 23, + content: 'Welcome to the club, we are with you.', + customer_id: 'user-123', + delivery_id: 'RAECAAFwnUSneIa0ZXkmq8EdkAM==', + headers: { 'Custom-Header': ['custom-value'] }, + identifiers: { id: 'user-123' }, + recipient: 'test@example.com', + subject: 'Thanks for signing up', + }, + event_id: '01E2EMRMM6TZ12TF9WGZN0WJQT', + metric: 'sent', + object_type: 'email', + timestamp: 1644227937, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Email Sent', + properties: { + eventId: '01E2EMRMM6TZ12TF9WGZN0WJQT', + deliveryId: 'RAECAAFwnUSneIa0ZXkmq8EdkAM==', + actionId: 42, + content: 'Welcome to the club, we are with you.', + emailSubject: 'Thanks for signing up', + campaignId: 23, + }, + userId: 'user-123', + originalTimestamp: '2022-02-07T09:58:57.000Z', + sentAt: '2022-02-07T09:58:57.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-8', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + customer_id: 'user-123', + delivery_id: 'REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==', + identifiers: { cio_id: '7ef807109981', id: 'user-123' }, + recipient: 'test@example.com', + subject: 'Thanks for signing up', + transactional_message_id: 2, + }, + event_id: '01ER4R5WB62QWCNREKFB4DYXGR', + metric: 'delivered', + object_type: 'email', + timestamp: 1675196819, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { cioId: '7ef807109981', email: 'test@example.com' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Email Delivered', + properties: { + eventId: '01ER4R5WB62QWCNREKFB4DYXGR', + deliveryId: 'REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==', + emailSubject: 'Thanks for signing up', + transactionalMessageId: 2, + }, + userId: 'user-123', + originalTimestamp: '2023-01-31T20:26:59.000Z', + sentAt: '2023-01-31T20:26:59.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-9', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 38, + campaign_id: 6, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RAEABQFxN56fWzydfV4_EGvfobI=', + failure_message: 'NoDevicesSynced', + }, + event_id: '01E4VSX8SZ0T9AQMH4Q16NRB89', + object_type: 'push', + metric: 'attempted', + timestamp: 1585776075, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Push Attempted', + properties: { + eventId: '01E4VSX8SZ0T9AQMH4Q16NRB89', + deliveryId: 'RAEABQFxN56fWzydfV4_EGvfobI=', + actionId: 38, + reason: 'NoDevicesSynced', + campaignId: 6, + }, + userId: '0200102', + originalTimestamp: '2020-04-01T21:21:15.000Z', + sentAt: '2020-04-01T21:21:15.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-10', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 37, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + device_platform: 'android', + }, + ], + }, + event_id: '01E4C4HDQ7P1X9KTKF0ZX7PWHE', + object_type: 'push', + metric: 'sent', + timestamp: 1585250350, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Push Sent', + properties: { + eventId: '01E4C4HDQ7P1X9KTKF0ZX7PWHE', + deliveryId: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + actionId: 37, + broadcastId: 9, + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + device_platform: 'android', + }, + ], + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:19:10.000Z', + sentAt: '2020-03-26T19:19:10.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-11', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 37, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + href: 'ciosas://product/2', + link_id: 1, + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + }, + ], + }, + event_id: '01E4V2SBHYK4TNTG8WKMP39G9R', + object_type: 'push', + metric: 'clicked', + timestamp: 1585751829, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Push Link Clicked', + properties: { + eventId: '01E4V2SBHYK4TNTG8WKMP39G9R', + deliveryId: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + actionId: 37, + broadcastId: 9, + link: { url: 'ciosas://product/2', id: 1 }, + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + }, + ], + }, + userId: '0200102', + originalTimestamp: '2020-04-01T14:37:09.000Z', + sentAt: '2020-04-01T14:37:09.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-12', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 41, + campaign_id: 7, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'ROk1AAIBcR4iT6mueuxiDtzO8HXv', + failure_message: + "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309.", + }, + event_id: '01E4F3DCS83P8HT7R3E6DWQN1X', + object_type: 'sms', + metric: 'attempted', + timestamp: 1234567890, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'SMS Attempted', + properties: { + eventId: '01E4F3DCS83P8HT7R3E6DWQN1X', + deliveryId: 'ROk1AAIBcR4iT6mueuxiDtzO8HXv', + actionId: 41, + reason: + "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309.", + campaignId: 7, + }, + userId: '0200102', + originalTimestamp: '2009-02-13T23:31:30.000Z', + sentAt: '2009-02-13T23:31:30.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-13', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 38, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgIBcRh6qzHz-8gKvscP2UZa', + href: 'https://app.com/verify', + link_id: 1, + recipient: '+18008675309', + }, + event_id: '01E4XXPN42JDF4B1ATQKTZ8WHV', + object_type: 'sms', + metric: 'clicked', + timestamp: 1585847161, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: '+18008675309' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'SMS Link Clicked', + properties: { + eventId: '01E4XXPN42JDF4B1ATQKTZ8WHV', + deliveryId: 'RPILAgIBcRh6qzHz-8gKvscP2UZa', + actionId: 38, + broadcastId: 9, + link: { url: 'https://app.com/verify', id: 1 }, + }, + userId: '0200102', + originalTimestamp: '2020-04-02T17:06:01.000Z', + sentAt: '2020-04-02T17:06:01.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-14', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 39, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgQBcRhNAufb0s30bmz5HD7Y', + recipient: '#signups', + }, + event_id: '01E4C4TQKD6KJ274870J5DE2HB', + object_type: 'slack', + metric: 'sent', + timestamp: 1585250655, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: '#signups' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Slack Message Sent', + properties: { + eventId: '01E4C4TQKD6KJ274870J5DE2HB', + deliveryId: 'RPILAgQBcRhNAufb0s30bmz5HD7Y', + actionId: 39, + broadcastId: 9, + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:24:15.000Z', + sentAt: '2020-03-26T19:24:15.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-15', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 39, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgQBcRhocpCJE3mFfwvRzNe6', + href: 'http://bing.com', + link_id: 1, + recipient: '#signups', + }, + event_id: '01E4C6HJTBNDX18XC4B88M3Y2G', + object_type: 'slack', + metric: 'clicked', + timestamp: 1585252451, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: '#signups' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Slack Message Link Clicked', + properties: { + eventId: '01E4C6HJTBNDX18XC4B88M3Y2G', + deliveryId: 'RPILAgQBcRhocpCJE3mFfwvRzNe6', + actionId: 39, + broadcastId: 9, + link: { url: 'http://bing.com', id: 1 }, + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:54:11.000Z', + sentAt: '2020-03-26T19:54:11.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-16', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 39, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgQBcRhIBqRiZAc0fyQiLvkC', + failure_message: 'value passed for channel was invalid', + }, + event_id: '01E4C4HDQ77BCN0X23Z3WBE764', + object_type: 'slack', + metric: 'failed', + timestamp: 1585250350, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Slack Message Failed', + properties: { + eventId: '01E4C4HDQ77BCN0X23Z3WBE764', + deliveryId: 'RPILAgQBcRhIBqRiZAc0fyQiLvkC', + actionId: 39, + broadcastId: 9, + reason: 'value passed for channel was invalid', + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:19:10.000Z', + sentAt: '2020-03-26T19:19:10.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-17', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 40, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgEBcRhIBqSrYcXDr2ks6Pj9', + }, + event_id: '01E4C4G1S04QCV1NASF4NWMQNR', + object_type: 'webhook', + metric: 'drafted', + timestamp: 1585250305, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Webhook Message Drafted', + properties: { + eventId: '01E4C4G1S04QCV1NASF4NWMQNR', + deliveryId: 'RPILAgEBcRhIBqSrYcXDr2ks6Pj9', + actionId: 40, + broadcastId: 9, + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:18:25.000Z', + sentAt: '2020-03-26T19:18:25.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-18', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 38, + broadcast_id: 6, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RAECAQFxNeUBx6LqgjqrN1j-BJc=', + failure_message: "Variable 'customer.test' is missing", + }, + event_id: '01E4TYA2KA9T0XGHCRJ784B774', + object_type: 'webhook', + metric: 'attempted', + timestamp: 1585747134, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Webhook Message Attempted', + properties: { + eventId: '01E4TYA2KA9T0XGHCRJ784B774', + deliveryId: 'RAECAQFxNeUBx6LqgjqrN1j-BJc=', + actionId: 38, + broadcastId: 6, + reason: "Variable 'customer.test' is missing", + }, + userId: '0200102', + originalTimestamp: '2020-04-01T13:18:54.000Z', + sentAt: '2020-04-01T13:18:54.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-19', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 40, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgEBcRhNAufr2aU82jtDZEh6', + recipient: 'https://test.example.com/process', + }, + event_id: '01E4C6EP0HCKRHKFARMZ5XEH7A', + object_type: 'webhook', + metric: 'sent', + timestamp: 1585252357, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'https://test.example.com/process' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Webhook Message Sent', + properties: { + eventId: '01E4C6EP0HCKRHKFARMZ5XEH7A', + deliveryId: 'RPILAgEBcRhNAufr2aU82jtDZEh6', + actionId: 40, + broadcastId: 9, + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:52:37.000Z', + sentAt: '2020-03-26T19:52:37.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-20', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 40, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgEBcRhNAufr2aU82jtDZEh6', + href: 'http://bing.com', + link_id: 1, + recipient: 'https://test.example.com/process', + }, + event_id: '01E4C6F5N1Y54TVGJTN64Y1ZS9', + object_type: 'webhook', + metric: 'clicked', + timestamp: 1585252373, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + traits: { email: 'https://test.example.com/process' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Webhook Message Link Clicked', + properties: { + eventId: '01E4C6F5N1Y54TVGJTN64Y1ZS9', + deliveryId: 'RPILAgEBcRhNAufr2aU82jtDZEh6', + actionId: 40, + broadcastId: 9, + link: { url: 'http://bing.com', id: 1 }, + }, + userId: '0200102', + originalTimestamp: '2020-03-26T19:52:53.000Z', + sentAt: '2020-03-26T19:52:53.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-21', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 38, + broadcast_id: 6, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RAECAQFxNeK3bC4SYqhQqFGBQrQ=', + failure_message: 'HTTP 404 Not Found []', + }, + event_id: '01E4TY5FVB0ZQ4KVDKRME0XSYZ', + object_type: 'webhook', + metric: 'failed', + timestamp: 1585746984, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Webhook Message Failed', + properties: { + eventId: '01E4TY5FVB0ZQ4KVDKRME0XSYZ', + deliveryId: 'RAECAQFxNeK3bC4SYqhQqFGBQrQ=', + actionId: 38, + broadcastId: 6, + reason: 'HTTP 404 Not Found []', + }, + userId: '0200102', + originalTimestamp: '2020-04-01T13:16:24.000Z', + sentAt: '2020-04-01T13:16:24.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'customerio', + description: 'test-22', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + data: { + action_id: 37, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + href: 'ciosas://product/2', + link_id: 1, + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + }, + ], + }, + event_id: '01E4V2SBHYK4TNTG8WKMP39G9S', + object_type: 'push', + metric: 'delivered', + timestamp: 1585751830, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Customer.io' }, + }, + integrations: { 'Customer.io': false }, + type: 'track', + event: 'Push Delivered', + properties: { + eventId: '01E4V2SBHYK4TNTG8WKMP39G9S', + deliveryId: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + actionId: 37, + broadcastId: 9, + link: { url: 'ciosas://product/2', id: 1 }, + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + }, + ], + }, + userId: '0200102', + originalTimestamp: '2020-04-01T14:37:10.000Z', + sentAt: '2020-04-01T14:37:10.000Z', + }, + ], + }, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/formsort/data.ts b/test/integrations/sources/formsort/data.ts new file mode 100644 index 0000000000..ef275f6c1c --- /dev/null +++ b/test/integrations/sources/formsort/data.ts @@ -0,0 +1,126 @@ +export const data = [ + { + name: 'formsort', + description: 'when we receive finalized as false', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + answers: { + yes: true, + enter_email: 'test@user.com', + enter_name: '2022-11-17', + yes_or_no: false, + }, + responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', + flow_label: 'new-flow-2022-11-25', + variant_label: 'main', + variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', + finalized: false, + created_at: '2022-11-25T14:41:22+00:00', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Formsort' }, + page: { title: 'new-flow-2022-11-25' }, + variantLabel: 'main', + variantUuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', + }, + integrations: { Formsort: false }, + type: 'track', + userId: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', + originalTimestamp: '2022-11-25T14:41:22+00:00', + properties: { + yes: true, + enter_email: 'test@user.com', + enter_name: '2022-11-17', + yes_or_no: false, + }, + event: 'FlowLoaded', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'formsort', + description: 'when we receive finalized as true', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + answers: { + yes: true, + enter_email: 'test@user.com', + enter_name: '2022-11-17', + yes_or_no: false, + }, + responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', + flow_label: 'new-flow-2022-11-25', + variant_label: 'main', + variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', + finalized: true, + created_at: '2022-11-25T14:41:22+00:00', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Formsort' }, + page: { title: 'new-flow-2022-11-25' }, + variantLabel: 'main', + variantUuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', + }, + integrations: { Formsort: false }, + type: 'track', + userId: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', + originalTimestamp: '2022-11-25T14:41:22+00:00', + properties: { + yes: true, + enter_email: 'test@user.com', + enter_name: '2022-11-17', + yes_or_no: false, + }, + event: 'FlowFinalized', + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/gainsightpx/data.ts b/test/integrations/sources/gainsightpx/data.ts new file mode 100644 index 0000000000..b038001580 --- /dev/null +++ b/test/integrations/sources/gainsightpx/data.ts @@ -0,0 +1,1625 @@ +export const data = [ + { + name: 'gainsightpx', + description: 'Identify Call', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SIGN_UP', + eventId: '1283c08b-f290-4bc4-9deb-75c7867d69ee', + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + date: 1665582808376, + sessionId: 'AP-EOXPSEZGC5LA-2-1665582441084-16821368', + globalContext: {}, + userType: 'USER', + }, + configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'identify', + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + score: 0, + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + id: 'New!', + country: 'India', + account: { + id: 'IBM', + name: 'International Business Machine', + numberOfEmployees: 0, + numberOfUsers: 0, + }, + }, + userId: 'New!', + createdAt: '2022-10-12T13:53:11.753Z', + originalTimestamp: '2022-10-12T13:53:11.753Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'Custom Track Call ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'CUSTOM', + eventId: 'df58cbd6-2736-4f8a-ad26-6049eac2e150', + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + date: 1665656881448, + sessionId: 'AP-EOXPSEZGC5LA-2-1665656622955-48127533', + globalContext: {}, + userType: 'USER', + eventName: 'Product Clicked', + attributes: { + 'Audience Size': 5000, + name: 'TESTing TRACK CALL FIRST', + 'Launched date': 1520532660000, + Launched: true, + }, + url: 'http://127.0.0.1:5501/GPXTEST2.html', + referrer: '', + remoteHost: '122.161.66.140', + }, + configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + ip: '122.161.66.140', + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + 'Audience Size': 5000, + name: 'TESTing TRACK CALL FIRST', + 'Launched date': 1520532660000, + Launched: true, + ip: '122.161.66.140', + url: 'http://127.0.0.1:5501/GPXTEST2.html', + }, + userId: 'New!', + category: 'CUSTOM', + event: 'Product Clicked', + sentAt: '2022-10-13T10:28:01.448Z', + originalTimestamp: '2022-10-13T10:28:01.448Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'Feedback Track Call ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'FEEDBACK', + eventId: 'd007bd76-decb-4a77-8456-d84fb15c6a83', + propertyKey: 'AP-E9VUBBLZ6BIS-2-1', + date: 1665415753621, + sessionId: 'AP-E9VUBBLZ6BIS-2-1665415678379-45445457', + globalContext: null, + userType: 'USER', + subject: 'feedback title', + category: 'Labels test', + description: 'feedback body', + labels: ['492120f5-3573-11ec-bef0-42010a800545'], + remoteHost: '122.161.66.140', + source: 'Knowledge Center Bot', + }, + configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + ip: '122.161.66.140', + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-E9VUBBLZ6BIS-2-1', + feedback: { + labels: ['492120f5-3573-11ec-bef0-42010a800545'], + description: 'feedback body', + subject: 'feedback title', + source: 'Knowledge Center Bot', + }, + ip: '122.161.66.140', + }, + userId: 'New!', + category: 'FEEDBACK', + event: 'Labels test', + sentAt: '2022-10-10T15:29:13.621Z', + originalTimestamp: '2022-10-10T15:29:13.621Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'Feature Match Track Call ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'FEATURE_MATCH', + eventId: 'ae1e5538-1736-4088-86d1-e90a10ffe901-05951b40-944f-4052-9a4a-51c74683f658', + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + date: 1665582808376, + sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', + globalContext: { role: 'Admin' }, + userType: 'USER', + featureId: '05951b40-944f-4052-9a4a-51c74683f658', + featureName: 'Charts', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + globalContext: { role: 'Admin' }, + featureId: '05951b40-944f-4052-9a4a-51c74683f658', + }, + userId: 'New!', + category: 'FEATURE_MATCH', + event: 'Charts', + sentAt: '2022-10-12T13:53:28.376Z', + originalTimestamp: '2022-10-12T13:53:28.376Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'Segment Match Track Call and no userId and yes anonymousId as event.sessionId', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SEGMENT', + eventId: 'ddb9ca94-beb1-449c-bdcd-b53190f8e784', + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + date: 1665582808376, + sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', + globalContext: { role: 'Admin' }, + userType: 'USER', + segmentId: 'e3ab2e48-24f9-4602-ab92-b9f1f4343845', + segmentName: 'Linux User', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + globalContext: { role: 'Admin' }, + segmentId: 'e3ab2e48-24f9-4602-ab92-b9f1f4343845', + }, + category: 'SEGMENT', + event: 'Linux User', + sentAt: '2022-10-12T13:53:28.376Z', + originalTimestamp: '2022-10-12T13:53:28.376Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'No Match Track Call ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + eventType: 'Unavailable', + eventId: 'ddb9ca94-beb1-449c-bdcd-b53190f8e784', + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + date: 1601303075964, + sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', + globalContext: { role: 'Admin' }, + userType: 'USER', + segmentId: 'e3ab2e48-24f9-4602-ab92-b9f1f4343845', + segmentName: 'Linux User', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Event type Unavailable not supported', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'Survey Track Call -> Multi Question Survey ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SURVEY', + eventId: 'c9883e3b-05d4-4f96-8b9c-e2ce10430493', + propertyKey: 'AP-N6SV00EVMR1E-2-1', + date: 1601303075964, + sessionId: 'AP-N6SV00EVMR1E-2-1605265939566-23853426', + globalContext: { role: 'Admin' }, + userType: 'EMPTY_USER_TYPE', + contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', + engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', + engagementName: 'Quarterly Survey', + surveyType: 'Multi Question', + interaction: 'SINGLE_STEP_SURVEY_RESPONDED', + score: 0, + activation: 'Auto', + executionId: '1ad2d383-d1fa-425d-84f0-2a531e17a5d9', + executionDate: 1605265939965, + questionType: 'Multi choice', + questionId: 'de9e6bf1-351c-46ec-907d-c985bd420c2b', + questionHtml: + '
Favorite travel destinations
', + questionText: 'Favorite travel destinations', + answers: [ + { + answerId: '563e2103-2906-4088-869f-bcccd185f288', + answerHtml: '
Europe
', + answerText: 'Europe', + }, + ], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-N6SV00EVMR1E-2-1', + globalContext: { role: 'Admin' }, + engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', + contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', + surveyType: 'Multi Question', + interaction: 'SINGLE_STEP_SURVEY_RESPONDED', + survey: { + activation: 'Auto', + questionType: 'Multi choice', + score: 0, + questionId: 'de9e6bf1-351c-46ec-907d-c985bd420c2b', + questionHtml: + '
Favorite travel destinations
', + questionText: 'Favorite travel destinations', + answers: [ + { + answerId: '563e2103-2906-4088-869f-bcccd185f288', + answerHtml: '
Europe
', + answerText: 'Europe', + }, + ], + }, + }, + userId: 'New!', + category: 'SURVEY', + event: 'Quarterly Survey', + sentAt: '2020-09-28T14:24:35.964Z', + originalTimestamp: '2020-09-28T14:24:35.964Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'Survey Track Call -> NPS ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SURVEY', + eventId: 'c9883e3b-05d4-4f96-8b9c-e2ce10430493', + propertyKey: 'AP-N6SV00EVMR1E-2-1', + date: 1601303075964, + sessionId: 'AP-N6SV00EVMR1E-2-1605265939566-23853426', + globalContext: { role: 'Admin' }, + userType: 'EMPTY_USER_TYPE', + contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', + engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', + engagementName: 'Quarterly Survey', + surveyType: 'Multi Question', + interaction: 'SINGLE_STEP_SURVEY_RESPONDED', + score: 0, + scoreType: null, + stepNumber: null, + userInput: 'I like new features', + activation: 'Auto', + executionId: '1ad2d383-d1fa-425d-84f0-2a531e17a5d9', + executionDate: 1605265939965, + questionType: 'Open text question', + questionHtml: + '
\n
\n How was your experience?\n
\n
\n', + questionText: 'How was your experience?', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-N6SV00EVMR1E-2-1', + globalContext: { role: 'Admin' }, + engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', + contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', + surveyType: 'Multi Question', + interaction: 'SINGLE_STEP_SURVEY_RESPONDED', + survey: { + activation: 'Auto', + userInput: 'I like new features', + questionType: 'Open text question', + score: 0, + questionHtml: + '
\n
\n How was your experience?\n
\n
\n', + questionText: 'How was your experience?', + }, + }, + userId: 'New!', + category: 'SURVEY', + event: 'Quarterly Survey', + sentAt: '2020-09-28T14:24:35.964Z', + originalTimestamp: '2020-09-28T14:24:35.964Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'Engagement Track Call ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'ENGAGEMENT', + eventId: '6494e73a-976b-4ee5-b8a8-de9effff7e80', + propertyKey: 'AP-N6SV00EVMR1E-2-1', + date: 1605262539389, + sessionId: 'AP-N6SV00EVMR1E-2-1605262502068-24197555', + globalContext: { role: 'Admin' }, + userType: 'EMPTY_USER_TYPE', + contentType: 'IN_APP_DIALOG', + engagementId: '83c30d4e-88c3-4054-a0fa-33451a6ea7fc', + engagementType: 'Dialog', + engagementName: 'Release Announcement', + interaction: 'VIEWED', + stepNumber: 1, + activation: 'Auto', + executionId: 'b633945f-d4a5-404a-ae39-5ced5b542240', + executionDate: 1605262539389, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-N6SV00EVMR1E-2-1', + engagementId: '83c30d4e-88c3-4054-a0fa-33451a6ea7fc', + contentType: 'IN_APP_DIALOG', + engagementType: 'Dialog', + interaction: 'VIEWED', + globalContext: { role: 'Admin' }, + engagement: { stepNumber: 1, activation: 'Auto' }, + }, + userId: 'New!', + category: 'ENGAGEMENT', + event: 'Release Announcement', + sentAt: '2020-11-13T10:15:39.389Z', + originalTimestamp: '2020-11-13T10:15:39.389Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'gainsightpx', + description: 'SegmentIO S2S Track Call ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SEGMENT_IO', + eventId: 'ajs-next-69810a17571dc115ccead5281cc3fb7d', + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + date: 1666687235178, + sessionId: '31a524fa-1490-48db-9600-adfb1fa95333', + globalContext: {}, + userType: 'USER', + segmentIOEvent: { + pxPropertyKey: 'AP-EOXPSEZGC5LA-2', + type: 'group', + userId: '1001', + anonymousId: 'a4303a13-eb10-46d8-8935-d787daf1cfbd', + context: { + ip: '122.161.67.121', + library: { name: 'analytics.js', version: 'next-1.45.0' }, + locale: 'en-GB', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36', + page: { + path: '/abc.html', + title: 'Engage Testing', + url: 'http://127.0.0.1:5501/abc.html', + }, + }, + messageId: 'ajs-next-69810a17571dc115ccead5281cc3fb7d', + receivedAt: '2022-10-25T08:40:35.184Z', + sentAt: '2022-10-25T08:40:34.809Z', + timestamp: '2022-10-25T08:40:35.178Z', + traits: { name: 'International Business Machine' }, + version: 2, + channel: 'client', + groupId: 'IBM', + }, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'GAINSIGHTPX' }, + traits: { + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + title: 'Mr.', + globalUnsubscribe: false, + accountId: 'IBM', + numberOfVisits: 1, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + score: 0, + id: 'New!', + country: 'India', + account: { + numberOfEmployees: 0, + numberOfUsers: 0, + id: 'IBM', + name: 'International Business Machine', + }, + }, + externalId: [ + { + type: 'gainsightpxAptrinsicId', + id: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + }, + ], + }, + integrations: { GAINSIGHTPX: false }, + type: 'track', + properties: { + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + pxPropertyKey: 'AP-EOXPSEZGC5LA-2', + type: 'group', + userId: '1001', + anonymousId: 'a4303a13-eb10-46d8-8935-d787daf1cfbd', + context: { + ip: '122.161.67.121', + library: { name: 'analytics.js', version: 'next-1.45.0' }, + locale: 'en-GB', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36', + page: { + path: '/abc.html', + title: 'Engage Testing', + url: 'http://127.0.0.1:5501/abc.html', + }, + }, + messageId: 'ajs-next-69810a17571dc115ccead5281cc3fb7d', + receivedAt: '2022-10-25T08:40:35.184Z', + sentAt: '2022-10-25T08:40:34.809Z', + timestamp: '2022-10-25T08:40:35.178Z', + traits: { name: 'International Business Machine' }, + version: 2, + channel: 'client', + groupId: 'IBM', + }, + userId: 'New!', + category: 'SEGMENT_IO', + event: 'SegmentIO Cloud Server', + sentAt: '2022-10-25T08:40:35.178Z', + originalTimestamp: '2022-10-25T08:40:35.178Z', + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/iterable/data.ts b/test/integrations/sources/iterable/data.ts new file mode 100644 index 0000000000..8912c83434 --- /dev/null +++ b/test/integrations/sources/iterable/data.ts @@ -0,0 +1,2222 @@ +export const data = [ + { + name: 'iterable', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'test@rudderstack.com', + eventName: 'emailSubscribe', + dataFields: { + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + email: 'test@rudderstack.com', + createdAt: '2022-04-19 03:33:50 +00:00', + messageTypeIds: [], + emailListIds: [1589748], + channelIds: [], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'test@rudderstack.com' }, + }, + event: 'emailSubscribe', + integrations: { Iterable: false }, + properties: { + channelIds: [], + createdAt: '2022-04-19 03:33:50 +00:00', + emailListIds: [1589748], + messageTypeIds: [], + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + }, + receivedAt: '2022-04-19T03:33:50.000Z', + timestamp: '2022-04-19T03:33:50.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventName: 'emailSubscribe', + dataFields: { + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + email: 'test@abcd.com', + createdAt: '2022-04-19 03:33:50 +00:00', + messageTypeIds: [], + emailListIds: [1589748], + channelIds: [], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Unknwon event type from Iterable', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'test@ruddstack.com', + eventTitle: 'smsReceived', + dataFields: { + fromPhoneNumber: '+16503926753', + toPhoneNumber: '+14155824541', + smsMessage: 'Message text', + email: 'docs@iterable.com', + createdAt: '2016-12-05 22:51:25 +00:00', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Unknwon event type from Iterable', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [{ email: 'test@rudderstack.com', eventName: 'inAppSendSkip' }], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'test@rudderstack.com' }, + }, + event: 'inAppSendSkip', + integrations: { Iterable: false }, + type: 'track', + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'test@rudderstack.com', + eventName: 'emailSend', + dataFields: { + contentId: 331201, + email: 'test@rudderstack.com', + createdAt: '2016-12-02 20:21:04 +00:00', + campaignId: 59667, + templateId: 93849, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c59667:t93849:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'test@rudderstack.com' }, + }, + event: 'emailSend', + integrations: { Iterable: false }, + properties: { + contentId: 331201, + createdAt: '2016-12-02 20:21:04 +00:00', + campaignId: 59667, + templateId: 93849, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c59667:t93849:docs@iterable.com', + }, + receivedAt: '2016-12-02T20:21:04.000Z', + timestamp: '2016-12-02T20:21:04.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-5', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'invalid_email@iterable.com', + eventName: 'emailBounce', + dataFields: { + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2598, + messageTypeId: 2870, + experimentId: null, + recipientState: 'HardBounce', + templateId: 167484, + email: 'invalid_email@iterable.com', + createdAt: '2017-05-15 23:59:47 +00:00', + campaignId: 114746, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailId: 'c114746:t167484:invalid_email@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: 'b053765f5d0d23b0d5e4dd960be9513f', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'invalid_email@iterable.com' }, + }, + event: 'emailBounce', + integrations: { Iterable: false }, + properties: { + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2598, + messageTypeId: 2870, + experimentId: null, + recipientState: 'HardBounce', + templateId: 167484, + createdAt: '2017-05-15 23:59:47 +00:00', + campaignId: 114746, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailId: 'c114746:t167484:invalid_email@iterable.com', + }, + receivedAt: '2017-05-15T23:59:47.000Z', + timestamp: '2017-05-15T23:59:47.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-6', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'emailClick', + dataFields: { + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36', + ip: '162.245.22.184', + templateId: 93849, + userAgentDevice: 'Mac', + url: 'https://www.iterable.com', + canonicalUrlId: '3145668988', + city: 'San Francisco', + region: 'CA', + email: 'docs@iterable.com', + createdAt: '2016-12-02 20:31:39 +00:00', + campaignId: 59667, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + linkUrl: 'https://www.iterable.com', + linkId: '3145668988', + emailId: 'c59667:t93849:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'emailClick', + integrations: { Iterable: false }, + properties: { + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36', + ip: '162.245.22.184', + templateId: 93849, + userAgentDevice: 'Mac', + url: 'https://www.iterable.com', + canonicalUrlId: '3145668988', + city: 'San Francisco', + region: 'CA', + createdAt: '2016-12-02 20:31:39 +00:00', + campaignId: 59667, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + linkUrl: 'https://www.iterable.com', + linkId: '3145668988', + emailId: 'c59667:t93849:docs@iterable.com', + }, + receivedAt: '2016-12-02T20:31:39.000Z', + timestamp: '2016-12-02T20:31:39.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-7', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'emailComplaint', + dataFields: { + recipientState: 'Complaint', + templateId: 79190, + email: 'docs@iterable.com', + createdAt: '2016-12-09 18:52:19 +00:00', + campaignId: 49313, + messageId: 'd3c44d47b4994306b4db8d16a94db025', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'test template', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'emailComplaint', + integrations: { Iterable: false }, + properties: { + recipientState: 'Complaint', + templateId: 79190, + createdAt: '2016-12-09 18:52:19 +00:00', + campaignId: 49313, + messageId: 'd3c44d47b4994306b4db8d16a94db025', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'test template', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + receivedAt: '2016-12-09T18:52:19.000Z', + timestamp: '2016-12-09T18:52:19.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-8', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'emailOpen', + dataFields: { + userAgent: + 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', + proxySource: 'Gmail', + ip: '66.249.84.204', + templateId: 79190, + device: 'Gmail', + email: 'docs@iterable.com', + createdAt: '2016-12-02 18:51:45 +00:00', + campaignId: 49313, + messageId: '210badf49fe54f2591d64ad0d055f4fb', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'emailOpen', + integrations: { Iterable: false }, + properties: { + userAgent: + 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', + proxySource: 'Gmail', + ip: '66.249.84.204', + templateId: 79190, + device: 'Gmail', + createdAt: '2016-12-02 18:51:45 +00:00', + campaignId: 49313, + messageId: '210badf49fe54f2591d64ad0d055f4fb', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + receivedAt: '2016-12-02T18:51:45.000Z', + timestamp: '2016-12-02T18:51:45.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-9', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'emailSendSkip', + dataFields: { + createdAt: '2019-08-07 18:56:10 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 721398, + messageId: '98430abe1b9842c991ce221010121553', + email: 'docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'emailSendSkip', + integrations: { Iterable: false }, + properties: { + createdAt: '2019-08-07 18:56:10 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 721398, + messageId: '98430abe1b9842c991ce221010121553', + }, + receivedAt: '2019-08-07T18:56:10.000Z', + timestamp: '2019-08-07T18:56:10.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-10', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'test@rudderstack.com', + eventName: 'emailSubscribe', + dataFields: { + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + email: 'test@abcd.com', + createdAt: '2022-04-19 03:33:50 +00:00', + messageTypeIds: [], + emailListIds: [1589748], + channelIds: [], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'test@rudderstack.com' }, + }, + event: 'emailSubscribe', + integrations: { Iterable: false }, + properties: { + channelIds: [], + createdAt: '2022-04-19 03:33:50 +00:00', + emailListIds: [1589748], + messageTypeIds: [], + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + }, + receivedAt: '2022-04-19T03:33:50.000Z', + timestamp: '2022-04-19T03:33:50.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-11', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'emailUnSubscribe', + dataFields: { + campaignId: 1089024, + messageId: 'bf008db8ab194b65816398c05bf30f99', + emailId: 'c1089024:t1526112:docs@iterable.com', + workflowName: 'My test workflow', + messageTypeIds: [], + locale: null, + templateId: 1526112, + emailSubject: 'Upcoming events!', + labels: [], + unsubSource: 'EmailLink', + createdAt: '2020-03-20 23:34:15 +00:00', + templateName: 'My test template', + emailListIds: [], + messageTypeId: 31082, + experimentId: null, + channelIds: [27447], + campaignName: 'My test campaign', + workflowId: 76786, + email: 'docs@iterable.com', + channelId: 27447, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'emailUnSubscribe', + integrations: { Iterable: false }, + properties: { + campaignId: 1089024, + messageId: 'bf008db8ab194b65816398c05bf30f99', + emailId: 'c1089024:t1526112:docs@iterable.com', + workflowName: 'My test workflow', + messageTypeIds: [], + locale: null, + templateId: 1526112, + emailSubject: 'Upcoming events!', + labels: [], + unsubSource: 'EmailLink', + createdAt: '2020-03-20 23:34:15 +00:00', + templateName: 'My test template', + emailListIds: [], + messageTypeId: 31082, + experimentId: null, + channelIds: [27447], + campaignName: 'My test campaign', + workflowId: 76786, + channelId: 27447, + }, + receivedAt: '2020-03-20T23:34:15.000Z', + timestamp: '2020-03-20T23:34:15.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-12', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + userId: '1', + eventName: 'hostedUnsubscribeClick', + dataFields: { + country: 'United States', + city: 'San Jose', + campaignId: 1074721, + ip: '192.168.0.1', + userAgentDevice: 'Mac', + messageId: 'ceb3d4d929fc406ca93b28a0ef1efff1', + emailId: 'c1074721:t1506266:docs@iterable.com', + 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', + workflowName: 'My workflow', + locale: null, + templateId: 1506266, + emailSubject: 'My email subject', + url: 'https://iterable.com', + labels: [], + createdAt: '2020-03-21 00:24:08 +00:00', + templateName: 'My email template', + messageTypeId: 13406, + experimentId: null, + region: 'CA', + campaignName: 'My email campaign', + workflowId: 60102, + email: 'docs@iterable.com', + channelId: 12466, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '1', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'hostedUnsubscribeClick', + integrations: { Iterable: false }, + properties: { + country: 'United States', + city: 'San Jose', + campaignId: 1074721, + ip: '192.168.0.1', + userAgentDevice: 'Mac', + messageId: 'ceb3d4d929fc406ca93b28a0ef1efff1', + emailId: 'c1074721:t1506266:docs@iterable.com', + 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', + workflowName: 'My workflow', + locale: null, + templateId: 1506266, + emailSubject: 'My email subject', + url: 'https://iterable.com', + labels: [], + createdAt: '2020-03-21 00:24:08 +00:00', + templateName: 'My email template', + messageTypeId: 13406, + experimentId: null, + region: 'CA', + campaignName: 'My email campaign', + workflowId: 60102, + channelId: 12466, + }, + receivedAt: '2020-03-21T00:24:08.000Z', + timestamp: '2020-03-21T00:24:08.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-13', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'inAppClick', + dataFields: { + email: 'docs@iterable.com', + createdAt: '2018-03-27 00:44:40 +00:00', + campaignId: 269450, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'inAppClick', + integrations: { Iterable: false }, + properties: { createdAt: '2018-03-27 00:44:40 +00:00', campaignId: 269450 }, + receivedAt: '2018-03-27T00:44:40.000Z', + timestamp: '2018-03-27T00:44:40.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-14', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'inAppOpen', + dataFields: { + email: 'docs@iterable.com', + createdAt: '2018-03-27 00:44:30 +00:00', + campaignId: 269450, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'inAppOpen', + integrations: { Iterable: false }, + properties: { createdAt: '2018-03-27 00:44:30 +00:00', campaignId: 269450 }, + receivedAt: '2018-03-27T00:44:30.000Z', + timestamp: '2018-03-27T00:44:30.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-15', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'inAppSend', + dataFields: { + messageContext: { saveToInbox: false, trigger: 'immediate' }, + campaignId: 732678, + contentId: 18997, + messageId: 'vA16d48VVi4LQ5hMuZuquKzL0BXTdQJJUMJRjKnL1', + workflowName: null, + emailId: 'c732678:t1032729:docs@iterable.com', + locale: null, + templateId: 1032729, + inAppBody: '', + email: 'docs@iterable.com', + createdAt: '2016-12-10 01:00:38 +00:00', + campaignId: 74768, + templateId: 113554, + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'yourpath/subpath' }, + sound: '', + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'pushBounce', + integrations: { Iterable: false }, + properties: { + platformEndpoint: '', + createdAt: '2016-12-10 01:00:38 +00:00', + campaignId: 74768, + templateId: 113554, + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'yourpath/subpath' }, + sound: '', + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + receivedAt: '2016-12-10T01:00:38.000Z', + timestamp: '2016-12-10T01:00:38.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-18', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'pushOpen', + dataFields: { + appAlreadyRunning: false, + email: 'docs@iterable.com', + createdAt: '2016-12-08 01:25:22 +00:00', + campaignId: 74768, + templateId: 113554, + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'shop_home' }, + sound: null, + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'pushOpen', + integrations: { Iterable: false }, + properties: { + appAlreadyRunning: false, + createdAt: '2016-12-08 01:25:22 +00:00', + campaignId: 74768, + templateId: 113554, + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'shop_home' }, + sound: null, + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + receivedAt: '2016-12-08T01:25:22.000Z', + timestamp: '2016-12-08T01:25:22.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-19', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'pushSend', + dataFields: { + contentId: 6724, + platformEndpoint: '', + email: 'docs@iterable.com', + createdAt: '2016-12-08 00:53:11 +00:00', + campaignId: 74758, + templateId: 113541, + messageId: '73f2d3f13cd04db0b56c6143b179adc5', + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 1744, + messageTypeId: 1759, + experimentId: null, + payload: { a: '2' }, + sound: '', + badge: '', + contentAvailable: false, + deeplink: null, + locale: null, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'pushSend', + integrations: { Iterable: false }, + properties: { + contentId: 6724, + platformEndpoint: '', + createdAt: '2016-12-08 00:53:11 +00:00', + campaignId: 74758, + templateId: 113541, + messageId: '73f2d3f13cd04db0b56c6143b179adc5', + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 1744, + messageTypeId: 1759, + experimentId: null, + payload: { a: '2' }, + sound: '', + badge: '', + contentAvailable: false, + deeplink: null, + locale: null, + }, + receivedAt: '2016-12-08T00:53:11.000Z', + timestamp: '2016-12-08T00:53:11.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-20', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'pushSendSkip', + dataFields: { + createdAt: '2019-08-07 22:28:51 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 732667, + messageId: '8306ae0c74324635b7554947c5ec0e56', + email: 'docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'pushSendSkip', + integrations: { Iterable: false }, + properties: { + createdAt: '2019-08-07 22:28:51 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 732667, + messageId: '8306ae0c74324635b7554947c5ec0e56', + }, + receivedAt: '2019-08-07T22:28:51.000Z', + timestamp: '2019-08-07T22:28:51.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-21', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'pushUninstall', + dataFields: { + isGhostPush: false, + platformEndpoint: '', + email: 'docs@iterable.com', + createdAt: '2016-12-09 20:50:54 +00:00', + campaignId: 74768, + templateId: 113554, + messageId: '73f2d3f13cd04db0b56c6143b179adc5', + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'your_folder/30' }, + sound: '', + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'pushUninstall', + integrations: { Iterable: false }, + properties: { + isGhostPush: false, + platformEndpoint: '', + createdAt: '2016-12-09 20:50:54 +00:00', + campaignId: 74768, + templateId: 113554, + messageId: '73f2d3f13cd04db0b56c6143b179adc5', + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'your_folder/30' }, + sound: '', + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + receivedAt: '2016-12-09T20:50:54.000Z', + timestamp: '2016-12-09T20:50:54.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-22', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'smsBounce', + dataFields: { + smsProviderResponse: { + status: 404, + message: + 'The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found', + code: 20404, + more_info: 'https://www.twilio.com/docs/errors/20404', + }, + email: 'docs@iterable.com', + createdAt: '2016-12-05 22:43:24 +00:00', + campaignId: 74003, + templateId: 112561, + smsMessage: "Here is example message, please respond with 'received'", + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 4270, + messageTypeId: 4769, + experimentId: null, + fromPhoneNumberId: 268, + imageUrl: null, + locale: null, + emailId: 'c74003:t112561:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'smsBounce', + integrations: { Iterable: false }, + properties: { + smsProviderResponse: { + status: 404, + message: + 'The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found', + code: 20404, + more_info: 'https://www.twilio.com/docs/errors/20404', + }, + createdAt: '2016-12-05 22:43:24 +00:00', + campaignId: 74003, + templateId: 112561, + smsMessage: "Here is example message, please respond with 'received'", + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 4270, + messageTypeId: 4769, + experimentId: null, + fromPhoneNumberId: 268, + imageUrl: null, + locale: null, + emailId: 'c74003:t112561:docs@iterable.com', + }, + receivedAt: '2016-12-05T22:43:24.000Z', + timestamp: '2016-12-05T22:43:24.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-23', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'smsClick', + dataFields: { + campaignId: 1234567, + campaignName: 'My test campaign', + workflowId: null, + workflowName: null, + templateName: 'My template', + locale: null, + channelId: 98765, + messageTypeId: 43210, + experimentId: null, + labels: [], + smsMessage: 'Test SMS! https://www.example.com', + fromPhoneNumberId: 1234, + imageUrl: null, + clickedUrl: 'https://www.example.com', + email: 'docs@iterable.com', + createdAt: '2022-03-10 05:00:14 +00:00', + templateId: 1112222, + messageId: 'ebd8f3cfc1f74353b423c5e0f3dd8b39', + emailId: 'c1234567:t9876543:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'smsClick', + integrations: { Iterable: false }, + properties: { + campaignId: 1234567, + campaignName: 'My test campaign', + workflowId: null, + workflowName: null, + templateName: 'My template', + locale: null, + channelId: 98765, + messageTypeId: 43210, + experimentId: null, + labels: [], + smsMessage: 'Test SMS! https://www.example.com', + fromPhoneNumberId: 1234, + imageUrl: null, + clickedUrl: 'https://www.example.com', + createdAt: '2022-03-10 05:00:14 +00:00', + templateId: 1112222, + messageId: 'ebd8f3cfc1f74353b423c5e0f3dd8b39', + emailId: 'c1234567:t9876543:docs@iterable.com', + }, + receivedAt: '2022-03-10T05:00:14.000Z', + timestamp: '2022-03-10T05:00:14.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-24', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'smsReceived', + dataFields: { + fromPhoneNumber: '+16503926753', + toPhoneNumber: '+14155824541', + smsMessage: 'Message text', + email: 'docs@iterable.com', + createdAt: '2016-12-05 22:51:25 +00:00', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'smsReceived', + integrations: { Iterable: false }, + properties: { + fromPhoneNumber: '+16503926753', + toPhoneNumber: '+14155824541', + smsMessage: 'Message text', + createdAt: '2016-12-05 22:51:25 +00:00', + }, + receivedAt: '2016-12-05T22:51:25.000Z', + timestamp: '2016-12-05T22:51:25.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-25', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'smsSend', + dataFields: { + toPhoneNumber: '+16503926753', + fromSMSSenderId: 258, + contentId: 2086, + email: 'docs@iterable.com', + createdAt: '2016-12-05 21:50:32 +00:00', + campaignId: 73974, + templateId: 112523, + smsMessage: 'Message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 4270, + messageTypeId: 4769, + experimentId: null, + fromPhoneNumberId: 258, + imageUrl: null, + locale: null, + emailId: 'c73974:t112523:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'smsSend', + integrations: { Iterable: false }, + properties: { + toPhoneNumber: '+16503926753', + fromSMSSenderId: 258, + contentId: 2086, + createdAt: '2016-12-05 21:50:32 +00:00', + campaignId: 73974, + templateId: 112523, + smsMessage: 'Message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 4270, + messageTypeId: 4769, + experimentId: null, + fromPhoneNumberId: 258, + imageUrl: null, + locale: null, + emailId: 'c73974:t112523:docs@iterable.com', + }, + receivedAt: '2016-12-05T21:50:32.000Z', + timestamp: '2016-12-05T21:50:32.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-26', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'smsSendSkip', + dataFields: { + createdAt: '2019-08-07 18:49:48 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 729390, + messageId: '2c780bf42f26485db0fc6571d2e0f6a0', + email: 'docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'smsSendSkip', + integrations: { Iterable: false }, + properties: { + createdAt: '2019-08-07 18:49:48 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 729390, + messageId: '2c780bf42f26485db0fc6571d2e0f6a0', + }, + receivedAt: '2019-08-07T18:49:48.000Z', + timestamp: '2019-08-07T18:49:48.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-27', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'emailSend', + dataFields: { + contentId: 274222, + email: 'docs@iterable.com', + createdAt: '2016-12-02 18:51:40 +00:00', + campaignId: 49313, + transactionalData: { + __comment: + 'transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total.', + }, + templateId: 79190, + messageId: '210badf49fe54f2591d64ad0d055f4fb', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'emailSend', + integrations: { Iterable: false }, + properties: { + contentId: 274222, + createdAt: '2016-12-02 18:51:40 +00:00', + campaignId: 49313, + transactionalData: { + __comment: + 'transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total.', + }, + templateId: 79190, + messageId: '210badf49fe54f2591d64ad0d055f4fb', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + receivedAt: '2016-12-02T18:51:40.000Z', + timestamp: '2016-12-02T18:51:40.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-28', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'webPushSend', + dataFields: { + campaignId: 723636, + browserToken: + 'cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b', + contentId: 3681, + messageId: 'af4c726ae76b48c7871b6d0d7760d47c', + workflowName: 'My workflow name', + emailId: 'c723636:t1020396:docs@iterable.com', + locale: null, + webPushIcon: null, + templateId: 1020396, + labels: [], + createdAt: '2019-08-07 23:43:02 +00:00', + templateName: 'My template name', + webPushMessage: '', + messageTypeId: 9106, + webPushBody: null, + experimentId: null, + webPushClickAction: null, + campaignName: 'My campaign name', + workflowId: 53505, + channelId: 8539, + email: 'docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'webPushSend', + integrations: { Iterable: false }, + properties: { + campaignId: 723636, + browserToken: + 'cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b', + contentId: 3681, + messageId: 'af4c726ae76b48c7871b6d0d7760d47c', + workflowName: 'My workflow name', + emailId: 'c723636:t1020396:docs@iterable.com', + locale: null, + webPushIcon: null, + templateId: 1020396, + labels: [], + createdAt: '2019-08-07 23:43:02 +00:00', + templateName: 'My template name', + webPushMessage: '', + messageTypeId: 9106, + webPushBody: null, + experimentId: null, + webPushClickAction: null, + campaignName: 'My campaign name', + workflowId: 53505, + channelId: 8539, + }, + receivedAt: '2019-08-07T23:43:02.000Z', + timestamp: '2019-08-07T23:43:02.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'iterable', + description: 'test-29', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + email: 'docs@iterable.com', + eventName: 'webPushSendSkip', + dataFields: { + createdAt: '2019-08-07 23:43:48 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 723636, + messageId: '4238c918b20a41dfbe9a910275b76f12', + email: 'docs@iterable.com', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '0e13848b1c7e27eb5d88c5d35b70783e', + context: { + integration: { name: 'Iterable', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'docs@iterable.com' }, + }, + event: 'webPushSendSkip', + integrations: { Iterable: false }, + properties: { + createdAt: '2019-08-07 23:43:48 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 723636, + messageId: '4238c918b20a41dfbe9a910275b76f12', + }, + receivedAt: '2019-08-07T23:43:48.000Z', + timestamp: '2019-08-07T23:43:48.000Z', + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + overrideReceivedAt: true, +})); diff --git a/test/integrations/sources/mailjet/data.ts b/test/integrations/sources/mailjet/data.ts new file mode 100644 index 0000000000..2a8f3eaf46 --- /dev/null +++ b/test/integrations/sources/mailjet/data.ts @@ -0,0 +1,394 @@ +export const data = [ + { + name: 'mailjet', + description: 'MailJet email open event', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: 'open', + time: 1664443614, + MessageID: 94857068804950690, + Message_GUID: '54d6cdec-f659-4547-8926-13d9c4126b82', + email: 'test@rudderstack.com', + mj_campaign_id: 108760, + mj_contact_id: 399962859, + customcampaign: 'mj.nl=58424', + ip: '66.249.84.231', + geo: 'US', + agent: + 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', + CustomID: '', + Payload: '', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'MailJet' }, + traits: { email: 'test@rudderstack.com' }, + ip: '66.249.84.231', + userAgent: + 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', + externalId: [{ type: 'mailjetContactId', id: 399962859 }], + }, + integrations: { MailJet: false }, + type: 'track', + event: 'open', + properties: { + ip: '66.249.84.231', + customcampaign: 'mj.nl=58424', + mj_campaign_id: 108760, + Payload: '', + }, + originalTimestamp: '2022-09-29T09:26:54.000Z', + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailjet', + description: 'MailJet email bounce event where input event is of type ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: 'bounce', + time: 1664444171, + MessageID: 55169098999352350, + Message_GUID: '447d7eab-3335-4aba-9a51-09454bc14b81', + email: 'test@rudderstack.com', + mj_campaign_id: 108892, + mj_contact_id: 373142816, + customcampaign: 'mj.nl=58486', + blocked: false, + hard_bounce: false, + error_related_to: 'system', + error: 'connection issue', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'MailJet' }, + traits: { email: 'test@rudderstack.com' }, + externalId: [{ type: 'mailjetContactId', id: 373142816 }], + }, + integrations: { MailJet: false }, + type: 'track', + event: 'bounce', + properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + originalTimestamp: '2022-09-29T09:36:11.000Z', + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailjet', + description: 'MailJet email sent event', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: 'sent', + time: 1664444171, + MessageID: 92886743924596480, + Message_GUID: '0230c73a-2b77-4aea-8ef2-ed15d0edc5fd', + email: 'test@rudderstack.com', + mj_campaign_id: 108892, + mj_contact_id: 372651182, + customcampaign: 'mj.nl=58486', + smtp_reply: + '250 2.0.0 OK DMARC:Quarantine 1664444171 u17-20020adfdd51000000b0022cc3f2bf13si3225188wrm.271 - gsmtp', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'MailJet' }, + traits: { email: 'test@rudderstack.com' }, + externalId: [{ type: 'mailjetContactId', id: 372651182 }], + }, + integrations: { MailJet: false }, + type: 'track', + event: 'sent', + properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + originalTimestamp: '2022-09-29T09:36:11.000Z', + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailjet', + description: 'MailJet email bounce event', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: 'bounce', + time: 1664444170, + MessageID: 56013522696710744, + Message_GUID: 'dbe4f0a3-4a5a-4784-a724-a9794d3c0444', + email: 'test@rudderstack.com', + mj_campaign_id: 108892, + mj_contact_id: 373142182, + customcampaign: 'mj.nl=58486', + blocked: false, + hard_bounce: false, + error_related_to: 'system', + error: 'connection issue', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'MailJet' }, + traits: { email: 'test@rudderstack.com' }, + externalId: [{ type: 'mailjetContactId', id: 373142182 }], + }, + integrations: { MailJet: false }, + type: 'track', + event: 'bounce', + properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + originalTimestamp: '2022-09-29T09:36:10.000Z', + userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailjet', + description: 'MailJet when no email is present', + module: 'source', + version: 'v0', + skipGo: 'FIXME', + input: { + request: { + body: [ + { + event: 'bounce', + time: 1664444170, + MessageID: 56013522696710744, + Message_GUID: 'dbe4f0a3-4a5a-4784-a724-a9794d3c0444', + mj_campaign_id: 108892, + mj_contact_id: 373142182, + customcampaign: 'mj.nl=58486', + blocked: false, + hard_bounce: false, + error_related_to: 'system', + error: 'connection issue', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'MailJet' }, + externalId: [{ type: 'mailjetContactId', id: 373142182 }], + }, + integrations: { MailJet: false }, + type: 'track', + event: 'bounce', + properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + originalTimestamp: '2022-09-29T09:36:10.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailjet', + description: 'MailJet Multiple payloads in single request', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: 'open', + time: 1704458040, + MessageID: 987654, + Message_GUID: '876r-oihugyf-7tfygh', + email: 'abc@r.com', + mj_campaign_id: 321, + mj_contact_id: 123, + customcampaign: 'test_campaign', + url: 'https://www.example.com/', + ip: 'ip_info', + geo: 'some geo info', + agent: 'mailjet api test', + }, + { + event: 'click', + time: 1704458041, + MessageID: 12345234567, + Message_GUID: '12345-kjhgfd-2efv', + email: 'abc@r.com', + mj_campaign_id: 12, + mj_contact_id: 32532, + customcampaign: 'test_campaign', + url: 'https://www.example.com/', + ip: 'ip_info', + geo: 'some geo info', + agent: 'mailjet api test', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + ip: 'ip_info', + integration: { name: 'MailJet' }, + traits: { email: 'abc@r.com' }, + page: { url: 'https://www.example.com/' }, + userAgent: 'mailjet api test', + externalId: [{ type: 'mailjetContactId', id: 123 }], + }, + integrations: { MailJet: false }, + type: 'track', + event: 'open', + properties: { + customcampaign: 'test_campaign', + mj_campaign_id: 321, + ip: 'ip_info', + url: 'https://www.example.com/', + }, + userId: '593a5aff0b445b3b77a6d9676b7ec86e', + originalTimestamp: '2024-01-05T12:34:00.000Z', + }, + ], + }, + }, + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + page: { url: 'https://www.example.com/' }, + integration: { name: 'MailJet' }, + traits: { email: 'abc@r.com' }, + userAgent: 'mailjet api test', + ip: 'ip_info', + externalId: [{ type: 'mailjetContactId', id: 32532 }], + }, + integrations: { MailJet: false }, + type: 'track', + event: 'click', + properties: { + customcampaign: 'test_campaign', + mj_campaign_id: 12, + ip: 'ip_info', + url: 'https://www.example.com/', + }, + userId: '593a5aff0b445b3b77a6d9676b7ec86e', + originalTimestamp: '2024-01-05T12:34:01.000Z', + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/mailmodo/data.ts b/test/integrations/sources/mailmodo/data.ts new file mode 100644 index 0000000000..aa34363831 --- /dev/null +++ b/test/integrations/sources/mailmodo/data.ts @@ -0,0 +1,589 @@ +export const data = [ + { + name: 'mailmodo', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + triggerData: { + data: {}, + triggerSource: 'CsvList', + email: 'gouhgc@mailmodo.com', + triggerDetails: + 'file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e', + userId: 'd3775892hvh4f2f-b9d5-e49810eb2cae', + journeyId: '1a69df39hgvh4e0b-8b5c-73776157aa37', + eventProperty: {}, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: 'f43848cce166e51b097cbed2851adc16ed9d4c341928f1c790215c50cefb59b0', + context: { + externalId: [ + { id: 'd3775892hvh4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + ], + traits: { email: 'gouhgc@mailmodo.com' }, + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'CsvList', + integrations: { Mailmodo: false }, + properties: { + 'triggerData.triggerSource': 'CsvList', + 'triggerData.triggerDetails': + 'file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e', + 'triggerData.journeyId': '1a69df39hgvh4e0b-8b5c-73776157aa37', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + fuuid: '27905', + 'next-step-id': 'success', + 'total-steps': '3', + responseId: 'b9a5d224-cc5a-4e64-9800-5a3db9515fdf', + recipientEmail: 'test.rudderlabs21997@gmail.com', + formId: 'formosztd5', + recordedAt: { ts: 1662695704, date: '2022-09-09', hour: 9, minute: 25 }, + submissionSource: 'amp', + elementjbtz42: 'Everything ', + element8jzo13: ['Reliable', 'High Quality', 'Useful'], + recipientData: { email: 'test.rudderlabs21997@gmail.com' }, + recommend: '9', + liking: 'upvote', + satisfaction: '4', + campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', + campaignName: 'Campaign-testing', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: 'a80b34ec43ca959c7b8e5116ac626c3cf8561f62616e000a01729a8a900cc0a0', + context: { + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'test.rudderlabs21997@gmail.com' }, + }, + event: 'Form Submitted', + integrations: { Mailmodo: false }, + originalTimestamp: '2022-09-09T03:55:04.000Z', + properties: { + campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', + campaignName: 'Campaign-testing', + 'element8jzo13[0]': 'Reliable', + 'element8jzo13[1]': 'High Quality', + 'element8jzo13[2]': 'Useful', + elementjbtz42: 'Everything ', + formId: 'formosztd5', + fuuid: '27905', + liking: 'upvote', + 'next-step-id': 'success', + recommend: '9', + responseId: 'b9a5d224-cc5a-4e64-9800-5a3db9515fdf', + satisfaction: '4', + submissionSource: 'amp', + 'total-steps': '3', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + triggerData: { + data: {}, + triggerSource: 'Manual Add To List', + email: 'gou****@mailmodo.com', + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: '349e986e-f56c-****-bc3b-b5f13c3e34da', + eventProperty: {}, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', + context: { + externalId: [ + { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + ], + traits: { email: 'gou****@mailmodo.com' }, + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'Manual Add To List', + integrations: { Mailmodo: false }, + properties: { + 'triggerData.triggerSource': 'Manual Add To List', + 'triggerData.journeyId': '349e986e-f56c-****-bc3b-b5f13c3e34da', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + triggerData: { + data: {}, + triggerSource: 'Dashboard-change in property: first_name', + email: 'gou****@mailmodo.com', + userId: 'cc56708d-****-****-8c07-a4bfa5a7b79b', + journeyId: 'a78d7221-de34-47d8-81c6-5ad70cf4ee38', + eventProperty: {}, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', + context: { + externalId: [ + { id: 'cc56708d-****-****-8c07-a4bfa5a7b79b', type: 'mailmodoUserId' }, + ], + traits: { email: 'gou****@mailmodo.com' }, + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'Dashboard-change in property: first_name', + integrations: { Mailmodo: false }, + properties: { + 'triggerData.triggerSource': 'Dashboard-change in property: first_name', + 'triggerData.journeyId': 'a78d7221-de34-47d8-81c6-5ad70cf4ee38', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + triggerData: { + data: {}, + formSubmissionData: { + element6ehxt3: 'Te**', + element6jkcy4: 'Bang****', + fuuid: '47949', + 'next-step-id': 'step7tr7n2', + 'total-steps': '3', + responseId: '4a8bfda7-****-4a8c-9cd1-a30d30a6dab9', + recipientEmail: 'gou****@mailmodo.com', + formId: 'formmqxnu2', + recordedAt: { ts: 1657097786, date: '2022-07-06', hour: 14, minute: 26 }, + submissionSource: 'amp', + }, + email: 'gou****@mailmodo.com', + triggerSource: 'form submission', + userId: '11bff3e8-****-4e93-a533-fd8f9defc768', + journeyId: '03664747-****-412e-8790-de9e9abe96a5', + eventProperty: {}, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', + context: { + externalId: [ + { id: '11bff3e8-****-4e93-a533-fd8f9defc768', type: 'mailmodoUserId' }, + ], + traits: { email: 'gou****@mailmodo.com' }, + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'form submission', + integrations: { Mailmodo: false }, + originalTimestamp: '2022-07-06T08:56:26.000Z', + properties: { + 'triggerData.triggerSource': 'form submission', + 'triggerData.formSubmissionData.element6ehxt3': 'Te**', + 'triggerData.formSubmissionData.element6jkcy4': 'Bang****', + 'triggerData.formSubmissionData.formId': 'formmqxnu2', + 'triggerData.formSubmissionData.fuuid': '47949', + 'triggerData.formSubmissionData.next-step-id': 'step7tr7n2', + 'triggerData.formSubmissionData.responseId': + '4a8bfda7-****-4a8c-9cd1-a30d30a6dab9', + 'triggerData.formSubmissionData.submissionSource': 'amp', + 'triggerData.formSubmissionData.total-steps': '3', + 'triggerData.journeyId': '03664747-****-412e-8790-de9e9abe96a5', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-5', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + triggerData: { + data: {}, + eventProperty: { + Name: 'APPLE iPhone 13 (Blue, 128 GB)', + Category: 'Mobiles', + 'Is Purchased': 'false', + Price: '829', + Currency: 'USD', + }, + triggerSource: 'New Custom Event Trigger - Product Viewed', + email: 'gou****@mailmodo.com', + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: '3f135bf7-****-4e31-b265-f61cfe1bd423', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', + context: { + externalId: [ + { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + ], + traits: { email: 'gou****@mailmodo.com' }, + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'New Custom Event Trigger - Product Viewed', + integrations: { Mailmodo: false }, + properties: { + 'triggerData.eventProperty.Category': 'Mobiles', + 'triggerData.eventProperty.Currency': 'USD', + 'triggerData.eventProperty.Is Purchased': 'false', + 'triggerData.eventProperty.Name': 'APPLE iPhone 13 (Blue, 128 GB)', + 'triggerData.eventProperty.Price': '829', + 'triggerData.journeyId': '3f135bf7-****-4e31-b265-f61cfe1bd423', + 'triggerData.triggerSource': 'New Custom Event Trigger - Product Viewed', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-6', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + triggerData: { + email: 'gou****@mailmodo.com', + data: {}, + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: 'b1ee6bf6-****-4b5a-b7b5-0637853cd8c3', + triggerSource: 'Api', + eventProperty: {}, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', + context: { + externalId: [ + { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + ], + traits: { email: 'gou****@mailmodo.com' }, + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'Api', + integrations: { Mailmodo: false }, + properties: { + 'triggerData.triggerSource': 'Api', + 'triggerData.journeyId': 'b1ee6bf6-****-4b5a-b7b5-0637853cd8c3', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-7', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventData: { type: 'html' }, + triggerData: { + data: {}, + triggerSource: 'CsvList', + email: 'gou****@mailmodo.com', + triggerDetails: + 'file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af', + userId: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', + journeyId: '5d31c2b4-****-4a84-acd3-834cae80231b', + eventProperty: {}, + }, + lastCampaignEmailRef: '064c76e7-****-4780-a001-226c066aaa12', + lastCampaignId: '31422f76-****-4a72-a630-dd6f9f615bc3', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', + context: { + externalId: [ + { id: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', type: 'mailmodoUserId' }, + ], + traits: { email: 'gou****@mailmodo.com' }, + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'CsvList', + integrations: { Mailmodo: false }, + properties: { + 'eventData.type': 'html', + lastCampaignEmailRef: '064c76e7-****-4780-a001-226c066aaa12', + lastCampaignId: '31422f76-****-4a72-a630-dd6f9f615bc3', + 'triggerData.journeyId': '5d31c2b4-****-4a84-acd3-834cae80231b', + 'triggerData.triggerDetails': + 'file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af', + 'triggerData.triggerSource': 'CsvList', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'mailmodo', + description: 'test-8', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + fuuid: '98255', + 'next-step-id': 'success', + 'total-steps': '3', + responseId: 'ad20a980-4fce-44b6-887d-2236df514a76', + recipientEmail: 'test@rudderstack.com', + formId: 'formosztd5', + recordedAt: { ts: 1662695887, date: '2022-09-09', hour: 9, minute: 28 }, + submissionSource: 'amp', + elementjbtz42: 'peace', + element8jzo13: ['Useful'], + recipientData: { email: 'test@rudderstack.com', first_name: 'abcda' }, + recommend: '1', + liking: 'downvote', + satisfaction: '1', + campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', + campaignName: 'Campaign-testing', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '1c5e54849f5c711ce38fa60716fbbe44bff478f9ca250897b39cdfc2438cd1bd', + context: { + integration: { name: 'Mailmodo', version: '1.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + traits: { email: 'test@rudderstack.com', first_name: 'abcda' }, + }, + event: 'Form Submitted', + integrations: { Mailmodo: false }, + originalTimestamp: '2022-09-09T03:58:07.000Z', + properties: { + fuuid: '98255', + 'next-step-id': 'success', + 'total-steps': '3', + responseId: 'ad20a980-4fce-44b6-887d-2236df514a76', + formId: 'formosztd5', + submissionSource: 'amp', + elementjbtz42: 'peace', + 'element8jzo13[0]': 'Useful', + recommend: '1', + liking: 'downvote', + satisfaction: '1', + campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', + campaignName: 'Campaign-testing', + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/moengage/data.ts b/test/integrations/sources/moengage/data.ts index e8160ae08b..c307959121 100644 --- a/test/integrations/sources/moengage/data.ts +++ b/test/integrations/sources/moengage/data.ts @@ -264,6 +264,8 @@ const data = [ description: 'Batch of events', module: 'source', version: 'v0', + overrideReceivedAt: true, + overrideRequestIP: true, input: { request: { body: [ diff --git a/test/integrations/sources/monday/data.ts b/test/integrations/sources/monday/data.ts new file mode 100644 index 0000000000..1bb2693090 --- /dev/null +++ b/test/integrations/sources/monday/data.ts @@ -0,0 +1,454 @@ +export const data = [ + { + name: 'monday', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + pulseId: 3160188786, + pulseName: 'New Sprint Item', + groupId: 'topics', + groupName: 'Group Title', + groupColor: '#579bfc', + isTopGroup: true, + columnValues: {}, + app: 'monday', + type: 'create_pulse', + triggerTime: '2022-08-30T09:02:39.191Z', + subscriptionId: 150881106, + triggerUuid: '049869226bf6711705c62e301a2c3eee', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Create Pulse', + context: { + library: { name: 'unknown', version: 'unknown' }, + externalId: [{ id: 33556506, type: 'mondayUserId' }], + integration: { name: 'MONDAY' }, + }, + timestamp: '2022-08-30T09:02:39.191Z', + properties: { + app: 'monday', + type: 'create_pulse', + boardId: 3139815405, + groupId: 'topics', + pulseId: 3160188786, + groupName: 'Group Title', + pulseName: 'New Sprint Item', + groupColor: '#579bfc', + isTopGroup: true, + triggerUuid: '049869226bf6711705c62e301a2c3eee', + columnValues: {}, + subscriptionId: 150881106, + originalTriggerUuid: null, + }, + anonymousId: '6f0a3dc76a335860e17fa1d8ab779742e2ca', + integrations: { MONDAY: false }, + originalTimestamp: '2022-08-30T09:02:39.191Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + itemId: 3160188786, + itemName: 'New Sprint Item', + app: 'monday', + type: 'delete_pulse', + triggerTime: '2022-08-30T09:06:09.176Z', + subscriptionId: 150882006, + triggerUuid: '4e4f87c8255c4ba4ba2f5e9934cb6d40', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Delete Pulse', + context: { + library: { name: 'unknown', version: 'unknown' }, + externalId: [{ id: 33556506, type: 'mondayUserId' }], + integration: { name: 'MONDAY' }, + }, + timestamp: '2022-08-30T09:06:09.176Z', + properties: { + app: 'monday', + type: 'delete_pulse', + itemId: 3160188786, + boardId: 3139815405, + itemName: 'New Sprint Item', + triggerUuid: '4e4f87c8255c4ba4ba2f5e9934cb6d40', + subscriptionId: 150882006, + originalTriggerUuid: null, + }, + anonymousId: '6f0a3dc76a335860e17fa1d8ab779742e2ca', + integrations: { MONDAY: false }, + originalTimestamp: '2022-08-30T09:06:09.176Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + groupId: 'topics', + pulseId: 3160181387, + pulseName: 'New Sprint Item', + columnId: 'status', + columnType: 'color', + columnTitle: 'Status', + value: { + label: { + index: 1, + text: 'Done', + style: { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + is_done: true, + }, + post_id: null, + }, + previousValue: null, + changedAt: 1661859406.8970098, + isTopGroup: true, + app: 'monday', + type: 'update_column_value', + triggerTime: '2022-08-30T11:36:47.406Z', + subscriptionId: 150894742, + triggerUuid: '51730730740a9d00ec45203bd392a9bd', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Update Column Value', + context: { + library: { name: 'unknown', version: 'unknown' }, + externalId: [{ id: 33556506, type: 'mondayUserId' }], + integration: { name: 'MONDAY' }, + }, + timestamp: '2022-08-30T11:36:47.406Z', + properties: { + app: 'monday', + type: 'update_column_value', + value: { + label: { + text: 'Done', + index: 1, + style: { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + is_done: true, + }, + post_id: null, + }, + boardId: 3139815405, + groupId: 'topics', + pulseId: 3160181387, + columnId: 'status', + changedAt: 1661859406.8970098, + pulseName: 'New Sprint Item', + columnType: 'color', + isTopGroup: true, + columnTitle: 'Status', + triggerUuid: '51730730740a9d00ec45203bd392a9bd', + previousValue: null, + subscriptionId: 150894742, + originalTriggerUuid: null, + }, + anonymousId: '6f0a3dc76a335860e17fa1d8ab779742e2ca', + integrations: { MONDAY: false }, + originalTimestamp: '2022-08-30T11:36:47.406Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + groupId: 'topics', + pulseId: 3160181387, + value: { name: 'New Sprint Item renamed' }, + previousValue: { name: 'New Sprint Item' }, + app: 'monday', + type: 'update_name', + triggerTime: '2022-08-30T11:40:17.351Z', + subscriptionId: 150910867, + triggerUuid: '05ce13d32d0256c4fb7dd5de25b1a1ba', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Update Name', + context: { + library: { name: 'unknown', version: 'unknown' }, + externalId: [{ id: 33556506, type: 'mondayUserId' }], + integration: { name: 'MONDAY' }, + }, + timestamp: '2022-08-30T11:40:17.351Z', + properties: { + app: 'monday', + type: 'update_name', + value: { name: 'New Sprint Item renamed' }, + boardId: 3139815405, + groupId: 'topics', + pulseId: 3160181387, + triggerUuid: '05ce13d32d0256c4fb7dd5de25b1a1ba', + previousValue: { name: 'New Sprint Item' }, + subscriptionId: 150910867, + originalTriggerUuid: null, + }, + anonymousId: '6f0a3dc76a335860e17fa1d8ab779742e2ca', + integrations: { MONDAY: false }, + originalTimestamp: '2022-08-30T11:40:17.351Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3160805239, + pulseId: 3161163765, + pulseName: 'new subitem', + groupId: 'topics', + groupName: 'Subitems', + groupColor: '#579bfc', + isTopGroup: true, + columnValues: {}, + app: 'monday', + type: 'create_pulse', + triggerTime: '2022-08-30T12:56:27.281Z', + subscriptionId: 150911592, + triggerUuid: '70a2219427804e47a508a91b5c244543', + parentItemId: '3160181387', + parentItemBoardId: '3139815405', + itemId: 3161163765, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Create Pulse', + context: { + library: { name: 'unknown', version: 'unknown' }, + externalId: [{ id: 33556506, type: 'mondayUserId' }], + integration: { name: 'MONDAY' }, + }, + timestamp: '2022-08-30T12:56:27.281Z', + properties: { + app: 'monday', + type: 'create_pulse', + itemId: 3161163765, + boardId: 3160805239, + groupId: 'topics', + pulseId: 3161163765, + groupName: 'Subitems', + pulseName: 'new subitem', + groupColor: '#579bfc', + isTopGroup: true, + triggerUuid: '70a2219427804e47a508a91b5c244543', + columnValues: {}, + parentItemId: '3160181387', + subscriptionId: 150911592, + parentItemBoardId: '3139815405', + originalTriggerUuid: null, + }, + anonymousId: '6f0a3dc76a335860e17fa1d8ab779742e2ca', + integrations: { MONDAY: false }, + originalTimestamp: '2022-08-30T12:56:27.281Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'monday', + description: 'test-5', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + itemId: 3160181387, + itemName: 'New Sprint Item renamed', + app: 'monday', + type: 'archive_pulse', + triggerTime: '2022-08-30T12:58:15.844Z', + subscriptionId: 150925947, + triggerUuid: 'aa8bd5dbb6fd592aedd57322dd776379', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Archive Pulse', + context: { + library: { name: 'unknown', version: 'unknown' }, + externalId: [{ id: 33556506, type: 'mondayUserId' }], + integration: { name: 'MONDAY' }, + }, + timestamp: '2022-08-30T12:58:15.844Z', + properties: { + app: 'monday', + type: 'archive_pulse', + itemId: 3160181387, + boardId: 3139815405, + itemName: 'New Sprint Item renamed', + triggerUuid: 'aa8bd5dbb6fd592aedd57322dd776379', + subscriptionId: 150925947, + originalTriggerUuid: null, + }, + anonymousId: '6f0a3dc76a335860e17fa1d8ab779742e2ca', + integrations: { MONDAY: false }, + originalTimestamp: '2022-08-30T12:58:15.844Z', + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/olark/data.ts b/test/integrations/sources/olark/data.ts new file mode 100644 index 0000000000..3486e84907 --- /dev/null +++ b/test/integrations/sources/olark/data.ts @@ -0,0 +1,301 @@ +export const data = [ + { + name: 'olark', + description: 'Olark webhook response', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + kind: 'Conversation', + id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', + manuallySubmitted: false, + items: [ + { + kind: 'OfflineMessage', + timestamp: '1669285628.796693', + body: 'name: test rudderlabs\nemail: ruddertest@gmail.com\nMessage: I am Fine', + }, + ], + tags: [], + visitor: { + kind: 'Visitor', + id: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', + fullName: 'test', + emailAddress: 'ruddertest@gmail.com', + ip: '', + country: 'India', + countryCode: 'IN', + browser: 'Chrome 105.0.0.0', + operatingSystem: 'Macintosh', + conversationBeginPage: 'http://localhost:5503/', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Conversation', + traits: {}, + userId: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', + context: { + os: { name: 'Macintosh' }, + page: { url: 'http://localhost:5503/' }, + traits: { name: 'test', email: 'ruddertest@gmail.com', country: 'India' }, + browser: { name: 'Chrome', version: '105.0.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Olark' }, + }, + properties: { + tags: [], + items: [ + { + body: 'name: test rudderlabs\nemail: ruddertest@gmail.com\nMessage: I am Fine', + kind: 'OfflineMessage', + timestamp: '1669285628.796693', + }, + ], + }, + integrations: { Olark: false }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'olark', + description: 'Olark webhook response', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + kind: 'Conversation', + id: 'NOTAREALTRANSCRIPT5LGcbVTa3hKBRB', + manuallySubmitted: false, + items: [ + { + kind: 'MessageToVisitor', + nickname: 'Olark operator', + operatorId: '6208911878914048', + timestamp: '1473774819.263083', + body: 'Hi from an operator', + }, + { + kind: 'MessageToOperator', + nickname: 'Returning Visitor | USA (San Francisco, CA) #7617', + timestamp: '1473774821.411154', + body: 'Hi from a visitor', + visitor_nickname: 'Olark Visitor', + }, + ], + tags: ['test_example'], + visitor: { + kind: 'Visitor', + id: 'NOTAREALVISITORIDS5LGl6QUrK2OaPP', + fullName: 'Olark', + phoneNumber: '5555555555', + emailAddress: 'support+integrationtest@olark.com', + ip: '', + city: 'San Francisco', + region: 'CA', + country: 'United States', + countryCode: 'US', + organization: 'Visitor Organization', + browser: 'Internet Explorer 11', + operatingSystem: 'Windows', + referrer: 'http://www.olark.com', + conversationBeginPage: 'http://www.olark.com', + chat_feedback: { overall_chat: 4, responsiveness: 5, knowledge: 4, friendliness: 5 }, + }, + operators: { + '6208911878914048': { + kind: 'Operator', + id: '6208911878914048', + nickname: 'integration', + emailAddress: 'integration-accounts@rudderstack.com', + username: 'integration-accounts-92750bc547', + }, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Conversation', + traits: { + organization: 'Visitor Organization', + chat_feedback: { + knowledge: 4, + friendliness: 5, + overall_chat: 4, + responsiveness: 5, + }, + }, + userId: 'NOTAREALVISITORIDS5LGl6QUrK2OaPP', + context: { + os: { name: 'Windows' }, + page: { url: 'http://www.olark.com', referrer: 'http://www.olark.com' }, + traits: { + city: 'San Francisco', + name: 'Olark', + email: 'support+integrationtest@olark.com', + phone: '5555555555', + region: 'CA', + country: 'United States', + }, + browser: { name: 'Internet Explorer', version: '11' }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Olark' }, + }, + properties: { + tags: ['test_example'], + items: [ + { + body: 'Hi from an operator', + kind: 'MessageToVisitor', + nickname: 'Olark operator', + timestamp: '1473774819.263083', + operatorId: '6208911878914048', + }, + { + body: 'Hi from a visitor', + kind: 'MessageToOperator', + nickname: 'Returning Visitor | USA (San Francisco, CA) #7617', + timestamp: '1473774821.411154', + visitor_nickname: 'Olark Visitor', + }, + ], + }, + integrations: { Olark: false }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'olark', + description: 'Olark webhook response', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + kind: 'Conversation', + id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', + manuallySubmitted: false, + items: [ + { + kind: 'OfflineMessage', + timestamp: '1669288532.567071', + body: 'name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv', + }, + ], + tags: [], + groups: [{ kind: 'Group', id: 'ca77f4296fb7568909ad864aebf48201', name: 'Group 1' }], + visitor: { + kind: 'Visitor', + id: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', + fullName: 'test rudderstack', + emailAddress: 'rudder14@gmail.com', + ip: '', + country: 'India', + countryCode: 'IN', + browser: 'Chrome 105.0.0.0', + operatingSystem: 'Macintosh', + conversationBeginPage: 'http://localhost:5503/', + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Conversation', + traits: {}, + userId: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', + context: { + os: { name: 'Macintosh' }, + page: { url: 'http://localhost:5503/' }, + traits: { + name: 'test rudderstack', + email: 'rudder14@gmail.com', + country: 'India', + }, + browser: { name: 'Chrome', version: '105.0.0.0' }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Olark' }, + }, + properties: { + tags: [], + items: [ + { + body: 'name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv', + kind: 'OfflineMessage', + timestamp: '1669288532.567071', + }, + ], + }, + integrations: { Olark: false }, + }, + { + name: 'Group 1', + type: 'group', + traits: { kind: 'Group' }, + userId: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Olark' }, + }, + groupId: 'ca77f4296fb7568909ad864aebf48201', + integrations: { Olark: false }, + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/pagerduty/data.ts b/test/integrations/sources/pagerduty/data.ts new file mode 100644 index 0000000000..fdfee6fc0d --- /dev/null +++ b/test/integrations/sources/pagerduty/data.ts @@ -0,0 +1,725 @@ +export const data = [ + { + name: 'pagerduty', + description: 'Incident Triggered', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + id: '01DEN0V2VIFEN5871PQGX72URP', + event_type: 'incident.triggered', + resource_type: 'incident', + occurred_at: '2022-12-07T10:56:52.337Z', + agent: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + client: { name: 'Monitoring Service', url: 'https://monitoring.service.com' }, + data: { + id: 'Q3S7IX2U5KTCOY', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + number: 2, + status: 'triggered', + incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', + created_at: '2022-12-07T10:56:52Z', + title: 'Server Crashed', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [ + { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + ], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + summary: 'P1', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: null, + resolve_reason: null, + }, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Incident Triggered', + userId: 'PXZZD2E', + context: { + traits: { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'PagerDuty' }, + }, + messageId: '01DEN0V2VIFEN5871PQGX72URP', + properties: { + data: { + id: 'Q3S7IX2U5KTCOY', + self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + type: 'incident', + teams: [], + title: 'Server Crashed', + number: 2, + status: 'triggered', + service: { + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + type: 'service_reference', + summary: 'Database', + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + }, + urgency: 'high', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + priority: { + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + type: 'priority_reference', + summary: 'P1', + html_url: + 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + }, + assignees: [ + { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + ], + created_at: '2022-12-07T10:56:52Z', + incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', + resolve_reason: null, + conference_bridge: null, + escalation_policy: { + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + type: 'escalation_policy_reference', + summary: 'Default', + html_url: + 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + }, + }, + client: { url: 'https://monitoring.service.com', name: 'Monitoring Service' }, + resourceType: 'incident', + }, + integrations: { PagerDuty: false }, + originalTimestamp: '2022-12-07T10:56:52.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pagerduty', + description: 'Incident Priority Updated', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + id: '01DFU6P4VDDZCIHVQ5Q0ME99OE', + event_type: 'incident.priority_updated', + resource_type: 'incident', + occurred_at: '2022-12-20T11:43:24.342Z', + agent: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + client: null, + data: { + id: 'Q1KRTY75EUMGM0', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + number: 7, + status: 'acknowledged', + incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', + created_at: '2022-12-20T11:37:19Z', + title: 'Event Stream Failure', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [ + { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + ], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + summary: 'P1', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: null, + resolve_reason: null, + }, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Incident Priority Updated', + userId: 'PXZZD2E', + context: { + traits: { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'PagerDuty' }, + }, + messageId: '01DFU6P4VDDZCIHVQ5Q0ME99OE', + properties: { + data: { + id: 'Q1KRTY75EUMGM0', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + type: 'incident', + teams: [], + title: 'Event Stream Failure', + number: 7, + status: 'acknowledged', + service: { + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + type: 'service_reference', + summary: 'Database', + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + }, + urgency: 'high', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + priority: { + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + type: 'priority_reference', + summary: 'P1', + html_url: + 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + }, + assignees: [ + { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + ], + created_at: '2022-12-20T11:37:19Z', + incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', + resolve_reason: null, + conference_bridge: null, + escalation_policy: { + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + type: 'escalation_policy_reference', + summary: 'Default', + html_url: + 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + }, + }, + resourceType: 'incident', + }, + integrations: { PagerDuty: false }, + originalTimestamp: '2022-12-20T11:43:24.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pagerduty', + description: 'Incident Responder Added', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + id: '01DFU6Z1ZCLMV9SEK3X5JZ5WLW', + event_type: 'incident.responder.added', + resource_type: 'incident', + occurred_at: '2022-12-20T11:46:44.213Z', + agent: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + client: null, + data: { + incident: { + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + id: 'Q1KRTY75EUMGM0', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + summary: 'Event Stream Failure', + type: 'incident_reference', + }, + user: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + escalation_policy: null, + message: 'Please help with "Event Stream Failure"', + state: 'pending', + type: 'incident_responder', + }, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Incident Responder Added', + userId: 'PXZZD2E', + context: { + traits: { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'PagerDuty' }, + }, + messageId: '01DFU6Z1ZCLMV9SEK3X5JZ5WLW', + properties: { + data: { + type: 'incident_responder', + user: { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + state: 'pending', + message: 'Please help with "Event Stream Failure"', + incident: { + id: 'Q1KRTY75EUMGM0', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + type: 'incident_reference', + summary: 'Event Stream Failure', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + }, + escalation_policy: null, + }, + resourceType: 'incident', + }, + integrations: { PagerDuty: false }, + originalTimestamp: '2022-12-20T11:46:44.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pagerduty', + description: 'Incident Escalated', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + id: '01DFU77KTKK9UUYX779UX0N1ZP', + event_type: 'incident.escalated', + resource_type: 'incident', + occurred_at: '2022-12-20T11:49:35.385Z', + agent: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + client: null, + data: { + id: 'Q1KRTY75EUMGM0', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + number: 7, + status: 'triggered', + incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', + created_at: '2022-12-20T11:37:19Z', + title: 'Event Stream Failure', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [ + { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + ], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + summary: 'P1', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: null, + resolve_reason: null, + }, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Incident Escalated', + userId: 'PXZZD2E', + context: { + traits: { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'PagerDuty' }, + }, + messageId: '01DFU77KTKK9UUYX779UX0N1ZP', + properties: { + data: { + id: 'Q1KRTY75EUMGM0', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + type: 'incident', + teams: [], + title: 'Event Stream Failure', + number: 7, + status: 'triggered', + service: { + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + type: 'service_reference', + summary: 'Database', + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + }, + urgency: 'high', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + priority: { + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + type: 'priority_reference', + summary: 'P1', + html_url: + 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + }, + assignees: [ + { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + ], + created_at: '2022-12-20T11:37:19Z', + incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', + resolve_reason: null, + conference_bridge: null, + escalation_policy: { + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + type: 'escalation_policy_reference', + summary: 'Default', + html_url: + 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + }, + }, + resourceType: 'incident', + }, + integrations: { PagerDuty: false }, + originalTimestamp: '2022-12-20T11:49:35.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pagerduty', + description: 'Incident Resolved', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: { + id: '01DEN1HNLBC1VITK192ETJ1MPJ', + event_type: 'incident.resolved', + resource_type: 'incident', + occurred_at: '2022-12-07T11:04:27.459Z', + agent: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + client: null, + data: { + id: 'Q3S7IX2U5KTCOY', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + number: 2, + status: 'resolved', + incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', + created_at: '2022-12-07T10:56:52Z', + title: 'Server Crashed', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'P5DBC3A', + self: 'https://api.pagerduty.com/priorities/P5DBC3A', + summary: 'P3', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: { conference_number: '', conference_url: '' }, + resolve_reason: null, + }, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'Incident Resolved', + userId: 'PXZZD2E', + context: { + traits: { + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + type: 'user_reference', + summary: 'rudder test', + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'PagerDuty' }, + }, + messageId: '01DEN1HNLBC1VITK192ETJ1MPJ', + properties: { + data: { + id: 'Q3S7IX2U5KTCOY', + self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + type: 'incident', + teams: [], + title: 'Server Crashed', + number: 2, + status: 'resolved', + service: { + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + type: 'service_reference', + summary: 'Database', + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + }, + urgency: 'high', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + priority: { + id: 'P5DBC3A', + self: 'https://api.pagerduty.com/priorities/P5DBC3A', + type: 'priority_reference', + summary: 'P3', + html_url: + 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + }, + assignees: [], + created_at: '2022-12-07T10:56:52Z', + incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', + resolve_reason: null, + conference_bridge: { conference_url: '', conference_number: '' }, + escalation_policy: { + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + type: 'escalation_policy_reference', + summary: 'Default', + html_url: + 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + }, + }, + resourceType: 'incident', + }, + integrations: { PagerDuty: false }, + originalTimestamp: '2022-12-07T11:04:27.000Z', + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/pipedream/data.ts b/test/integrations/sources/pipedream/data.ts new file mode 100644 index 0000000000..4be5621f0c --- /dev/null +++ b/test/integrations/sources/pipedream/data.ts @@ -0,0 +1,345 @@ +export const data = [ + { + name: 'pipedream', + description: 'No type or userId is given', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + anonymousId: '63767499ca6fb1b7c988d5bb', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + event: 'pipedream_source_event', + anonymousId: '63767499ca6fb1b7c988d5bb', + context: { + integration: { name: 'PIPEDREAM' }, + library: { name: 'unknown', version: 'unknown' }, + }, + integrations: { PIPEDREAM: false }, + type: 'track', + properties: { + anonymousId: '63767499ca6fb1b7c988d5bb', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pipedream', + description: 'No type or anonymousId is given', + module: 'source', + version: 'v0', + input: { + request: { + body: [{ userId: '12', artist: 'Gautam', genre: 'Jazz', song: 'Take Five' }], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + event: 'pipedream_source_event', + anonymousId: '12', + context: { + integration: { name: 'PIPEDREAM' }, + library: { name: 'unknown', version: 'unknown' }, + }, + integrations: { PIPEDREAM: false }, + type: 'track', + properties: { userId: '12', artist: 'Gautam', genre: 'Jazz', song: 'Take Five' }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pipedream', + description: 'Track Call -> type and userId is given', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + event: 'Song Played', + userId: 'R1234', + context: { + library: { name: 'unknown', version: 'unknown' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + userDeleted: false, + }, + locale: 'en', + location: { country: 'IN', countryName: 'India', short: 'India', long: 'India' }, + device: { os: 'macOS', type: 'desktop' }, + page: { referrer: 'http://127.0.0.1:5500/testSm.html' }, + }, + type: 'track', + properties: { artist: 'John', Album: 'ABCD' }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + event: 'Song Played', + userId: 'R1234', + context: { + library: { name: 'unknown', version: 'unknown' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + userDeleted: false, + }, + locale: 'en', + location: { + country: 'IN', + countryName: 'India', + short: 'India', + long: 'India', + }, + device: { os: 'macOS', type: 'desktop' }, + page: { referrer: 'http://127.0.0.1:5500/testSm.html' }, + }, + type: 'track', + properties: { artist: 'John', Album: 'ABCD' }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pipedream', + description: 'Identify type -> type and userId is given', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + userId: '1', + originalTimestamp: '2020-09-28T19:53:31.900Z', + traits: { + firstName: 'John', + lastName: 'doe', + email: 'John@r.com', + hasPurchased: 'yes', + address: { Home: { city: 'iudcb' }, Office: { abc: 'jbc' } }, + state: 'Delhi', + title: 'Mr', + }, + timestamp: '2020-09-29T14:50:29.907+05:30', + type: 'identify', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: '1', + originalTimestamp: '2020-09-28T19:53:31.900Z', + traits: { + firstName: 'John', + lastName: 'doe', + email: 'John@r.com', + hasPurchased: 'yes', + address: { Home: { city: 'iudcb' }, Office: { abc: 'jbc' } }, + state: 'Delhi', + title: 'Mr', + }, + timestamp: '2020-09-29T14:50:29.907+05:30', + type: 'identify', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pipedream', + description: 'Group type -> type and userId is given', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + userId: 'user123', + groupId: '17', + context: {}, + traits: { operation: 'add' }, + type: 'group', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + userId: 'user123', + groupId: '17', + context: {}, + traits: { operation: 'add' }, + type: 'group', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pipedream', + description: 'Page type -> type and userId is given', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + anonymousId: '21e13f4bc7ceddad', + channel: 'mobile', + context: { + os: { name: 'Android', version: '9' }, + timezone: 'Asia/Kolkata', + traits: { customProp: 'customValue' }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + name: 'Home', + properties: { title: 'Home | RudderStack', url: 'http://www.rudderstack.com' }, + receivedAt: '2020-09-29T14:50:43.005+05:30', + type: 'page', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: '21e13f4bc7ceddad', + channel: 'mobile', + context: { + os: { name: 'Android', version: '9' }, + timezone: 'Asia/Kolkata', + traits: { customProp: 'customValue' }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + name: 'Home', + properties: { title: 'Home | RudderStack', url: 'http://www.rudderstack.com' }, + receivedAt: '2020-09-29T14:50:43.005+05:30', + type: 'page', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'pipedream', + description: 'Alias type -> type and userId is given', + module: 'source', + version: 'v0', + input: { + request: { + body: [{ type: 'alias', previousId: 'name@surname.com', userId: '12345' }], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { batch: [{ type: 'alias', previousId: 'name@surname.com', userId: '12345' }] }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/refiner/data.ts b/test/integrations/sources/refiner/data.ts new file mode 100644 index 0000000000..255004322c --- /dev/null +++ b/test/integrations/sources/refiner/data.ts @@ -0,0 +1,391 @@ +export const data = [ + { + name: 'refiner', + description: 'Refiner webhook response', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + uuid: 'd769e130-49cf-11ed-968d-936a69fadf81', + project_uuid: '0d8759d0-401c-11ed-8ded-9757c4929b55', + remote_id: 'user@17', + email: 'test17@user.com', + display_name: 'test user', + first_seen_at: '2022-10-12T01:47:33.000000Z', + last_seen_at: '2022-10-12T02:00:00.000000Z', + attributes: { + address: null, + address_city: null, + address_state: null, + age: null, + another_attribute: null, + city: null, + country: null, + created_at: null, + email: 'test17@user.com', + event: null, + first_name: null, + first_seen_at: '2022-10-12T01:47:33.000000Z', + form_submissions_count: '1', + form_views_count: '2', + gender: null, + last_form_submission_at: '2022-10-12T02:05:55.000000Z', + last_form_view_at: '2022-10-12T02:03:46.000000Z', + last_name: null, + last_seen_at: '2022-10-12T02:00:00.000000Z', + name: 'test user', + phone: null, + some_attribute: null, + status: null, + student: null, + tag: null, + trait1: null, + trait2: null, + trait3: null, + url: null, + user_address_city: null, + user_address_state: null, + user_country: null, + user_id: null, + username: null, + useroccupation: null, + why_did_you_cancel_your_subscription: 'Pricing', + }, + segments: [ + { + uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', + name: 'All Users', + created_at: '2022-10-12T01:47:34.000000Z', + updated_at: '2022-10-12T01:47:34.000000Z', + }, + { + uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', + name: 'test-segment', + created_at: '2022-10-12T01:47:34.000000Z', + updated_at: '2022-10-12T01:47:34.000000Z', + }, + ], + account: { + uuid: 'd76c9e80-49cf-11ed-a783-6317eca951a6', + remote_id: 'ACCOUNT-ID-ABC-1', + domain: null, + display_name: 'Awesome Inc.', + first_seen_at: '2022-10-12T01:47:33.000000Z', + last_seen_at: '2022-10-12T02:00:00.000000Z', + attributes: { + a_date_at: '2022-10-01T00:00:00.000000Z', + business_email: null, + company: null, + email: null, + isfunded: null, + name: 'Awesome Inc.', + revenue: null, + some_account_data: 'something', + trait1: null, + trait2: null, + trait3: null, + }, + }, + triggered_event: 'Completed Survey', + form: { uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', name: 'Customer Churn Survey' }, + response: { + uuid: 'eb117cb0-49cf-11ed-b050-03a44b32151c', + first_shown_at: '2022-10-12T01:48:06.000000Z', + last_shown_at: '2022-10-12T02:03:46.000000Z', + show_counter: null, + first_data_reception_at: '2022-10-12T02:05:55.000000Z', + last_data_reception_at: '2022-10-12T02:05:55.000000Z', + completed_at: '2022-10-12T02:05:55.000000Z', + dismissed_at: null, + received_at: '2022-10-12T02:05:55.000000Z', + data: { why_did_you_cancel_your_subscription: 'Pricing' }, + tags: [], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + traits: { + email: 'test17@user.com', + segments: [ + { + name: 'All Users', + uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', + created_at: '2022-10-12T01:47:34.000000Z', + updated_at: '2022-10-12T01:47:34.000000Z', + }, + { + name: 'test-segment', + uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', + created_at: '2022-10-12T01:47:34.000000Z', + updated_at: '2022-10-12T01:47:34.000000Z', + }, + ], + }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Refiner' }, + formUuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + formName: 'Customer Churn Survey', + }, + integrations: { Refiner: false }, + type: 'identify', + userId: 'user@17', + traits: { why_did_you_cancel_your_subscription: 'Pricing' }, + originalTimestamp: '2022-10-12T02:05:55.000000Z', + }, + { + type: 'track', + event: 'Completed Survey', + userId: 'user@17', + context: { + library: { name: 'unknown', version: 'unknown' }, + formName: 'Customer Churn Survey', + formUuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + integration: { name: 'Refiner' }, + }, + properties: { + response: { + data: { why_did_you_cancel_your_subscription: 'Pricing' }, + tags: [], + uuid: 'eb117cb0-49cf-11ed-b050-03a44b32151c', + received_at: '2022-10-12T02:05:55.000000Z', + completed_at: '2022-10-12T02:05:55.000000Z', + last_shown_at: '2022-10-12T02:03:46.000000Z', + first_shown_at: '2022-10-12T01:48:06.000000Z', + last_data_reception_at: '2022-10-12T02:05:55.000000Z', + first_data_reception_at: '2022-10-12T02:05:55.000000Z', + }, + refiner_form_name: 'Customer Churn Survey', + refiner_form_uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + }, + integrations: { Refiner: false }, + originalTimestamp: '2022-10-12T02:05:55.000000Z', + }, + { + type: 'group', + traits: { + name: 'Awesome Inc.', + a_date_at: '2022-10-01T00:00:00.000000Z', + some_account_data: 'something', + }, + userId: 'user@17', + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Refiner' }, + }, + groupId: 'ACCOUNT-ID-ABC-1', + integrations: { Refiner: false }, + originalTimestamp: '2022-10-12T02:05:55.000000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'refiner', + description: 'Refiner webhook response', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + uuid: '69b83e20-4ea2-11ed-941c-e1cb6c7a3870', + cookie_uuid: '2f9b7e6a-9ba8-1c68-d474-48d719d92a60', + project_uuid: '0d8759d0-401c-11ed-8ded-9757c4929b55', + remote_id: 'sdk@30', + email: 'sdk30@gmail.com', + display_name: '', + first_seen_at: '2022-10-18T05:04:58.000000Z', + last_seen_at: '2022-10-18T05:04:58.000000Z', + attributes: { + address: null, + address_city: null, + address_state: null, + age: null, + another_attribute: null, + city: null, + country: null, + created_at: null, + email: 'sdk30@gmail.com', + event: null, + first_name: null, + first_seen_at: '2022-10-18T05:04:58.000000Z', + form_submissions_count: '1', + form_views_count: '1', + gender: null, + last_form_submission_at: '2022-10-18T05:05:45.000000Z', + last_form_view_at: '2022-10-18T05:05:29.000000Z', + last_name: null, + last_seen_at: '2022-10-18T05:04:58.000000Z', + name: null, + phone: null, + some_attribute: null, + status: null, + student: null, + tag: null, + trait1: null, + trait2: null, + trait3: null, + url: null, + user_address_city: null, + user_address_state: null, + user_country: null, + user_id: null, + username: null, + useroccupation: null, + why_did_you_cancel_your_subscription: 'Missing features', + }, + segments: [ + { + uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', + name: 'All Users', + created_at: '2022-10-18T05:04:58.000000Z', + updated_at: '2022-10-18T05:04:58.000000Z', + }, + { + uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', + name: 'test-segment', + created_at: '2022-10-18T05:04:58.000000Z', + updated_at: '2022-10-18T05:04:58.000000Z', + }, + ], + account: { + uuid: '69ba2030-4ea2-11ed-adfc-595e70c7ab07', + remote_id: null, + domain: null, + display_name: '', + first_seen_at: '2022-10-18T05:04:58.000000Z', + last_seen_at: '2022-10-18T05:04:58.000000Z', + attributes: { + '1': null, + '2': null, + '3': null, + '4': null, + a_date_at: null, + business_email: null, + company: null, + email: null, + isfunded: null, + location: null, + name: null, + revenue: null, + some_account_data: null, + trait1: null, + trait2: null, + trait3: null, + user_id: null, + }, + }, + triggered_event: 'Completed Survey', + form: { uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', name: 'Customer Churn Survey' }, + response: { + uuid: '7c508c60-4ea2-11ed-9302-57708fe11d26', + first_shown_at: '2022-10-18T05:05:29.000000Z', + last_shown_at: '2022-10-18T05:05:29.000000Z', + show_counter: null, + first_data_reception_at: '2022-10-18T05:05:45.000000Z', + last_data_reception_at: '2022-10-18T05:05:45.000000Z', + completed_at: '2022-10-18T05:05:45.000000Z', + dismissed_at: null, + received_at: '2022-10-18T05:05:45.000000Z', + data: { why_did_you_cancel_your_subscription: 'Missing features' }, + tags: [], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'identify', + traits: { why_did_you_cancel_your_subscription: 'Missing features' }, + userId: 'sdk@30', + context: { + traits: { + email: 'sdk30@gmail.com', + segments: [ + { + name: 'All Users', + uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', + created_at: '2022-10-18T05:04:58.000000Z', + updated_at: '2022-10-18T05:04:58.000000Z', + }, + { + name: 'test-segment', + uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', + created_at: '2022-10-18T05:04:58.000000Z', + updated_at: '2022-10-18T05:04:58.000000Z', + }, + ], + }, + library: { name: 'unknown', version: 'unknown' }, + formName: 'Customer Churn Survey', + formUuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + integration: { name: 'Refiner' }, + }, + integrations: { Refiner: false }, + originalTimestamp: '2022-10-18T05:05:45.000000Z', + }, + { + type: 'track', + event: 'Completed Survey', + userId: 'sdk@30', + context: { + library: { name: 'unknown', version: 'unknown' }, + formName: 'Customer Churn Survey', + formUuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + integration: { name: 'Refiner' }, + }, + properties: { + response: { + data: { why_did_you_cancel_your_subscription: 'Missing features' }, + tags: [], + uuid: '7c508c60-4ea2-11ed-9302-57708fe11d26', + received_at: '2022-10-18T05:05:45.000000Z', + completed_at: '2022-10-18T05:05:45.000000Z', + last_shown_at: '2022-10-18T05:05:29.000000Z', + first_shown_at: '2022-10-18T05:05:29.000000Z', + last_data_reception_at: '2022-10-18T05:05:45.000000Z', + first_data_reception_at: '2022-10-18T05:05:45.000000Z', + }, + refiner_form_name: 'Customer Churn Survey', + refiner_form_uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + }, + integrations: { Refiner: false }, + originalTimestamp: '2022-10-18T05:05:45.000000Z', + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/satismeter/data.ts b/test/integrations/sources/satismeter/data.ts new file mode 100644 index 0000000000..713f527f2c --- /dev/null +++ b/test/integrations/sources/satismeter/data.ts @@ -0,0 +1,426 @@ +export const data = [ + { + name: 'satismeter', + description: ' All fields Check with event as completed', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + response: { + id: '63767499ca6fb1b7c988d5bb', + created: '2022-11-17T17:51:21.764Z', + rating: 5, + feedback: 'Many things to imporve\n', + dismissed: false, + pending: false, + answers: [ + { + label: 'How likely are you to recommend us to your friends and colleagues?', + id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', + value: 5, + name: 'SM_rating', + type: 'scale', + metric: 'nps', + }, + { + label: 'What could we do to improve?', + id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', + value: 'Many things to imporve\n', + name: 'SM_comment', + type: 'long-text', + }, + { + label: 'The company made it easy for me to handle my issue.', + id: '1dc53f60-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'scale', + metric: 'ces', + }, + { + label: 'How satisfied were you with the service you received?', + id: '24c5b290-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'smiley', + metric: 'csat', + }, + { + label: 'How you like to rate the surevy?', + id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', + value: 4, + type: 'scale', + }, + { + label: 'Your Name (Single Answer)', + id: '37a8c000-66a0-11ed-856c-6f39711bf041', + value: 'a', + type: 'single-choice', + }, + { + label: 'Your Name (Multiple Answer)', + id: '4b435da0-66a0-11ed-856c-6f39711bf041', + value: ['a1', 'b1'], + type: 'multiple-choice', + }, + ], + category: 'detractor', + score: -100, + user: { + id: '63766fbb7ac7b72676145338', + name: 'John Doe', + email: 'john@doe.com', + userId: 'No response', + deleted: false, + groups: { group1: 'grooupId' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + }, + }, + device: { os: 'macOS', type: 'desktop' }, + location: { + country: 'IN', + countryName: 'India', + region: '', + city: '', + short: 'India', + long: 'India', + }, + referrer: 'http://127.0.0.1:5500/testSm.html', + method: 'In-app', + language: 'en', + project: '6372247a764986ebee62bf66', + campaign: '6373271b764986ebee62bfca', + }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + }, + campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + event: 'completed', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + event: 'Survey completed', + anonymousId: '63766fbb7ac7b72676145338', + context: { + library: { name: 'unknown', version: 'unknown' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + userDeleted: false, + }, + locale: 'en', + campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + integration: { name: 'SATISMETER' }, + location: { + country: 'IN', + countryName: 'India', + short: 'India', + long: 'India', + }, + device: { os: 'macOS', type: 'desktop' }, + page: { referrer: 'http://127.0.0.1:5500/testSm.html' }, + }, + integrations: { SATISMETER: false }, + type: 'track', + traits: { groups: { group1: 'grooupId' } }, + userId: 'No response', + properties: { + category: 'detractor', + answers: [ + { + label: 'How likely are you to recommend us to your friends and colleagues?', + id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', + value: 5, + name: 'SM_rating', + type: 'scale', + metric: 'nps', + }, + { + label: 'What could we do to improve?', + id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', + value: 'Many things to imporve\n', + name: 'SM_comment', + type: 'long-text', + }, + { + label: 'The company made it easy for me to handle my issue.', + id: '1dc53f60-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'scale', + metric: 'ces', + }, + { + label: 'How satisfied were you with the service you received?', + id: '24c5b290-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'smiley', + metric: 'csat', + }, + { + label: 'How you like to rate the surevy?', + id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', + value: 4, + type: 'scale', + }, + { + label: 'Your Name (Single Answer)', + id: '37a8c000-66a0-11ed-856c-6f39711bf041', + value: 'a', + type: 'single-choice', + }, + { + label: 'Your Name (Multiple Answer)', + id: '4b435da0-66a0-11ed-856c-6f39711bf041', + value: ['a1', 'b1'], + type: 'multiple-choice', + }, + ], + surveyDismissed: false, + surveyPending: false, + receivedAt: '2022-11-17T17:51:21.764Z', + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'satismeter', + description: + ' Neither reponse.user.id or response.user.userId is provided in payload then mapping response.id to anonymousId', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + response: { + id: '63767499ca6fb1b7c988d5bb', + created: '2022-11-17T17:51:21.764Z', + rating: 5, + feedback: 'Many things to imporve\n', + dismissed: false, + pending: false, + answers: [ + { + label: 'How likely are you to recommend us to your friends and colleagues?', + id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', + value: 5, + name: 'SM_rating', + type: 'scale', + metric: 'nps', + }, + { + label: 'What could we do to improve?', + id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', + value: 'Many things to imporve\n', + name: 'SM_comment', + type: 'long-text', + }, + { + label: 'The company made it easy for me to handle my issue.', + id: '1dc53f60-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'scale', + metric: 'ces', + }, + { + label: 'How satisfied were you with the service you received?', + id: '24c5b290-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'smiley', + metric: 'csat', + }, + { + label: 'How you like to rate the surevy?', + id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', + value: 4, + type: 'scale', + }, + { + label: 'Your Name (Single Answer)', + id: '37a8c000-66a0-11ed-856c-6f39711bf041', + value: 'a', + type: 'single-choice', + }, + { + label: 'Your Name (Multiple Answer)', + id: '4b435da0-66a0-11ed-856c-6f39711bf041', + value: ['a1', 'b1'], + type: 'multiple-choice', + }, + ], + category: 'detractor', + score: -100, + user: { + name: 'John Doe', + email: 'john@doe.com', + deleted: false, + groups: { group1: 'grooupId' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + }, + }, + device: { os: 'macOS', type: 'desktop' }, + location: { + country: 'IN', + countryName: 'India', + region: '', + city: '', + short: 'India', + long: 'India', + }, + referrer: 'http://127.0.0.1:5500/testSm.html', + method: 'In-app', + language: 'en', + project: '6372247a764986ebee62bf66', + campaign: '6373271b764986ebee62bfca', + }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + }, + campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + event: 'completed', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + event: 'Survey completed', + anonymousId: '63767499ca6fb1b7c988d5bb', + context: { + library: { name: 'unknown', version: 'unknown' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + userDeleted: false, + }, + locale: 'en', + campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + integration: { name: 'SATISMETER' }, + location: { + country: 'IN', + countryName: 'India', + short: 'India', + long: 'India', + }, + device: { os: 'macOS', type: 'desktop' }, + page: { referrer: 'http://127.0.0.1:5500/testSm.html' }, + }, + integrations: { SATISMETER: false }, + type: 'track', + traits: { groups: { group1: 'grooupId' } }, + properties: { + category: 'detractor', + answers: [ + { + label: 'How likely are you to recommend us to your friends and colleagues?', + id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', + value: 5, + name: 'SM_rating', + type: 'scale', + metric: 'nps', + }, + { + label: 'What could we do to improve?', + id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', + value: 'Many things to imporve\n', + name: 'SM_comment', + type: 'long-text', + }, + { + label: 'The company made it easy for me to handle my issue.', + id: '1dc53f60-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'scale', + metric: 'ces', + }, + { + label: 'How satisfied were you with the service you received?', + id: '24c5b290-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'smiley', + metric: 'csat', + }, + { + label: 'How you like to rate the surevy?', + id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', + value: 4, + type: 'scale', + }, + { + label: 'Your Name (Single Answer)', + id: '37a8c000-66a0-11ed-856c-6f39711bf041', + value: 'a', + type: 'single-choice', + }, + { + label: 'Your Name (Multiple Answer)', + id: '4b435da0-66a0-11ed-856c-6f39711bf041', + value: ['a1', 'b1'], + type: 'multiple-choice', + }, + ], + surveyDismissed: false, + surveyPending: false, + receivedAt: '2022-11-17T17:51:21.764Z', + }, + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/segment/data.ts b/test/integrations/sources/segment/data.ts new file mode 100644 index 0000000000..8c66abd252 --- /dev/null +++ b/test/integrations/sources/segment/data.ts @@ -0,0 +1,241 @@ +import utils from '../../../../src/v0/util'; +import { SrcTestCaseData } from '../../testTypes'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + +export const data: SrcTestCaseData[] = [ + { + name: 'segment', + description: 'test-0', + module: 'source', + version: 'v0', + skipGo: 'NoAnonID error', + input: { + request: { + body: [ + { + date: '2020-07-10T07:43:07.766Z', + type: 's', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }, + { + date: '2020-07-10T07:43:09.620Z', + type: 'seacft', + description: '', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'okhttp 2.7.5 / Other 0.0.0', + details: { code: '*************Xst' }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: false, + }, + { + date: '2020-07-10T07:43:07.766Z', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }, + { + type: 's', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + date: '2020-07-10T07:43:07.766Z', + type: 's', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }, + ], + }, + }, + { + output: { + batch: [ + { + date: '2020-07-10T07:43:09.620Z', + type: 'seacft', + description: '', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'okhttp 2.7.5 / Other 0.0.0', + details: { code: '*************Xst' }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: false, + }, + ], + }, + }, + { + output: { + batch: [ + { + date: '2020-07-10T07:43:07.766Z', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }, + ], + }, + }, + { + output: { + batch: [ + { + type: 's', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }, + ], + }, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns(_) { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/shopify/data.ts b/test/integrations/sources/shopify/data.ts new file mode 100644 index 0000000000..f5eb3c148b --- /dev/null +++ b/test/integrations/sources/shopify/data.ts @@ -0,0 +1,609 @@ +import { skip } from 'node:test'; + +export const data = [ + { + name: 'shopify', + description: 'Track Call -> carts_create ', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + id: 'shopify_test3', + query_parameters: { topic: ['carts_create'] }, + token: 'shopify_test3', + line_items: [], + note: null, + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [{ outputToSource: { body: 'T0s=', contentType: 'text/plain' }, statusCode: 200 }], + }, + }, + }, + { + name: 'shopify', + description: 'No Query Parameters', + module: 'source', + version: 'v0', + skipGo: 'not possible', + input: { + request: { body: [{}], method: 'POST', headers: { 'Content-Type': 'application/json' } }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Query_parameters is missing', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'shopify', + description: 'Invalid topic', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { query_parameters: { signature: ['rudderstack'], writeKey: ['sample-write-key'] } }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Invalid topic in query_parameters', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'shopify', + description: 'Topic Not found', + module: 'source', + version: 'v0', + skipGo: 'not possible', + input: { + request: { + body: [ + { + query_parameters: { + topic: [], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Topic not found', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'shopify', + description: 'Unsupported Event Type', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + query_parameters: { + topic: ['random_event'], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [{ outputToSource: { body: 'T0s=', contentType: 'text/plain' }, statusCode: 200 }], + }, + }, + }, + { + name: 'shopify', + description: 'Identify Call for customers create event', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + query_parameters: { + topic: ['customers_create'], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, + id: 5747017285820, + email: 'anuraj@rudderstack.com', + accepts_marketing: false, + created_at: '2021-12-29T15:15:19+05:30', + updated_at: '2021-12-29T15:15:20+05:30', + first_name: 'Anuraj', + last_name: 'Guha', + orders_count: 0, + state: 'disabled', + total_spent: '0.00', + last_order_id: null, + note: '', + verified_email: true, + multipass_identifier: null, + tax_exempt: false, + phone: '+919876543210', + tags: '', + last_order_name: null, + currency: 'INR', + addresses: [ + { + id: 6947581821116, + customer_id: 5747017285820, + first_name: 'Anuraj', + last_name: 'Guha', + company: 'Rudderstack', + address1: 'Home', + address2: 'Apartment', + city: 'Kolkata', + province: 'West Bengal', + country: 'India', + zip: '708091', + phone: '+919876543210', + name: 'Anuraj Guha', + province_code: 'WB', + country_code: 'IN', + country_name: 'India', + default: true, + }, + ], + accepts_marketing_updated_at: '2021-12-29T15:15:20+05:30', + marketing_opt_in_level: null, + tax_exemptions: [], + sms_marketing_consent: { + state: 'not_subscribed', + opt_in_level: 'single_opt_in', + consent_updated_at: null, + consent_collected_from: 'SHOPIFY', + }, + admin_graphql_api_id: 'gid://shopify/Customer/5747017285820', + default_address: { + id: 6947581821116, + customer_id: 5747017285820, + first_name: 'Anuraj', + last_name: 'Guha', + company: 'Rudderstack', + address1: 'Home', + address2: 'Apartment', + city: 'Kolkata', + province: 'West Bengal', + country: 'India', + zip: '708091', + phone: '+919876543210', + name: 'Anuraj Guha', + province_code: 'WB', + country_code: 'IN', + country_name: 'India', + default: true, + }, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'RudderStack Shopify Cloud', version: '1.0.0' }, + integration: { name: 'SHOPIFY' }, + topic: 'customers_create', + }, + integrations: { SHOPIFY: true }, + type: 'identify', + userId: '5747017285820', + traits: { + email: 'anuraj@rudderstack.com', + firstName: 'Anuraj', + lastName: 'Guha', + phone: '+919876543210', + addressList: [ + { + id: 6947581821116, + customer_id: 5747017285820, + first_name: 'Anuraj', + last_name: 'Guha', + company: 'Rudderstack', + address1: 'Home', + address2: 'Apartment', + city: 'Kolkata', + province: 'West Bengal', + country: 'India', + zip: '708091', + phone: '+919876543210', + name: 'Anuraj Guha', + province_code: 'WB', + country_code: 'IN', + country_name: 'India', + default: true, + }, + ], + address: { + id: 6947581821116, + customer_id: 5747017285820, + first_name: 'Anuraj', + last_name: 'Guha', + company: 'Rudderstack', + address1: 'Home', + address2: 'Apartment', + city: 'Kolkata', + province: 'West Bengal', + country: 'India', + zip: '708091', + phone: '+919876543210', + name: 'Anuraj Guha', + province_code: 'WB', + country_code: 'IN', + country_name: 'India', + default: true, + }, + acceptsMarketing: false, + orderCount: 0, + state: 'disabled', + totalSpent: '0.00', + note: '', + verifiedEmail: true, + taxExempt: false, + tags: '', + currency: 'INR', + taxExemptions: [], + smsMarketingConsent: { + state: 'not_subscribed', + opt_in_level: 'single_opt_in', + consent_updated_at: null, + consent_collected_from: 'SHOPIFY', + }, + adminGraphqlApiId: 'gid://shopify/Customer/5747017285820', + acceptsMarketingUpdatedAt: '2021-12-29T15:15:20+05:30', + }, + timestamp: '2021-12-29T09:45:20.000Z', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'shopify', + description: 'Unsupported checkout event', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + query_parameters: { + topic: ['checkout_delete'], + writeKey: ['sample-write-key'], + signature: ['rudderstack'], + }, + admin_graphql_api_id: 'gid://shopify/Fulfillment/4124667937024', + created_at: '2022-01-05T18:13:02+05:30', + destination: null, + id: 4124667937024, + line_items: [], + customer: { email: 'test_person@email.com', first_name: 'Test', last_name: 'Person' }, + billing_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + shipping_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + location_id: 66855371008, + name: '#1002.1', + order_id: 4617255092480, + origin_address: null, + receipt: {}, + service: 'manual', + shipment_status: null, + status: 'success', + tracking_company: 'Amazon Logistics UK', + tracking_number: 'Sample001test', + tracking_numbers: ['Sample001test'], + tracking_url: 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + tracking_urls: [ + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + ], + updated_at: '2022-01-05T18:16:48+05:30', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [{ outputToSource: { body: 'T0s=', contentType: 'text/plain' }, statusCode: 200 }], + }, + }, + }, + { + name: 'shopify', + description: 'Track Call -> Fullfillments updated event', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + query_parameters: { + topic: ['fulfillments_update'], + writeKey: ['sample-write-key'], + signature: ['rudderstack'], + }, + shipping_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + billing_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + admin_graphql_api_id: 'gid://shopify/Fulfillment/4124667937024', + created_at: '2022-01-05T18:13:02+05:30', + destination: null, + email: 'test_person@email.com', + id: 4124667937024, + line_items: [ + { + admin_graphql_api_id: 'gid://shopify/LineItem/11896203149568', + discount_allocations: [], + duties: [], + fulfillable_quantity: 0, + fulfillment_service: 'manual', + fulfillment_status: 'fulfilled', + gift_card: false, + grams: 0, + id: 11896203149568, + name: 'p1', + origin_location: { + address1: '74 CC/7, Anupama Housing Estate - II', + address2: '', + city: 'Kolkatta', + country_code: 'IN', + id: 3373642219776, + name: '74 CC/7, Anupama Housing Estate - II', + province_code: 'WB', + zip: '700052', + }, + price: '5000.00', + price_set: { + presentment_money: { amount: '5000.00', currency_code: 'INR' }, + shop_money: { amount: '5000.00', currency_code: 'INR' }, + }, + product_exists: true, + product_id: 7510929801472, + properties: [], + quantity: 1, + requires_shipping: true, + sku: '15', + tax_lines: [ + { + channel_liable: false, + price: '900.00', + price_set: { + presentment_money: { amount: '900.00', currency_code: 'INR' }, + shop_money: { amount: '900.00', currency_code: 'INR' }, + }, + rate: 0.18, + title: 'IGST', + }, + ], + taxable: true, + title: 'p1', + total_discount: '0.00', + total_discount_set: { + presentment_money: { amount: '0.00', currency_code: 'INR' }, + shop_money: { amount: '0.00', currency_code: 'INR' }, + }, + variant_id: 42211160228096, + variant_inventory_management: 'shopify', + variant_title: '', + vendor: 'rudderstack-store', + }, + ], + location_id: 66855371008, + name: '#1002.1', + order_id: 4617255092480, + origin_address: null, + receipt: {}, + service: 'manual', + shipment_status: null, + status: 'success', + tracking_company: 'Amazon Logistics UK', + tracking_number: 'Sample001test', + tracking_numbers: ['Sample001test'], + tracking_url: 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + tracking_urls: [ + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + ], + updated_at: '2022-01-05T18:16:48+05:30', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'RudderStack Shopify Cloud', version: '1.0.0' }, + integration: { name: 'SHOPIFY' }, + topic: 'fulfillments_update', + }, + integrations: { SHOPIFY: true }, + type: 'track', + userId: 'shopify-admin', + event: 'Fulfillments Update', + properties: { + admin_graphql_api_id: 'gid://shopify/Fulfillment/4124667937024', + created_at: '2022-01-05T18:13:02+05:30', + destination: null, + email: 'test_person@email.com', + id: 4124667937024, + location_id: 66855371008, + name: '#1002.1', + order_id: 4617255092480, + origin_address: null, + receipt: {}, + service: 'manual', + shipment_status: null, + status: 'success', + tracking_company: 'Amazon Logistics UK', + tracking_number: 'Sample001test', + tracking_numbers: ['Sample001test'], + tracking_url: + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + tracking_urls: [ + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + ], + updated_at: '2022-01-05T18:16:48+05:30', + products: [ + { + product_id: 7510929801472, + sku: '15', + title: 'p1', + price: '5000.00', + brand: 'rudderstack-store', + quantity: 1, + admin_graphql_api_id: 'gid://shopify/LineItem/11896203149568', + discount_allocations: [], + duties: [], + fulfillable_quantity: 0, + fulfillment_service: 'manual', + fulfillment_status: 'fulfilled', + gift_card: false, + grams: 0, + id: 11896203149568, + origin_location: { + address1: '74 CC/7, Anupama Housing Estate - II', + address2: '', + city: 'Kolkatta', + country_code: 'IN', + id: 3373642219776, + name: '74 CC/7, Anupama Housing Estate - II', + province_code: 'WB', + zip: '700052', + }, + price_set: { + presentment_money: { amount: '5000.00', currency_code: 'INR' }, + shop_money: { amount: '5000.00', currency_code: 'INR' }, + }, + product_exists: true, + properties: [], + requires_shipping: true, + tax_lines: [ + { + channel_liable: false, + price: '900.00', + price_set: { + presentment_money: { amount: '900.00', currency_code: 'INR' }, + shop_money: { amount: '900.00', currency_code: 'INR' }, + }, + rate: 0.18, + title: 'IGST', + }, + ], + taxable: true, + total_discount: '0.00', + total_discount_set: { + presentment_money: { amount: '0.00', currency_code: 'INR' }, + shop_money: { amount: '0.00', currency_code: 'INR' }, + }, + variant_inventory_management: 'shopify', + variant: '42211160228096 ', + }, + ], + }, + traits: { + shippingAddress: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + billingAddress: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + email: 'test_person@email.com', + }, + }, + ], + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/sources/signl4/data.ts b/test/integrations/sources/signl4/data.ts new file mode 100644 index 0000000000..b318bfb6df --- /dev/null +++ b/test/integrations/sources/signl4/data.ts @@ -0,0 +1,550 @@ +import utils from '../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('97fcd7b2-cc24-47d7-b776-057b7b199513'); +}; + +export const data = [ + { + name: 'signl4', + description: 'test-0', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 200, + eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', + subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, + alert: { + statusCode: 1, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'INC091210', + id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + }, + integrations: { Signl4: false }, + type: 'track', + messageId: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + originalTimestamp: '2017-09-01T08:11:37.000Z', + event: 'New Alert Created', + properties: { + eventType: 200, + 'subscription.id': '0acf8014-22f2-4503-88d7-f7d05b46744f', + 'alert.statusCode': 1, + 'alert.eventId': '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + 'alert.externalEventId': 'INC091210', + 'alert.id': '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-1', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 201, + eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', + subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, + user: { + username: 'Rene', + mailaddress: 'rene@signl4.com', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, + alert: { + statusCode: 2, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'Content you passed in the X-S4-ExternalID parameter', + acknowledgedUserIds: ['f0bd5063-9588-51cf-b3d9-94e5647dedc5'], + id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + externalId: [ + { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + ], + traits: { email: 'rene@signl4.com', name: 'Rene' }, + }, + integrations: { Signl4: false }, + type: 'track', + messageId: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + originalTimestamp: '2017-09-01T08:11:37.000Z', + event: 'Alert Confirmed', + properties: { + eventType: 201, + 'subscription.id': '0acf8014-22f2-4503-88d7-f7d05b46744f', + 'alert.statusCode': 2, + 'alert.eventId': '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + 'alert.externalEventId': 'Content you passed in the X-S4-ExternalID parameter', + 'alert.acknowledgedUserIds[0]': 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + 'alert.id': '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-2', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 201, + eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', + subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, + user: { + username: 'Rene', + mailaddress: 'rene@signl4.com', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, + alert: { + statusCode: 4, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'Content you passed in the X-S4-ExternalID parameter', + acknowledgedUserIds: ['f0bd5063-9588-51cf-b3d9-94e5647dedc5'], + id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + externalId: [ + { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + ], + traits: { email: 'rene@signl4.com', name: 'Rene' }, + }, + integrations: { Signl4: false }, + type: 'track', + messageId: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + originalTimestamp: '2017-09-01T08:11:37.000Z', + event: 'Alert Resolved', + properties: { + eventType: 201, + 'subscription.id': '0acf8014-22f2-4503-88d7-f7d05b46744f', + 'alert.statusCode': 4, + 'alert.eventId': '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + 'alert.externalEventId': 'Content you passed in the X-S4-ExternalID parameter', + 'alert.acknowledgedUserIds[0]': 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + 'alert.id': '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-3', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 202, + eventRaisedUtc: '2020-01-10T12:27:19Z', + subscription: { id: 'b8fdd850-e2ad-45ff-924d-9c332a063200' }, + team: { id: '0e8979f7-0c6a-472d-8918-ecfd339252f8' }, + alert: { + statusCode: 1, + eventId: '2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9', + externalEventId: 'INC091210', + acknowledgedUserIds: [], + id: '2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2', + }, + id: '27283793-47c8-4da2-9767-d37be224338d', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + }, + integrations: { Signl4: false }, + type: 'track', + messageId: '27283793-47c8-4da2-9767-d37be224338d', + originalTimestamp: '2020-01-10T12:27:19.000Z', + event: 'Alert Escalated', + properties: { + eventType: 202, + 'subscription.id': 'b8fdd850-e2ad-45ff-924d-9c332a063200', + 'team.id': '0e8979f7-0c6a-472d-8918-ecfd339252f8', + 'alert.statusCode': 1, + 'alert.eventId': '2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9', + 'alert.externalEventId': 'INC091210', + 'alert.id': '2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2', + 'alert.acknowledgedUserIds': [], + }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-4', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 203, + eventRaisedUtc: '2018-04-17T15:00:32Z', + subscription: { id: '1578ebd9-0a27-44ab-bc8e-52cd7d32e81d' }, + user: { + username: 'Rene', + mailaddress: 'rene@signl4.com', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, + alert: { + statusCode: 0, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'Content you passed in the X-S4-ExternalID parameter', + id: '2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2', + }, + annotation: { + message: "OK, I'll take care about it.", + id: '2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761', + }, + id: '141c0f88-7831-4d5e-b055-f6e83c269770', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + externalId: [ + { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + ], + traits: { email: 'rene@signl4.com', name: 'Rene' }, + }, + integrations: { Signl4: false }, + type: 'track', + messageId: '141c0f88-7831-4d5e-b055-f6e83c269770', + originalTimestamp: '2018-04-17T15:00:32.000Z', + event: 'Alert Annotated', + properties: { + eventType: 203, + 'subscription.id': '1578ebd9-0a27-44ab-bc8e-52cd7d32e81d', + 'alert.statusCode': 0, + 'alert.eventId': '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + 'alert.externalEventId': 'Content you passed in the X-S4-ExternalID parameter', + 'alert.id': '2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2', + 'annotation.message': "OK, I'll take care about it.", + 'annotation.id': '2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761', + }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-5', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 300, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + }, + integrations: { Signl4: false }, + type: 'track', + messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + originalTimestamp: '2017-09-01T09:16:17.000Z', + event: 'Duty Period Started', + properties: { eventType: 300, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-6', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 301, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + }, + integrations: { Signl4: false }, + type: 'track', + messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + originalTimestamp: '2017-09-01T09:16:17.000Z', + event: 'Duty Period Ended', + properties: { eventType: 301, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-7', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 302, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + user: { id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + externalId: [ + { type: 'signl4UserId', id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + ], + }, + integrations: { Signl4: false }, + type: 'track', + messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + originalTimestamp: '2017-09-01T09:16:17.000Z', + event: 'Somebody Punched-In', + properties: { eventType: 302, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'signl4', + description: 'test-8', + module: 'source', + version: 'v0', + input: { + request: { + body: [ + { + eventType: 303, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + user: { id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Signl4' }, + externalId: [ + { type: 'signl4UserId', id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + ], + }, + integrations: { Signl4: false }, + type: 'track', + messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + originalTimestamp: '2017-09-01T09:16:17.000Z', + event: 'Somebody Punched-Out', + properties: { eventType: 303, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', + }, + ], + }, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index 77635f2198..3c5cf60600 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -52,9 +52,29 @@ export interface TestCaseData { input: inputType; output: outputType; mock?: mockType[]; + overrideReceivedAt?: string; + overrideRequestIP?: string; mockFns?: (mockAdapter: MockAdapter) => {}; } +export type MockFns = (mockAdapter: MockAdapter) => void; + +export interface SrcTestCaseData { + id?: string; + name: string; + description: string; + scenario?: string; + successCriteria?: string; + comment?: string; + feature?: string; + module: string; + version?: string; + input: inputType; + output: outputType; + mock?: mockType[]; + mockFns?: MockFns; +} + export type MockHttpCallsData = { httpReq: Record; httpRes: Partial; diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts index 4f5181e41e..bec79f8570 100644 --- a/test/integrations/testUtils.ts +++ b/test/integrations/testUtils.ts @@ -24,6 +24,7 @@ const generateAlphanumericId = (size = 36) => export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): string[] => { const globPattern = join(dirPath, '**', 'data.ts'); let testFilePaths = globSync(globPattern); + if (opts.destination || opts.source) { testFilePaths = testFilePaths.filter((testFile) => testFile.includes(opts.destination || opts.source), @@ -565,11 +566,11 @@ export const validateTestWithZOD = (testPayload: TestCaseData, response: any) => // ----------------------------- // Helper functions -export const generateMetadata = (jobId: number): any => { +export const generateMetadata = (jobId: number, userId?: string): any => { return { jobId, attemptNum: 1, - userId: 'default-userId', + userId: userId || 'default-userId', sourceId: 'default-sourceId', destinationId: 'default-destinationId', workspaceId: 'default-workspaceId', diff --git a/test/scripts/generateJson.ts b/test/scripts/generateJson.ts index 7e4c3a3c0f..388c81477d 100644 --- a/test/scripts/generateJson.ts +++ b/test/scripts/generateJson.ts @@ -1,8 +1,11 @@ import { Command, OptionValues } from 'commander'; import path from 'path'; import fs from 'fs'; +import get from 'get-value'; import { getTestData, getTestDataFilePaths, produceTestData } from '../integrations/testUtils'; -import { head } from 'lodash'; +import { head, isNumber } from 'lodash'; +import { responseType } from '../integrations/testTypes'; +import { isDefinedAndNotNull } from '@rudderstack/integrations-lib'; interface TestCaseData { name: string; @@ -17,6 +20,7 @@ interface Input { query: string; body: any; headers?: Record; + method?: string; }; } @@ -39,11 +43,44 @@ jsonGenerator .command('sources') .description('generator JSON test cases for source') .argument('', 'output path') - .option('-s, --source ', 'source', ',') + .option('-s, --source ', 'source', '') .action(generateSources); jsonGenerator.parse(); +function getStatusCode(outputResponse?: responseType): number { + const statusCodeKeys = ['body.0.statusCode', 'statusCode', 'status']; + const stCode = statusCodeKeys + .map((statusKey) => get(outputResponse, statusKey)) + .find((stCode) => isNumber(stCode)); + return stCode || 200; +} + +function getErrorResponse(outputResponse?: responseType) { + const bodyKeys = ['body.0.error', 'error']; + const errorResponse = bodyKeys + .map((statusKey) => get(outputResponse, statusKey)) + .find(isDefinedAndNotNull); + if (errorResponse) { + return errorResponse + '\n'; + } + return errorResponse; +} + +function getSourceRequestBody(testCase: any, version?: string) { + const bodyElement = + testCase.input.request.body.length === 1 + ? testCase.input.request.body[0] + : testCase.input.request.body; + if (version === 'v0') { + return bodyElement; + } + if (Array.isArray(bodyElement?.event)) { + return bodyElement.event.map((e) => ({ ...e, source: bodyElement.source })); + } + return { ...bodyElement.event, source: bodyElement.source }; +} + function generateSources(outputFolder: string, options: OptionValues) { const rootDir = __dirname; const resolvedpath = path.resolve(rootDir, '../integrations/sources'); @@ -51,22 +88,27 @@ function generateSources(outputFolder: string, options: OptionValues) { const files = getTestDataFilePaths(resolvedpath, options); files.forEach((testDataPath) => { - let testData = getTestData(testDataPath); - testData.forEach((testCase) => { - let statusCode: number = - testCase.output.response?.statusCode || testCase.output.response?.status || 200; + const testData = getTestData(testDataPath); + testData.forEach(({ version, ...testCase }) => { + let statusCode: number = getStatusCode(testCase.output.response); let responseBody: any = 'OK'; if (statusCode == 200) { if (testCase.output.response?.body[0]?.outputToSource?.body) { - responseBody = JSON.parse( - Buffer.from(testCase.output.response?.body[0]?.outputToSource?.body, 'base64').toString( - 'utf-8', - ), - ); + let rawBody = Buffer.from( + testCase.output.response?.body[0]?.outputToSource?.body, + 'base64', + ).toString(); + if ( + testCase.output.response?.body[0]?.outputToSource?.contentType === 'application/json' + ) { + responseBody = JSON.parse(rawBody); + } else { + responseBody = rawBody; + } } } else { - responseBody = testCase.output.response?.error; + responseBody = getErrorResponse(testCase.output.response); } testCase.input.request.body.forEach((body) => { @@ -74,16 +116,20 @@ function generateSources(outputFolder: string, options: OptionValues) { delete body['request_ip']; }); + let errorQueue: any[] = []; + if (statusCode !== 200) { + errorQueue = Array.isArray(testCase.input.request?.body) + ? testCase.input.request?.body + : [testCase.input.request?.body]; + } + let goTest: TestCaseData = { name: testCase.name, description: testCase.description, input: { request: { query: JSON.stringify(testCase.input.request.params), - body: - testCase.input.request.body.length === 1 - ? testCase.input.request.body[0] - : testCase.input.request.body, + body: getSourceRequestBody(testCase, version), headers: testCase.input.request.headers || { 'Content-Type': 'application/json', }, @@ -102,19 +148,33 @@ function generateSources(outputFolder: string, options: OptionValues) { .map((i) => i.output.batch) .flat() : [], - errQueue: statusCode != 200 ? [testCase.output.response?.body] : [], + errQueue: errorQueue, }, }; + if (testCase.input.request.method && testCase.input.request.method.toLowerCase() !== 'post') { + goTest.input.request.method = testCase.input.request.method; + } const dirPath = path.join(outputFolder, goTest.name); - const filePath = path.join(dirPath, `${toSnakeCase(goTest.description)}.json`); + const safeName = toSnakeCase(goTest.description) + .replace(/[^a-z0-9]/gi, '_') + .toLowerCase(); + const filePath = path.join(dirPath, `${safeName}.json`); if (testCase.skipGo) { goTest.skip = testCase.skipGo; } - goTest.output.queue.forEach((queueItem) => { - queueItem['receivedAt'] = '2024-03-03T04:48:29.000Z'; - queueItem['request_ip'] = '192.0.2.30'; + goTest.output.queue.forEach((queueItem, i) => { + queueItem['receivedAt'] = + testCase?.overrideReceivedAt && + testCase.output.response?.body?.[0]?.output?.batch?.[i]?.receivedAt + ? testCase.output.response?.body?.[0]?.output?.batch?.[i]?.receivedAt + : '2024-03-03T04:48:29.000Z'; + queueItem['request_ip'] = + testCase?.overrideRequestIP && + testCase.output.response?.body?.[0]?.output?.batch?.[i]?.request_ip + ? testCase.output.response?.body?.[0]?.output?.batch?.[i]?.request_ip + : '192.0.2.30'; if (!queueItem['messageId']) { queueItem['messageId'] = '00000000-0000-0000-0000-000000000000'; }